
/**
 * Estilos públicos de TuCosmos.
 * Incluye los estilos públicos compartidos y los específicos de Actualidad.
 * Complementa Bootstrap sin sustituir sus componentes.
 */

/* =========================================================
   MENÚ PRINCIPAL - layouts/principal.php
   ========================================================= */

/* Fondo y separación entre opciones del menú. */
.bg-principal {
    background: #002060;
}

.navbar-nav > li {
    margin-left: 10px;
    margin-right: 10px;
}

/* Transición y realce al pasar el cursor por las opciones. */
.navbar-nav > li > a {
    transition: color 0.3s, font-weight 0.3s;
}

.navbar-nav > li > a:hover {
    font-weight: bold;
    color: #333;
}

/* =========================================================
   PIE DE PÁGINA - layouts/principal.php
   ========================================================= */

footer {
    font-size: 0.9rem;
}

.bg-footer {
    background: #111827;
}

/* =========================================================
   BUSCADOR Y PRESENTACIÓN - home/index.php
   ========================================================= */

/* Texto informativo bajo el buscador. */
.line-seo {
    font-size: 14px;
    color: #444;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.2px;
    text-align: center;
    margin: 10px auto 16px;
    max-width: 620px;
}

/* Efecto de la lupa del buscador. */
.lupa-buscar {
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.lupa-buscar:hover {
    transform: scale(1.15);
    opacity: 0.75;
}

/* =========================================================
   LÍNEA "DESCUBRE" - home/index.php
   ========================================================= */

.linea-home-impacto {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 0 auto;
    max-width: 600px;
    padding: 0;
}

/* Rayas decorativas a ambos lados del texto. */
.linea-home-impacto .linea {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4a017);
    border-radius: 2px;
    position: relative;
}

.linea-home-impacto .linea.derecha {
    background: linear-gradient(90deg, #d4a017, transparent);
}

/* Texto dorado con animación de brillo. */
.linea-home-impacto .texto-enganche {
    color: #d4a017;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0 10px;
    text-shadow: 0 0 20px rgba(212, 160, 23, 0.6),
                 0 0 60px rgba(212, 160, 23, 0.3);
    animation: brillo-neon 2s ease-in-out infinite;
    cursor: default;
    transition: all 0.3s ease;
}

.linea-home-impacto .texto-enganche:hover {
    color: #d6a317;
    text-shadow: 0 0 30px rgba(212, 160, 23, 0.9),
                 0 0 80px rgba(212, 160, 23, 0.5);
    transform: scale(1.05);
    letter-spacing: 8px;
}

@keyframes brillo-neon {
    0%, 100% {
        text-shadow: 0 0 20px rgba(212, 160, 23, 0.6),
                     0 0 60px rgba(212, 160, 23, 0.3);
    }

    50% {
        text-shadow: 0 0 35px rgba(212, 160, 23, 0.9),
                     0 0 80px rgba(212, 160, 23, 0.5),
                     0 0 120px rgba(212, 160, 23, 0.2);
    }
}

/* Resplandor de las rayas al pasar el cursor. */
.linea-home-impacto .linea::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    width: 100%;
    height: 8px;
    background: radial-gradient(ellipse, rgba(212, 160, 23, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.linea-home-impacto:hover .linea::after {
    opacity: 1;
}

/* =========================================================
   TARJETAS DE EMPRESAS - home/index.php
   ========================================================= */

/* Fondo de las filas de empresas. */
.bg-gray-cos {
    background: #DBDBDB;
}

/* Estructura de las tarjetas del Home. */
.card-home {
    width: 100%;
    padding: 8px;
    overflow: hidden;
}

.card-home a {
    cursor: pointer;
}

/* Fotografías uniformes, sin deformar su proporción. */
.card-home .card-img-top {
    width: 100%;
    height: 230px;
    object-fit: cover;
    object-position: center top;
}

/* Solo fotos nuevas de 500 x 500: ocupar todo el ancho, sin recortar.
   Las fotos históricas conservan su altura original de 230px. */
.card-home .card-img-top.card-home-img-cuadrada {
    height: auto;
    min-height: 230px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center center;
    background-color: #fff;
}

/* Regla original de imágenes dentro de tarjetas. */
.card img {
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* Límite de ancho original entre 600 y 765 píxeles. */
@media (min-width: 600px) and (max-width: 765px) {
    .card img {
        max-width: 300px;
    }
}

/* Color del nombre de las empresas. */
.text-blue-cos {
    color: blue;
}

/* Elevación al pasar el cursor sobre las tarjetas. */
.box-shadow-cos {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.box-shadow-cos:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

/* Ajuste original de sombra para pantallas pequeñas. */
@media (max-width: 576px) {
    .box-shadow-cos {
        box-shadow: none;
    }
}

/* Ampliación suave de fotos del Home y carrusel de noticias. */
.img-hover-zoom {
    transition: transform 0.45s ease, filter 0.45s ease;
}

.img-hover-zoom:hover {
    transform: scale(1.07);
    filter: brightness(1.04);
}

/* Solo carrusel de noticias del Home: limitar fotos altas sin recortarlas. */
#carouselExampleControls .carousel-item .overflow-hidden > img.img-hover-zoom {
    max-height: 380px;
    object-fit: contain;
    object-position: center;
}

@media (max-width: 767.98px) {
    #carouselExampleControls .carousel-item .overflow-hidden > img.img-hover-zoom {
        max-height: 300px;
    }
}

/* =========================================================
   ENLACES DE EMPRESAS Y NOTICIAS - home/index.php
   ========================================================= */

/* Enlace "Ver Más" de las tarjetas de empresas. */
.link-black {
    color: #000;
    text-decoration: none;
    font-size: 14px;
}

.link-black:link {
    color: rgb(14, 12, 12);
}

.link-black:visited,
.link-black:active {
    color: rgb(14, 11, 11);
}

.link-black:hover {
    color: #ff0000 !important;
}

/* Enlace "Ver Más" del carrusel de noticias. */
.link-blue {
    color: #0101DF;
    text-decoration: none;
    font-size: 14px;
}

.link-blue:link,
.link-blue:visited,
.link-blue:active {
    color: #0101DF;
}

.link-blue:hover {
    color: #ff0000 !important;
}

/* =========================================================
   BOTÓN PRINCIPAL - FORMULARIOS PÚBLICOS
   ========================================================= */

.btn-cos-cta {
    background-color: #1f4e79;
    color: #fff;
    border: 1px solid #1f4e79;
}

.btn-cos-cta:hover,
.btn-cos-cta:focus-visible {
    background-color: #163756;
    color: #fff;
    border-color: #163756;
}

/* =========================================================
   ACTUALIDAD PÚBLICA - noticias/blog.php
   ========================================================= */

.actualidad-miniatura {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: filter 0.2s ease;
}

.actualidad-enlace-foto:hover .actualidad-miniatura {
    filter: brightness(0.95);
}

.actualidad-titulo a:hover {
    color: #1f4e79 !important;
}

.actualidad-resumen {
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 5;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

/* =========================================================
   ACTUALIDAD - CARRUSEL LATERAL DE EMPRESAS
   ========================================================= */

/* Fotografías laterales de Noticias y Promociones. */
.actualidad-foto-empresa {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin-inline: auto;
}

@media (max-width: 575.98px) {
    .actualidad-titulo {
        font-size: 1rem;
    }

    .actualidad-resumen {
        line-clamp: 3;
        -webkit-line-clamp: 3;
        font-size: 0.9rem;
    }
}

/* =========================================================
   ACTUALIDAD PÚBLICA - DETALLE DE ARTÍCULOS
   ========================================================= */

/*
 * Solo artículos con fotografía horizontal o cuadrada.
 * El texto queda alineado al ancho máximo de la fotografía.
 * Las fotografías verticales conservan el ancho de la columna.
 */
.actualidad-detalle.actualidad-detalle-horizontal {
    max-width: 700px;
    margin-inline: auto;
}

.actualidad-detalle-foto-contenedor {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/*
 * Fotografía principal completa y proporcional.
 * Altura limitada para evitar imágenes verticales excesivas.
 */
.actualidad-detalle-foto-principal {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 700px);
    max-height: min(65vh, 560px);
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

.actualidad-detalle-contenido {
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* =========================================================
   ACTUALIDAD - GALERÍA DE FOTOGRAFÍAS ADICIONALES
   ========================================================= */

.actualidad-detalle-galeria-enlace {
    display: block;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

.actualidad-detalle-galeria-imagen {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: filter 0.2s ease;
}

.actualidad-detalle-galeria-enlace:hover .actualidad-detalle-galeria-imagen {
    filter: brightness(1.05);
}

.actualidad-detalle-galeria-enlace:focus-visible {
    outline: 2px solid #1f4e79;
    outline-offset: 3px;
}

/* =========================================================
   LIGHTBOX3 - NAVEGACIÓN EN MÓVILES
   ========================================================= */

@media (max-width: 600px) {
    .lightbox3-overlay .lightbox3-arrow {
        display: flex;
        width: 40px;
        height: 40px;
    }

    .lightbox3-overlay .lightbox3-arrow svg {
        width: 24px;
        height: 24px;
    }

    .lightbox3-overlay .lightbox3-arrow-prev {
        left: 8px;
    }

    .lightbox3-overlay .lightbox3-arrow-next {
        right: 8px;
    }
}

/* Noticias RSS: desplazamiento hasta el título de cada sección. */
[id^="rss-seccion-"],
[id^="rss-titulo-"] {
    scroll-margin-top: 160px;
}

/* Noticias RSS: selector de categorías visible al desplazarse. */
.rss-menu-fijo {
    position: sticky;
    top: 70px;
    z-index: 1010;
    background-color: #fff;
    padding: 8px 0;
}

/* Noticias RSS: mantener visibles los dos carruseles laterales en PC. */
@media (min-width: 992px) {
    .rss-lateral-fijo {
        position: sticky;
        top: 125px;
        align-self: flex-start;
        max-height: calc(100vh - 135px);
        overflow-y: auto;
    }
}

/* Noticias RSS: pequeña separación de los carruseles laterales. */
@media (min-width: 992px) {
    .rss-lateral-fijo > div {
        margin-left: 30px;
    }
}
