:root {
    --bone: #F2EFE9;
    --jungle: #1B3022;
    --jade: #2D6A4F;
    --terracotta: #BC6C25;
    --stone: #dfdacd;
    --text: #2b2b2b;
    --sidebar-w: 260px;
    --header-h: 70px;
}

/* --- Base & Scroll Logic --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bone);
    color: var(--text);
    font-family: 'Charter', 'Georgia', serif;
    overflow-x: hidden;
}

/* Desktop Locking (Solo bloquea el scroll si la pantalla es grande) */
@media (min-width: 1025px) {
    body { overflow: hidden; }
}

/* --- Header & Navigation --- */
.main-header {
    height: var(--header-h);
    background: var(--jungle);
    color: var(--bone);
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
}

.header-container {
    max-width: 1600px; margin: 0 auto; height: 100%;
    display: flex; justify-content: space-between; align-items: center; padding: 0 2rem;
}

.header-logo {
    max-height: calc(var(--header-h) - 20px);
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lang-container { background: rgba(0, 0, 0, 0.3); padding: 3px; border-radius: 50px; }
.lang-link {
    text-decoration: none; color: var(--bone); font-size: 0.75rem;
    font-weight: bold; padding: 6px 14px; border-radius: 25px; transition: 0.3s;
}
.lang-link.active { background: var(--terracotta); color: white; }

/* --- Layout --- */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w);
    max-width: 1600px;
    margin: 0 auto;
    height: 100vh;
    padding-top: var(--header-h);
}

.sidebar-left {
    padding: 2rem 1rem;
    background: var(--bone);
    border-right: 1px solid rgba(0,0,0,0.05);
}

.nav-menu { display: flex; flex-direction: column; gap: 12px; }

.nav-btn {
    text-decoration: none; padding: 18px; background: var(--stone);
    color: var(--jungle); font-weight: bold; text-transform: uppercase;
    letter-spacing: 1px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1); transition: 0.3s; text-align: center;
}

.nav-btn:hover { transform: translateY(-2px); box-shadow: 4px 4px 0px var(--terracotta); background: #e9e5dc; }

/* --- Center Content & Reveal Animation --- */
.content-center {
    overflow-y: auto;
    padding: 3rem 8%;
    scroll-behavior: smooth;
    background: white;
}

/* Custom Scrollbar */
.content-center::-webkit-scrollbar { width: 6px; }
.content-center::-webkit-scrollbar-thumb { background: var(--terracotta); border-radius: 10px; }

/* REVEAL ENGINE */
.reveal { 
    opacity: 0; 
    transform: translateY(40px); 
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1); 
    visibility: hidden;
}

.reveal.active { 
    opacity: 1; 
    transform: translateY(0); 
    visibility: visible;
}

/* --- Hero & Images --- */
.sidebar-right { 
    background-color: var(--jungle);
    position: sticky; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow: hidden;
}

.hero-image-container { 
    height: 100%; width: 100%; 
    background-image: url('images/background-C3.png');
    background-size: cover; background-position: center;
    filter: sepia(15%) contrast(105%); transition: 0.8s;
}

.sidebar-right:hover .hero-image-container { filter: sepia(0%) contrast(100%); }

/* --- Typography --- */
h1 { font-size: 3rem; color: var(--jungle); margin-bottom: 1.5rem; line-height: 1.1; }
h2 { font-size: 2.2rem; color: var(--terracotta); margin: 3rem 0 1.5rem; }
p { font-size: 1.1rem; line-height: 1.8; margin-bottom: 1.5rem; }

.sacred-text-box { padding: 3rem 0; border-bottom: 1px solid var(--stone); margin-bottom: 3rem; }
.popol-vuh-text { font-size: 1.35rem; font-style: italic; text-align: justify; color: var(--jungle); }
.glyph-cap {
    float: left; font-size: 5rem; line-height: 0.8; padding-right: 15px;
    color: var(--terracotta); font-weight: 900; text-shadow: 2px 2px 0px var(--stone);
}

/* --- Custom Components --- */
.alert-box {
    background: #fff; border: 2px solid var(--terracotta);
    padding: 2.5rem; border-radius: 8px; box-shadow: 10px 10px 0px var(--stone);
    margin: 3rem 0;
}

.mission-statement { background: var(--jungle); color: var(--bone); padding: 2.5rem; border-radius: 8px; }
.mission-text { border-left: 3px solid var(--terracotta); padding-left: 20px; font-style: italic; }

.innovation-box {
    background: #fff5eb; border: 1px solid var(--stone);
    padding: 1rem; text-align: center; border-radius: 12px; margin: 4rem 0;
}
.rounded-img-shadow { width: 100%; max-width: 400px; border-radius: 10px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); }

/* Vision Cards Fix (Texto oscuro sobre fondo claro) */
.vision-card {
    background: #fff5eb;
    color: var(--text); /* Corregido de var(--bone) para que se lea */
    padding: 2rem; border-radius: 8px; border-left: 4px solid var(--terracotta);
    margin-bottom: 1.5rem;
}

/* Triple Column Row */
.image-triple-row { display: flex; gap: 25px; margin: 4rem 0; }
.triple-column { flex: 1; text-align: center; }
.img-wrapper { aspect-ratio: 2/3; overflow: hidden; border-radius: 8px; margin-top: 15px; }
.column-img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.column-img:hover { transform: scale(1.08); }

/* Manuals Grid (3x2) */
.library-container {
    background: white; padding: 3rem; border: 1px solid #eee;
    border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.03); margin: 5rem 0;
}
.manuals-grid-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.manual-item img { 
    width: 100%; border-radius: 6px; border: 1px solid #ddd; 
    transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}
.manual-item a:hover img { transform: translateY(-5px); box-shadow: 0 12px 20px rgba(0,0,0,0.1); }

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .app-container { grid-template-columns: 1fr; }
    .sidebar-right { display: none; }
    .sidebar-left {
        position: fixed; left: -100%; top: var(--header-h);
        width: 280px; height: 100%; z-index: 1001;
        transition: 0.4s ease; box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    .sidebar-left.open { left: 0; }
    .menu-toggle { display: block; background: none; border: none; color: white; font-size: 1.8rem; }
    .content-center { padding: 2rem 5%; }
}

/* 1. Esconder por defecto en computadoras */
.menu-toggle { 
    display: none; /* Esto quita el icono fantasma de la esquina */
    background: none; 
    border: none; 
    color: white; 
    font-size: 1.8rem; 
    cursor: pointer; 
}

/* 2. Mostrar solo en móviles (Esta parte va dentro del @media (max-width: 1024px)) */
@media (max-width: 1024px) {
    .menu-toggle { 
        display: block; /* Aquí sí aparece porque el menú lateral se esconde */
    }
    /* ... resto de tu código móvil ... */
}

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    .image-triple-row { flex-direction: column; }
    .manuals-grid-layout { grid-template-columns: repeat(2, 1fr); }
    .img-wrapper { aspect-ratio: 1/1; }
}

@media (max-width: 480px) {
    .manuals-grid-layout { grid-template-columns: 1fr; }
}

/* --- Galería Dinámica Estilo Editorial --- */
.pura-vida-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 250px;
    gap: 20px;
    margin-top: 2rem;
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: var(--stone);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: block;
}

/* Efectos de Tamaño */
.gallery-card.tall { grid-row: span 2; } /* Foto vertical larga */
.gallery-card.wide { grid-column: span 2; } /* Foto panorámica */

/* Overlay con Gradiente */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(27, 48, 34, 0.9) 0%, rgba(27, 48, 34, 0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    opacity: 0.9; /* Siempre visible un poco para SEO y UX */
    transition: all 0.4s ease;
}

.gallery-card:hover img {
    transform: scale(1.1) rotate(1deg); /* Ligero giro para dinamismo */
}

.gallery-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(245, 219, 197, 0.9) 0%, transparent 10%); /* Cambio a Terracotta al pasar el mouse */
}



.card-overlay .tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--terracotta);
    background: var(--bone);
    padding: 4px 10px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 10px;
}

.card-overlay h3 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* Ajuste móvil: Que no se vea apretado */
@media (max-width: 600px) {
    .pura-vida-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }
    .gallery-card.tall, .gallery-card.wide {
        grid-row: span 1;
        grid-column: span 1;
    }
}

.impact-container {
    position: relative;
    margin: 4rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--jungle); /* Fondo oscuro para resaltar el texto */
    display: flex;
    flex-direction: column;
}

.impact-container .image-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
}

.impact-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%); /* Tono documental serio */
    transition: transform 1.2s ease;
}

.impact-container:hover .impact-img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* Sombreado para que el texto sea legible */
.scrim-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.8) 100%);
}

.impact-caption {
    padding: 2.5rem;
    background: white;
    border-left: 6px solid var(--terracotta);
    margin: -60px 2rem 2rem 2rem; /* El texto "monta" sobre la imagen */
    position: relative;
    z-index: 2;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-radius: 4px;
}

.alert-tag {
    display: inline-block;
    color: var(--terracotta);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.impact-title {
    font-size: 1.6rem;
    color: var(--jungle);
    line-height: 1.3;
    margin-bottom: 1rem;
    font-family: 'Charter', serif;
}

.impact-description {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    .impact-container .image-wrapper {
        height: 300px;
    }
    .impact-caption {
        margin: -30px 1rem 1rem 1rem;
        padding: 1.5rem;
    }
    .impact-title {
        font-size: 1.3rem;
    }
}