/* ============================================================
   sections.css — the composed regions: header, hero, home
   sections, subscribe band, footer.
   ============================================================ */

/* ============================================================
   HEADER
   ============================================================ */
.header { position: relative; z-index: var(--z-header); background: var(--c-white); }

/* --- Tier 1: utility bar --------------------------------- */
.header__utility {
    height: 44px;
    background: var(--c-black);
    color: var(--c-white);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
}
.header__utility-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
}
.header__date { display: inline-flex; align-items: center; gap: 8px; color: var(--c-on-dark-soft); }
.header__utility-right { display: flex; align-items: center; gap: 18px; }

.lang { position: relative; }
.lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--c-on-dark-soft);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    transition: color var(--t-fast) var(--e-out);
}
@media (hover: hover) { .lang__btn:hover { color: var(--c-white); } }
.lang .dropdown__panel { top: calc(100% + 8px); left: 0; right: auto; min-width: 160px; }

.header__vline { width: 1px; height: 16px; background: var(--c-on-dark-line); }

.social-row { display: flex; align-items: center; gap: 18px; }
.social-row__link {
    font-size: 16px;
    color: var(--c-on-dark-soft);
    transition: color var(--t-fast) var(--e-out);
}
@media (hover: hover) { .social-row__link:hover { color: var(--c-white); } }

/* --- Tier 2: masthead ------------------------------------ */
.header__masthead {
    height: 96px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
}
.header__masthead-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--s-5);
}
.header__left { display: flex; align-items: center; gap: var(--s-3); }
.header__right { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-3); }

/* Brand wordmark */
.brand { display: inline-flex; align-items: baseline; justify-content: center; }
.brand__word {
    font-size: 28px;
    font-weight: var(--fw-black);
    letter-spacing: var(--ls-display);
    line-height: 1;
    color: var(--c-heading);
    white-space: nowrap;
}
.brand__dot {
    width: 6px; height: 6px;
    border-radius: var(--r-circle);
    background: var(--c-accent);
    display: inline-block;
    margin-left: 4px;
    vertical-align: super;
    align-self: flex-start;
    margin-top: 2px;
}
.brand--sm .brand__word { font-size: 24px; }
.brand--xs .brand__word { font-size: 22px; }
.brand__logo { height: 44px; width: auto; }
.on-dark .brand__word, .footer .brand__word { color: inherit; }
.on-dark .brand__dot { background: currentColor; }

/* Quick search pill (desktop only) */
.quick-search { position: relative; width: 240px; }
.quick-search .input {
    height: 44px;
    background: var(--c-grey-100);
    border-color: transparent;
    border-radius: var(--r-pill);
    padding-left: 42px;
    font-size: var(--fs-sm);
}
.quick-search__icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--c-grey-500);
    pointer-events: none;
}

.header__textlink {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--c-text);
    position: relative;
}
@media (hover: hover) { .header__textlink:hover { text-decoration: underline; } }
.header__divider { width: 1px; height: 16px; background: var(--c-border); }

/* --- Tier 3: category nav -------------------------------- */
.header__nav {
    height: 56px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-grey-300);
}
.header__nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.nav { display: flex; align-items: center; gap: 34px; height: 100%; }
.nav__item { height: 100%; display: flex; align-items: center; position: static; }
.nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    font-size: 15px;
    font-weight: var(--fw-medium);
    color: var(--c-ink);
    transition: color var(--t-fast) var(--e-out), font-weight var(--t-fast);
}
.nav__link::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 12px;
    width: 0; height: 2px;
    background: var(--c-accent);
    transform: translateX(-50%);
    transition: width var(--t-base) var(--e-out);
}
@media (hover: hover) { .nav__link:hover::after { width: 100%; } }
.nav__link:focus-visible::after,
.nav__item.is-active .nav__link::after { width: 100%; }
.nav__item.is-active .nav__link { font-weight: var(--fw-bold); }

.header__nav-right {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

/* Mega menu */
.mega {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-top: 0;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    box-shadow: var(--c-shadow-lg);
    padding: var(--s-7);
    display: none;
    grid-template-columns: 2fr 1fr;
    gap: var(--s-8);
    z-index: var(--z-dropdown);
}
.mega.is-open { display: grid; }
.mega__links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px var(--s-6);
    align-content: start;
}
.mega__link { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text-soft); }
@media (hover: hover) { .mega__link:hover { color: var(--c-accent); } }
.mega__feature { min-width: 0; }

/* --- Sticky compact bar ---------------------------------- */
.header__nav.is-stuck {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    box-shadow: var(--c-shadow-sm);
    z-index: var(--z-header);
    animation: header-drop var(--t-base) var(--e-out);
}
@keyframes header-drop { from { transform: translateY(-100%); } }
.header__nav.is-stuck .header__nav-inner { justify-content: space-between; }
.header__nav.is-stuck .header__compact { display: flex; }
.header__nav.is-stuck .nav { flex: 1; justify-content: center; }
.header__nav.is-stuck .header__nav-right { position: static; }
.header__compact { display: none; align-items: center; gap: var(--s-3); }
/* Placeholder that keeps the page from jumping when tier 3 detaches. */
.header__spacer { display: none; height: 64px; }
.header__spacer.is-active { display: block; }

/* --- Mobile bar ------------------------------------------ */
.header__mobile {
    display: none;
    height: 64px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
}
.header__mobile-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--s-3);
}
.header__mobile-right { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); }

.chip-strip {
    display: none;
    height: 48px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-white);
    position: relative;
}
.chip-strip__track {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.chip-strip__track::-webkit-scrollbar { display: none; }
.chip-strip__link {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    white-space: nowrap;
    scroll-snap-align: start;
    color: var(--c-text-soft);
}
.chip-strip__link.is-active { color: var(--c-accent); font-weight: var(--fw-bold); }

/* --- Drawer ---------------------------------------------- */
.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-5);
    border-bottom: 1px solid var(--c-border);
}
.drawer__body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5); }
.drawer__nav { display: flex; flex-direction: column; }
.drawer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    height: 52px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border-bottom: 1px solid var(--c-border);
    width: 100%;
    text-align: left;
}
.drawer__sub { display: none; padding: 0 0 var(--s-3) var(--s-4); }
.drawer__sub.is-open { display: block; }
.drawer__sub a { display: block; padding: 10px 0; font-size: var(--fs-xs); color: var(--c-text-soft); }
.drawer__actions { display: grid; gap: var(--s-3); }
.drawer__foot {
    margin-top: auto;
    padding: var(--s-5);
    border-top: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
.drawer__foot .social-row__link { color: var(--c-grey-600); }

/* --- Search overlay -------------------------------------- */
.search-overlay {
    position: fixed;
    inset: 0;
    background: var(--c-white);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms var(--e-out), visibility 200ms;
    overflow-y: auto;
    padding-top: var(--s-7);
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-8);
}
.search-overlay__field { position: relative; display: flex; align-items: center; gap: var(--s-4); }
.search-overlay__input {
    flex: 1;
    height: 72px;
    border: 0;
    background: transparent;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-h2);
    color: var(--c-ink);
    min-width: 0;
}
.search-overlay__input::placeholder { color: var(--c-grey-300); }
.search-overlay__input:focus { outline: none; }
.search-overlay__icon { font-size: 28px; color: var(--c-grey-500); }
.search-overlay__body { padding-bottom: var(--s-12); border-top: 1px solid var(--c-border); padding-top: var(--s-6); }
.search-overlay__label { margin-bottom: var(--s-4); }
.search-overlay__results { display: grid; gap: 0; }
.search-overlay mark { background: var(--c-accent-soft); color: var(--c-accent); font-weight: var(--fw-semibold); }

/* ============================================================
   TOP STORIES — the carousel that opens the homepage
   ============================================================ */

/* This block replaced the old photographic hero. A slide is a group of six
   cards rather than one picture, which is what lets the shared cross-fade
   carousel in carousel.js drive it with no JavaScript of its own: it only
   ever toggles .is-active on a [data-carousel-slide]. */
.top-stories {
    padding: var(--s-8) 0 var(--s-9);
    background: var(--c-bg-alt);
}
.top-stories__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s-5);
    margin-bottom: var(--section-head-gap);
}
.top-stories__title {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
    letter-spacing: var(--ls-h2);
    color: var(--c-heading);
}
.top-stories__tools { display: flex; align-items: center; gap: var(--s-4); }
.top-stories__arrows { display: flex; gap: var(--s-2); }

/* Every slide sits in the same grid cell, so the viewport is exactly as
   tall as a slide without anything being positioned absolutely — and the
   height cannot jump halfway through a cross-fade. */
.top-stories__viewport { display: grid; }
.top-stories__slide {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--grid-gap);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-slow) var(--e-out), visibility var(--t-slow);
}
.top-stories__slide.is-active { opacity: 1; visibility: visible; }
.top-stories__dots { margin-top: var(--s-7); }

/* One card: the photograph, then the headline. Nothing else — the ranking
   is the section, not the individual card. Built to the same recipe as
   .card in components.css so it reads as part of the same family, with a
   heavier resting shadow because these sit on the grey band. */
.ts-card {
    position: relative;
    min-width: 0;
    display: flex;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--c-shadow-md);
    transition: transform var(--t-base) var(--e-out),
                box-shadow var(--t-base) var(--e-out),
                border-color var(--t-base) var(--e-out);
}
@media (hover: hover) {
    .ts-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--c-shadow-lg);
        border-color: var(--c-grey-300);
    }
    .ts-card:hover .ts-card__title { color: var(--c-accent); }
    .ts-card:hover .photo { transform: scale(var(--img-zoom-hover)); }
}
.ts-card:focus-within { box-shadow: var(--c-shadow-lg); }
.ts-card:focus-within .photo { transform: scale(var(--img-zoom-hover)); }

/* The cards are grid items, so they already stretch to the tallest in the
   row; the link fills that height and keeps the headline hard against the
   photograph rather than floating in the middle. */
.ts-card__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: inherit;
}
/* The card clips and rounds the photograph now, so the media needs neither
   a radius nor a shadow of its own. */
.ts-card__media { background: var(--c-grey-100); }
.ts-card__title {
    padding: var(--s-4);
    font-size: var(--fs-sm);
    line-height: 1.5;
    font-weight: var(--fw-semibold);
    color: var(--c-heading);
    transition: color var(--t-fast) var(--e-out);
}
.ts-card__link:focus-visible { outline: 2px solid var(--c-accent-line); outline-offset: -2px; }

/* ============================================================
   HOME SECTIONS
   ============================================================ */

/* Latest Release: one feature + a stack */
.latest__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--grid-gap); align-items: start; }
.latest__stack { display: grid; gap: var(--s-6); }

/* Editor's Pick band */
.picks__grid { display: grid; grid-template-columns: 3fr 6fr 3fr; gap: var(--grid-gap); align-items: stretch; }
.picks__col { min-width: 0; display: flex; flex-direction: column; }
/* The three columns share the row height, so the cards inside each side
   column soak up the leftover space rather than leaving a ragged edge. */
.picks__col > .card { flex: 1 1 auto; }
.picks__heading { font-size: var(--fs-h5); margin-bottom: var(--s-5); padding-bottom: var(--s-3); border-bottom: 2px solid var(--c-accent); }
.picks__center { min-height: 520px; }
.picks__center .card--overlay { min-height: 520px; height: 100%; }

/* Wide banner carousel */
.banner {
    position: relative;
    height: 420px;
    border-radius: var(--r-xl);
    overflow: hidden;
    isolation: isolate;
    color: var(--c-white);
    background: var(--c-ink);
}
.banner__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 500ms var(--e-out), visibility 500ms; }
.banner__slide.is-active { opacity: 1; visibility: visible; }
.banner__slide .photo { width: 100%; height: 100%; object-fit: cover; }
.banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .1) 30%, rgba(0, 0, 0, .88) 100%);
    pointer-events: none;
}
.banner__content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: var(--s-8);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-4);
    max-width: 720px;
}
.banner__title { font-size: var(--fs-h3); line-height: var(--lh-h3); color: var(--c-white); }
.banner .carousel__dots { position: absolute; left: 0; right: 0; bottom: 24px; z-index: 3; }
.banner .btn--glass { width: 44px; height: 44px; }

/* Topic sections */
.topic__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }

/* Spotlight (dark band around one category) */
.spotlight { background: var(--c-black); color: var(--c-white); }
.spotlight .section__title, .spotlight .card__title { color: var(--c-white); }
.spotlight .card { background: var(--c-ink-2); border-color: var(--c-on-dark-line); }
.spotlight .card__excerpt, .spotlight .meta { color: var(--c-on-dark-soft); }
.spotlight .meta__item + .meta__item::before { background: var(--c-on-dark-line); }
.spotlight .btn--viewall { background: var(--c-white); color: var(--c-black); }
.spotlight .btn--read { background: var(--c-white); color: var(--c-black); }

/* ============================================================
   SUBSCRIBE BAND
   ============================================================ */
.section--subscribe {
    background: var(--c-black);
    color: var(--c-white);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.section--subscribe::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, .02) 0 1px,
        transparent 1px 14px
    );
}
.subscribe__inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); }
.subscribe__title { color: var(--c-white); max-width: 720px; }
.subscribe__sub { color: var(--c-on-dark-soft); max-width: 560px; font-size: var(--fs-sm); }
.subscribe__form { width: min(100%, 620px); margin-top: var(--s-4); }
.subscribe__pill {
    display: flex;
    align-items: center;
    height: 64px;
    background: var(--c-white);
    border-radius: var(--r-pill);
    padding: 6px 6px 6px 26px;
    gap: var(--s-3);
}
.subscribe__pill .input {
    flex: 1;
    height: 52px;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 15px;
    min-width: 0;
}
.subscribe__pill .input:focus { box-shadow: none; }
.subscribe__pill .btn { height: 52px; flex-shrink: 0; }
.subscribe__note { font-size: 12px; color: var(--c-on-dark-soft); margin-top: var(--s-3); }
.subscribe__done {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--c-white);
    color: var(--c-text);
    border: 1.5px solid var(--c-accent);
    border-radius: var(--r-md);
    padding: var(--s-5) var(--s-6);
    font-weight: var(--fw-semibold);
    width: min(100%, 480px);
}
.subscribe__done.is-visible { display: flex; }

/* Compact newsletter card used in listing sidebars. */
.newsletter-card {
    background: var(--c-black);
    color: var(--c-white);
    border-radius: var(--r-lg);
    padding: 28px;
}
.newsletter-card__title { font-size: 18px; font-weight: var(--fw-bold); color: var(--c-white); margin-bottom: var(--s-3); }
.newsletter-card__text { font-size: var(--fs-xs); color: var(--c-on-dark-soft); margin-bottom: var(--s-4); }
.newsletter-card .input { height: 44px; border-color: transparent; }
.newsletter-card .btn { margin-top: var(--s-3); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--c-bg-alt);
    border-top: 1px solid var(--c-grey-300);
    padding-top: var(--s-12);
}
.footer__top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--s-8);
}
.footer__brand { display: flex; flex-direction: column; gap: var(--s-4); align-items: flex-start; }
.footer__desc { font-size: var(--fs-sm); line-height: 1.75; color: var(--c-text-soft); max-width: 300px; }
.footer__contact { display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--fs-sm); color: var(--c-text-soft); }
.footer__contact a { display: inline-flex; align-items: center; gap: 10px; }
@media (hover: hover) { .footer__contact a:hover { color: var(--c-accent); } }

.footer__socials { display: flex; gap: var(--s-2); }
.footer__social {
    width: 40px; height: 40px;
    border-radius: var(--r-circle);
    border: 1px solid var(--c-grey-300);
    display: grid;
    place-items: center;
    font-size: 15px;
    color: var(--c-text);
    transition: all var(--t-fast) var(--e-out);
}
@media (hover: hover) { .footer__social:hover { background: var(--c-accent); color: var(--c-on-accent); border-color: var(--c-accent); } }

.footer__col-title {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: var(--s-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.footer__col-title .icon { display: none; }
.footer__links { display: flex; flex-direction: column; gap: var(--s-3); }
.footer__links a {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--c-text-soft);
    transition: color var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
    display: inline-block;
}
@media (hover: hover) { .footer__links a:hover { color: var(--c-accent); transform: translateX(4px); } }

.footer__rule { margin-top: var(--s-10); }
.footer__bottom {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--c-text-meta);
}
.footer__legal { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.footer__legal a + a::before {
    content: '';
    display: inline-block;
    width: 3px; height: 3px;
    border-radius: var(--r-circle);
    background: var(--c-grey-300);
    margin-right: var(--s-2);
    vertical-align: middle;
}
@media (hover: hover) { .footer__legal a:hover { color: var(--c-accent); } }
