/* page-news.css — bespoke news hero + filterable post grid. */

  /* ---------- Hero (adaptive clip-path, fade-in, search bar) -------------
   * Clip path lives in main.js (setupAdaptiveClip) keyed off
   * `news-hero-clip-path`. 25 px circular corners on all 4 sides. */
  .news-hero { padding: 15px 32px 0; background: #fff; }
  /* Visible by default; the entrance is a pure-CSS time-based animation
     with `both` fill, so it always ends visible without main.js (which
     WP Rocket Delay-JS holds until first interaction). The old
     .is-revealed / .no-anim JS gates are gone — main.js may still add
     the classes, they just don't control visibility anymore. */
  .news-hero-shape {
    position: relative;
    max-width: 1860px; margin: 0 auto;
    aspect-ratio: 1860 / 460;
  }
  @media screen and (prefers-reduced-motion: no-preference) {
    .news-hero-shape {
      animation: newsHeroIn 760ms cubic-bezier(.22,.61,.36,1) 0.1s both;
    }
  }
  @keyframes newsHeroIn {
    from { opacity: 0; transform: translate3d(0, 22px, 0) scale(0.985); }
    to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  }
  .news-hero-photo {
    position: absolute; inset: 0;
    background-color: #050505;
    /* --news-hero-bg is set inline on the element so PHP can resolve the
       theme asset path. The linear-gradient on top of it is the dark
       overlay. A fallback URL keeps the overlay if no var is set. */
    background-image:
      linear-gradient(rgba(5, 5, 5, 0.62), rgba(5, 5, 5, 0.62)),
      var(--news-hero-bg, var(--at-bg-at-news-hero));
    background-size: cover;
    background-position: center;
    /* Simple rounded rect — radius scales with the viewport (generous on
       desktop, tighter on mobile) instead of a fixed 25px SVG <rect rx>. */
    clip-path: inset(0 round clamp(14px, 1.78vw, 25px));
    -webkit-clip-path: inset(0 round clamp(14px, 1.78vw, 25px));
  }
  .news-hero-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
  }
  .news-hero-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 56px 56px;
    max-width: 1140px; margin: 0 auto;
  }
  .news-hero .crumbs {
    font-family: var(--font-mono); font-size: 12px;
    letter-spacing: 0.08em; color: rgba(255,255,255,0.55);
    display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap; justify-content: center; margin-bottom: 18px;
  }
  .news-hero .crumbs a { color: inherit; text-decoration: none; }
  .news-hero .crumbs a:hover { color: #fff; }
  .news-hero .crumbs .sep { opacity: 0.4; }
  .news-hero h1 {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(30px, 3.2vw, 44px); line-height: 1;
    letter-spacing: -0.015em; text-transform: uppercase;
    color: #ffffff; margin: 0 0 14px;
  }
  .news-hero .sub {
    font-size: 16px; line-height: 1.55; color: rgba(255,255,255,0.72);
    max-width: 56ch; margin: 0 auto;
  }

  /* News-only search bar — mirrors the alttune-vehicles av-search-hero pill
     (leading icon + flush input + black submit pill inside a white rounded
     field), with the submit using the global orange wipe-in hover from
     .at-btn-primary so it reads consistently with our primary CTAs. */
  .news-hero-search {
    position: relative;
    display: flex; justify-content: center;
    width: 100%;
    margin: 28px auto 0;
  }
  .news-hero-search__field {
    position: relative;
    display: flex; align-items: stretch;
    width: 100%; max-width: 680px;
    /* Translucent dark "in-hero" variant — matches the av-search-hero
       --in-hero look from alttune-vehicles. Sits on the dark photo with
       a soft blur and a white focus halo. */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: border-color 150ms, box-shadow 150ms, background-color 150ms;
  }
  .news-hero-search__field:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  }
  .news-hero-search__icon {
    flex: 0 0 auto; align-self: center;
    margin: 0 6px 0 18px;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
  }
  .news-hero-search__input {
    flex: 1 1 auto; min-width: 0;
    border: none !important;
    background: transparent !important;
    padding: 14px 12px !important;
    font-family: var(--font-display);
    font-size: 15px;
    color: #ffffff;
    outline: none !important;
    box-shadow: none !important;
  }
  .news-hero-search__input::placeholder { color: rgba(255, 255, 255, 0.55); }

  /* Submit pill — black by default, orange wipe-in on hover (same easing
     and skew as .at-btn-primary). Contained inside the white pill via
     `margin: 4px`; the wipe is clipped to the pill via `overflow: hidden`. */
  .news-hero-search__submit {
    position: relative;
    flex: 0 0 auto;
    margin: 4px;
    padding: 0 26px;
    background: #ffffff;
    color: #111827;
    border: 1px solid #ffffff;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 14px; font-weight: 700; letter-spacing: 0.01em;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: color 220ms ease, border-color 280ms cubic-bezier(.32,.72,0,1), background-color 220ms;
  }
  .news-hero-search__submit::before {
    content: "";
    position: absolute; inset: 0;
    background: var(--performance-orange);
    transform: translate3d(-101%, 0, 0) skewX(-8deg);
    transform-origin: left center;
    transition: transform 540ms cubic-bezier(.32,.72,0,1);
    z-index: -1;
  }
  .news-hero-search__submit > * {
    position: relative; z-index: 1;
    display: inline-block;
    transition: transform 540ms cubic-bezier(.32,.72,0,1);
  }
  .news-hero-search__submit:hover,
  .news-hero-search__submit:focus-visible {
    color: #ffffff;
    background: transparent;
    border-color: var(--performance-orange);
    outline: none;
  }
  .news-hero-search__submit:hover::before,
  .news-hero-search__submit:focus-visible::before {
    transform: translate3d(0, 0, 0) skewX(0deg);
  }
  .news-hero-search__submit:hover > *,
  .news-hero-search__submit:focus-visible > * {
    transform: translate3d(3px, 0, 0);
  }

  /* Desktop shows the "Search" text; the icon is a mobile-only fallback. */
  .news-hero-search__submit-icon { display: none; }

  /* Suggestion dropdown — anchored to the field, not the form, so it sits
     directly under the pill width-matched. */
  .news-hero-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 680px;
    background: #fff;
    border: 1px solid var(--steel-silver);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(10,9,8,0.18);
    overflow: hidden;
    z-index: 5;
    text-align: left;
  }
  .news-hero-suggest .row {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 6px;
    padding: 14px 18px;
    text-decoration: none; color: var(--rubber-black);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    transition: background-color 140ms;
  }
  .news-hero-suggest .row:last-child { border-bottom: 0; }
  .news-hero-suggest .row:hover,
  .news-hero-suggest .row.is-active {
    background: var(--steel-silver-100);
  }
  .news-hero-suggest .row .t {
    width: 100%;
    font-family: var(--font-display); font-weight: 600; font-size: 13px;
    line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Highlight matched query words */
  .news-hero-suggest mark {
    background: rgba(242, 105, 33, 0.18);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
  }
  /* Section headers (Articles / Categories) */
  .news-hero-suggest__head {
    padding: 10px 18px 6px;
    font-family: var(--font-mono);
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.16em; color: var(--fg-3);
    text-transform: uppercase;
    background: #fafafa;
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }
  /* Categories rendered as pill chips (matches .at-radio-pill style used
     elsewhere on the page) instead of full-width rows. */
  .news-hero-suggest__cats {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 14px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }
  .news-hero-suggest__pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    gap: 4px;
  }
  .news-hero-suggest__pill-label { font-family: inherit; }
  /* Legacy category row variant — kept for any older markup. */
  .news-hero-suggest .row--cat .count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 18px;
    padding: 0 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0;
  }
  /* See-all-results footer — single inline line with underline, arrow
     sits next to the text and inherits its color. */
  .news-hero-suggest .row--all {
    background: var(--steel-silver-100);
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-direction: row; align-items: center; justify-content: flex-start;
  }
  .news-hero-suggest .row--all .t {
    width: auto;
    font-size: 12px; font-weight: 600; color: var(--rubber-black);
    text-decoration: underline;
    text-underline-offset: 3px;
    display: inline-flex; align-items: baseline; gap: 6px;
  }
  .news-hero-suggest .row--all .arrow {
    font-size: 14px; color: inherit;
    text-decoration: none;
    display: inline-block;
  }
  .news-hero-suggest .row .m {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.12em; color: var(--fg-3);
    font-weight: 500;
    text-transform: uppercase;
  }
  .news-hero-suggest .row .m .d::before {
    content: "·";
    margin-right: 8px;
    opacity: 0.5;
  }
  .news-hero-suggest .row .cat { color: var(--fg-3); }
  .news-hero-suggest[hidden] { display: none; }

  @media (max-width: 720px) {
    .news-hero { padding: 16px; }
    .news-hero-shape { aspect-ratio: 16 / 11; }
    .news-hero-content { padding: 36px 20px; }
    .news-hero-search__field { border-radius: 28px; }
    /* The --compact search uses a fixed 260/460px px width that overflows a
       narrow viewport — go full-width on phones so it never sticks out. */
    .news-hero-search--compact,
    .news-hero-search--compact:focus-within,
    .news-hero-search--compact:hover,
    .news-hero-search--compact.has-suggest {
      width: 100%;
      margin: 16px 0 0;
    }
    /* Drop the leading magnifier (redundant + steals width) and turn the "Search"
       text button into a compact icon button, so the whole bar fits. */
    .news-hero-search__icon { display: none; }
    .news-hero-search__input { padding-left: 20px !important; }
    .news-hero-search__submit { padding: 0; flex: 0 0 46px; width: 46px; font-size: 13px; }
    .news-hero-search__submit > span { display: none; }
    .news-hero-search__submit-icon { display: inline-flex; align-items: center; justify-content: center; }
  }
  @media (prefers-reduced-motion: reduce) {
    .news-hero-shape {
      opacity: 1 !important;
      transform: none !important;
      transition: none !important;
    }
  }

  /* auto-fill (not auto-fit) keeps phantom tracks when there are few cards
     so 1-3 cards don't stretch to fill the full container width. Same card
     width whether the row has 1 or 4 items. */
  .news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
  .post-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--steel-silver); transition: all 220ms; }
  .post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
  .post-card .photo {
    aspect-ratio: 16 / 10;
    background-color: var(--steel-silver-100);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
  }
  .post-card .photo::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(0,0,0,0.05) 0, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 14px); }
  /* Category tag — discreet, low-contrast label tucked into the photo's
     bottom-left. Same muted mono treatment as .nh-card__cat / side rows
     so the visual language is consistent everywhere a category appears. */
  .post-card .photo .tag {
    position: absolute; bottom: 10px; left: 10px;
    padding: 3px 8px;
    background: rgba(255,255,255,0.92);
    border-radius: 4px;
    color: var(--fg-3);
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.12em; font-weight: 500;
    text-transform: uppercase;
    z-index: 1;
  }
  .post-card .body { padding: 22px; }
  .post-card .date { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); margin-bottom: 10px; letter-spacing: 0.06em; }
  .post-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; letter-spacing: -0.005em; margin: 0 0 10px; }
  .post-card p { font-size: 13px; color: var(--fg-2); margin: 0; line-height: 1.5; }
  .post-card.is-featured { grid-column: span 2; flex-direction: row; }
  .post-card.is-featured .photo { flex: 1; aspect-ratio: auto; min-height: 320px; }
  .post-card.is-featured .body { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
  .post-card.is-featured h3 { font-size: 28px; line-height: 1.1; }
  .post-card.is-featured p { font-size: 15px; }
  @media (max-width: 920px) { .post-card.is-featured { grid-column: span 1; flex-direction: column; } .post-card.is-featured .photo { aspect-ratio: 16 / 10; } }

/* ============================================================================
   News filter chips + paginated toolbar (top and bottom).
   Mirrors the vehicles archive look: white strip with a soft border,
   count summary + per-page select on the left, prev / page-input / next
   on the right. Renders once above the grid and once below.
   ========================================================================== */
.news-filters {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.news-filters__label {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.18em; color: var(--fg-3);
    text-transform: uppercase; margin-right: 8px;
}

.news-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid var(--steel-silver);
    border-radius: 12px;
    margin: 18px 0;
    font-family: var(--font-display); font-size: 13px;
    color: var(--rubber-black);
}
.news-toolbar__left,
.news-toolbar__right {
    display: flex; align-items: center; gap: 18px;
    flex-wrap: wrap;
}
.news-toolbar__count {
    display: inline-flex; align-items: center; gap: 6px;
}
.news-toolbar__count .of    { color: var(--fg-3); text-transform: uppercase; font-size: 11px; letter-spacing: 0.12em; }
.news-toolbar__count .muted { color: var(--fg-3); font-weight: 500; }
.news-toolbar__count strong { font-weight: 700; }

.news-toolbar__perpage,
.news-toolbar__sort {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0;
}
.news-toolbar__label {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.18em; color: var(--fg-3);
    text-transform: uppercase;
}
.news-toolbar__perpage select,
.news-toolbar__sort select {
    appearance: none;
    background: #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23050505' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
        no-repeat right 8px center / 12px;
    border: 1px solid var(--steel-silver);
    border-radius: 8px;
    padding: 6px 28px 6px 12px;
    font-family: inherit; font-size: 13px;
    color: var(--rubber-black);
    cursor: pointer;
    line-height: 1;
}
.news-toolbar__perpage select:focus,
.news-toolbar__sort select:focus { outline: 2px solid var(--performance-orange); outline-offset: 2px; }

.news-toolbar__nav {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--steel-silver);
    border-radius: 8px;
    background: #fff;
    color: var(--rubber-black);
    text-decoration: none;
    transition: background-color 140ms, border-color 140ms, color 140ms;
}
.news-toolbar__nav:hover { background: var(--steel-silver-100); border-color: var(--rubber-black); }
.news-toolbar__nav[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }

.news-toolbar__pageform {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0;
}
.news-toolbar__input {
    width: 52px;
    text-align: center;
    height: 32px;
    border: 1px solid var(--steel-silver);
    border-radius: 8px;
    background: #fff;
    color: var(--rubber-black);
    font-family: inherit; font-size: 13px;
    -moz-appearance: textfield;
}
.news-toolbar__input::-webkit-outer-spin-button,
.news-toolbar__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.news-toolbar__input:focus { outline: 2px solid var(--performance-orange); outline-offset: 1px; border-color: var(--rubber-black); }
.news-toolbar__of { color: var(--fg-3); font-size: 12px; }

@media (max-width: 720px) {
    .news-toolbar {
        flex-direction: column; align-items: stretch;
        padding: 12px 14px;
    }
    .news-toolbar__left,
    .news-toolbar__right {
        justify-content: space-between;
    }
}

/* ============================================================================
   News archive — Futurism-style category swiper rows.
   Each .news-row carries a horizontal scroll-snap track of post cards,
   with prev/next chevron buttons and a "See all →" link to the category
   archive. The rows render BETWEEN the hero and "The Feed" full grid.
   ========================================================================== */
.news-quick-nav { padding-top: 28px; padding-bottom: 0; }
/* Topics pills relocated to the hero sidebar (replaces the old standalone
   .news-quick-nav strip). Stacked variant wraps tightly under the side list. */
.news-hero-editorial__topics {
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--steel-silver);
}
.news-hero-editorial__topics-head {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.18em; color: var(--rubber-black);
    text-transform: uppercase;
    margin-bottom: 12px;
}
.news-filters--stacked {
    margin-bottom: 0;
    gap: 5px;
}
.news-filters--stacked .at-radio-pill {
    /* Pills sit on a narrower column; keep them tight. */
    font-size: 11px;
    padding: 5px 10px;
    letter-spacing: 0.02em;
}

.news-row { padding-top: 28px; padding-bottom: 28px; }
.news-row + .news-row { padding-top: 8px; }

.news-row__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--steel-silver);
}
.news-row__title {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(20px, 1.8vw, 26px);
    line-height: 1; letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--rubber-black);
    margin: 0;
}
.news-row__title a { color: inherit; text-decoration: none; transition: color 140ms; }
.news-row__title a:hover { color: var(--performance-orange); }
.news-row__sub {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.12em; color: var(--fg-3);
    text-transform: uppercase;
}
.news-row__actions {
    display: inline-flex; align-items: center; gap: 14px;
}
.news-row__see-all {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--rubber-black);
    text-decoration: none;
}
.news-row__see-all:hover { color: var(--performance-orange); }
.news-row__nav { display: inline-flex; gap: 6px; }
.news-row__btn {
    appearance: none;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff;
    color: var(--rubber-black);
    border: 1px solid var(--steel-silver);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 140ms, border-color 140ms, color 140ms, opacity 140ms;
}
.news-row__btn:hover { background: var(--rubber-black); border-color: var(--rubber-black); color: #fff; }
.news-row__btn[disabled] { opacity: 0.35; pointer-events: none; }

.news-row__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 320px);
    gap: 22px;
    overflow-x: auto;
    /* overflow-x: auto forces overflow-y to auto too (spec), so a hovered
       card scaled with transform would be clipped at top/bottom. We add
       vertical padding (with compensating negative margins so the visual
       rhythm with surrounding elements is unchanged) to give scaled
       cards breathing room without losing the horizontal scroll. */
    scroll-snap-type: x mandatory;
    scroll-padding-left: 2px;
    scrollbar-width: none;
    padding: 14px 8px 18px;
    margin: -14px -8px -18px;
}
.news-row__track::-webkit-scrollbar { display: none; }
.news-row__card {
    scroll-snap-align: start;
}

/* Right-edge soft fade when the track is actually scrollable (6+ cards on
   desktop). JS toggles .is-at-end on the track when scrolled to the right
   edge so the fade disappears (nothing left to crop). */
@media (min-width: 901px) {
    .news-row__track:has(.news-row__card:nth-child(6)) {
        --news-fade: 96px;
        -webkit-mask-image: linear-gradient(to right,
            #000 0,
            #000 calc(100% - var(--news-fade)),
            transparent 100%);
                mask-image: linear-gradient(to right,
            #000 0,
            #000 calc(100% - var(--news-fade)),
            transparent 100%);
    }
    .news-row__track:has(.news-row__card:nth-child(6)).is-at-end {
        -webkit-mask-image: none;
                mask-image: none;
    }
}

/* ----------------------------- The Feed section ---------------------------- */
.news-feed { padding-top: 48px; }
.news-feed .news-row__head { margin-bottom: 22px; }

/* Search results — the head + matching-terms section + feed sit back-to-back
   with no editorial / swiper rows above. Tighten the vertical spacing so the
   page reads as one block, not three big airy sections. */
.news-search-head { padding-top: 40px; padding-bottom: 12px; }
.news-search-head__inner {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.news-search-head__eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-3);
}
.news-search-head__query {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(28px, 3.2vw, 44px);
    line-height: 1.05; letter-spacing: -0.02em;
    color: var(--rubber-black);
    margin: 0;
}
.news-search-head__quote { color: var(--fg-3); }
.news-search-head__stats {
    display: inline-flex; align-items: center; gap: 12px;
    font-family: var(--font-display); font-size: 14px;
    color: var(--fg-2);
    margin-top: 4px;
}
.news-search-head__stat {
    color: var(--fg-2);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: color 160ms, border-color 160ms;
}
.news-search-head__stat strong { color: var(--rubber-black); font-weight: 800; margin-right: 4px; }
.news-search-head__stat:hover {
    color: var(--performance-orange);
    border-bottom-color: var(--performance-orange);
}
.news-search-head__stat:hover strong { color: var(--performance-orange); }
.news-search-head__sep { opacity: 0.4; }

.news-search-terms { padding-top: 16px; padding-bottom: 12px; }
.news-search-head + .news-search-terms { padding-top: 8px; }
.news-search-terms + .news-feed { padding-top: 12px; }
.news-search-head + .news-feed { padding-top: 12px; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 720px) {
    .news-row__track {
        grid-auto-columns: minmax(240px, 78%);
        gap: 14px;
    }
    /* Tighter vertical rhythm between category rows on mobile. */
    .news-row { padding-top: 18px; padding-bottom: 18px; }
    .news-row + .news-row { padding-top: 6px; }
    .news-row__nav { display: none; }
    .news-row__head { padding-bottom: 8px; }
}

/* ============================================================================
   News editorial hero — Futurism-style 3-col layout.
   Top breadcrumb + title + search row, then a grid:
     [ lead (big photo + title + excerpt) ][ 2 middle cards ][ side list ]
   Stacks on smaller viewports.
   ========================================================================== */
/* Outer band: white page background, side padding so the .at-hero-card
   inside has small visible breathing room on the page sides. Card chrome
   itself (#f9f9f9, border, radius, pattern, 1440 inner) lives in the
   shared .at-hero-card class in page-shared.css. */
.news-hero-editorial {
    /* Use the global gutter token so this band aligns with every other
       section on all breakpoints. Vertical padding stays bespoke. */
    padding: 15px var(--at-gutter) 32px;
    background: #fff;
}

/* Editorial grid moved OUT of the hero card — sits as its own section row
   below the hero, with the same horizontal gutter as every other section. */
.news-hero-editorial-grid-row {
    padding: 0 var(--at-gutter) 40px;
    background: #fff;
}
.news-hero-editorial-grid-row__inner {
    max-width: 1440px;
    margin: 0 auto;
}
/* Compact variant for category archives — short hero band, no editorial
   grid, and tighter rhythm below. Scoped to category-only via body class
   so the /news/ page (which uses the same .at-hero-card chrome) is unaffected. */
.alttune-page--category .news-hero-editorial--compact .news-hero-editorial__head { padding-bottom: 8px; }
.alttune-page--category .news-hero-editorial--compact .at-hero-card__inner { min-height: 150px; }
.alttune-page--category .at-section { --at-section-y: 32px; }

/* Content sections below the hero use the 1440 px container. */
.alttune-page--news .at-section-inner { max-width: 1440px; }

/* Pattern + z-index handled by .at-hero-card / .at-hero-card__inner in
   page-shared.css — keep header + grid relative so any in-section z-index
   tricks (like the search suggest dropdown) still resolve correctly. */
.news-hero-editorial__head,
.news-hero-editorial__grid { position: relative; }

/* Header row */
.news-hero-editorial__head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 24px 32px;
    margin-bottom: 0;
    padding-bottom: 0;
}
.news-hero-editorial__crumbs {
    grid-column: 1 / -1;
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.12em; color: var(--fg-3);
    display: flex; gap: 8px; align-items: center;
    text-transform: uppercase;
}
.news-hero-editorial__crumbs a { color: inherit; text-decoration: none; }
.news-hero-editorial__crumbs a:hover { color: var(--performance-orange); }
.news-hero-editorial__crumbs .sep { opacity: 0.4; }

.news-hero-editorial__title-row {
    display: flex; flex-direction: column; gap: 10px;
    min-width: 0;
}
.news-hero-editorial__title {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(30px, 3.2vw, 44px); line-height: 1;
    letter-spacing: -0.02em; text-transform: uppercase;
    color: var(--rubber-black);
    margin: 0;
}
.news-hero-editorial__sub {
    font-size: 15px; line-height: 1.55;
    color: var(--fg-2); margin: 0;
    max-width: 56ch;
}

/* Compact search variant — anchored to the right of the hero head;
   expands leftward on hover/focus so the icon stays put and the input
   "grows" toward the title. Animates `width` directly (more reliable
   than max-width inside flex parents — max-width transitions can be
   skipped browser-side when the element resizes past previous bounds). */
.news-hero-search--compact {
    /* Right-aligned in its grid cell. (Base .news-hero-search uses
       `margin: 28px auto 0`; reset margin-right so it doesn't centre.) */
    margin: 0 0 0 auto;
    width: 260px;
    max-width: 100%;
    transition: width 420ms cubic-bezier(.22,.61,.36,1);
    will-change: width;
}
.news-hero-search--compact:focus-within,
.news-hero-search--compact:hover,
.news-hero-search--compact.has-suggest { width: 460px; }

/* Compact (category) hero head: title sits ALONE on its own row, then the
   description + search share the row below. The head stacks as a flex column;
   the description/search row reserves the search's EXPANDED width (460px) as a
   fixed grid track so growing the search never reflows the description — this
   kills the hover→wrap→shrink→regrow oscillation with long category names. */
.news-hero-editorial--compact .news-hero-editorial__head {
    display: flex;
    flex-direction: column;
    align-items: stretch;   /* full-width rows, left-aligned (base sets `end`) */
    gap: 16px;
}
/* Let the search-suggest dropdown spill out below the hero card. The card
   has overflow:hidden by default (so the pattern + rounded corners clip
   inside content), but on any news-editorial hero (news index, category
   archives, etc.) the dropdown is anchored to the search field and needs
   to escape the card. */
.news-hero-editorial .at-hero-card { overflow: visible; }
.news-hero-editorial--compact .news-hero-editorial__crumbs { justify-content: flex-start; }
.news-hero-editorial--compact .news-hero-editorial__title  { text-align: left; }
.news-hero-editorial__row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.news-hero-editorial__row .news-hero-editorial__sub { margin: 0; min-width: 0; align-self: start; }
@media (min-width: 801px) {
    .news-hero-editorial__row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 460px;
        align-items: end;
        gap: 32px;
    }
}
@media (max-width: 720px) {
    /* On phones the head stacks vertically — full width at rest, no grow. */
    .news-hero-search--compact,
    .news-hero-search--compact:focus-within,
    .news-hero-search--compact:hover { width: 100%; }
}
.news-hero-search--compact .news-hero-search__field {
    background: #fff;
    border: 1px solid var(--steel-silver);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.news-hero-search--compact .news-hero-search__field:focus-within {
    background: #fff;
    border-color: var(--rubber-black);
    box-shadow: 0 0 0 3px rgba(242,105,33,0.18);
}
.news-hero-search--compact .news-hero-search__icon { color: var(--fg-3); }
.news-hero-search--compact .news-hero-search__input { color: var(--rubber-black); }
.news-hero-search--compact .news-hero-search__input::placeholder { color: #9ca3af; }
.news-hero-search--compact .news-hero-search__submit {
    background: var(--rubber-black);
    color: #fff;
    border-color: var(--rubber-black);
}
.news-hero-search--compact .news-hero-search__submit:hover {
    background: transparent;
    color: #fff;
    border-color: var(--performance-orange);
}

/* Main 3-column grid */
.news-hero-editorial__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 0.85fr);
    gap: 20px;
    align-items: stretch;
}
.news-hero-editorial__middle {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
}

/* Cards — three variants share .nh-card. Chrome matches .post-card
   (white surface, steel border, 16px radius, hover lift + shadow) so the
   hero composition is visually consistent with the rows below. */
.nh-card {
    display: flex; flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: var(--rubber-black);
    background: #fff;
    border: 1px solid var(--steel-silver);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 220ms, box-shadow 220ms;
}
.nh-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
/* Title stays in its base color on hover — the spotlight zoom + shadow
   already communicate the focus state. */
.nh-card__photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--steel-silver-100);
    background-size: cover; background-position: center; background-repeat: no-repeat;
    /* Card already clips with overflow:hidden + 16px radius; no inner radius. */
    border-radius: 0;
}
.nh-card__body {
    display: flex; flex-direction: column; gap: 10px;
    padding: 22px;
    flex: 1;
}
.nh-card__cat {
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.12em; color: var(--fg-3);
    font-weight: 500;
    text-transform: uppercase;
}
.nh-card__title {
    font-family: var(--font-display); font-weight: 800;
    font-size: 22px; line-height: 1.1;
    letter-spacing: -0.005em;
    margin: 0;
    transition: color 140ms;
}
.nh-card__excerpt {
    font-size: 15px; line-height: 1.5;
    color: var(--fg-2); margin: 0;
}
.nh-card__date {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.06em; color: var(--fg-3);
    margin-top: auto;
    padding-top: 4px;
}

/* Lead — big photo, larger title + excerpt. Radii inherit from the card chrome. */
.nh-card--lead .nh-card__photo { aspect-ratio: 16 / 11; }
.nh-card--lead .nh-card__title { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.05; }
.nh-card--lead .nh-card__excerpt { font-size: 16px; }

/* Middle — column layout (photo above, body below), same flow as the lead */
.nh-card--middle { display: flex; flex-direction: column; }
.nh-card--middle .nh-card__photo { aspect-ratio: 16 / 10; }
.nh-card--middle .nh-card__title  { font-size: 18px; line-height: 1.2; }

/* Sidebar — vertical list of latest stories */
.news-hero-editorial__side {
    border-left: 1px solid var(--steel-silver);
    padding-left: 24px;
}
.news-hero-editorial__side-head {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.18em; color: var(--rubber-black);
    text-transform: uppercase;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--steel-silver);
}
.news-hero-editorial__side-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column;
}
.news-hero-editorial__side-list li + li {
    border-top: 1px solid var(--steel-silver);
}
.nh-side-row {
    display: flex; flex-direction: column; gap: 6px;
    padding: 14px 0;
    text-decoration: none;
    color: var(--rubber-black);
}
.nh-side-row__cat {
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.12em; color: var(--fg-3);
    font-weight: 500;
    text-transform: uppercase;
}
.nh-side-row__title {
    font-family: var(--font-display); font-weight: 700;
    font-size: 14px; line-height: 1.3;
    transition: color 140ms;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Side-row title keeps its base color on hover (same rationale as .nh-card). */

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 1100px) {
    .news-hero-editorial__grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }
    .news-hero-editorial__side {
        grid-column: 1 / -1;
        border-left: 0;
        padding-left: 0;
        padding-top: 24px;
        margin-top: 8px;
        border-top: 1px solid var(--steel-silver);
    }
    .news-hero-editorial__side-list {
        display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px;
    }
    .news-hero-editorial__side-list li + li { border-top: 1px solid var(--steel-silver); }
}
@media (max-width: 800px) {
    .news-hero-editorial { padding: 15px var(--at-gutter) 24px; }
    .news-hero-editorial__head {
        grid-template-columns: 1fr;
        margin-bottom: 28px;
        padding-bottom: 18px;
    }
    .news-hero-editorial__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .news-hero-editorial__middle { grid-template-rows: auto; gap: 20px; }
    .news-hero-editorial__side-list { grid-template-columns: 1fr; }

    /* Mobile: render hero posts as rows (photo beside text), not stacked cards. */
    .nh-card,
    .nh-card--lead,
    .nh-card--middle {
        display: grid;
        grid-template-columns: 116px 1fr;
        align-items: stretch;
        height: auto;
    }
    .nh-card__photo,
    .nh-card--lead .nh-card__photo,
    .nh-card--middle .nh-card__photo {
        aspect-ratio: auto;
        height: 100%;
        min-height: 104px;
    }
    .nh-card__body { padding: 14px; gap: 6px; }
    .nh-card__title,
    .nh-card--lead .nh-card__title,
    .nh-card--middle .nh-card__title { font-size: 15px; line-height: 1.25; }
    .nh-card--lead .nh-card__excerpt { font-size: 14px; }
    /* Trim excerpts in the narrow row to keep heights even. */
    .nh-card__excerpt {
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* =============================================================
   Spotlight hover — hovering a card scales it up slightly and
   scales the siblings down + dims them. Uses `transform: scale()`
   which is purely visual (no reflow) so the grid stays frozen.

   Asymmetric timing: snappy return (200ms) feels responsive, lush
   entry (380ms) feels deliberate. Achieved by declaring a base
   transition on the card that's overridden only while the parent
   is hovered. The base transition only "wins" once scroll-reveal.js
   strips the .reveal class after the entry animation completes.
   ============================================================= */
@media (hover: hover) {
    /* Base (out) — fast snap-back */
    .nh-card, .nh-side-row, .post-card, .news-row__card {
        transform-origin: center center;
    }
    /* Scope each spotlight to its own sub-section using `:has()` so:
       - hovering a lead/middle .nh-card only dims other lead/middle cards
         (side list stays full opacity)
       - hovering a side row only dims other side rows (lead/middle untouched)
       - swiper rows + feed grid each scope to themselves */
    .news-hero-editorial__grid:has(.nh-card:hover) .nh-card,
    .news-hero-editorial__side-list:has(.nh-side-row:hover) .nh-side-row,
    .news-row__track:has(.news-row__card:hover) .news-row__card,
    .news-grid:has(.post-card:hover) .post-card {
        transition: opacity 320ms cubic-bezier(.22,.61,.36,1),
                    transform 320ms cubic-bezier(.22,.61,.36,1),
                    box-shadow 320ms cubic-bezier(.22,.61,.36,1) !important;
        will-change: transform, opacity;
    }
    /* Hovered card: subtle zoom-in. Combines with the element's own
       translateY lift where one exists. */
    .news-hero-editorial__grid:has(.nh-card:hover) .nh-card:hover,
    .news-grid:has(.post-card:hover) .post-card:hover {
        transform: translateY(-2px) scale(1.03);
        z-index: 2;
    }
    /* Swiper cards use a gentler scale and stay anchored to center so the
       row doesn't appear to drift sideways. */
    .news-row__track:has(.news-row__card:hover) .news-row__card:hover {
        transform: translateY(-2px) scale(1.02);
        z-index: 2;
    }
    .news-hero-editorial__side-list:has(.nh-side-row:hover) .nh-side-row:hover {
        transform: scale(1.02);
        z-index: 2;
    }
    /* Siblings within the same sub-section: dim + slight zoom-out */
    .news-hero-editorial__grid:has(.nh-card:hover) .nh-card:not(:hover),
    .news-grid:has(.post-card:hover) .post-card:not(:hover) {
        opacity: 0.5;
        transform: scale(0.97);
    }
    .news-row__track:has(.news-row__card:hover) .news-row__card:not(:hover) {
        opacity: 0.55;
        transform: scale(0.98);
    }
    .news-hero-editorial__side-list:has(.nh-side-row:hover) .nh-side-row:not(:hover) {
        opacity: 0.5;
        transform: scale(0.98);
    }
}

/* ============================================================
   Per-category counter chip — small muted badge appended to
   each .at-radio-pill in the topics list / sibling chip strip.
   Inherits color from the pill so it flips on .is-active.
   ============================================================ */
.at-radio-pill__count {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 6px;
    /* Square at single digit (looks circular), grows naturally with content
       for 2–3 digit counts. No min-width override that would stretch "1". */
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    font-family: var(--font-mono);
    font-size: 9.5px; font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: currentColor;
    opacity: 0.7;
    box-sizing: border-box;
    transition: background-color 140ms, opacity 140ms;
}
.at-radio-pill:hover .at-radio-pill__count { opacity: 0.9; }
.at-radio-pill.is-active .at-radio-pill__count {
    background: rgba(255, 255, 255, 0.18);
    opacity: 1;
}

/* Level-2 sub-filter row on category archives — sits directly under
   the top-level chip strip with a tighter rhythm and a subtle inset
   so it visually reads as "drilling into" the active branch. */
.news-filters--sub {
    margin-top: -4px;
    margin-bottom: 22px;
    padding-top: 12px;
    border-top: 1px dashed var(--steel-silver);
}
.news-filters--sub .news-filters__label {
    color: var(--rubber-black);
    font-weight: 500;
}
