/* -------------------------------------------------------------------------
   Cancún Jungle Camp — hero.css
   Portada inmersiva y graduaciones: nav flotante, hero de video, cinta de
   datos, puertas por segmento, bloque "el lugar", galería con pie de foto,
   marco 9:16, línea de tiempo y cierre. Se carga DESPUÉS de components.css
   solo en las páginas que lo usan (index, servicios/graduaciones).

   Reglas: animaciones solo con transform/opacity y siempre dentro de
   prefers-reduced-motion: no-preference. Los nombres de variables.css no
   se tocan; aquí solo se AGREGAN tokens del medallón.
   ------------------------------------------------------------------------- */

:root {
    --medallon-caoba: #7A1D09;
    --medallon-oro:   #E9B830;
    --medallon-arena: #C9A06A;
    --caliza:         #F3E9D7;
    --tinta:          #14201A;
    --hero-ease:      cubic-bezier(.2, .7, .2, 1);
}

/* Utilidades pequeñas que no existían -------------------------------- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.kicker {
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--medallon-oro);
    margin-bottom: .9rem;
}

.sec-fest h2 { padding-bottom: 0; }
.sec-fest h2::after { display: none; }

/* Foco visible en todo lo interactivo nuevo ---------------------------- */
.btn:focus-visible,
.puerta:focus-visible,
.hero__scroll:focus-visible,
.nav-brand:focus-visible,
.timeline__item a:focus-visible,
details summary:focus-visible {
    outline: 3px solid var(--medallon-oro);
    outline-offset: 3px;
}

/* Botones nuevos ------------------------------------------------------- */
.btn-ghost {
    background: transparent;
    border-color: rgba(243, 233, 215, .55);
    color: var(--caliza);
}
.btn-ghost:hover {
    background: rgba(243, 233, 215, .10);
    border-color: var(--caliza);
    transform: translateY(-2px);
}
.btn-wa {
    background: #25D366;
    color: #0b1f12;
    box-shadow: 0 4px 15px rgba(37, 211, 102, .25);
}
.btn-wa:hover { background: #20BA5A; transform: translateY(-2px); }
.btn-wa svg { width: 1.15em; height: 1.15em; }

/* -------------------------------------------------------------------------
   1. NAV FLOTANTE
   Transparente sobre el hero; al pasar de 60 px main.js agrega .scrolled y
   se vuelve tinta selva sólida con blur.
   ------------------------------------------------------------------------- */
.navbar.navbar--float {
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
    transition: background-color .35s var(--hero-ease),
                border-color .35s var(--hero-ease),
                height .35s var(--hero-ease);
}
.navbar.navbar--float.scrolled {
    background-color: rgba(20, 32, 26, .92);
    backdrop-filter: var(--blur-normal);
    -webkit-backdrop-filter: var(--blur-normal);
    border-bottom-color: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.navbar--float .nav-link { color: rgba(243, 233, 215, .82); }
.navbar--float .nav-link:hover,
.navbar--float .nav-link.active { color: var(--caliza); }
.navbar--float .nav-link::after { background-color: var(--medallon-oro); }
.nav-actions { display: none; align-items: center; gap: .6rem; }
@media (min-width: 992px) { .nav-actions { display: flex; } }
.brand-medallon { display: block; }

/* -------------------------------------------------------------------------
   2. HERO A PANTALLA COMPLETA
   ------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background-color: var(--tinta);
    color: var(--caliza);
    padding: calc(var(--header-height) + 2rem) 0 4.5rem;
    isolation: isolate;
}
.hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* background-image (el poster) va inline en el HTML: un url() dentro de una
       custom property se resuelve contra css/, no contra la página. */
    background: center / cover no-repeat var(--tinta);
}
.hero__video,
.hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--foto-filtro);
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(20, 32, 26, .25) 0%,
        rgba(20, 32, 26, .55) 60%,
        var(--bg-dark) 100%);
}
/* Si el video no puede cargar (o hay reduced-motion) queda solo el poster de fondo. */
.hero__media.is-still .hero__video { display: none; }

.hero__content {
    position: relative;
    z-index: 1;
    width: min(92%, 860px);
    margin: 0 auto;
    text-align: center;
}
/* Viñeta suave detrás del texto: asegura contraste del titular aunque el
   cuadro del video sea claro. */
.hero__content::before {
    content: "";
    position: absolute;
    inset: -20% -30%;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(20, 32, 26, .55) 0%, rgba(20, 32, 26, 0) 68%);
    pointer-events: none;
}
.hero__medallon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.4rem;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45));
}
.hero__kicker {
    font-size: clamp(.68rem, 1.6vw, .82rem);
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--caliza);
    opacity: .92;
    margin-bottom: 1.2rem;
}
.hero__title {
    font-family: var(--font-body);
    font-size: clamp(2.6rem, 7vw, 6rem);
    font-weight: 700;
    line-height: .98;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--caliza);
    margin: 0 0 1.2rem;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}
.hero__lead {
    font-size: clamp(1.02rem, 1.6vw, 1.25rem);
    line-height: 1.55;
    max-width: 40rem;
    margin: 0 auto 2rem;
    color: var(--caliza);
    opacity: .94;
    text-wrap: pretty;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .9rem;
}
.hero .btn-lg { padding: 1.05rem 2.2rem; }

/* Indicador de scroll: una línea que respira. */
.hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 1.6rem;
    z-index: 1;
    width: 2px;
    height: 56px;
    transform: translateX(-50%);
    background: rgba(243, 233, 215, .25);
    overflow: hidden;
    border-radius: 2px;
}
.hero__scroll span {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 40%;
    background: var(--medallon-oro);
    transform: translateY(-110%);
}

/* Hero de graduaciones: dos columnas y marco 9:16 ----------------------- */
.hero--grad { padding-bottom: 3.5rem; }
.hero--grad .hero__content { text-align: left; }
.hero--grad .hero__content::before { display: none; }
.hero__grid {
    /* En móvil es estático para que el marco .phone (absoluto) llene todo el hero;
       en escritorio vuelve a ser el contenedor de las dos columnas. */
    position: static;
    width: min(92%, 1140px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 2rem;
}
.hero__copy { position: relative; z-index: 1; }
.hero__copy .hero__title { font-size: clamp(2.3rem, 5.6vw, 4.6rem); }
.hero__copy .hero__lead { margin-left: 0; }
.hero__copy .hero__actions { justify-content: flex-start; }

.phone {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: center / cover no-repeat var(--tinta);   /* poster inline en el HTML */
}
.phone video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--foto-filtro);
}
/* En móvil el video de graduaciones va a sangre con el mismo overlay del index. */
.phone::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(20, 32, 26, .25) 0%,
        rgba(20, 32, 26, .55) 60%,
        var(--bg-dark) 100%);
}
.phone.is-still video { display: none; }

@media (min-width: 900px) {
    .hero__grid { position: relative; z-index: 1; grid-template-columns: 1.15fr .85fr; gap: 3rem; }
    .phone {
        position: relative;
        inset: auto;
        justify-self: center;
        width: min(340px, 34vw);
        aspect-ratio: 9 / 16;
        border-radius: 28px;
        border: 1px solid rgba(243, 233, 215, .18);
        box-shadow: 0 40px 80px rgba(0, 0, 0, .55), 0 0 0 10px rgba(20, 32, 26, .6);
        background: var(--tinta);
    }
    .phone::after { background: linear-gradient(180deg, rgba(20, 32, 26, 0) 70%, rgba(20, 32, 26, .35) 100%); }
}

/* -------------------------------------------------------------------------
   3. CINTA DE DATOS (ticker)
   ------------------------------------------------------------------------- */
.ticker {
    background: var(--medallon-caoba);
    color: var(--caliza);
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, .25);
    border-bottom: 1px solid rgba(0, 0, 0, .25);
}
.ticker__track {
    display: flex;
    width: max-content;
}
.ticker__list {
    list-style: none;
    display: flex;
    align-items: center;
    padding: .95rem 0;
    margin: 0;
    flex: 0 0 auto;
}
.ticker__list li {
    font-family: var(--font-title);
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0 1.6rem;
    font-variant-numeric: tabular-nums;
}
.ticker__list li::after {
    content: "·";
    color: var(--medallon-oro);
    margin-left: 3.2rem;
}

/* -------------------------------------------------------------------------
   4. PUERTAS POR SEGMENTO
   ------------------------------------------------------------------------- */
.puertas { background: var(--bg-dark); }
.puertas__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(82vw, 340px);
    gap: .6rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: .6rem;
    scrollbar-width: none;
}
.puertas__track::-webkit-scrollbar { display: none; }
.puerta {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    scroll-snap-align: center;
    background: var(--tinta);
    color: var(--caliza);
    isolation: isolate;
}
.puerta img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--foto-filtro);
    transition: transform .9s var(--hero-ease);
}
.puerta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(20, 32, 26, 0) 35%, rgba(20, 32, 26, .88) 100%);
}
.puerta::after {
    /* velo caoba al hover */
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--medallon-caoba);
    opacity: 0;
    transition: opacity .4s var(--hero-ease);
}
.puerta:hover img, .puerta:focus-visible img { transform: scale(1.06); }
.puerta:hover::after, .puerta:focus-visible::after { opacity: .38; }
.puerta__body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 1.4rem 1.4rem 1.6rem;
    display: grid;
    gap: .35rem;
}
.puerta__kicker {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--medallon-oro);
}
.puerta__title {
    font-family: var(--font-title);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.05;
}
.puerta__text {
    font-size: .95rem;
    line-height: 1.45;
    color: rgba(243, 233, 215, .88);
}
.puerta__arrow {
    font-family: var(--font-title);
    font-size: .85rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-top: .4rem;
    color: var(--caliza);
}
@media (min-width: 900px) {
    .puertas__track {
        grid-auto-flow: row;
        grid-template-columns: repeat(4, 1fr);
        grid-auto-columns: auto;
        overflow: visible;
        padding: 0;
        gap: .4rem;
    }
    .puerta { aspect-ratio: 3 / 4.2; }
}

/* -------------------------------------------------------------------------
   5. EL LUGAR: video aéreo + cifras
   ------------------------------------------------------------------------- */
.lugar {
    background: var(--tinta);
    color: var(--caliza);
    display: grid;
    grid-template-columns: 1fr;
}
.lugar__video {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--tinta);
}
.lugar__video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--foto-filtro);
}
.lugar__video::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 32, 26, 0) 60%, rgba(20, 32, 26, .35) 100%),
                linear-gradient(0deg, rgba(20, 32, 26, .35) 0%, rgba(20, 32, 26, 0) 40%);
    pointer-events: none;
}
.lugar__datos {
    padding: 3.5rem 6vw;
    display: grid;
    align-content: center;
    gap: 1.2rem;
}
.lugar__datos h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    margin-bottom: .4rem;
}
.lugar__datos p { color: rgba(243, 233, 215, .82); max-width: 34rem; }
.cifras {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: .5rem 0 1rem;
}
.cifras div {
    border-top: 2px solid var(--medallon-oro);
    padding-top: .8rem;
}
.cifras dd {
    font-family: var(--font-title);
    font-size: clamp(2.4rem, 5.5vw, 4.4rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--caliza);
    margin: 0 0 .25rem;
}
.cifras dt {
    order: 2;
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(243, 233, 215, .7);
}
.cifras div { display: flex; flex-direction: column; }
@media (min-width: 900px) {
    .lugar { grid-template-columns: 1.1fr .9fr; }
    .lugar__video { aspect-ratio: auto; min-height: 560px; }
    .lugar__datos { padding: 5rem 5vw 5rem 4vw; }
}

/* -------------------------------------------------------------------------
   6. GALERÍA MASONRY CON PIE DE FOTO
   ------------------------------------------------------------------------- */
.galeria { background: var(--bg-dark); padding: 5rem 0; }
.galeria__head { max-width: 760px; margin-bottom: 2.4rem; }
.masonry {
    columns: 1;
    column-gap: 1rem;
}
.masonry__item {
    break-inside: avoid;
    margin: 0 0 1rem;
    background: var(--tinta);
    border: 1px solid var(--glass-border);
}
.masonry__item img {
    width: 100%;
    height: auto;
    display: block;
    filter: var(--foto-filtro);
    transition: transform .8s var(--hero-ease);
}
.masonry__item.is-tall img { aspect-ratio: 4 / 5; object-fit: cover; }
.masonry__item.is-square img { aspect-ratio: 1 / 1; object-fit: cover; }
.masonry__item figcaption {
    padding: .8rem 1rem .95rem;
    font-size: .88rem;
    line-height: 1.45;
    color: var(--text-muted-light);
    border-top: 1px solid var(--glass-border);
}
.masonry__item figcaption strong {
    display: block;
    font-family: var(--font-title);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--caliza);
    margin-bottom: .15rem;
}
@media (min-width: 600px)  { .masonry { columns: 2; } }
@media (min-width: 1000px) { .masonry { columns: 3; } }

/* -------------------------------------------------------------------------
   7. CIERRE A MEDIA PANTALLA CON FOGATA
   ------------------------------------------------------------------------- */
.cierre {
    position: relative;
    min-height: 62svh;
    display: grid;
    place-items: center;
    padding: 5rem 0;
    color: var(--caliza);
    background: center / cover no-repeat var(--tinta);   /* imagen inline en el HTML */
    isolation: isolate;
}
.cierre::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(20, 32, 26, .35) 30%, rgba(20, 32, 26, .55) 100%);
}
.cierre__content {
    width: min(92%, 720px);
    text-align: center;
}
.cierre h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); text-wrap: balance; }
.cierre p { color: rgba(243, 233, 215, .88); max-width: 34rem; margin: 0 auto 2rem; }
.cierre .hero__actions { justify-content: center; }
.cierre a.text-accent-orange { color: var(--caliza); text-decoration: underline; text-underline-offset: .2em; }

/* -------------------------------------------------------------------------
   8. LÍNEA DE TIEMPO (graduaciones)
   ------------------------------------------------------------------------- */
.timeline-sec { background: var(--bg-dark); padding: 5rem 0 4rem; }
.timeline {
    list-style: none;
    margin: 2.2rem 0 0;
    padding: 0 6vw 1rem;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(78vw, 340px);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 6vw;
    position: relative;
    scrollbar-width: none;
}
.timeline::-webkit-scrollbar { display: none; }
.timeline__item {
    scroll-snap-align: start;
    position: relative;
    padding-top: 1.6rem;
    counter-increment: dia;
}
.timeline__item::before {
    /* la línea */
    content: "";
    position: absolute;
    top: .45rem;
    left: 0;
    right: -1rem;
    height: 2px;
    background: rgba(243, 233, 215, .18);
}
.timeline__item:last-child::before { right: 0; }
.timeline__item::after {
    /* el punto */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--medallon-oro);
    box-shadow: 0 0 0 4px var(--bg-dark);
}
.timeline__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    filter: var(--foto-filtro);
    margin-bottom: 1rem;
}
.timeline__day {
    display: block;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--medallon-oro);
    margin-bottom: .35rem;
}
.timeline__item h3 { font-size: 1.45rem; margin-bottom: .4rem; }
.timeline__item p { font-size: .95rem; color: var(--text-muted-light); margin: 0; }
@media (min-width: 1100px) {
    .timeline {
        grid-auto-flow: row;
        grid-template-columns: repeat(4, 1fr);
        grid-auto-columns: auto;
        overflow: visible;
        padding: 0;
        width: 90%;
        max-width: var(--max-width);
        margin-left: auto;
        margin-right: auto;
    }
}

/* -------------------------------------------------------------------------
   9. ACORDEÓN ACCESIBLE (details)
   ------------------------------------------------------------------------- */
.acordeon { display: grid; gap: .5rem; }
.acordeon details {
    background: var(--bg-light-card);
    border: 1px solid var(--linea);
    border-radius: var(--border-radius-md);
}
.section-dark .acordeon details {
    background: var(--bg-dark-card);
    border-color: var(--glass-border);
}
.acordeon summary {
    cursor: pointer;
    list-style: none;
    padding: 1.1rem 3.2rem 1.1rem 1.4rem;
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    position: relative;
}
.acordeon summary::-webkit-details-marker { display: none; }
.acordeon summary::after {
    content: "+";
    position: absolute;
    right: 1.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent-orange);
    transition: transform .3s var(--hero-ease);
}
.section-dark .acordeon summary::after { color: var(--accent-volt-claro); }
.acordeon details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.acordeon details p {
    margin: 0;
    padding: 0 1.4rem 1.3rem;
    line-height: 1.6;
}
.section-light .acordeon details p { color: var(--text-muted-dark); }

/* -------------------------------------------------------------------------
   10. CINTA DE PRUEBA SOCIAL (480)
   ------------------------------------------------------------------------- */
.cinta-480 {
    background: var(--medallon-caoba);
    color: var(--caliza);
    padding: 3rem 0;
    text-align: center;
}
.cinta-480 .kicker { color: var(--caliza); opacity: .8; }
.cinta-480 strong {
    display: block;
    font-family: var(--font-title);
    font-size: clamp(3.2rem, 9vw, 6.5rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin: .2rem 0 .4rem;
}
.cinta-480 p { margin: 0; color: rgba(243, 233, 215, .9); }

/* -------------------------------------------------------------------------
   MOVIMIENTO: solo si el usuario no pidió reducirlo
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    @keyframes hero-scroll-line {
        0%   { transform: translateY(-110%); }
        60%  { transform: translateY(260%); }
        100% { transform: translateY(260%); }
    }
    .hero__scroll span { animation: hero-scroll-line 2.2s var(--hero-ease) infinite; }

    @keyframes hero-in {
        from { opacity: 0; transform: translateY(18px); }
        to   { opacity: 1; transform: none; }
    }
    .hero__medallon, .hero__kicker, .hero__title, .hero__lead, .hero__actions, .phone {
        animation: hero-in .9s var(--hero-ease) both;
    }
    .hero__kicker  { animation-delay: .08s; }
    .hero__title   { animation-delay: .16s; }
    .hero__lead    { animation-delay: .26s; }
    .hero__actions { animation-delay: .36s; }
    .phone         { animation-delay: .3s; }

    @keyframes ticker-run {
        from { transform: translateX(0); }
        to   { transform: translateX(-50%); }
    }
    .ticker__track { animation: ticker-run 46s linear infinite; }
    .ticker:hover .ticker__track,
    .ticker:focus-within .ticker__track { animation-play-state: paused; }
}

@media (prefers-reduced-motion: reduce) {
    /* El hero muestra solo el poster; la cinta se vuelve estática. */
    .hero__video, .phone video { display: none; }
    .hero__scroll { display: none; }
    .ticker__track { width: 100%; }
    .ticker__list { flex-wrap: wrap; justify-content: center; row-gap: .4rem; }
    .ticker__list[aria-hidden="true"] { display: none; }
    .puerta img, .masonry__item img { transition: none; }
    .lugar__video video { display: none; }
}
