/* ---------------------------------- */
/* 1. Reset Básico y Tipografía       */
/* ---------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Inter:wght@300;400;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Paleta 'El Archivo Vivo' - Museo Premium */
    --primary-color: #1A1A1A;
    /* Negro Carbón - Elegancia y Autoridad */
    --secondary-color: #FCFAF7;
    /* Alabastro Cálido - Fondo papel */
    --accent-color: #C5A059;
    /* Oro Antiguo - Detalles Premium */
    --accent-hover: #D4AF37;
    /* Oro Tenue - Interactive State */
    --accent-warm: #A0522D;
    /* Siena Tostado - Enlaces/CTAs alternativos */
    --text-color: #2E2E2E;
    /* Carbón suave - Legibilidad mejorada */
    --text-light: #5C5C5C;
    /* Gris Medio - Subtítulos */
    --border-color: #E8E4DF;
    /* Líneas cálidas sutiles */

    --bg-color: var(--secondary-color);
    --header-bg: rgba(26, 26, 26, 0.97);
    /* Header más opaco para legibilidad */
    --footer-bg: #0F0F0F;
    /* Footer casi negro */
    --white: #ffffff;

    /* Typography - Sistema dual Serif/Sans */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-display: 'Cinzel', 'Times New Roman', serif;
    --font-body: 'Inter', 'Helvetica Neue', sans-serif;

    /* Spacing & Layout */
    --container-width: 1400px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;

    /* Premium Card System - Museo Style */
    --card-bg: #ffffff;
    --card-bg-warm: #FDFBF7;
    /* Fondo papel antiguo */
    --card-border: 1px solid rgba(0, 0, 0, 0.06);
    --card-border-warm: 1px solid #EADDCF;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 20px 30px -8px rgba(0, 0, 0, 0.12);
    --card-radius: 3px;
    /* Más cuadrado = más elegante */
    --card-radius-sm: 2px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.25s ease;

    /* Museo Gallery Filters */
    --image-filter-default: sepia(15%) contrast(102%);
    --image-filter-hover: sepia(0%) contrast(100%);

    /* Material Educativo Premium Styles (Stitch) */
    --edu-navy: #0A192F;
    --edu-gold: #C9A961;
    --edu-cream: #F8F5F2;
    --edu-glass: rgba(255, 255, 255, 0.1);
    --edu-glass-border: rgba(255, 255, 255, 0.2);
    --edu-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
}

/* ---------------------------------- */
/* 2. Colores y Layout Principal      */
/* ---------------------------------- */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

header {
    background: var(--header-bg);
    color: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

header h2 {
    font-size: 1.2em;
    font-weight: normal;
    margin-bottom: 10px;
}

/* ---------------------------------- */
/* 3. Navegación y Botones            */
/* ---------------------------------- */
header nav ul {
    list-style: none;
    padding-bottom: 10px;
}

/* Navigation Links */
header nav ul li {
    display: inline-block;
    margin-left: 2rem;
}

header a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

header a:hover,
header a.active {
    color: var(--accent-color);
}

/* Primary Button */
.btn-principal {
    display: inline-block;
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 2px;
    /* Minimalist */
    margin: 20px 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.btn-principal:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--primary-color);
}

/* ---------------------------------- */
/* 4. Secciones y Footer              */
/* ---------------------------------- */
/* Hero Section Redesign */
.hero {
    position: relative;
    height: 85vh;
    /* Cine-like height */
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--white);
    text-align: center;
    background: #000;
    /* Fallback */
}

.hero-slider,
.slide,
.slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 2rem;
    animation: fadeInUp 1s ease-out;
}

.hero h2 {
    font-family: var(--font-display);
    /* Cinzel */
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* ============================================
   HERO TITLE DUAL - Premium Style
   Primera palabra: Blanco Serif Elegante
   Segunda palabra: Oro Antiguo (Accent)
   ============================================ */
.hero-title-dual {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hero-title-dual .title-white {
    color: #FFFFFF;
    font-style: italic;
    font-weight: 400;
    display: block;
    margin-bottom: 0.1em;
}

.hero-title-dual .title-gold {
    color: var(--accent-color, #C5A059);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.25em;
}

/* Variante inline (ambas palabras en la misma línea) */
.hero-title-dual.inline .title-white,
.hero-title-dual.inline .title-gold {
    display: inline;
}

.hero-title-dual.inline .title-white {
    margin-bottom: 0;
    margin-right: 0.3em;
}

/* Animación de entrada */
.hero-title-dual {
    animation: heroTitleFadeIn 1.2s ease-out;
}

@keyframes heroTitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
        letter-spacing: 0.3em;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.15em;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title-dual {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        letter-spacing: 0.1em;
    }

    .hero-title-dual .title-gold {
        letter-spacing: 0.15em;
    }
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PAGE HERO - Unified Banner Component
   For internal pages (not homepage)
   ============================================ */
.page-hero {
    background: linear-gradient(135deg, #1a1510 0%, #2d2419 50%, #1a1510 100%);
    padding: 3rem 1rem 2rem;
    text-align: center;
}

.page-hero.with-image {
    background-size: cover;
    background-position: center;
    position: relative;
}

.page-hero.with-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.page-hero.with-image .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    color: #f4e9d9;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.page-hero h1 .accent {
    color: #c9a961;
    font-style: italic;
}

.page-hero .tagline {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    color: rgba(244, 233, 217, 0.8);
    font-style: italic;
    max-width: 700px;
    margin: 0 auto;
}

.page-hero .badge {
    display: inline-block;
    background: linear-gradient(135deg, #c9a961 0%, #8b7355 100%);
    color: #1a1510;
    padding: 0.4rem 1.5rem;
    border-radius: 30px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 1rem;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .page-hero h1 {
        font-size: 1.8rem;
    }

    .page-hero .tagline {
        font-size: 1rem;
    }

    .page-hero .badge {
        font-size: 0.8rem;
        padding: 0.3rem 1rem;
    }
}

.seccion-fotos,
.seccion-educativa {
    padding: 30px 0;
    border-bottom: #ccc 1px solid;
    text-align: center;
}

.seccion-fotos h3,
.seccion-educativa h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

footer {
    background: var(--footer-bg);
    color: #888;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* ---------------------------------- */
/* Professional Footer Styles         */
/* ---------------------------------- */
.site-footer {
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1510 100%);
    color: #a0a0a0;
    margin-top: 4rem;
}

/* CTA Banner */
.footer-cta {
    background: linear-gradient(135deg, #c9a961 0%, #a88b4a 100%);
    padding: 1rem 0;
}

.footer-cta .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-cta-text {
    color: #1a1510;
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-cta-btn {
    background: #1a1510;
    color: #c9a961;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.footer-cta-btn:hover {
    background: #2d2419;
    transform: translateX(3px);
}

/* Main Footer */
.footer-main {
    padding: 3.5rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
}

/* Brand Column */
.footer-brand {
    padding-right: 2rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #f4e9d9;
    margin-bottom: 0.25rem;
}

.footer-tagline {
    color: #c9a961;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.footer-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #888;
    margin-bottom: 1.25rem;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(201, 169, 97, 0.1);
    border: 1px solid rgba(201, 169, 97, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    color: #c9a961;
}

/* Navigation Columns */
.footer-nav-col h4 {
    color: #f4e9d9;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.footer-nav-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-col li {
    margin-bottom: 0.75rem;
}

.footer-nav-col a {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-nav-col a:hover {
    color: #c9a961;
    padding-left: 5px;
}

/* Contact Column */
.footer-contact h4 {
    color: #f4e9d9;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.footer-email,
.footer-whatsapp {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.footer-email:hover,
.footer-whatsapp:hover {
    color: #c9a961;
}

.footer-whatsapp {
    background: rgba(37, 211, 102, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-flex;
    margin-bottom: 1rem;
}

.footer-whatsapp:hover {
    background: rgba(37, 211, 102, 0.2);
    color: #25D366;
}

.footer-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    margin-top: 1rem;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.footer-credits {
    margin-top: 0.5rem !important;
    font-size: 0.8rem !important;
    color: #555 !important;
}

/* Footer Responsive */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
        padding-right: 0;
        text-align: center;
    }

    .footer-badge {
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-nav-col,
    .footer-contact {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 1.5rem;
    }

    .footer-nav-col a:hover {
        padding-left: 0;
    }

    .footer-email,
    .footer-whatsapp,
    .footer-location {
        justify-content: center;
    }

    .footer-cta .container {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ---------------------------------- */
/* 5. RESPONSIVO (Móviles)            */
/* ---------------------------------- */
/* Botón Volver Arriba */
#backToTopBtn {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    /* Redondo */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, transform 0.3s;
}

#backToTopBtn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
    /* Efecto hover */
}

/* ---------------------------------- */
/* 6. Video Responsivo                */
/* ---------------------------------- */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
    /* Consistent with other inputs/images */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .slider-container {
        aspect-ratio: 4/3;
        /* Más cuadrado en móviles */
    }
}

/* Presentation / Slideshow Component (History & Ecos) */
.presentation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: 'Merriweather', serif;
}

.presentation-slide {
    display: none;
    animation: fadeIn 0.5s;
}

.presentation-slide.active {
    display: block;
}

/* Note: @keyframes fadeIn is already common, but ensure it exists if used. It was local before. */
/* If fadeIn is not in style.css, we should add it. */
/* Checking style.css... fadeInUp is there, but fadeIn? */
/* The inline style had fadeIn. I will include it. */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.presentation-slide img {
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    /* Responsive constraint */
    display: block;
    margin: 0 auto 2rem auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Navegación de slides */
.presentation-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.presentation-nav button {
    padding: 0.75rem 1.5rem;
    background: #8c4623;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.presentation-nav button:hover {
    background: #6b341b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.presentation-nav button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Indicadores de progreso */
.presentation-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.presentation-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.presentation-dots .dot.active {
    background: #8c4623;
    transform: scale(1.3);
}

.presentation-dots .dot:hover {
    background: #b35d2d;
}

/* Contador de slides */
.presentation-counter {
    text-align: center;
    color: #6b341b;
    font-family: 'Lato', sans-serif;
    margin: 1rem 0;
    font-size: 0.9rem;
}

/* Controles de teclado info */
.keyboard-hint {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin-top: 1rem;
    font-family: 'Lato', sans-serif;
}

/* Hero section for presentation pages */
.hero-presentation {
    background: linear-gradient(135deg, #fdf6f0 0%, #fce9d7 100%);
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 3px solid #d17a3a;
}

.hero-presentation h1 {
    font-family: 'Merriweather', serif;
    color: #4a2313;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-presentation p {
    font-family: 'Lato', sans-serif;
    color: #6b341b;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-presentation h1 {
        font-size: 1.8rem;
    }

    .presentation-nav {
        gap: 0.5rem;
    }

    .presentation-nav button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Botón de descarga */
.download-section {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.download-section h3 {
    color: #4a2313;
    margin-bottom: 1rem;
    font-family: 'Merriweather', serif;
}

.download-section p {
    color: #6b341b;
    margin-bottom: 1.5rem;
    font-family: 'Lato', sans-serif;
}

.btn-download {
    display: inline-block;
    padding: 1rem 2rem;
    background: #d17a3a;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: #b35d2d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ---------------------------------- */
/* 7. Premium Card System             */
/* ---------------------------------- */

/* Base Card Component */
.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
}

.premium-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(93, 64, 55, 0.15);
}

/* Card Image Container */
.premium-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.premium-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.premium-card:hover .premium-card-image img {
    transform: scale(1.05);
}

/* Card Content */
.premium-card-content {
    padding: 1.5rem;
}

.premium-card-title {
    font-family: 'Merriweather', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.premium-card-text {
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: var(--text-color);
    margin: 0 0 1rem 0;
    line-height: 1.6;
    opacity: 0.85;
}

/* Card Button */
.premium-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-color);
    color: var(--text-color);
    padding: 0.65rem 1.25rem;
    border-radius: var(--card-radius-sm);
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.premium-card-btn:hover {
    background: var(--accent-hover);
    transform: translateX(4px);
}

.premium-card-btn::after {
    content: '→';
    transition: var(--transition-fast);
}

.premium-card-btn:hover::after {
    transform: translateX(4px);
}

/* 8. Premium Grid System             */
/* ---------------------------------- */

/* === GALLERY GRID - Stable & Uniform === */
.grid-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
}

/* Animation on load */
@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-galeria .card-foto {
    opacity: 0;
    animation: fadeInCard 0.4s ease forwards;
}

.grid-galeria .card-foto:nth-child(1) {
    animation-delay: 0.05s;
}

.grid-galeria .card-foto:nth-child(2) {
    animation-delay: 0.1s;
}

.grid-galeria .card-foto:nth-child(3) {
    animation-delay: 0.12s;
}

.grid-galeria .card-foto:nth-child(4) {
    animation-delay: 0.15s;
}

.grid-galeria .card-foto:nth-child(5) {
    animation-delay: 0.18s;
}

.grid-galeria .card-foto:nth-child(6) {
    animation-delay: 0.2s;
}

.grid-galeria .card-foto:nth-child(n+7) {
    animation-delay: 0.22s;
}

@media (max-width: 768px) {
    .grid-galeria {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .grid-galeria {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .grid-galeria {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* Legacy Card Support - Enhanced */
/* Legacy Card Support - Refined for Museo Style */
.card-foto {
    background: var(--card-bg-warm, #FDFBF7);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-foto:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
    z-index: 10;
}

.card-foto-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    margin: 0;
    background: #1a1510 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-foto-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* This should hide the baked-in bars by zooming in */
    transition: transform 0.7s ease;
    filter: var(--image-filter-default);
}

.card-foto:hover .card-foto-img-container img {
    transform: scale(1.05);
    filter: sepia(0%) contrast(100%);
}

.card-foto-content {
    padding: 1.25rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-foto-content h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card-foto-content p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-style: italic;
    line-height: 1.4;
}



.btn-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--card-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.btn-card:hover {
    background: var(--accent-hover);
    transform: translateX(3px);
}

/* Testimonio/Content Cards - Enhanced */
.card-testimonio {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.card-testimonio:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.card-testimonio h3,
.card-testimonio h4 {
    font-family: 'Merriweather', serif;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    font-weight: 700;
}

.card-testimonio h3 {
    font-size: 1.15rem;
}

.card-testimonio h4 {
    font-size: 1.05rem;
}

.card-testimonio p {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    opacity: 0.85;
}

/* Placeholder Icons */
.galeria-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hero-bg) 0%, #f5f0eb 100%);
    border-radius: var(--card-radius-sm);
    font-size: 3rem;
    opacity: 0.7;
}

/* Time Capsule Cards (Vintage/Archive Look) */
.card-capsule {
    background-color: #fdfbf7;
    /* Old paper color */
    border: 1px solid #eaddcf;
    padding: 2.5rem 2rem;
    position: relative;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.03);
    /* Very subtle shadow initially */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 2px;
    /* Sharp corners like paper */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Internal decorative border (The "frame") */
.card-capsule::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(160, 82, 45, 0.1);
    /* Subtle sepia border */
    pointer-events: none;
    z-index: 0;
}

.card-capsule:hover {
    transform: translateY(-5px) rotate(0.3deg);
    /* Organic lift and twist */
    box-shadow: 5px 15px 25px rgba(0, 0, 0, 0.08);
    border-color: #c5a059;
    /* Accent color on border */
    background-color: #fff;
    /* Brightens slightly on hover */
}

.card-capsule h3 {
    font-family: 'Playfair Display', serif;
    color: #4a3b32;
    /* Dark sepia text */
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    border-bottom: 2px solid #e0d0b0;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.card-capsule p {
    font-family: 'Lato', sans-serif;
    color: #6b5a50;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    z-index: 1;
    position: relative;
    font-style: italic;
    /* Handwritten feel */
}

/* Button inside capsule */
.card-capsule .btn-principal {
    align-self: flex-start;
    background-color: transparent;
    color: #8c4623;
    /* Sepia/Rust link color */
    border: 1px solid #8c4623;
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    z-index: 1;
    box-shadow: none;
}

.card-capsule .btn-principal:hover {
    background-color: #8c4623;
    color: #fff;
    transform: none;
}

/* Optional: "Stamp" decoration in top right */
.card-capsule::after {
    content: '★';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
    color: #eaddcf;
    z-index: 0;
}

.grid-deportistas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.card-deportista {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.card-deportista:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.card-deportista .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4a332c 100%);
    color: var(--white);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-deportista .card-header h3 {
    margin: 0;
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-deportista .badge {
    background: var(--accent-color);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.card-deportista .card-body {
    padding: 1.25rem;
}

.card-deportista .card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.card-deportista .card-logros {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.card-deportista .card-footer {
    padding: 1rem 1.25rem;
    background: var(--hero-bg);
    border-top: 1px solid var(--card-border);
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius-sm);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 183, 77, 0.2);
}

.filter-box select {
    padding: 0.85rem 2.5rem 0.85rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius-sm);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235D4037' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.filter-box select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.timeline-summary {
    background: var(--hero-bg);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

/* ---------------------------------- */
/* 10. Navigation Enhancements        */
/* ---------------------------------- */

/* Logo Area */
.logo-area {
    padding: 0.5rem 0;
}

.logo-area h1 a {
    transition: var(--transition-fast);
}

.logo-area h1 a:hover {
    opacity: 0.9;
}

.logo-area .subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* Main Navigation */
.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav ul li {
    display: inline-block;
    padding: 0;
}

.main-nav ul li a {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--card-radius-sm);
    transition: var(--transition-fast);
}

.main-nav ul li a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.main-nav ul li a.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

.btn-nav {
    background: var(--accent-color) !important;
    color: var(--text-color) !important;
    font-weight: 700 !important;
}

.btn-nav:hover {
    background: var(--accent-hover) !important;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition-fast);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    header .container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .main-nav {
        display: none;
        width: 100%;
        padding: 1rem 0;
    }

    .main-nav.show {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.25rem;
    }

    .main-nav ul li a {
        display: block;
        padding: 0.75rem 1rem;
    }
}

/* ---------------------------------- */
/* 11. Animations                     */
/* ---------------------------------- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Detail Page Hero Override */
.hero-detalle {
    height: 40vh;
    min-height: 300px;
    background: #111;
}

.hero-detalle h2 {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    color: var(--accent-color);
}

/* ---------------------------------- */
/* 12. Modal System                   */
/* ---------------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-color);
    margin: 2rem auto;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 1100px;
    border-radius: var(--card-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.modal-header h2 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.colorear-item {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
    text-align: center;
}

.colorear-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent-color);
}

.colorear-img-container {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-bottom: 1rem;
    border-radius: var(--card-radius-sm);
    background: #f5f0eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.colorear-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.colorear-item:hover .colorear-img {
    transform: scale(1.05);
}

.btn-download-sm {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-download-sm:hover {
    background: var(--accent-hover);
    color: var(--primary-color);
}

/* Video Grid System for Modals */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.video-card-ia {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: var(--transition-smooth);
}

.video-card-ia:hover {
    border-color: var(--accent-color);
    background: rgba(197, 160, 89, 0.05);
}

.video-card-ia h4 {
    margin-bottom: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Modal Quick Navigation */
.modal-quick-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f6f4;
    border-bottom: 2px solid #e8e0da;
    flex-wrap: wrap;
    justify-content: center;
    margin: -2.5rem -2.5rem 1.5rem -2.5rem;
}

.quick-nav-btn {
    padding: 0.6rem 1rem;
    background: white;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.quick-nav-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(197, 160, 89, 0.3);
}

.quick-nav-btn.active {
    background: var(--accent-color);
    color: white;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(26, 26, 26, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(26, 26, 26, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .modal-quick-nav {
        padding: 0.75rem;
        gap: 0.4rem;
    }

    .quick-nav-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .btn-back {
        font-size: 0.85rem;
    }

    /* ✅ Modal responsive mejorado para móvil */
    .modal-content {
        width: 100%;
        margin: 0;
        padding: 1.25rem;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
        border: none;
    }

    .modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .colorear-img-container {
        aspect-ratio: 4 / 3;
    }

    .close-modal {
        position: fixed;
        right: 1rem;
        top: 0.5rem;
        z-index: 2001;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }
}

/* ---------------------------------- */
/* 12. Museo "Frameless" Cards        */
/* ---------------------------------- */
/* Tarjetas sin marco estilo galería */

.card-museo {
    position: relative;
    background: transparent;
    border: none;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.card-museo-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    /* Portrait like gallery paintings */
}

.card-museo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--image-filter-default);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-museo:hover .card-museo-image img {
    filter: var(--image-filter-hover);
    transform: scale(1.03);
}

.card-museo-caption {
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.card-museo-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.3rem 0;
    letter-spacing: 0.02em;
}

.card-museo-meta {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin: 0;
}

.card-museo-link {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-warm);
    text-decoration: none;
    letter-spacing: 0.5px;
    border-bottom: 1px solid transparent;
    transition: var(--transition-fast);
}

.card-museo-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Grid for Museo Cards */
.grid-museo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3rem;
    padding: var(--spacing-xl) 0;
}

@media (min-width: 768px) {
    .grid-museo {
        grid-template-columns: repeat(3, 1fr);
        gap: 4rem 3rem;
    }
}

/* ---------------------------------- */
/* 13. Section Dividers & Pull Quotes */
/* ---------------------------------- */

.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-xxl) auto;
    max-width: 200px;
}

.pull-quote {
    max-width: 800px;
    margin: var(--spacing-xxl) auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    position: relative;
}

.pull-quote::before {
    content: '"';
    font-family: var(--font-display);
    font-size: 5rem;
    color: var(--accent-color);
    opacity: 0.3;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1;
}

.pull-quote p {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--primary-color);
    line-height: 1.6;
    margin: 0;
}

.pull-quote cite {
    display: block;
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-style: normal;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ---------------------------------- */
/* 14. Heritage Labeling Framework    */
/* ---------------------------------- */
.heritage-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 2px;
    z-index: 10;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition-fast);
}

.badge-original {
    background: rgba(26, 26, 26, 0.85);
    /* Black / Archive */
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
}

.badge-restored {
    background: rgba(197, 160, 89, 0.9);
    /* Gold / Restoration */
    color: var(--primary-color);
    border-color: rgba(0, 0, 0, 0.1);
}

.badge-ia {
    background: rgba(160, 82, 45, 0.9);
    /* Sienna / AI Interpretation */
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Hover effects */
.premium-card:hover .heritage-badge,
.card-foto:hover .heritage-badge {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustment for badges */
@media (max-width: 480px) {
    .heritage-badge {
        font-size: 0.55rem;
        padding: 0.3rem 0.6rem;
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* ---------------------------------- */
/* 15. Historical Chatbot UI          */
/* ---------------------------------- */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    border: 2px solid var(--white);
    color: var(--white);
    font-size: 1.5rem;
}

.chat-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent-hover);
}

.chat-window {
    width: 350px;
    max-width: 90vw;
    height: 500px;
    background: rgba(252, 250, 247, 0.95);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(197, 160, 89, 0.3);
    animation: chatJumpIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chatJumpIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-window.show {
    display: flex;
}

.chat-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
    object-fit: cover;
}

.chat-header-info h4 {
    color: var(--white);
    font-size: 1rem;
    margin: 0;
}

.chat-header-info span {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Response link inside chat */
.chat-response-link {
    display: block;
    margin-top: 1rem;
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: underline;
    font-size: 0.8rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--card-bg-warm);
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(197, 160, 89, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    animation: messageSlide 0.4s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.user {
    align-self: flex-end;
    background: var(--accent-color);
    color: var(--primary-color);
    border-bottom-right-radius: 2px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(197, 160, 89, 0.2);
    animation: messageSlideUser 0.4s ease-out;
}

@keyframes messageSlideUser {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-input-area {
    padding: 1rem;
    background: var(--white);
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.chat-send-btn {
    background: var(--accent-color);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 2rem);
        height: 400px;
    }
}

/* ---------------------------------- */
/* 9. Lightbox & UI Enhancements      */
/* ---------------------------------- */

/* Back to Top Button */
#backToTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1100;
    border: none;
    outline: none;
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

#backToTopBtn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1) translateY(-5px);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: zoom 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes zoom {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    height: 150px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2100;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
}

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}

/* Debug / fix: asegurar que tarjetas sean clicables */
.card-foto {
    position: relative;
    z-index: 2 !important;
    pointer-events: auto !important;
}

.main-nav,
header {
    z-index: 9999;
    /* para que navbar quede encima si hace falta */
}

/* ---------------------------------- */
/* ACCESSIBILITY: Focus-Visible       */
/* ---------------------------------- */
/* Solo muestra outline cuando se usa teclado, no con mouse */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Links and buttons */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Form inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 1px;
    border-color: var(--accent-color);
}

/* Cards and interactive elements */
.card-foto:focus-visible,
.card-testimonio:focus-visible,
.nav-card:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(197, 160, 89, 0.2);
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 8px 16px;
    z-index: 100000;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* ---------------------------------------------------- */
/* 30. Material Educativo Premium (Diseño de Stitch)    */
/* ---------------------------------------------------- */

.edu-section {
    padding: 6rem 0;
    background: radial-gradient(circle at top right, #1a2a44, var(--edu-navy));
    color: var(--edu-cream);
    min-height: 80vh;
}

.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.edu-card {
    background: var(--edu-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--edu-glass-border);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--edu-shadow);
    position: relative;
    overflow: hidden;
}

.edu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transition: 0.5s;
}

.edu-card:hover::before {
    left: 100%;
}

.edu-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--edu-gold);
}

.edu-card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--edu-gold);
}

.edu-card h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--edu-gold);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.edu-card p {
    color: rgba(248, 245, 242, 0.8);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.edu-card-actions {
    display: flex;
    gap: 1rem;
}

.btn-edu {
    padding: 0.8rem 1.5rem;
    border-radius: 2px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.btn-edu-primary {
    background: var(--edu-gold);
    color: var(--edu-navy);
}

.btn-edu-primary:hover {
    background: var(--white);
    color: var(--edu-navy);
}

.btn-edu-secondary {
    border: 1px solid var(--edu-gold);
    color: var(--edu-gold);
}

.btn-edu-secondary:hover {
    background: var(--edu-gold);
    color: var(--edu-navy);
}

/* Animación de entrada para las tarjetas */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edu-card {
    animation: cardEntrance 0.8s ease-out forwards;
}

.edu-card:nth-child(2) {
    animation-delay: 0.2s;
}

.edu-card:nth-child(3) {
    animation-delay: 0.4s;
}

@media (max-width: 768px) {
    .edu-section {
        padding: 4rem 1rem;
    }

    .edu-grid {
        gap: 2rem;
    }
}