/* =========================================================
   RUMBO AL 70 ANIVERSARIO — CENHCH
   - Línea del tiempo (.tl-*)          → historia.html
   - Bloque 70 + cuenta regresiva (.tl-final, .tl-countdown) → cualquier página
   - Modal de aviso (.a70-modal)       → index.html
   Mobile-first. Prefijos propios para no chocar con el template.
   ========================================================= */

:root {
    --tl-vino: #5D101D;
    --tl-vino-dark: #3d0a13;
    --tl-dorado: #FFC72C;
    --tl-crema: #faf6f1;
    --tl-texto: #555;
    --tl-line: #e6dcd3;
}

.tl-section {
    --tl-sticky-top: 0px;           /* JS lo iguala al borde inferior del navbar */
    position: relative;
    background: var(--tl-crema);
    padding: 70px 0 0;
    overflow: clip;                  /* clip (no hidden) para que funcione sticky */
}

/* ---------- Encabezado ---------- */
.tl-header { text-align: center; padding: 0 16px; margin-bottom: 28px; }
.tl-eyebrow {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 100px;
    background: rgba(93, 16, 29, .08);
    color: var(--tl-vino);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.tl-header h2 {
    font-size: clamp(32px, 7vw, 56px);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin: 0 0 12px;
    color: #111;
}
.tl-header h2 span { color: var(--tl-vino); }
.tl-header p { max-width: 560px; margin: 0 auto; color: var(--tl-texto); }
.tl-hint {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 18px; font-size: 13px; color: var(--tl-vino); font-weight: 600;
}
.tl-hint i { animation: tl-bounce 1.6s infinite; }
@keyframes tl-bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(5px) } }

/* ---------- Navegador de años (sticky) ---------- */
.tl-nav {
    position: sticky;
    top: var(--tl-sticky-top);
    z-index: 20;
    background: rgba(250, 246, 241, .92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--tl-line);
}
.tl-nav-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    max-width: 1140px;
    margin: 0 auto;
}
.tl-nav-track::-webkit-scrollbar { display: none; }
.tl-nav a {
    flex: 0 0 auto;
    scroll-snap-align: center;
    padding: 7px 16px;
    border-radius: 100px;
    border: 1px solid var(--tl-line);
    background: #fff;
    color: #333;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.tl-nav a:hover { border-color: var(--tl-vino); color: var(--tl-vino); }
.tl-nav a.is-active {
    background: var(--tl-vino);
    border-color: var(--tl-vino);
    color: #fff;
    transform: scale(1.05);
}
.tl-nav a.tl-nav-70 { border-color: var(--tl-dorado); }
.tl-nav a.tl-nav-70.is-active { background: var(--tl-dorado); color: var(--tl-vino); }

/* ---------- Riel / línea ---------- */
.tl-rail {
    position: relative;
    max-width: 1140px;
    margin: 0 auto;
    padding: 50px 16px 40px 16px;
}
.tl-line,
.tl-line-progress {
    position: absolute;
    top: 0;
    left: 31px;                     /* móvil: línea a la izquierda */
    width: 3px;
    border-radius: 3px;
}
.tl-line { bottom: 0; background: var(--tl-line); }
.tl-line-progress {
    height: 0;
    background: linear-gradient(to bottom, var(--tl-vino), var(--tl-dorado));
    box-shadow: 0 0 12px rgba(255, 199, 44, .6);
    will-change: height;
}

/* ---------- Hito ---------- */
.tl-item {
    position: relative;
    padding-left: 48px;             /* espacio para la línea en móvil */
    margin-bottom: 56px;
    scroll-margin-top: calc(var(--tl-sticky-top) + 80px);
}
.tl-dot {
    position: absolute;
    left: 7px;
    top: 6px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--tl-line);
    transition: border-color .4s, background .4s, transform .4s;
    z-index: 2;
}
.tl-item.is-reached .tl-dot {
    border-color: var(--tl-vino);
    background: var(--tl-dorado);
    transform: scale(1.15);
}

/* Año grande */
.tl-year {
    display: block;
    font-size: clamp(54px, 16vw, 96px);
    font-weight: 800;
    line-height: .9;
    letter-spacing: -3px;
    color: transparent;
    -webkit-text-stroke: 2px var(--tl-vino);
    margin-bottom: 14px;
    transition: color .6s;
}
.tl-item.is-visible .tl-year { color: var(--tl-vino); }

/* Tarjeta */
.tl-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(17, 17, 17, .08);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.tl-item.is-visible .tl-card { opacity: 1; transform: none; }

.tl-media { position: relative; aspect-ratio: 4 / 3; background: #eee; overflow: hidden; }
.tl-media img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: scale(1.12);
    transition: transform 1.4s cubic-bezier(.2, .8, .2, 1), filter 1.6s ease;
}
.tl-item.is-visible .tl-media img { transform: scale(1); }

/* Fotos "antiguas": entran en sepia y se van coloreando */
.tl-vintage .tl-media img { filter: grayscale(1) sepia(.45) contrast(1.05); }
.tl-vintage.is-visible .tl-media img { filter: grayscale(.85) sepia(.35); }

.tl-tag {
    position: absolute; left: 12px; top: 12px;
    background: var(--tl-dorado); color: var(--tl-vino);
    font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 100px;
}

/* Mini galería deslizable (varias fotos en un hito) */
.tl-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    height: 100%;
}
.tl-gallery::-webkit-scrollbar { display: none; }
.tl-gallery img { flex: 0 0 100%; scroll-snap-align: center; }
.tl-gallery-dots {
    position: absolute; bottom: 10px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 6px;
}
.tl-gallery-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255, 255, 255, .55); transition: background .3s, width .3s;
}
.tl-gallery-dots span.is-active { background: #fff; width: 18px; border-radius: 4px; }

.tl-body { padding: 22px 22px 24px; }
.tl-body h3 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 8px; color: #111; line-height: 1.2; }
.tl-body p { margin: 0; color: var(--tl-texto); font-size: 16px; line-height: 1.6; }
.tl-quote {
    margin-top: 14px !important;
    padding-left: 14px;
    border-left: 3px solid var(--tl-dorado);
    font-style: italic;
    color: #333 !important;
}

/* Tarjeta solo de texto (años sin foto) */
.tl-card.tl-card-text { border-top: 5px solid var(--tl-dorado); }
.tl-card.tl-card-text .tl-body { padding-top: 26px; }
.tl-card .tl-kicker {
    display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 100px;
    background: rgba(93, 16, 29, .08); color: var(--tl-vino);
    font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tl-chips li { background: var(--tl-crema); border-radius: 100px; padding: 6px 12px; font-size: 13px; line-height: 1.25; }
.tl-chips li b { color: var(--tl-vino); }
.tl-more { display: inline-block; margin-top: 14px; font-weight: 700; color: var(--tl-vino); }
.tl-more:hover { color: var(--tl-vino-dark); text-decoration: underline; }

/* ---------- Gran final: 70 Aniversario ---------- */
.tl-final {
    position: relative;
    background: radial-gradient(circle at 50% 0%, #7a1626 0%, var(--tl-vino) 45%, var(--tl-vino-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 80px 16px 90px;
    overflow: hidden;
    scroll-margin-top: var(--tl-sticky-top);
}
.tl-final::before {                 /* brillo dorado sutil */
    content: "";
    position: absolute; inset: -40%;
    background: conic-gradient(from 0deg, transparent 0 20%, rgba(255, 199, 44, .12) 25%, transparent 30% 70%, rgba(255, 199, 44, .12) 75%, transparent 80%);
    animation: tl-spin 28s linear infinite;
    pointer-events: none;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }
.tl-final > * { position: relative; }
.tl-final img.tl-final-logo { max-width: 130px; margin-bottom: 18px; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .35)); }
.tl-final .tl-eyebrow { background: rgba(255, 199, 44, .15); color: var(--tl-dorado); }
.tl-final-number {
    font-size: clamp(120px, 38vw, 240px);
    font-weight: 800;
    line-height: .85;
    letter-spacing: -8px;
    color: var(--tl-dorado);
    text-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.tl-final h3 { color: #fff; font-size: clamp(24px, 5vw, 36px); font-weight: 800; margin: 6px 0 10px; }
.tl-final p { color: rgba(255, 255, 255, .8); max-width: 560px; margin: 0 auto; }

.tl-countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 440px;
    margin: 30px auto 28px;
}
.tl-countdown div {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 199, 44, .35);
    border-radius: 12px;
    padding: 12px 4px;
}
.tl-countdown strong { display: block; font-size: clamp(26px, 7vw, 38px); font-weight: 800; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.tl-countdown span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tl-dorado); }
.tl-final .btn-tl {
    display: inline-block;
    background: var(--tl-dorado); color: var(--tl-vino);
    font-weight: 800; padding: 13px 30px; border-radius: 100px;
    transition: transform .25s, box-shadow .25s;
}
.tl-final .btn-tl:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0, 0, 0, .3); color: var(--tl-vino); }

.tl-final .btn-tl.btn-tl-ghost { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .5); padding: 11px 28px; }
.tl-final .btn-tl.btn-tl-ghost:hover { border-color: var(--tl-dorado); color: var(--tl-dorado); }
.tl-final-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* "Un 2027 histórico" dentro del bloque final */
.tl-2027 { list-style: none; padding: 0; margin: 4px auto 30px; max-width: 520px; display: grid; gap: 8px; text-align: left; }
.tl-2027 li {
    display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center;
    padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .85); font-size: 15px; line-height: 1.35;
}
.tl-2027 li.is-main { background: rgba(255, 199, 44, .16); border: 1px solid rgba(255, 199, 44, .45); }
.tl-2027 b { color: var(--tl-dorado); font-weight: 800; font-size: 16px; }
.tl-2027 strong { color: #fff; }

/* Variante "banda" para usar dentro de cualquier página (inicio) */
.tl-final.tl-band { border-radius: 6px; padding: 60px 20px 64px; }
.tl-band .tl-band-years {
    display: flex; justify-content: center; align-items: center; gap: 14px;
    font-weight: 800; color: rgba(255, 255, 255, .55); font-size: 15px; letter-spacing: .1em;
    margin-bottom: 4px;
}
.tl-band .tl-band-years::before,
.tl-band .tl-band-years::after { content: ""; width: 40px; height: 1px; background: rgba(255, 199, 44, .5); }

/* =========================================================
   MODAL "RUMBO AL 70" (inicio)
   ========================================================= */
.a70-modal .modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #7a1626 0%, var(--tl-vino) 50%, var(--tl-vino-dark) 100%);
    color: #fff;
    text-align: center;
}
.a70-modal .btn-close { position: absolute; top: 14px; right: 14px; z-index: 2; filter: invert(1); opacity: .8; }
.a70-modal .modal-body { padding: 38px 26px 30px; }
.a70-modal img { max-height: 90px; margin-bottom: 10px; }
.a70-modal .tl-eyebrow { background: rgba(255, 199, 44, .15); color: var(--tl-dorado); margin-bottom: 6px; }
.a70-modal .a70-number { font-size: 110px; font-weight: 800; line-height: .9; letter-spacing: -5px; color: var(--tl-dorado); }
.a70-modal h5 { color: #fff; font-weight: 800; font-size: 22px; margin: 4px 0 6px; }
.a70-modal p { color: rgba(255, 255, 255, .8); font-size: 15px; line-height: 1.5; margin: 0 auto; max-width: 340px; }
.a70-modal .tl-countdown { margin: 20px auto 22px; gap: 8px; }
.a70-modal .tl-countdown strong { font-size: 26px; }
.a70-modal .btn-tl {
    display: inline-block; background: var(--tl-dorado); color: var(--tl-vino);
    font-weight: 800; padding: 12px 28px; border-radius: 100px;
}
.a70-modal .a70-skip { display: block; margin-top: 12px; color: rgba(255, 255, 255, .65); font-size: 14px; background: none; border: 0; width: 100%; }

/* =========================================================
   CONTADOR EN EL FOOTER (todas las páginas)
   ========================================================= */
.a70-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 8px;
    border-radius: 100px;
    border: 1px solid rgba(255, 199, 44, .35);
    background: rgba(255, 199, 44, .06);
    color: #ddd !important;
    font-size: 14px;
    line-height: 1.3;
    text-align: left;
    transition: border-color .25s, background .25s;
}
.a70-pill:hover { border-color: var(--tl-dorado); background: rgba(255, 199, 44, .12); }
.a70-pill b.a70-pill-num {
    flex: 0 0 auto;
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--tl-dorado); color: var(--tl-vino);
    font-weight: 800; font-size: 15px;
}
.a70-pill strong { color: var(--tl-dorado); }
.a70-pill i { color: var(--tl-dorado); }

/* =========================================================
   TABLET / ESCRITORIO: línea al centro, tarjetas alternadas
   ========================================================= */
@media (min-width: 992px) {
    .tl-section { padding-top: 110px; }
    .tl-header { margin-bottom: 40px; }
    .tl-nav-track { justify-content: center; }
    .tl-rail { padding: 80px 15px 60px; }

    .tl-line, .tl-line-progress { left: 50%; transform: translateX(-50%); }

    .tl-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 90px;
        align-items: center;
        padding-left: 0;
        margin-bottom: 110px;
    }
    .tl-dot { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; }
    .tl-item.is-reached .tl-dot { transform: translate(-50%, -50%) scale(1.2); }

    /* Año en una columna, tarjeta en la otra; se alternan */
    .tl-year { grid-column: 1; text-align: right; margin: 0; font-size: 130px; }
    .tl-card { grid-column: 2; grid-row: 1; transform: translateX(60px); }
    .tl-item:nth-of-type(even) .tl-year { grid-column: 2; text-align: left; }
    .tl-item:nth-of-type(even) .tl-card { grid-column: 1; transform: translateX(-60px); }
    .tl-item.is-visible .tl-card { transform: none; }

    .tl-body { padding: 28px 30px 30px; }
    .tl-body h3 { font-size: 26px; }

    .tl-final { padding: 120px 15px 130px; border-radius: 6px; }
    .tl-final.tl-band { padding: 80px 40px 86px; }
    .tl-band .tl-final-number { font-size: 200px; }
}

/* Accesibilidad: sin animaciones si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
    .tl-card, .tl-media img, .tl-year { transition: none !important; }
    .tl-card { opacity: 1; transform: none !important; }
    .tl-media img { transform: none; }
    .tl-final::before, .tl-hint i { animation: none; }
}

@media (min-width: 992px) {
    .a70-pill span { white-space: nowrap; }
}
