/* ============================================= */
/* VARIABLES Y ESTILOS BASE */
/* ============================================= */
:root {
    --primary-color: #8d7427;
    --secondary-color: #f4f4f4;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Playfair Display', serif;
}

/* Reset y estilos base */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: #333;
}

/* ============================================= */
/* ESTRUCTURA PRINCIPAL */
/* ============================================= */

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.logo-container {
    flex: 0 0 auto;
    background-color: transparent;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid #ffffff;
    width: 80px;
    height: 80px;
}

.logo-container img, .logo {
    width: 100%;
    height: auto;
    display: block;
}

header .logo {
    height: 70px;
    width: auto;
}

/* Navegación */
nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 10px;
    text-align: center;
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--secondary-color);
}

.menu-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

/* Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-menu li {
    margin: 5px 0;
}

.dropdown-menu a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 5px 10px;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Estilo mejorado para el enlace activo */
.nav-link.active {
    position: relative;
    font-weight: bold;
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Efecto hover para enlace activo */
.nav-link.active:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Indicador visual para enlace activo */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Para los enlaces en el dropdown */
.dropdown-menu .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-left: 3px solid #fff;
    border-radius: 0;
    margin-left: -10px;
    padding-left: 7px;
}

/* Efecto hover para enlaces activos en dropdown */
.dropdown-menu .nav-link.active:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Estilo para el icono del enlace activo */
.nav-link.active .menu-icon {
    filter: brightness(0) invert(1) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* ============================================= */
/* COMPONENTES REUTILIZABLES */
/* ============================================= */

/* Contenedores comunes */
.container, .presentacion, .proyecto-contenido, 
.libro-club, .publicaciones-container, 
.publicaciones-main {
    text-align: center;
    position: relative;
    margin: 20px auto 10px;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

/* Títulos con línea decorativa */
.title-box {
    display: inline-block;
    background-color: var(--primary-color);
    padding: 10px 20px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.line {
    width: 90%;
    height: 3px;
    background-color: var(--primary-color);
    position: absolute;
    top: 98%; 
    left: 5%;
    z-index: 1;
    transform: translateY(-50%);
}

/* ============================================= */
/* SECCIONES ESPECÍFICAS */
/* ============================================= */

/* Video Header */
.video-header-container {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    overflow: hidden;
}

.local-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(141, 116, 39, 0.5);
    z-index: 2;
}

.header-text {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    z-index: 3;
    width: auto;
    max-width: 600px;
    padding: 20px;
    background-color: rgba(141, 116, 39, 0.3);
    backdrop-filter: blur(8px);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-text h1 {
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    letter-spacing: 1px;
}

.text-image-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.etimologia-container {
    flex: 1;
}

.etimologia-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.nahuatl {
    font-weight: bold;
    color: #f8d56b;
    font-size: 1rem;
    font-style: italic;
}

.translation {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.separator {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 3px;
}

.highlight {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
}

.custom-header-image {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 20px;
    margin-top: -20px;
}

.custom-header-img {
    width: 140px;
    height: auto;
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    position: relative;
    top: -10px;
}

.custom-header-img:hover {
    transform: scale(1.1);
}

.icon-circle {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulse 4s infinite ease-in-out;
    top: -5px;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 0.9; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Sección de presentación */
.presentacion-imagen {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.presentacion-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.presentacion-texto {
    max-width: 1050px;
    margin: 20px auto;
    padding: 0 20px;
    text-align: center;
}

.presentacion-texto h2, .proyecto-texto h2, 
.section-header h2, .section-title-text {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-title-text {
    color: #890116;
    font-weight: bold;
    font-size: 1.5rem;
    text-align: center;
}

.presentacion-texto p, .proyecto-texto p, 
.institutions-text {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    text-align: justify;
}
.timeline-item
/* Club de lectura */
.libro-club {
    background-color: #f9f9f9;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.libro-club-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    gap: 10px;
}

.libro-club-imagen {
    flex: 1;
    display: flex;
    justify-content: center;
}

.libro-club-imagen img {
    width: 600px;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

.libro-club-texto {
    flex: 2;
    text-align: justify;
    text-justify: inter-word;
    padding-left: 10px;
}

.libro-club-texto p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Contador */
.contador {
    background-color: #f9f9f9;
    padding: 60px 20px;
    margin: 40px 0;
    text-align: center;
}

.contador-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.contador-item {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px 15px;
    height: 100%;
    min-height: 200px;
    justify-content: center;
}

.contador-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.contador-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    object-fit: contain;
}

.contador-numero {
    font-size: 36px;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
    transition: color 0.3s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contador-item:hover .contador-numero {
    color: #6b5a1f;
}

.contador-item p {
    font-size: 16px;
    color: #555;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

/* Proyectos */
.proyecto-contenido {
    padding: 20px 2rem;
    background-color: #f9f5f0;
    position: relative;
    margin-top: 10px;
}

.proyecto-imagen-texto {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.proyecto-imagen {
    flex: 1.2;
    max-width: 50%;
}

.proyecto-imagen img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    max-height: 300px;
    object-fit: cover;
}

.proyecto-texto {
    flex: 1;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ============================================= */
/* COMPONENTES INTERACTIVOS */
/* ============================================= */

/* Carrusel */
.carousel {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.slide {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(141, 116, 39, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    font-size: 20px;
    z-index: 10;
}

.prev { left: 10px; }
.next { right: 10px; }

.carousel-indicators {
    text-align: center;
    margin-top: 10px;
}

.indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.indicator.active {
    background-color: var(--primary-color);
}

/* Tarjetas flip */
.flip-card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    height: 300px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

.flip-card-front {
    background-color: #fff;
    color: #000;
}

.flip-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flip-card-back {
    background-color: #333;
    color: #fff;
    transform: rotateY(180deg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* ============================================= */
/* BOTONES */
/* ============================================= */

/* Estilo base para todos los botones */
.boton .btn, 
.gallery-btn, 
.card-btn,
.read-more-btn {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 5px;
    min-width: 120px;
    text-align: center;
    line-height: 1.4;
    flex: 0 1 auto;
}

/* Efecto hover */
.boton .btn:hover, 
.gallery-btn:hover, 
.card-btn:hover,
.read-more-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Efecto activo */
.boton .btn:active, 
.gallery-btn:active, 
.card-btn:active,
.read-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

/* Botón secundario */
.btn-outline-light {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-light:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Botón principal */
.boton.principal .btn {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Botón pequeño */
.boton.pequeno .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-width: 100px;
}

/* Botón con efecto especial */
.boton2 {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.boton2::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.boton2:hover::after {
    transform: translateX(0);
}

/* ============================================= */
/* GALERÍA Y MULTIMEDIA */
/* ============================================= */

/* Galería */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(141, 116, 39, 0.8);
    color: white;
    padding: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.gallery-item:hover .gallery-caption {
    background: rgba(141, 116, 39, 0.95);
    padding: 12px 10px;
    font-weight: bold;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    display: block;
    margin: 60px auto;
    max-width: 90%;
    max-height: calc(100vh - 120px);
    border: 3px solid white;
    border-radius: 5px;
}

.lightbox-caption {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 10px 20px;
    max-width: 80%;
    margin: 0 auto;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: #f1f1f1;
}

/* Videos */
.video-section, .videos-interculturales {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0 40px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 30px auto;
    max-width: 1200px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
    position: relative;
}

.video-spacer {
    height: 0;
}

.video-section-title, .section-header h2 {
    font-family: 'Segoe UI', sans-serif;
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.video-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: #3498db;
    border-radius: 3px;
}

.video-outer-container {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
    margin-top: 30px;
}

.side-narrow-video-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-caption {
    margin-top: 25px;
    font-style: italic;
    color: #7f8c8d;
    text-align: center;
    font-size: 0.95rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.video-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin-top: 30px;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-description {
    padding: 25px;
    background: white;
}

.video-description h3 {
    color: #333;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
    font-size: 1.4em;
}

.video-description p {
    color: #666;
    line-height: 1.6;
    font-size: 1.1em;
}

/* ============================================= */
/* PUBLICACIONES */
/* ============================================= */

.publicaciones-grid, .calendarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    padding: 0 20px;
}

.publicacion-card, .calendario-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.publicacion-card:hover, .calendario-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-img-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 8px 8px 0 0;
}

/* Contenedores específicos para publicaciones */
.publicaciones-grid .card-img-container {
    height: 250px;
    background-color: #f8f8f8;
    padding: 15px;
}

.publicaciones-grid .card-img-container img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Contenedores para calendarios */
.calendarios-grid .card-img-container {
    height: 300px;
    background-color: white;
    padding: 20px;
}

.calendarios-grid .card-img-container img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0 0 10px;
    line-height: 1.3;
}

.card-meta {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.card-desc {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
    flex-grow: 1;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-top: auto;
}

.download-btn:hover {
    background-color: #6b5a1f;
}

.btn-icon {
    margin-right: 8px;
}

/* ============================================= */
/* ALIANZAS E INSTITUCIONES */
/* ============================================= */

.image-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 8px;
    margin: 10px auto 0;
    max-width: 1200px;
    padding: 0 10px;
    filter: grayscale(100%) brightness(110%);
    transition: filter 0.3s ease;
}

.image-item {
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f8f8;
    border-radius: 6px;
    padding: 6px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
    filter: grayscale(0%) brightness(100%);
}

.section-alliances {
    margin-bottom: 60px;
}

.grid-image {
    width: 95%;
    height: auto;
    max-height: 95px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 4px;
}

.image-name {
    font-size: 0.75rem;
    color: #444;
    font-weight: 500;
    word-break: break-word;
    padding: 0 2px;
    margin-top: 3px;
}

.image-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.institutions-list {
    font-size: 0.65rem;
    color: #555;
    line-height: 1.6;
    margin: 15px 0 25px;
    padding: 0;
    list-style-type: none;
    column-count: 3;
    column-gap: 20px;
}

.institutions-list li {
    margin-bottom: 5px;
    position: relative;
    padding-left: 12px;
}

.institutions-list li:before {
    content: "•";
    color: #890116;
    position: absolute;
    left: 0;
}

.institutions-text {
    font-size: 0.7rem;
    text-align: center;
    max-width: 900px;
    margin: 10px auto 20px;
    padding: 0 15px;
}

/* ============================================= */
/* LÍNEA DE TIEMPO
/* ============================================= */
.section-timeline {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.timeline-wrapper {
    position: relative;
}

.timeline {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

.timeline-items {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Para Firefox */
    -ms-overflow-style: none; /* Para IE y Edge */
    padding-bottom: 20px;
    margin-bottom: -20px; /* Compensa el padding */
}

.timeline-items::-webkit-scrollbar {
    display: none; /* Para Chrome, Safari y Opera */
}

.timeline-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

.timeline-item-content {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-item-content {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.timeline-img-container {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.timeline-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.timeline-item:hover .timeline-img-container img {
    transform: scale(1.05);
}

.timeline-item h3 {
    color: var(--primary-color);
    margin: 0 0 10px;
    font-size: 1.3rem;
}

.timeline-item p {
    color: #555;
    line-height: 1.5;
    margin: 0;
}

.timeline-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.timeline-nav-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.timeline-nav-button:hover {
    background-color: #6b5a1f;
    transform: scale(1.1);
}

.timeline-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.timeline-nav-button svg {
    width: 24px;
    height: 24px;
}
/* ============================================= */
/* MODALES 
/* ============================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    overflow: auto;
}

.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 25px;
    width: 85%;
    max-width: 750px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
}

.close-modal {
    color: #777;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-body {
    padding: 10px 0;
}

/* Contenedor principal del contenido */
.modal-body-content {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

/* Estilos para el texto */
.modal-text {
    flex: 1;
    min-width: 300px;
    text-align: justify;
    text-justify: inter-word;
    line-height: 1.7;
    color: #444;
    font-size: 1.05rem;
}

.modal-text p {
    margin-bottom: 15px;
}

/* Contenedor de imágenes */
.modal-image-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.image-caption {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.4;
    max-width: 90%;
}

/* Scrollbar para contenido largo */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 5% auto;
        padding: 20px;
    }
    
    .modal-body-content {
        flex-direction: column;
    }
    
    .modal-text, 
    .modal-image-container {
        min-width: 100%;
    }
    
    .modal-image {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-text {
        font-size: 1rem;
    }
}
/* Botón de información */
.info-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    margin: 10px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.info-btn:hover {
    background-color: #6b5a1f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.info-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* ============================================= */
/* FOOTER */
/* ============================================= */

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    font-family: Arial, sans-serif;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-section {
    margin: 10px 20px;
    text-align: left;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: white;
}

.footer-section p {
    margin: 5px 0;
    font-size: 14px;
}

.map-container {
    margin-top: 10px;
}

.map-container iframe {
    width: 100%;
    max-width: 300px;
    height: 200px;
    border: none;
    border-radius: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    font-size: 12px;
    color: #f4f4f4;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    justify-content: center;
}

.social-icons a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-icons a:hover {
    transform: scale(1.1);
}

.social-icon {
    width: 32px;
    height: 32px;
}

.siguenos-title {
    text-align: center;
    margin-bottom: 10px;
}

/* ============================================= */
/* MENÚ HAMBURGUESA */
/* ============================================= */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 15px;
    z-index: 1001;
    position: relative;
    margin-left: auto;
}

.hamburger {
    display: block;
    width: 30px;
    height: 3px;
    background-color: white;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger:before,
.hamburger:after {
    content: '';
    position: absolute;
    width: 30px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
}

.hamburger:before {
    top: -10px;
    transform-origin: center;
}

.hamburger:after {
    bottom: -10px;
    transform-origin: center;
}

/* Estado activo */
.menu-toggle.active .hamburger {
    background-color: transparent;
}

.menu-toggle.active .hamburger:before {
    transform: translateY(10px) rotate(45deg);
    background-color: #fff;
}

.menu-toggle.active .hamburger:after {
    transform: translateY(-10px) rotate(-45deg);
    background-color: #fff;
}

/* Botón de cerrar dentro del menú */
.close-menu {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1002;
    padding: 5px 15px;
}

.close-icon {
    display: block;
    line-height: 1;
    transition: transform 0.3s ease;
}

.close-menu:hover .close-icon {
    transform: scale(1.2);
}

/* ============================================= */
/* HEADERS ESPECÍFICOS */
/* ============================================= */

/* Header para página de inicio */
.home-header, .home-header-simple {
    position: relative;
    height: 90vh;
    min-height: 600px;
}

.home-header .home-header-text,
.home-header-simple .home-header-text-simple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    max-width: 800px;
    z-index: 3;
}

.home-header .home-header-text {
    padding: 30px;
    background-color: rgba(141, 116, 39, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 15px;
}

.home-header-simple .home-header-text-simple {
    background-color: transparent !important;
    backdrop-filter: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

.home-header .home-header-text h1,
.home-header-simple .home-header-text-simple h1 {
    font-family: 'Playfair Display', serif;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 15px;
    line-height: 1.2;
}

.home-header .home-header-text p,
.home-header-simple .home-header-text-simple p {
    font-family: 'Roboto', sans-serif;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.home-header .home-header-text h1 {
    font-size: 2.8rem;
}

.home-header-simple .home-header-text-simple h1 {
    font-size: 3rem;
    font-weight: 700;
}

.home-header .home-header-text p {
    font-size: 1.5rem;
}

.home-header-simple .home-header-text-simple p {
    font-size: 1.5rem;
    font-weight: 400;
}

/* ============================================= */
/* MEDIA QUERIES - RESPONSIVE */
/* ============================================= */

@media (max-width: 1200px) {
    .image-grid, .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .publicaciones-grid, .calendarios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-header-container, .home-header, .home-header-simple {
        height: 70vh;
        min-height: 500px;
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Menú hamburguesa */
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background-color: var(--primary-color);
        padding: 70px 20px 20px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }
    
    nav.active {
        right: 0;
    }
    
    .close-menu {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        padding: 0;
    }
    
    nav ul li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    nav ul li a {
        padding: 15px 0;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }
    
    .menu-icon {
        width: 30px;
        height: 30px;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        transform: none;
        box-shadow: none;
        display: none;
        padding: 0;
        background-color: rgba(0, 0, 0, 0.1);
        border-radius: 0;
        margin-top: 0;
    }
    
    .dropdown-menu li {
        padding-left: 45px;
    }
    
    .dropdown-menu a {
        padding: 12px 0;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    /* Overlay para fondo oscuro */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Ajustes generales */
    .image-grid, .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-text h1,
    .home-header .home-header-text h1,
    .home-header-simple .home-header-text-simple h1 {
        font-size: 28px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: calc(100vh - 100px);
    }
    
    .lightbox-caption {
        font-size: 1rem;
    }
    
    .section-header h2, .video-section-title {
        font-size: 1.5rem;
    }
    
    .institutions-list {
        column-count: 2;
    }
    
    .libro-club-content {
        flex-direction: column;
    }
    
    .libro-club-imagen, .libro-club-texto,
    .proyecto-imagen, .proyecto-texto {
        flex: auto;
        max-width: 100%;
    }
    
    .proyecto-imagen-texto {
        flex-direction: column;
    }
    
    .video-header-container, .home-header, .home-header-simple {
        height: 60vh;
        min-height: 400px;
    }
    
    .header-text h1 {
        font-size: 2rem;
    }
    
    .proyecto-texto {
        text-align: center;
        align-items: center;
    }
    
    .botones {
        justify-content: center;
    }
    
    .info-modal-content {
        width: 90%;
        margin: 20% auto;
    }
    
    .home-header .home-header-text h1,
    .home-header-simple .home-header-text-simple h1 {
        font-size: 2.2rem;
    }
    
    .home-header .home-header-text p,
    .home-header-simple .home-header-text-simple p {
        font-size: 1.2rem;
    }
}

@media (max-width: 600px) {
    .publicaciones-grid, .calendarios-grid, .flip-card-container {
        grid-template-columns: 1fr;
    }
    
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .institutions-list {
        column-count: 1;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-caption {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-spacer {
        height: 40px;
    }
    
    .video-item {
        margin-top: 20px;
    }
    
    .video-header-container, .home-header, .home-header-simple {
        height: 50vh;
        min-height: 300px;
    }
    
    .header-text h1 {
        font-size: 1.8rem;
    }
    
    .header-text p {
        font-size: 1rem;
    }
    
    .contador-content {
        grid-template-columns: 1fr;
    }
    
    .contador-item {
        min-height: 180px;
        padding: 20px 10px;
    }
    
    .contador-icon {
        width: 40px;
        height: 40px;
    }
    
    .contador-numero {
        font-size: 30px;
    }
    
    .contador-item p {
        font-size: 14px;
    }
    
    .timeline-item {
        min-width: 180px;
    }
    
    .timeline-img-container {
        height: 120px;
    }
    
    .timeline-item h3 {
        font-size: 1rem;
    }
    
    .timeline-item p {
        font-size: 13px;
    }
    
    .home-header .home-header-text,
    .home-header-simple .home-header-text-simple {
        padding: 20px;
    }
    
    .home-header .home-header-text h1,
    .home-header-simple .home-header-text-simple h1 {
        font-size: 1.8rem;
    }
    
    .home-header .home-header-text p,
    .home-header-simple .home-header-text-simple p {
        font-size: 1rem;
    }
}

/* ============================================= */
/* ANIMACIONES */
/* ============================================= */

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Evitar scroll cuando el modal está abierto */
.no-scroll {
    overflow: hidden;
}

/* Ajuste específico para el botón de la galería */
.gallery-btn-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    width: 100%;
}

.gallery .gallery-btn {
    margin: 0 auto;
}

/* Estilos para el plugin de Facebook */
.fb-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-plugin-wrapper {
    width: 250px;
    height: 250px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Ajustes responsivos para el footer */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fb-col {
        grid-column: span 3;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .fb-col {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .fb-col {
        grid-column: span 1;
    }
}
