/* trail overview (trail/display/trail.php + trail/blocks/*), loaded only on that page: the same blocks in the same order, restyled as cards to match the route page. The --tft-* tokens live in trailforks.css.
   Loaded before _common-min.css, so every rule is scoped under .page_trail to win on specificity */

.page_trail #trail_area1,
.page_trail #trail_area2 { color: var(--tft-ink); }

.page_trail #basicTrailStats .large,
.page_trail #recent_ridelog_activity .large { font-variant-numeric: tabular-nums; }

/* section headings: one size and weight for every block on the page */
.page_trail #trail_area1 h2.h3,
.page_trail #trail_area1 h3,
.page_trail #trail_area1 h3.h5,
.page_trail #trail_area2 h2.h3,
.page_trail #trail_area2 h3,
.page_trail .faq-trail h2.h3,
.page_trail .hit-the-trail > h3 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tft-ink);
    text-shadow: none;
}
.page_trail #trail_area1 h3 a,
.page_trail #trail_area2 h3 a,
.page_trail #trail_area2 h3.grey { color: var(--tft-ink); }
.page_trail #trail_area1 .block,
.page_trail #trail_area2 .block { margin-bottom: 24px; }

/* stats: a card with the main four on top and the extra stats as a tinted band under them */
.page_trail #basicTrailStats {
    padding: 0;
    margin-bottom: 20px !important;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
    overflow: hidden;
}
.page_trail #basicTrailStats > .padded10 { padding: 11px 8px 10px; }
.page_trail #basicTrailStats .large {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--tft-ink);
}
.page_trail #basicTrailStats .small.grey {
    margin-top: 1px;
    font-size: 13px;
    color: var(--tft-muted);
}
.page_trail #moreTrailStats {
    padding: 4px 8px 14px;
    border-top: 1px solid var(--tft-rule);
    background: var(--tft-ground);
}
.page_trail #moreTrailStats .large { font-size: 15px; }
.page_trail #toggleMoreStats {
    display: block;
    width: 100%;
    margin: 0;
    padding: 4px 8px;
    border: 0;
    background: none;
    font-family: inherit;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    color: #006784;
}
/* chevron after the label, flipped while the extra stats are open */
.page_trail #toggleMoreStats::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 0 3px 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    vertical-align: middle;
}
.page_trail #toggleMoreStats.is-open::after {
    margin-bottom: -1px;
    transform: rotate(-135deg);
}
.page_trail #toggleMoreStats:hover { background: var(--tft-ground); }

/* elevation chart sits in its own card under the stats */
.page_trail .trail-left .elevationchart,
.page_trail .trail-left #__elevation_chart_target__0 {
    margin-bottom: 20px;
    padding: 12px 16px;
    box-sizing: border-box;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
}

/* details: full width two-column key/value card, description under it */
.page_trail #trail_details {
    float: none !important;
    max-width: none;
    min-width: 0;
    margin: 0 0 16px;
}
.page_trail #trail_details > .block { margin-bottom: 0; }
.page_trail #traildetails_display {
    padding: 6px 16px 10px;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
    columns: 2 220px;
    column-gap: 28px;
}
.page_trail #traildetails_display > li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 7px 0;
    border-bottom: 1px solid var(--tft-rule-soft);
    font-size: 13.5px;
    break-inside: avoid;
}
.page_trail #traildetails_display > li:hover { background: none; }
/* the rows carry .clearfix, whose ::after would be a third flex item and pull the values off the right edge */
.page_trail #traildetails_display > li::after { content: none; }
.page_trail #traildetails_display .term,
.page_trail #traildetails_display .definition {
    float: none;
    width: auto;
}
.page_trail #traildetails_display .term { color: var(--tft-muted); }
/* "in Mountain Biking" and the [+] expanders were light grey on white */
.page_trail #traildetails_display .definition .grey2 {
    font-weight: 400;
    color: var(--tft-muted);
}
/* activities past the first 3, until the "+N more" chip opens them */
.page_trail #traildetails_display li.tf-act-more.none { display: none; }
.page_trail #traildetails_display .term:after { content: none; }
.page_trail #traildetails_display .definition {
    font-weight: 700;
    text-align: right;
}
.page_trail #trail_description_container { padding-top: 0 !important; }
.page_trail #trail_description {
    max-width: 68ch;
    font-size: 15px;
    line-height: 1.6;
}

/* supporters, association and the other people/org blocks become side-by-side cards */
.page_trail #maintainers,
.page_trail #local_association,
.page_trail #trail_info2 > .block:has(> ul.makecols2) {
    padding: 14px 16px;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
}
.page_trail #maintainers { margin-bottom: 16px !important; }
.page_trail #maintainers h3.h5,
.page_trail #local_association h3.h5,
.page_trail #trail_info2 > .block > h3.h5 {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--tft-muted);
}

/* the floated Check-in button gets its own row instead of pushing the "All" card down */
.page_trail #recent_ridelog_activity > .floatright { margin-bottom: 10px; }
.page_trail #recent_ridelog_activity > .block { clear: both; }

/* trail reports: a divided list instead of a boxed table, under the "update" button */
.page_trail #recent_reports > .button1 { margin-bottom: 10px; }
.page_trail #recent_reports .boxcontent { clear: both; }
.page_trail #recent_reports .boxcontent table { width: 100%; border-collapse: collapse; }
.page_trail #recent_reports .boxcontent tr { border-top: 1px solid var(--tft-rule-soft); }
.page_trail #recent_reports .boxcontent td { padding: 10px 6px; vertical-align: top; }

/* Trail Outlook keeps its own component, framed like the other cards */
.page_trail #trail_area1 .tf-rw--trail {
    padding: 16px;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: var(--tft-ground);
}

/* status, Trail Outlook and rating as a row of equal cards */
.page_trail .trailbuttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px !important;
}
.page_trail .trailbuttons::after { content: none; }
.page_trail .trailbuttons > .col-3,
.page_trail .trailbuttons:has(.tf-rw-hcol) > .col-3 {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
}

/* View larger map and 3D Tour sit in the map's bottom right corner, as on the route page; the
   map bar's own "Open in map" repeats View larger map */
.page_trail .mapcontainer {
    position: relative;
    margin-bottom: 20px;
}
/* the map's own bottom margin sat inside the container and pushed the buttons below its edge */
.page_trail .mapcontainer .map { margin-bottom: 0; }
.page_trail .tf-trail-mapbtns {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: flex;
    gap: 8px;
}
.page_trail .tf-trail-mapbtns .button1 {
    margin: 0;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, .25);
}
.page_trail .mapcontainer .tf-mapctl__openmap,
.page_trail .mapcontainer .tf-mapctl__menu li:has(> [data-tfmapctl-openmap]) { display: none !important; }

/* jQuery UI dialogs and their overlay sit above the site header (.tfnh is 1000, core .ui-front is 900),
   centred in CSS so dialogs that grow after their content loads (Save, Check-in) stay centred */
.page_trail .ui-front { z-index: 1010; }
.page_trail .ui-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    max-width: calc(100vw - 16px);
    transform: translate(-50%, -50%);
}
/* !important: jQuery UI writes an inline max-height: none */
.page_trail .ui-dialog .ui-dialog-content {
    max-height: calc(100vh - 80px) !important;
    max-height: calc(100dvh - 80px) !important;
    overflow-x: hidden;
    overflow-y: auto;
}

/* map, photos and videos: rounded to the same radius as the cards */
.page_trail #trail_area1 .mapcontainer,
.page_trail #trail_area1 .mapcontainer .map {
    border-radius: var(--tft-radius);
    overflow: hidden;
}
.page_trail #trail_area1 .photogrid .thumb img,
.page_trail #trail_area1 .uPhotoSmall img,
.page_trail #trail_area1 .videothumb img { border-radius: 8px; }

/* box titles from shared blocks (videos, routes): plain heading with the "more" link on the right */
.page_trail #trail_area1 .boxtitle,
.page_trail #trail_area2 .boxtitle {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
    background: none;
}
.page_trail #trail_area1 .boxtitle .more,
.page_trail #trail_area2 .boxtitle .more {
    font-size: 13px;
    font-weight: 600;
}

/* second row: route cards, nearby trails and region links */
.page_trail #trail_area2 .route-card {
    margin-bottom: 10px !important;
    padding: 10px !important;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
}
.page_trail #trail_area2 .route-card .grid-image img { border-radius: 8px; }
.page_trail #trail_area2 > .col-6.last > .clearfix > .col-6 > .block {
    padding: 14px 16px;
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
}
.page_trail #trail_area2 > .col-6.last > .clearfix > .col-6 > .block li {
    padding: 7px 0;
    border-bottom: 1px solid var(--tft-rule-soft);
}
.page_trail #trail_area2 > .col-6.last > .clearfix > .col-6 > .block li:last-child { border-bottom: 0; }
/* the region links were light grey on white, under AA contrast */
.page_trail #trail_area2 > .col-6.last > .clearfix > .col-6 > .block ul.grey2 a { color: #006784; }
.page_trail #trail_area2 {
    padding-top: 24px;
    border-top: 1px solid var(--tft-rule);
}

/* FAQ: plain divided list, Hit the trail as three cards */
.page_trail .faq-trail .faq-item { border-top: 1px solid var(--tft-rule); }
.page_trail .hit-the-trail .card.box1 {
    border: 1px solid var(--tft-rule);
    border-radius: var(--tft-radius);
    background: #fff;
}
.page_trail .hit-the-trail .card.box1:hover { border-color: #c9cfc6; }

/* phones: the cards keep their frames, the second row loses its rule above */
@media (max-width: 800px) {
    .page_trail #trail_area2 {
        padding-top: 0;
        border-top: 0;
    }
    .page_trail #traildetails_display { columns: 1; }
}

/* screen-reader text for icon-only status */
.page_trail .tf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* opaque30 grey fell to 1.5:1 on white; keep the muted tone readable */
.page_trail .trailbuttons .opaque30,
.page_trail .tf-rw-hcard .opaque30,
.page_trail .checkinLink {
    opacity: 1;
    color: var(--tft-muted);
}
.page_trail .tf-trail-coords { color: var(--tft-muted); }

/* phones: three cards don't fit in a row, so the rating takes the full width instead of sitting alone */
@media (max-width: 480px) {
    .page_trail .trailbuttons .tf-rw-hcol + .col-3 { grid-column: 1 / -1; }
}

/* logged out: the rendered map image under a sign-up card (trail/blocks/map_signup.php), as on the route page */
.page_trail .tf-trail-mapgate {
    height: 340px;
    background: #eef1ea;
}
.page_trail .tf-trail-mapgate__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page_trail .tf-trail-mapgate__card {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: min(380px, calc(100% - 32px));
    box-sizing: border-box;
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    text-align: center;
    transform: translate(-50%, -50%);
}
.page_trail .tf-trail-mapgate .tf-trail-mapgate__title {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-wrap: balance;
    color: var(--tft-ink);
}
.page_trail .tf-trail-mapgate__text {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--tft-muted);
}
.page_trail .tf-trail-mapgate__buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.page_trail .tf-trail-mapgate__buttons .button1 {
    min-width: 96px;
    margin: 0;
    text-align: center;
}

/* page header (trail/blocks/header.php), matching the route page's .tf-route-head */
.page_trail .tf-trail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 20px;
    margin: 14px 0 4px;
}
.page_trail .tf-trail-head__main {
    flex: 999 1 480px;
    min-width: 0;
}
.page_trail .tf-trail-head__title {
    margin: 0;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 800;
    font-size: 38px;
    line-height: 1.12;
    letter-spacing: -.01em;
    color: #1c1d1f;
    text-wrap: balance;
}
.page_trail .tf-trail-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}
.page_trail .tf-trail-head__diff {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
}
.page_trail .tf-trail-head__dot { color: #999; }
.page_trail .tf-trail-head #title_below { margin-top: 8px; }
/* responsive.css still styles this id as the old full-width phone dropdown */
.page_trail #trailUserActionsDropdown.tf-trail-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
}
.page_trail .tf-trail-head__actions .button1 { margin: 0; }
.page_trail #page_title_right.tf-trail-head__side {
    float: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
}
.page_trail .tf-trail-head #trailAssociationLogo,
.page_trail .tf-trail-head #bikeparkLogo { position: static; }

@media (max-width: 767px) {
    .page_trail .tf-trail-head__title { font-size: 26px; }
    .page_trail #page_title_right.tf-trail-head__side {
        align-items: stretch;
        width: 100%;
    }
    .page_trail #trailUserActionsDropdown.tf-trail-head__actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }
    .page_trail .tf-trail-head__actions .button1 {
        width: 100%;
        padding-left: 4px;
        padding-right: 4px;
        box-sizing: border-box;
        text-align: center;
    }
}

/* the elevation chart without its horizontal gridlines; the y labels still give the scale */
.page_trail .elevationchart path.domain-line { display: none; }
