/* Route page: cinematic hero, pill section navigation and a readable "who completed it" proof line.
   Loaded after the legacy route-detail layers, so selectors are deliberately specific. */

/* ---------- Hero ---------- */

html body.page-site-redesign.page-route-detail .route-detail-hero-card {
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-media {
    position: relative !important;
    isolation: isolate !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    min-height: clamp(440px, 64svh, 560px) !important;
    padding: 76px 18px 22px !important;
    overflow: hidden !important;
    border-radius: 0 0 32px 32px !important;
    background: #0d1512 !important;
    box-shadow: 0 24px 60px rgba(8, 14, 12, .28) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-media .route-detail-hero-image {
    position: absolute !important;
    inset: 0 !important;
    z-index: -2 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 45% !important;
    transform: scale(1.03) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-media::after {
    position: absolute !important;
    inset: 0 !important;
    z-index: -1 !important;
    content: "" !important;
    pointer-events: none !important;
    background:
        linear-gradient(180deg, rgba(5, 10, 12, .6) 0%, rgba(5, 10, 12, 0) 24%),
        linear-gradient(180deg, rgba(5, 10, 12, 0) 34%, rgba(5, 10, 12, .5) 62%, rgba(5, 10, 12, .92) 100%) !important;
}

/* Chips: one quiet scrolling row under the floating menu button. */
html body.page-site-redesign.page-route-detail .route-detail-hero-chips {
    position: absolute !important;
    z-index: 4 !important;
    top: 68px !important;
    margin: 0 !important;
    right: 0 !important;
    left: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    max-width: none !important;
    padding: 2px 18px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-chips::-webkit-scrollbar {
    display: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-chip,
html body.page-site-redesign.page-route-detail .route-detail-hero-chip--source-user {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 0 13px !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.4) !important;
    backdrop-filter: blur(14px) saturate(1.4) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-chip--source-official {
    border-color: rgba(255, 160, 110, .45) !important;
    background: rgba(255, 103, 29, .3) !important;
}

/* Freshness: a small status pill that leads into the title. */
html body.page-site-redesign.page-route-detail .route-detail-hero-freshness {
    position: static !important;
    align-self: flex-start !important;
    max-width: 100% !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-freshness .route-completion-freshness {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 2px 6px !important;
    min-height: 32px !important;
    padding: 6px 14px !important;
    border: 1px solid rgba(255, 255, 255, .2) !important;
    border-radius: 18px !important;
    background: rgba(9, 17, 22, .5) !important;
    color: #fff !important;
    font-size: 12.5px !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
}

/* Copy sits straight on the photo: no panel, just type and tiles. */
html body.page-site-redesign.page-route-detail .route-detail-hero-copy {
    position: static !important;
    inset: auto !important;
    max-width: 920px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-title {
    margin: 0 !important;
    color: #fff !important;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .45) !important;
    letter-spacing: -.035em !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-title__primary {
    display: block !important;
    font-size: clamp(30px, 8.3vw, 35px) !important;
    font-weight: 900 !important;
    line-height: 1.04 !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-title__secondary {
    display: block !important;
    margin-top: 4px !important;
    color: rgba(255, 255, 255, .9) !important;
    font-size: clamp(18px, 5vw, 21px) !important;
    font-weight: 650 !important;
    line-height: 1.15 !important;
    letter-spacing: -.02em !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-description {
    display: none !important;
}

/* Key numbers: four glass tiles. */
html body.page-site-redesign.page-route-detail .route-detail-hero-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 16px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-stat {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .12) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.4) !important;
    backdrop-filter: blur(16px) saturate(1.4) !important;
    text-align: left !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-stat__icon {
    display: grid !important;
    flex: 0 0 34px !important;
    place-items: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, .16) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-stat__icon img {
    width: 18px !important;
    height: 18px !important;
    filter: brightness(0) invert(1) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-stat dt {
    color: rgba(255, 255, 255, .72) !important;
    font-size: 11.5px !important;
    font-weight: 650 !important;
    line-height: 1.2 !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-stat dd {
    margin: 2px 0 0 !important;
    color: #fff !important;
    font-size: 17px !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    letter-spacing: -.01em !important;
}

/* Actions: one dominant button, then supporting pills. */
html body.page-site-redesign.page-route-detail .route-detail-hero-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 14px 0 0 !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    min-height: 50px !important;
    padding: 0 18px !important;
    border: 1px solid rgba(255, 255, 255, .24) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: blur(14px) !important;
    backdrop-filter: blur(14px) !important;
    transition: background-color .2s ease, transform .2s ease, border-color .2s ease !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action img,
html body.page-site-redesign.page-route-detail .route-detail-hero-action svg:not(.route-detail-download__chevron) {
    width: 18px !important;
    height: 18px !important;
    filter: brightness(0) invert(1) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action svg {
    color: #fff !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action:hover {
    border-color: rgba(255, 255, 255, .5) !important;
    background: rgba(255, 255, 255, .24) !important;
    color: #fff !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action:active {
    transform: scale(.98) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action--primary {
    grid-column: 1 / -1 !important;
    min-height: 56px !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, #ff7f3f 0%, #ff5512 100%) !important;
    font-size: 16px !important;
    box-shadow: 0 14px 30px rgba(255, 85, 18, .42) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action--primary:hover {
    background: linear-gradient(135deg, #ff8a4e 0%, #ff6020 100%) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action--completion {
    grid-column: 1 / -1 !important;
    min-height: 46px !important;
    border-color: transparent !important;
    background: transparent !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-action--completion:hover {
    border-color: rgba(255, 255, 255, .3) !important;
    background: rgba(255, 255, 255, .1) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-actions .route-detail-download {
    min-width: 0 !important;
}

html body.page-site-redesign.page-route-detail .route-detail-hero-actions .route-detail-download > summary {
    width: 100% !important;
}

/* The hero card clips its overflow and the actions sit at its bottom edge,
   so the download menu opens upwards, over the photo. */
html body.page-site-redesign.page-route-detail .route-detail-hero-actions .route-detail-download__menu {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
}

/* ---------- Who completed it ---------- */

html body.page-site-redesign.page-route-detail .route-detail-hero-media > .route-completion-people--hero {
    position: static !important;
    align-self: flex-start !important;
    margin-top: 14px !important;
    min-height: 44px !important;
    padding: 6px 16px 6px 6px !important;
    border: 1px solid rgba(255, 255, 255, .24) !important;
    border-radius: 999px !important;
    background: rgba(9, 17, 22, .5) !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: blur(14px) !important;
    backdrop-filter: blur(14px) !important;
}

html body.page-site-redesign.page-route-detail .route-completion-people--hero .route-completion-people__avatar,
html body.page-site-redesign.page-route-detail .route-completion-people--hero .route-completion-people__more {
    width: 32px !important;
    height: 32px !important;
    border: 2px solid rgba(255, 255, 255, .9) !important;
}

html body.page-site-redesign.page-route-detail .route-completion-people__label,
html body.page-site-redesign.page-route-detail .route-completion-people--hero .route-completion-people__label {
    display: inline !important;
    color: rgba(255, 255, 255, .88) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
}

html body.page-site-redesign.page-route-detail .route-completion-people__label b {
    color: #fff !important;
    font-weight: 900 !important;
}

html body.page-site-redesign.page-route-detail .route-completion-people--actuality .route-completion-people__label {
    color: #4b5563 !important;
}

html body.page-site-redesign.page-route-detail .route-completion-people--actuality .route-completion-people__label b {
    color: #111827 !important;
}

html[data-theme="dark"] body.page-site-redesign.page-route-detail .route-completion-people--actuality .route-completion-people__label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body.page-site-redesign.page-route-detail .route-completion-people--actuality .route-completion-people__label b {
    color: #fff !important;
}

/* ---------- Section navigation ---------- */

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav {
    position: sticky !important;
    top: 62px !important;
    z-index: 40 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: auto !important;
    margin: 14px 12px 18px !important;
    padding: 5px !important;
    overflow-x: auto !important;
    border: 1px solid rgba(17, 24, 39, .08) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .86) !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.6) !important;
    backdrop-filter: blur(20px) saturate(1.6) !important;
    scroll-snap-type: x proximity !important;
    scrollbar-width: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav::-webkit-scrollbar {
    display: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 42px !important;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #4b5563 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    scroll-snap-align: center !important;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a img {
    width: 17px !important;
    height: 17px !important;
    flex: 0 0 17px !important;
    opacity: .62 !important;
    filter: none !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a:hover {
    background: rgba(255, 103, 29, .1) !important;
    color: #c2410c !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a[aria-current="page"] {
    background: #ff671d !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(255, 103, 29, .38) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a[aria-current="page"] img {
    opacity: 1 !important;
    filter: brightness(0) invert(1) !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a:focus-visible {
    outline: 2px solid #ff671d !important;
    outline-offset: 2px !important;
}

html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a[hidden] {
    display: none !important;
}

html[data-theme="dark"] body.page-site-redesign.page-route-detail .route-detail-anchor-nav {
    border-color: rgba(255, 255, 255, .1) !important;
    background: rgba(17, 24, 32, .86) !important;
}

html[data-theme="dark"] body.page-site-redesign.page-route-detail .route-detail-anchor-nav a {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body.page-site-redesign.page-route-detail .route-detail-anchor-nav a img {
    filter: brightness(0) invert(1) !important;
    opacity: .7 !important;
}

html[data-theme="dark"] body.page-site-redesign.page-route-detail .route-detail-anchor-nav a[aria-current="page"] {
    color: #fff !important;
}

html body.page-site-redesign.page-route-detail .route-section-anchor {
    scroll-margin-top: 130px !important;
}

/* Pinned by route_detail_nav.js (position: sticky does not survive the page's overflow setup). */
html body.page-site-redesign.page-route-detail .route-detail-anchor-nav.is-pinned {
    position: fixed !important;
    top: 11px !important;
    right: 10px !important;
    left: 66px !important;
    z-index: 60 !important;
    margin: 0 !important;
}

/* ---------- Phones ---------- */

@media (max-width: 767px) {
    /* Title rides at the top, numbers and actions sit at the bottom: the cover photo shows in between. */
    html body.page-site-redesign.page-route-detail .route-detail-hero-media {
        justify-content: flex-start !important;
        min-height: clamp(580px, 84svh, 740px) !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-copy {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-stats {
        margin-top: auto !important;
        padding-top: 24px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-media::after {
        background:
            linear-gradient(180deg, rgba(5, 10, 12, .72) 0%, rgba(5, 10, 12, .38) 22%, rgba(5, 10, 12, 0) 40%),
            linear-gradient(180deg, rgba(5, 10, 12, 0) 52%, rgba(5, 10, 12, .62) 74%, rgba(5, 10, 12, .92) 100%) !important;
    }

    /* Save sits beside the main action as an icon button instead of a lone half-width pill. */
    html body.page-site-redesign.page-route-detail .route-detail-hero-actions {
        grid-template-columns: minmax(0, 1fr) 56px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-action--primary {
        grid-column: 1 !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-actions > [data-route-save-button] {
        grid-column: 2 !important;
        grid-row: 1 !important;
        width: 56px !important;
        min-width: 56px !important;
        height: 56px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-actions > [data-route-save-button] [data-save-label] {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-actions > [data-route-save-button] svg {
        width: 22px !important;
        height: 22px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-actions > [data-route-save-button][data-saved="true"] {
        border-color: transparent !important;
        background: rgba(255, 255, 255, .92) !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-actions > [data-route-save-button][data-saved="true"] svg {
        color: #ea580c !important;
        filter: none !important;
    }

    /* Chips: two that always fit (type and region); the rest live further down the page. */
    html body.page-site-redesign.page-route-detail .route-detail-hero-chips {
        top: 21px !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
        right: 14px !important;
        left: 68px !important;
        padding: 0 !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-chip--source-user,
    html body.page-site-redesign.page-route-detail .route-detail-hero-chip--source-official,
    html body.page-site-redesign.page-route-detail .route-detail-hero-chips > span.route-detail-hero-chip:last-child {
        display: none !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-chip {
        max-width: 100% !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-chip span {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Inline editing is a desktop tool. */
    html body.page-site-redesign.page-route-detail .route-admin-editor {
        display: none !important;
    }
}

/* ---------- Tablet and desktop ---------- */

@media (min-width: 768px) {
    html body.page-site-redesign.page-route-detail .route-detail-hero-media {
        min-height: 580px !important;
        padding: 96px 44px 40px !important;
        border-radius: 32px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-chips {
        top: 28px !important;
        padding: 2px 44px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-title__primary {
        font-size: clamp(44px, 4.6vw, 68px) !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-title__secondary {
        font-size: clamp(24px, 2.2vw, 32px) !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        max-width: 820px !important;
        gap: 10px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 10px !important;
        margin-top: 16px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-action--primary {
        grid-column: auto !important;
        min-width: 230px !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-action--completion {
        grid-column: auto !important;
        border-color: rgba(255, 255, 255, .24) !important;
        background: rgba(255, 255, 255, .08) !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-hero-media > .route-completion-people--hero {
        position: absolute !important;
        right: 40px !important;
        bottom: 40px !important;
        margin: 0 !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-anchor-nav.is-pinned {
        top: 84px !important;
        right: auto !important;
        left: 50% !important;
        width: fit-content !important;
        max-width: calc(100% - 48px) !important;
        transform: translateX(-50%) !important;
    }

    html body.page-site-redesign.page-route-detail .route-detail-anchor-nav {
        top: 84px !important;
        width: fit-content !important;
        max-width: 100% !important;
        margin: 18px auto 22px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body.page-site-redesign.page-route-detail .route-detail-hero-action,
    html body.page-site-redesign.page-route-detail .route-detail-anchor-nav a {
        transition: none !important;
    }
}
