/* =============================================================================
   Selected-route stage — shared component (mountain-trail contract §4k)

   The route photograph plus the selected route's identity, sitting between the
   route selector above and the route profile below.

   ARCHITECTURE
   - Exactly ONE <img> per page (.board__hero-img). Never a hidden per-route
     image collection — unselected routes' URLs live in data-stage-* on their
     route card, so they are not fetched until chosen.
   - object-fit is always `cover`. `fill` is prohibited: it stretches geometry.
   - Focal points are per-route, via --route-stage-pos-desktop /
     --route-stage-pos-mobile set on the <img> by assets/route-stage.js.

   RESPONSIVE ART DIRECTION — desktop and mobile deliberately differ.
   - Desktop: a composed two-part panel, ~67% photograph / ~33% identity panel,
     260–320px stable height. Never a shallow full-width panoramic strip.
   - Mobile (<=620px): an image-led ~4:3 card. The photograph is the subject, so
     the identity reduces to title + classification badge + status dot. The
     eyebrow and the descriptor are hidden here — the descriptor is NOT removed
     from the route data, because the desktop identity panel still renders it,
     and the four-field route summary immediately below carries the practical
     explanation on mobile.

   PAGE-SPECIFIC RULES STAY INLINE in each page: severe-route danger styling
   (e.g. Yr Wyddfa's Crib Goch), per-route focal data, and relative asset paths.
   ============================================================================= */

.board__hero {
    position: relative; margin: 0;
    border-radius: 14px; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 67fr) minmax(0, 33fr);
    min-height: 300px;
    background: #1b2b23;
    border: 1px solid rgba(228, 196, 122, 0.2);
}

.board__hero-stage { position: relative; min-width: 0; min-height: 0; }

.board__hero-img {
    display: block; position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    object-position: var(--route-stage-pos-desktop, 50% 42%);
}

/* Legibility wash — only rendered where text sits over the photograph (mobile).
   Desktop keeps the photograph clear because the identity sits beside it. */
.board__hero-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; }

/* ---- Desktop identity panel ---------------------------------------------
   Subordinate to the selector above and the profile below. Carries ONLY the
   eyebrow, route title, one route-character line and the classification badge.
   Route metrics belong to the four-field readout and the practical docket. */
.board__hero-panel {
    position: relative; z-index: 1; min-width: 0;
    display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center; gap: 3px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(23, 38, 31, 0.55) 0%, rgba(15, 26, 21, 0.92) 100%);
    border-left: 1px solid rgba(228, 196, 122, 0.2);
}

/* Route status dot. NOT decorative: pages turn it --danger for severe routes,
   so it is never hidden at any width. */
.board__hero-dot {
    flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%;
    margin-bottom: 8px;
    background: var(--gold-warm, #edb05a);
    box-shadow: 0 0 0 4px rgba(237, 176, 90, 0.24);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.board__hero-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.board__hero-eyebrow {
    color: rgba(248, 239, 216, 0.74);
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}

.board__hero-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.44rem; font-weight: 600; color: #fff6e4; line-height: 1.12;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.board__hero-terrain {
    color: rgba(248, 239, 216, 0.86);
    font-size: 0.82rem; font-style: italic;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.board__hero-grade {
    flex: 0 0 auto; align-self: flex-start; margin-top: 8px;
    padding: 4px 12px; border-radius: 999px;
    border: 1px solid rgba(228, 196, 122, 0.5);
    background: rgba(15, 26, 21, 0.5);
    color: var(--gold-bright, #f4d89f);
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* ---- Tablet — the desktop composition, reduced --------------------------- */
@media (max-width: 900px) {
    .board__hero { min-height: 260px; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); }
    .board__hero-panel { padding: 14px 16px; }
    .board__hero-name { font-size: 1.28rem; }
}

/* ---- Mobile — image-led card -------------------------------------------
   The photograph is the subject. Only title + badge + status dot are rendered
   over it: no eyebrow, no descriptor, so nothing can truncate or collide. */
@media (max-width: 620px) {
    .board__hero { display: block; min-height: 0; }
    .board__hero-stage { aspect-ratio: 4 / 3; }
    .board__hero-img { object-position: var(--route-stage-pos-mobile, 50% 42%); }

    /* Permanent gradient, only as strong as the reduced text needs. */
    .board__hero-stage::after {
        background: linear-gradient(180deg,
            rgba(15, 26, 21, 0) 44%,
            rgba(15, 26, 21, 0.40) 68%,
            rgba(15, 26, 21, 0.80) 100%);
    }

    /* Grid, not a flex row: the badge gets its own row, so it never competes
       with the title for width. */
    .board__hero-panel {
        position: absolute; inset: auto 0 0 0;
        display: grid; grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "dot title" ".   badge";
        gap: 0 11px; align-items: start;
        padding: 14px 16px; background: none; border-left: 0;
    }
    .board__hero-dot   { grid-area: dot; margin: 6px 0 0; }
    .board__hero-text  { grid-area: title; }
    .board__hero-grade { grid-area: badge; justify-self: start; align-self: start; margin: 9px 0 0; }

    /* Hidden on mobile only — still rendered in the desktop identity panel,
       and still present in the route data. */
    .board__hero-eyebrow,
    .board__hero-terrain { display: none; }

    /* Title: at most two lines, down to the narrowest supported width. */
    .board__hero-name {
        font-size: clamp(1.02rem, 4.6vw, 1.26rem);
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
        overflow: hidden;
    }
}

/* ---- Very narrow phones (<=360px) --------------------------------------
   Route names and classifications are FACTS and must not be shortened, so the
   component gives them room instead. Without this, real content clips at 320px:
   "Longest · gentlest gradient" / "Scramble · exposed ridge" overflow a nowrap
   badge, and "Sychnant, Alltwen & Penmaen-bach Circular" truncates at 2 lines.
   Scoped below 360px so the verified 390px composition is unchanged. */
@media (max-width: 360px) {
    /* The badge may wrap rather than be clipped — a clipped classification is
       worse than a two-line pill. */
    .board__hero-grade {
        white-space: normal;
        font-size: 0.58rem; padding: 4px 10px; line-height: 1.3;
        letter-spacing: 0.08em;
    }
    /* The longest real route name — "Sychnant, Alltwen & Penmaen-bach Circular" —
       measures ~336px, so at 320px the title box needs both a smaller face and
       reclaimed width to hold it in two lines without truncating. */
    .board__hero-name { font-size: clamp(0.78rem, 4.1vw, 0.92rem); }
    .board__hero-panel { padding: 11px 11px; gap: 0 8px; }
    .board__hero-dot { width: 10px; height: 10px; box-shadow: 0 0 0 3px rgba(237, 176, 90, 0.24); }
}
