/* ==========================================================================
   1. VARIABLES & TOKENS DE DISEÑO (PALETA ESTRICTA ARN)
   ========================================================================== */
:root {
    /* Fondos y Espacios (Maximizando el aire y la elegancia) */
    --c-bg-main: #ffffff;
    /* Blanco puro para dar respiro */
    --c-bg-light: #f9f2d7;
    /* Beige institucional para secciones alternas */
    --c-bg-neutral: #f9f2d7;
    /* Unificamos el neutro con el beige */

    /* Colores Principales (El Azul Profundo asume el control del texto) */
    --c-primary: #094a91;
    /* Azul Profundo: Títulos, botones primarios y texto base */
    --c-secondary: #0c74ef;
    /* Azul Brillante: Enlaces, hovers y foco (Accesibilidad) */
    --c-text-main: #094a91;
    /* Texto principal en azul profundo (Contraste superior a 4.5:1) */
    --c-text-light: #0c74ef;
    /* Texto secundario (con cuidado en fondos oscuros) */

    /* Acentos Cálidos (Uso micro-quirúrgico) */
    --c-accent-yellow-dark: #deb200;
    --c-accent-yellow: #f4c708;
    --c-accent-red-dark: #b81a17;
    --c-accent-red: #f5482a;

    /* Tipografía */
    --f-heading: 'Poppins', sans-serif;
    --f-body: 'Inter', sans-serif;

    /* Sombras, Bordes y Espaciado */
    --shadow-sm: 0 4px 12px rgba(9, 74, 145, 0.08);
    /* Sombra teñida de azul */
    --shadow-md: 0 10px 30px rgba(9, 74, 145, 0.12);
    --radius-md: 12px;
    --radius-lg: 24px;
    --space-section: 6rem;

    /* Transiciones */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   2. RESET & ACCESIBILIDAD BASE
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Base 16px para REMs accesibles */
}

body {
     font-family: var(--f-body);
    color: var(--c-text-main);
    background-color: var(--c-bg-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Evitar scroll horizontal por decoraciones */
}

/* Enfoque visible y accesible (WCAG) */
:focus-visible {
    outline: 3px solid var(--c-accent-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Saltar al contenido (Oculto visualmente, visible al recibir foco) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--c-primary);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.2s;
    text-decoration: none;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. TIPOGRAFÍA EDITORIAL
   ========================================================================== */
h1,
h2,
h3,
h4,
.serif {
    font-family: var(--f-heading);
     font-weight: 700;
    line-height: 1.2;
    color: var(--c-primary);
}

h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
}

h2.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.2rem;
    font-size: 1.125rem;
}

/* ==========================================================================
   4. LAYOUT & UTILIDADES
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    /* Por encima de elementos flotantes */
}

.section {
    padding: var(--space-section) 0;
    position: relative;
    overflow: hidden;
    /* Base para los fondos de imagen */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Modificadores de color de fondo (Fallback si falla imagen) */
.bg-light {
    background-color: var(--c-bg-light);
}

.bg-neutral {
    background-color: var(--c-bg-neutral);
}

.bg-white {
    background-color: #ffffff;
}

/* Grids modulares reutilizables */
.grid-2-col,
.grid-3-col,
.grid-4-col {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-2-col {
        grid-template-columns: 1fr 1fr;
    }

    .grid-3-col {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4-col {
        grid-template-columns: repeat(4, 1fr);
    }
}

.align-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--f-body);
    font-weight: 500;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background-color: var(--c-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--c-secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(11, 59, 66, 0.2);
}

.btn-outline {
    background-color: transparent;
    color: var(--c-primary);
    border: 1px solid var(--c-primary);
}

.btn-outline:hover {
    background-color: var(--c-primary);
    color: white;
}

.btn-text {
    color: var(--c-primary);
    font-weight: 600;
    text-decoration: none;
    position: relative;
}

.btn-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--c-primary);
    transition: width 0.3s ease;
}

.btn-text:hover::after {
    width: 100%;
}

/* ==========================================================================
   5. DECORACIONES FLOTANTES (Abstracciones)
   ========================================================================== */
.decorative-shape {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
}

.shape-1 {
    top: 10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--c-secondary);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.shape-2 {
    top: 40%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: var(--c-accent-yellow);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-delay: -5s;
}

.shape-3 {
    bottom: 10%;
    left: 20%;
    width: 350px;
    height: 350px;
    background: var(--c-accent-blue);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(50px, 50px) rotate(20deg);
    }
}

/* ==========================================================================
   6. COMPONENTES ESPECÍFICOS POR SECCIÓN
   ========================================================================== */

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: white;
}

.hero-overlay,
.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(11, 59, 66, 0.9) 0%, rgba(11, 59, 66, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0;
    /* Alinear a la izquierda visualmente dentro del container */
}

.hero-header h1 {
    color: white;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.accent-line {
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--c-accent-yellow);
    margin-bottom: 2rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid white;
    border-radius: 12px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    animation: scroll-wheel 1.5s infinite;
}

@keyframes scroll-wheel {
    0% {
        top: 6px;
        opacity: 1;
    }

    100% {
        top: 18px;
        opacity: 0;
    }
}

/* --- Storytelling --- */
.story-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    object-fit: cover;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* --- Video --- */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Indicadores --- */
.indicator-card {
    background: white;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.indicator-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.indicator-number {
    display: block;
    font-family: var(--f-heading);
    font-size: 3rem;
    color: var(--c-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.indicator-label {
    font-size: 1rem;
    color: var(--c-text-light);
    font-family: var(--f-body);
}

.indicator-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.accent-yellow {
    background: var(--c-accent-yellow);
}

.accent-blue {
    background: var(--c-accent-blue);
}

.accent-red {
    background: var(--c-accent-red);
}

.accent-green {
    background: var(--c-accent-green);
}

/* ==========================================================================
   4. INDICADORES (GRID DE IMÁGENES ASIMÉTRICO / COLLAGE COMPACTO)
   ========================================================================== */
.indicators {
    padding: var(--space-section) 0;
    background-color: var(--c-bg-light);
    /* Fondo beige institucional */
    overflow: visible;
    position: relative;
    clear: both;
}

/* CABECERA EDITORIAL: Compactada y blindada contra SharePoint
*/
.collage-header {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
    text-align: center;
    margin-bottom: 3.5rem !important;
    /* Reducido de 6rem a 3.5rem para acercarlo al collage */
    position: relative !important;
    z-index: 100 !important;
}

/* Contenedor del collage */
.indicators-image-collage {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 columna por defecto en móviles */
    gap: 1.5rem;
    /* Espacio estándar para móviles */
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Estilo común para cada tarjeta de imagen */
.collage-item {
    position: relative;
    transition: var(--transition-smooth);
    z-index: 2;
}

.collage-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(9, 74, 145, 0.08);
    /* Sombra un poco más sutil para el diseño compacto */
}

/* Al pasar el mouse, la tarjeta se eleva sutilmente */
.collage-item:hover {
    transform: scale(1.02) translateY(-4px) rotate(0deg) !important;
    z-index: 50;
    box-shadow: 0 12px 25px rgba(9, 74, 145, 0.18);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-icons a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    color: #0056b3;
    /* Azul */
    font-size: 20px;
    text-decoration: none;
    transition: all .3s ease;
}

.social-icons a:hover {
    background: #0056b3;
    color: #ffffff;
    transform: translateY(-3px) scale(1.08);
}

/* ==========================================================================
   DISTRIBUCIÓN EDITORIAL EN ESCRITORIO (COMPACTA)
   ========================================================================== */
@media (min-width: 992px) {
    .indicators-image-collage {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(130px, auto);
        /* Reducido a 1.25rem (20px) para compactar visualmente las tarjetas.
        */
        gap: 1.25rem;
        margin-top: 1.5rem !important;
        /* Ajuste superior refinado */
    }

    /* Coordenadas de traslación ajustadas para agrupar las imágenes de forma más estrecha.
    */

    /* ITEM 1: 105 Agendas (Arriba Izquierda) */
    .item-1 {
        grid-column: 1;
        grid-row: 1;
        transform: translate(-5px, -5px) rotate(-1.5deg);
        z-index: 3;
    }

    /* ITEM 2: +11.000 Firmantes (Arriba Centro) */
    .item-2 {
        grid-column: 2;
        grid-row: 1 / span 2;
        transform: translate(0, -5px) rotate(1deg);
        z-index: 4;
    }

    /* ITEM 3: 1.584 Soluciones Vivienda (Derecha - Vertical Largo) */
    .item-3 {
        grid-column: 3;
        grid-row: 1 / span 3;
        transform: translate(5px, 10px) rotate(-1deg);
        z-index: 3;
    }

    /* ITEM 4: 1.467 Proyectos (Izquierda - Vertical) */
    .item-4 {
        grid-column: 1;
        grid-row: 2 / span 2;
        transform: translate(-5px, 5px) rotate(0.8deg);
        z-index: 3;
    }

    /* ITEM 5: Logo Central "La Paz Nos Necesita" (Centro - Cuadrado) */
    .item-5 {
        grid-column: 2;
        grid-row: 3;
        transform: translate(0, 0) scale(1.02);
        z-index: 5;
        /* Destaca levemente en el centro del bloque compacto */
    }

    /* ITEM 6: 62 Proyectos (Abajo Centro - Vertical) */
    .item-6 {
        grid-column: 2;
        grid-row: 4 / span 2;
        transform: translate(0px, 12px) rotate(-0.5deg);
        z-index: 4;
    }

    /* ITEM 7: 130 Predios (Abajo Derecha - Horizontal) */
    .item-7 {
        grid-column: 3;
        grid-row: 4;
        transform: translate(8px, 5px) rotate(1.5deg);
        z-index: 3;
    }
}

/* Respetar accesibilidad de movimiento */
@media (prefers-reduced-motion: reduce) {
    .collage-item {
        transform: none !important;
        transition: none !important;
    }

    .collage-item:hover {
        transform: none !important;
    }
}

/* --- Noticias --- */
.news-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-date {
    font-size: 0.85rem;
    color: var(--c-accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.news-excerpt {
    font-size: 1rem;
    color: var(--c-text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* --- Hubs Interactivos (Botones de entrada) --- */
.interactive-hubs { margin-top: 3rem; }
.hub-card {
    position: relative;
    border: none;
    padding: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}
.hub-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.hub-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(9, 74, 145, 0.9), rgba(9, 74, 145, 0.3));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 2rem;
    text-align: left;
}
.hub-overlay h3 { color: white; font-size: 2rem; margin-bottom: 0.5rem; }
.hub-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(9, 74, 145, 0.25); }
.hub-card:hover img { transform: scale(1.05); }

/* --- Modales Modernos --- */
.modern-modal {
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    margin: auto;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--c-bg-main);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.modern-modal[open] { opacity: 1; transform: translateY(0); }
.modern-modal::backdrop { background: rgba(9, 74, 145, 0.85); backdrop-filter: blur(5px); }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: var(--c-bg-light);
    position: sticky;
    top: 0;
    z-index: 10;
}
.modal-header h2 { margin: 0; color: var(--c-primary); }
.close-modal {
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: var(--c-primary);
    cursor: pointer;
    transition: transform 0.3s ease;
}
.close-modal:hover { transform: rotate(90deg); color: var(--c-accent-red); }
.modal-body { padding: 3rem; overflow-y: auto; flex-grow: 1; }

/* Asegurar que el Lightbox actual quede por encima del Modal */
#lightbox { z-index: 9999 !important; }

/* --- Grilla de Cartas (Modal) --- */
.letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.letter-preview-card {
    text-decoration: none;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    border: 1px solid #e2dfd6;
}
.letter-img-box { height: 200px; overflow: hidden; }
.letter-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.letter-preview-info { padding: 1.5rem; }
.letter-preview-info h4 { color: var(--c-primary); margin-bottom: 0.5rem; font-size: 1.25rem; }
.letter-preview-info p { color: var(--c-text-light); font-size: 0.9rem; margin: 0; }
.letter-preview-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: var(--c-primary); }
.letter-preview-card:hover .letter-img-box img { transform: scale(1.08); }

/* ==========================================================================
   SECCIÓN FLYERS (GRILLA 3x3)
   ========================================================================== */
.flyers-section {
    padding: var(--space-section) 0;
    position: relative;
}

.flyers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
    margin-top: 2.5rem;
}

.flyer-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.flyer-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.flyer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 74, 145, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flyer-overlay i {
    color: #ffffff;
    font-size: 2rem; 
}

.flyer-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.flyer-card:hover img {
    transform: scale(1.04);
}

.flyer-card:hover .flyer-overlay {
    opacity: 1;
}

/* Adaptación Responsive */
@media (max-width: 991px) {
    .flyers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .flyers-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}

/* ================================
   Sección de Redes e Instagram
================================ */
.redes-section {
    padding: 140px 20px;
}

.instagram-category {
    margin-bottom: 5rem;
}

/* ================================
   Títulos
================================ */
.category-title {
    font-size: 1.6rem;
    color: #fff;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 12px;
    font-weight: 600;
}

.category-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 3px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366);
    border-radius: 10px;
}

/* ================================
   Grid (CORREGIDO)
================================ */
.instagram-grid {
    display: grid;
    /* Cambiado a 326px mínimo para que Instagram no colapse */
    grid-template-columns: repeat(auto-fit, minmax(326px, 1fr));
    gap: 30px;
    max-width: 1140px; /* Un poco más amplio para albergar cómodamente 3 columnas */
    margin: 0 auto;
    justify-items: center;
    align-items: start;
}

/* ================================
   Embebidos Instagram (CORREGIDO)
================================ */
.instagram-grid .instagram-media,
.instagram-grid iframe.instagram-media {
    width: 100% !important;
    min-width: 280px !important; /* Ajustado para pantallas de menor resolución */
    max-width: 350px !important;
    min-height: 450px !important; 
    margin: 0 auto !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, .15) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .15);
    transition: transform .3s ease, box-shadow .3s ease;
    background: transparent !important;
}

/* Hover */
@media (hover:hover){
    .instagram-grid .instagram-media:hover,
    .instagram-grid iframe.instagram-media:hover{
        transform: translateY(-6px);
        box-shadow: 0 16px 30px rgba(0,0,0,.20);
    }
}

/* ================================
   Tablet (CORREGIDO)
================================ */
@media (max-width:991px){
    .instagram-grid{
        /* Dejamos que auto-fit decida si caben 1 o 2 respetando los 326px */
        grid-template-columns: repeat(auto-fit, minmax(326px, 1fr));
    }
}

/* Ajustes Responsive */
@media (max-width: 640px) {
    .instagram-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .instagram-grid .instagram-media,
    .instagram-grid iframe.instagram-media {
        min-width: 100% !important; /* Asegura que ocupe el ancho disponible sin salirse */
        max-width: 100% !important;
    }
}

/* --- Cartas (Humano) --- */
.letter-card {
    background: #fbfbf9;
    /* Tono papel antiguo */
    border: 1px solid #e2dfd6;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .letter-card {
        flex-direction: row;
        align-items: center;
    }
}

.letter-image-wrapper {
    flex: 0 0 150px;
    border-radius: 8px;
    overflow: hidden;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.letter-transcription {
    font-family: var(--f-heading);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--c-primary);
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.letter-transcription::before {
    content: '“';
    position: absolute;
    left: 0;
    top: -10px;
    font-size: 4rem;
    color: rgba(11, 59, 66, 0.1);
}

.letter-author-info {
    font-size: 0.9rem;
    color: var(--c-text-light);
    display: flex;
    flex-direction: column;
}

.letter-author-info strong {
    color: var(--c-text-main);
    font-size: 1rem;
}

/* --- Galería --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius-md);
    aspect-ratio: 1 / 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 59, 66, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-overlay span {
    color: white;
    font-size: 2rem;
    font-weight: 300;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
    opacity: 1;
}

/* Lightbox UI */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    text-align: center;
}

.lightbox-content img {
    max-height: 70vh;
    margin: 0 auto;
    border-radius: 4px;
}

.lightbox-caption {
    color: white;
    margin-top: 1rem;
    font-family: var(--f-heading);
    font-size: 1.25rem;
}

/* --- Documentos --- */
.doc-card {
    background: white;
    border: 1px solid #e2dfd6;
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition-smooth);
}

.doc-card:hover {
    border-color: var(--c-primary);
}

.doc-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.doc-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.doc-meta {
    font-size: 0.85rem;
    color: var(--c-text-light);
    margin-bottom: 1.5rem;
}

/* --- Línea de Tiempo --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    width: 2px;
    background: var(--c-bg-neutral);
}

@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .timeline-item:nth-child(odd) {
        justify-content: flex-start;
    }
}

.timeline-dot {
    position: absolute;
    left: 8px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-primary);
    border: 4px solid white;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

@media (min-width: 768px) {
    .timeline-dot {
        left: 50%;
        transform: translateX(-50%);
    }
}

.timeline-content {
    width: calc(100% - 40px);
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .timeline-content {
        width: calc(50% - 40px);
    }
}

.timeline-content time {
    font-family: var(--f-heading);
    color: var(--c-accent-blue);
    font-weight: bold;
    font-size: 1.25rem;
}

/* --- CTA Final --- */
.cta {
    color: white;
}

.cta .cta-overlay {
    background: rgba(11, 59, 66, 0.85);
}

.cta-title {
    color: white;
    margin-bottom: 1rem;
}

.cta-content p {
    margin-bottom: 2rem;
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--c-text-main);
    color: white;
    padding: 4rem 0 2rem;
}

.site-footer h2,
.site-footer h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.social-icons a:hover {
    background: var(--c-primary);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.85rem;
}

/* ==========================================================================
   8. ANIMACIONES Y ESTADOS (SCROLL REVEAL)
   ========================================================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respeta la preferencia del usuario para reducir animaciones */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    .decorative-shape {
        display: none;
    }
}

/* ==========================================================================
   9. RESPONSIVE ADICIONAL
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --space-section: 4rem;
    }

    .hero-content {
        text-align: center;
        margin: 0 auto;
    }

    .accent-line {
        margin: 0 auto 2rem auto;
    }

    .story-image {
        order: -1;
        margin-bottom: 2rem;
    }
}