/* ============================================================================
   Lifehaki — Awards ("the awards record" design system).
   Desktop layout/spacing/colour live inline in templates/awards/*.php (an
   exact port of the design, same convention as the staff page). This file
   only carries what inline styles can't: the page shell, hover/focus states,
   filter-rail states and the mobile layout. Scoped to body.lh-ds-awards.
   ========================================================================== */

body.lh-ds-awards { background: #ffffff; }
body.lh-ds-awards ::selection { background: #fdc949; color: #15171c; }

.lh-ds-awards .aw { font-family: 'Urbanist', system-ui, sans-serif; color: #20242b; overflow-x: hidden; }
/* The analyse panel carries an inline `display:grid` (desktop layout lives
   inline on this page), which outranks the UA stylesheet's [hidden]{display:none}
   and leaves it open on load. Author-level !important is the fix. */
.lh-ds-awards .aw [hidden] { display: none !important; }
.lh-ds-awards .aw-wrap { max-width: 1440px; margin: 0 auto; }
.lh-ds-awards .aw a { text-decoration: none; }

.lh-ds-awards .aw-draftbar {
    background: #15171c; color: #fdc949; text-align: center;
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
    padding: 9px 16px;
}

/* The one accented phrase in a headline — see award_accent() in helpers.php. */
.lh-ds-awards .aw-accent { color: #ca2128; font-style: italic; }

/* ── /awards index cards ──────────────────────────────────────────────── */
.lh-ds-awards .aw-edcard { transition: transform .22s cubic-bezier(.16,1,.3,1), border-color .22s ease, box-shadow .22s ease; }
.lh-ds-awards .aw-edcard:hover {
    transform: translateY(-3px);
    border-color: #ca2128;
    box-shadow: 0 14px 30px rgba(21,23,40,.10);
}
.lh-ds-awards .aw-feature:hover .aw-lede-h { color: #ca2128; }
.lh-ds-awards .aw-feature .aw-lede-h { transition: color .16s ease; }

/* ── links inside editorial copy ──────────────────────────────────────── */
.lh-ds-awards .aw-link,
.lh-ds-awards .aw-haul-name a { color: inherit; transition: color .14s ease; }
.lh-ds-awards .aw-link:hover,
.lh-ds-awards .aw-haul-name a:hover { color: #ca2128; }

.lh-ds-awards .aw-logo { transition: opacity .16s ease; }
.lh-ds-awards .aw-logo:hover { opacity: .72; }

.lh-ds-awards .aw-btn { transition: background .16s ease, transform .16s ease; }
.lh-ds-awards .aw-btn:hover { background: #a81a20 !important; transform: translateY(-2px); }

/* ── stat strip: kill the trailing divider ────────────────────────────── */
.lh-ds-awards .aw-stat:last-child { border-right: none !important; }

/* ── haul chart ───────────────────────────────────────────────────────── */
.lh-ds-awards .aw-haul-row { transition: background .14s ease; }
.lh-ds-awards .aw-haul-row:hover { background: #faf9fd; }

/* ── filter rail ──────────────────────────────────────────────────────── */
.lh-ds-awards .aw-group {
    background: transparent; border: none; cursor: pointer;
    border-bottom: 2.5px solid transparent; color: #8a909c;
    transition: color .14s ease, border-color .14s ease;
}
.lh-ds-awards .aw-group:hover { color: #ca2128; }
.lh-ds-awards .aw-group.is-active { color: #15171c; border-bottom-color: #ca2128; }

.lh-ds-awards .aw-year { transition: color .14s ease; }
.lh-ds-awards .aw-year:hover { color: #ca2128 !important; }

.lh-ds-awards .aw-search input::placeholder { color: #9aa0ab; }
.lh-ds-awards .aw-search:focus-within { border-bottom-color: #ca2128 !important; }
.lh-ds-awards .aw-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.lh-ds-awards #aw-reset:hover,
.lh-ds-awards .aw-toggle:hover { color: #a81a20; }

/* ── category slate ───────────────────────────────────────────────────── */
.lh-ds-awards .aw-cat:last-of-type { border-bottom: none !important; }

.lh-ds-awards .aw-tile--win { transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease; }
.lh-ds-awards a.aw-tile--win:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(21,23,40,.24) !important;
}

.lh-ds-awards .aw-nom {
    display: block; color: inherit;
    transition: transform .24s cubic-bezier(.16,1,.3,1);
}
.lh-ds-awards a.aw-nom:hover { transform: translateY(-3px); }
.lh-ds-awards a.aw-nom:hover .aw-tile img { filter: saturate(1) brightness(1) !important; }

/* Keyboard parity with the hover affordances above. */
.lh-ds-awards .aw a:focus-visible,
.lh-ds-awards .aw button:focus-visible {
    outline: 2px solid #ca2128;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Motion opt-out. */
@media (prefers-reduced-motion: reduce) {
    .lh-ds-awards .aw *, .lh-ds-awards .aw *::before, .lh-ds-awards .aw *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
    .lh-ds-awards a.aw-nom:hover,
    .lh-ds-awards a.aw-tile--win:hover,
    .lh-ds-awards .aw-btn:hover { transform: none !important; }
}

/* ============================================================================
   TABLET — 1080px and down
   ========================================================================== */
@media (max-width: 1080px) {
    .lh-ds-awards .aw-wrap { padding-left: 32px !important; padding-right: 32px !important; }
    .lh-ds-awards .aw-h1 { font-size: 60px !important; }
    .lh-ds-awards .aw-nom-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .lh-ds-awards .aw-analysis { grid-template-columns: 1fr !important; gap: 24px !important; }
    .lh-ds-awards .aw-haul-row { grid-template-columns: 44px 1fr 150px 88px 84px !important; gap: 14px !important; }
    .lh-ds-awards .aw-feature { gap: 28px !important; }
}

/* ============================================================================
   MOBILE — 900px and down
   ========================================================================== */
@media (max-width: 900px) {
    .lh-ds-awards .aw-feature { grid-template-columns: 1fr !important; gap: 24px !important; }
    .lh-ds-awards .aw-lede { grid-template-columns: 1fr !important; gap: 28px !important; }
    .lh-ds-awards .aw-lede > div:first-child { grid-column: auto !important; }
    .lh-ds-awards .aw-cols { columns: 1 !important; column-rule: none !important; }
    .lh-ds-awards .aw-cat-body { grid-template-columns: 1fr !important; gap: 24px !important; }

    /* The winner card is a full-bleed 2:3 poster on desktop; on a phone that
       eats the fold, so it becomes a side-by-side identity row. */
    .lh-ds-awards .aw-winner { display: grid; grid-template-columns: 132px minmax(0,1fr); gap: 18px; align-items: center; }
    .lh-ds-awards .aw-winner > div,
    .lh-ds-awards .aw-winner > span { grid-column: 2; margin-top: 0 !important; margin-bottom: 4px !important; }
    .lh-ds-awards .aw-tile--win { grid-row: 1 / span 4; grid-column: 1; margin: 0; }
    .lh-ds-awards .aw-tile--win > span:last-child { display: none; }
    .lh-ds-awards .aw-badge { top: 8px !important; left: 8px !important; padding: 3px 8px !important; }
    .lh-ds-awards .aw-badge span { font-size: 10px !important; }

    /* Once the winner is a row, the nominee grid has to stop being a grid too:
       a 3-up grid here would make each nominee WIDER than the winner tile and
       invert the hierarchy. Fixed-width cards in a snap slider keep every
       nominee smaller than the winner at any viewport. */
    /* Grid items default to min-width:auto, so the scroll container would size
       to its content and stretch the column instead of overflowing (the page's
       overflow-x:hidden then silently clips the cards). min-width:0 is what
       actually lets the strip scroll. */
    .lh-ds-awards .aw-cat-body > div { min-width: 0; }
    .lh-ds-awards .aw-nom-grid {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 12px !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    .lh-ds-awards .aw-nom-grid::-webkit-scrollbar { display: none; }
    .lh-ds-awards .aw-nom { flex: 0 0 118px; scroll-snap-align: start; }
}

/* ============================================================================
   MOBILE — 640px and down
   ========================================================================== */
@media (max-width: 640px) {
    .lh-ds-awards .aw-wrap { padding-left: 18px !important; padding-right: 18px !important; }

    /* masthead */
    .lh-ds-awards .aw-masthead .aw-wrap { padding-top: 26px !important; }
    .lh-ds-awards .aw-h1 { font-size: 36px !important; line-height: .96 !important; letter-spacing: -.02em !important; }
    .lh-ds-awards .aw-dek { font-size: 16px !important; }
    .lh-ds-awards .aw-meta { font-size: 12px !important; letter-spacing: .12em !important; }
    .lh-ds-awards .aw-rule span:first-child,
    .lh-ds-awards .aw-rule span:last-child { width: 28px !important; }

    /* stats → 2×2 */
    .lh-ds-awards .aw-stats { display: grid !important; grid-template-columns: 1fr 1fr !important; }
    .lh-ds-awards .aw-stat { border-right: none !important; border-bottom: 1px solid #dfe0e8; padding: 14px 8px !important; }
    .lh-ds-awards .aw-stat:nth-child(odd) { border-right: 1px solid #dfe0e8 !important; }
    .lh-ds-awards .aw-stat div:first-child { font-size: 21px !important; }

    /* lede */
    .lh-ds-awards .aw-lede-h { font-size: 27px !important; }

    /* haul chart → rank + name + counts; pips move under the name */
    .lh-ds-awards .aw-legend { display: none; }
    .lh-ds-awards .aw-haul-row {
        grid-template-columns: 34px minmax(0,1fr) auto !important;
        gap: 4px 12px !important;
        padding: 13px 2px !important;
    }
    .lh-ds-awards .aw-haul-name { font-size: 17px !important; }
    .lh-ds-awards .aw-pips { grid-column: 2 / -1; grid-row: 2; }
    .lh-ds-awards .aw-haul-w { grid-column: 3; grid-row: 1; font-size: 13px !important; }
    .lh-ds-awards .aw-haul-n { grid-column: 3; grid-row: 2; font-size: 12px !important; }

    /* filter rail → scrolling group strip + full-width search */
    .lh-ds-awards .aw-rail-inner { padding: 12px 18px !important; gap: 12px !important; }
    .lh-ds-awards .aw-rail-sep, .lh-ds-awards .aw-rail-spacer { display: none !important; }
    .lh-ds-awards .aw-rail-years { width: 100%; overflow-x: auto; scrollbar-width: none; }
    .lh-ds-awards .aw-rail-years::-webkit-scrollbar { display: none; }
    .lh-ds-awards .aw-rail-groups {
        width: 100%; flex-wrap: nowrap !important; overflow-x: auto;
        gap: 14px !important; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .lh-ds-awards .aw-rail-groups::-webkit-scrollbar { display: none; }
    .lh-ds-awards .aw-group { white-space: nowrap; font-size: 14px !important; }
    .lh-ds-awards .aw-search { width: 100% !important; order: 5; }
    .lh-ds-awards .aw-winonly { order: 4; }

    /* categories */
    .lh-ds-awards .aw-cat { padding: 24px 0 22px !important; }
    .lh-ds-awards .aw-cat-head { flex-wrap: wrap; gap: 10px !important; align-items: flex-end !important; }
    .lh-ds-awards .aw-cat-head h3 { font-size: 23px !important; }
    /* Winner keeps a deliberately larger tile than the nominee thumbs below —
       on a phone the size difference is the only thing carrying the hierarchy
       the desktop layout gets from the 300px column. */
    .lh-ds-awards .aw-winner { grid-template-columns: 140px minmax(0,1fr); gap: 14px; }
    .lh-ds-awards .aw-winner > div:nth-of-type(2) { font-size: 19px !important; }

    /* Slider (set up at 900px) narrows to exactly 3 across.
       ponytail: negative margin + matching padding bleeds the strip to the
       screen edge so card 4 is visibly clipped — that sliver IS the scroll
       affordance, no arrows or dots needed. */
    .lh-ds-awards .aw-nom-grid {
        margin: 0 -18px;
        padding: 2px 18px 8px;
        scroll-padding-left: 18px;
    }
    /* 3-up on any real phone (320–470px). The max-width is the guardrail: past
       ~470px a third of the row would exceed the 140px winner tile and invert
       the hierarchy, so cards cap there and a 4th slides into view instead. */
    .lh-ds-awards .aw-nom { flex: 0 0 calc((100% - 24px) / 3); max-width: 126px; }
    .lh-ds-awards .aw-nom > div:nth-of-type(2) { font-size: 13px !important; }
    .lh-ds-awards .aw-feature > div:last-child { border-left: none !important; border-top: 2px solid #15171c; padding: 18px 0 0 !important; }

    /* archive */
    .lh-ds-awards .aw-archive { flex-direction: column; align-items: flex-start !important; gap: 12px !important; padding: 26px 0 !important; }
    .lh-ds-awards .aw-archive-year { font-size: 76px !important; }
    .lh-ds-awards .aw-archive h3 { font-size: 26px !important; }

    /* cta */
    .lh-ds-awards .aw-cta .aw-wrap { padding: 40px 18px !important; }
    .lh-ds-awards .aw-cta h3 { font-size: 27px !important; }
}
