/* ── Fonts (self-hosted; see base.html) ────────────────────────────── */
/* Variable fonts: one file per subset covers the whole 400–700 weight range.
   Self-hosted instead of Google's CDN so no visitor IP is sent to Google
   (GDPR). To update: re-download the woff2 from Google Fonts and replace the
   files in static/fonts/. */
@font-face {
    font-family: 'Host Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/host-grotesk-latin.565b7019ea62.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Host Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/host-grotesk-latin-ext.179806adc75a.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Miriam Libre';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/miriam-libre-latin.62e09b134c77.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Miriam Libre';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/miriam-libre-latin-ext.c8cdf2b748b3.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
    --color-dark:     #0F2420;
    --color-teal:     #4A7A6B;
    --color-sage:     #6B9978;
    --color-amber:    #D9883D;
    --color-amber-dark: #c4742e;
    --color-offwhite: #EEF0E6;

    --c-dark:      var(--color-dark);
    --c-teal:      var(--color-teal);
    --c-sage:      var(--color-sage);
    --c-amber:     var(--color-amber);
    --c-amber-dark: var(--color-amber-dark);
    --c-offwhite:  var(--color-offwhite);
    --c-white:     #ffffff;
    --font-sans:  'Host Grotesk', sans-serif;
    --font-serif: 'Miriam Libre', serif;
    --radius-card: 12px;
    --shadow-card: 0 2px 16px rgba(15,36,32,0.08);
    --shadow-hover: 0 10px 32px rgba(15,36,32,0.14);
}

/* ── Base reset (replaces Tailwind preflight) ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }

/* Small helpers the inline scripts / nav rely on */
.hidden { display: none !important; }
.contents { display: contents; }

/* ── Page chrome ───────────────────────────────────────────────────── */
body {
    background: var(--c-white);
    color: var(--c-dark);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }

/* ── Nav ───────────────────────────────────────────────────────────── */
.site-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 100;
}
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 3rem;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--c-white);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.site-logo-img {
    height: 2rem;
    width: auto;
    display: block;
}
.site-nav-links {
    display: flex;
    gap: 2rem;
}
.site-nav-links a,
.site-nav-links button {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.15s;
}
.site-nav-links a:hover,
.site-nav-links button:hover { color: var(--c-white); }

/* ── Shared layout ─────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
}
.section { padding: 6rem 0; }

.section-eyebrow {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-amber);
    margin-bottom: 0.6rem;
}
.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 700;
    color: var(--c-dark);
    line-height: 1.1;
    margin-bottom: 2.75rem;
}
.empty-state { color: #999; font-style: italic; }

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    height: 100vh;
    min-height: 580px;
    overflow: hidden;
    background: var(--c-dark);
}
.hero-slides {
    position: absolute;
    inset: 0;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45) saturate(0.85);
}
.hero-vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15,36,32,0.1) 0%,
        rgba(15,36,32,0.6) 100%
    );
}
.hero-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}
.hero-dot.active {
    background: var(--c-offwhite);
    transform: scale(1.35);
}
.hero-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    gap: 0.85rem;
}
.hero-eyebrow {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c-amber);
}
.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 7.5vw, 5.8rem);
    font-weight: 700;
    color: var(--c-white);
    line-height: 1.02;
}
.hero-sub {
    font-family: var(--font-sans);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: rgba(255,255,255,0.7);
    max-width: 480px;
    line-height: 1.6;
    margin-top: 0.25rem;
}

/* Search */
.hero-search {
    margin-top: 2rem;
    width: 100%;
    max-width: 660px;
}
.hero-search-wrap {
    display: flex;
    align-items: center;
    background: var(--c-white);
    border-radius: 50px;
    padding: 0.35rem 0.35rem 0.35rem 1.4rem;
    box-shadow: 0 12px 50px rgba(0,0,0,0.35);
    gap: 0.75rem;
}
.hero-search-wrap i {
    color: var(--c-teal);
    font-size: 1rem;
    flex-shrink: 0;
}
.hero-search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--c-dark);
    background: transparent;
    min-width: 0;
}
.hero-search-wrap input::placeholder { color: #bbb; }
.hero-search-btn {
    background: var(--c-amber);
    color: var(--c-white);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 1.9rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}
.hero-search-btn:hover { background: var(--c-amber-dark); }

/* ── Trail cards ───────────────────────────────────────────────────── */
.trails-section { background: var(--c-offwhite); }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.card {
    background: var(--c-white);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s, box-shadow 0.22s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.card-photo {
    position: relative;
    height: 210px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-dark) 100%);
}
.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.card:hover .card-photo img { transform: scale(1.05); }

.level-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.28rem 0.7rem;
    border-radius: 50px;
}
.level-easy     { background: #d1e7dd; color: #0a5c35; }
.level-moderate { background: #cfe2ff; color: #084298; }
.level-hard     { background: #fff3cd; color: #7d5a00; }
.level-brutal   { background: #f8d7da; color: #842029; }

.card-body {
    padding: 1.35rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
}
.card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-dark);
    line-height: 1.3;
}
.trail-meta {
    display: flex;
    gap: 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: #777;
    margin-top: 0.1rem;
}
.trail-meta i { color: var(--c-teal); width: 14px; margin-right: 6px; }

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-teal);
    text-decoration: none;
    transition: color 0.15s, gap 0.15s;
}
.card-link:hover { color: var(--c-amber); gap: 0.65rem; }
.card-link::after { content: ''; position: absolute; inset: 0; }

/* ── Blog cards ────────────────────────────────────────────────────── */
.posts-section { background: var(--c-white); }
.posts-section .card-photo {
    background: linear-gradient(135deg, var(--c-sage) 0%, var(--c-teal) 100%);
}
.post-tag {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--c-amber);
}

/* ── About ─────────────────────────────────────────────────────────── */
.about-section {
    background: var(--c-dark);
    overflow: hidden;
}
.about-section .section-title { color: var(--c-offwhite); }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}
.about-text {
    display: flex;
    flex-direction: column;
}
.about-text .section-title { margin-bottom: 1.25rem; }
.about-text p {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(238,240,230,0.7);
    margin-bottom: 1rem;
}
.about-cta {
    display: inline-block;
    margin-top: 1.5rem;
    background: var(--c-amber);
    color: var(--c-white);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    align-self: flex-start;
    transition: background 0.2s;
}
.about-cta:hover { background: var(--c-amber-dark); }

.about-image {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Trail detail hero ─────────────────────────────────────────────── */
.trail-hero {
    position: relative;
    height: 58vh;
    min-height: 420px;
    overflow: hidden;
    background: var(--c-dark);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.trail-hero-bg {
    position: absolute;
    inset: 0;
}
.trail-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45) saturate(0.8);
}
.trail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15,36,32,0.05) 0%,
        rgba(15,36,32,0.72) 100%
    );
}
.trail-hero-content {
    position: relative;
    z-index: 2;
    padding-bottom: 3rem;
}
.trail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    letter-spacing: 0.03em;
    margin-bottom: 1.25rem;
    transition: color 0.15s;
}
.trail-back-link:hover { color: var(--c-white); }
.trail-hero-meta { margin-bottom: 0.75rem; }
.trail-hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    color: var(--c-white);
    line-height: 1.08;
    margin-bottom: 1rem;
}
.trail-hero-stats {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}
.trail-hero-stats i { color: var(--c-amber); }

/* ── Trail detail body ─────────────────────────────────────────────── */
.trail-detail-section { background: var(--c-offwhite); padding-top: 3.5rem; }
.trail-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 3.5rem;
    align-items: start;
}

/* ── Markdown prose ────────────────────────────────────────────────── */
.trail-markdown { color: var(--c-dark); line-height: 1.8; font-family: var(--font-sans); }
.trail-markdown h2 {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--c-dark);
    margin: 2rem 0 0.6rem;
    line-height: 1.2;
}
.trail-markdown h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.5rem 0 0.4rem;
}
.trail-markdown p { margin-bottom: 1rem; }
.trail-markdown ul, .trail-markdown ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.trail-markdown li { margin-bottom: 0.3rem; }
.trail-markdown strong { font-weight: 700; }
.trail-markdown a { color: var(--c-teal); text-decoration: underline; }

/* ── Info blocks (warnings / gear) ────────────────────────────────── */
.trail-info-block {
    margin-top: 1.75rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-card);
    border-left: 4px solid transparent;
    background: var(--c-white);
    box-shadow: var(--shadow-card);
}
.trail-info-block h3 {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.trail-info-block p {
    font-family: var(--font-sans);
    font-size: 0.93rem;
    line-height: 1.7;
    color: #444;
    margin: 0;
}
.trail-info-warning { border-left-color: var(--c-amber); }
.trail-info-warning h3 { color: #8a5800; }
.trail-info-warning h3 i { color: var(--c-amber); }
.trail-info-gear { border-left-color: var(--c-teal); }
.trail-info-gear h3 { color: var(--c-teal); }
.trail-info-gear h3 i { color: var(--c-teal); }

/* ── Sidebar ───────────────────────────────────────────────────────── */
.trail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
}
.sidebar-card {
    background: var(--c-white);
    border-radius: var(--radius-card);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-card);
}
.sidebar-card-title {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-amber);
    margin-bottom: 1rem;
}
.trail-stat-list { display: flex; flex-direction: column; gap: 0.75rem; }
.trail-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.stat-label {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stat-label i { color: var(--c-teal); width: 14px; }
.stat-value {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-dark);
}

/* ── Month suitability ─────────────────────────────────────────────── */
.month-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.month-cell {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    padding: 0.4rem 0.1rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.month-suitable { background: #d1e7dd; color: #0a5c35; }
.month-partly   { background: #fff3cd; color: #7d5a00; }
.month-none     { background: #f8d7da; color: #842029; }
.month-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.month-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: #777;
}
.month-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Trailhead ─────────────────────────────────────────────────────── */
.trailhead-coords {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 0.75rem;
}
.trailhead-maps-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-teal);
    text-decoration: none;
    transition: color 0.15s;
}
.trailhead-maps-link:hover { color: var(--c-amber); }

/* ── Detail page responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
    .trail-detail-layout { grid-template-columns: 1fr; }
    .trail-sidebar { position: static; }
}
@media (max-width: 640px) {
    .trail-hero { height: 52vh; min-height: 360px; }
    .trail-hero-content { padding-bottom: 2rem; }
    .trail-detail-section { padding-top: 2.5rem; }
    .month-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Trail list — dual-range slider ───────────────────────────────── */
.tl-dual-range {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}
.tl-dual-range input[type="range"] {
    position: absolute;
    width: 100%;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    height: 4px;
}
.tl-dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-teal);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--c-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.tl-dual-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-teal);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--c-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    border: none;
}
.tl-range-track {
    position: absolute;
    height: 4px;
    border-radius: 2px;
    left: 0;
    right: 0;
    pointer-events: none;
    background: #e0e0e0;
}

/* Level badge sits inline inside sidebar checkbox row */
.tl-level-check .level-badge { position: static; }
.tl-level-check input[type="checkbox"],
.tl-month-check {
    accent-color: var(--c-teal);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Trail list page header (dark band above results) */
.tl-page-header {
    background: var(--c-dark);
    padding: 8rem 0 3rem;
}
.tl-page-header .section-title { color: var(--c-offwhite); margin-bottom: 1.5rem; }
.tl-page-header .hero-search-wrap { max-width: 640px; }
.tl-page-header--auth { padding-top: 7rem; text-align: center; }
.tl-page-header--auth .section-title { margin-bottom: 0; }

/* Clear search button */
.tl-search-clear {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #aaa;
    cursor: pointer;
    padding: 0 0.4rem;
    line-height: 1;
}

/* Range value display (overrides section-eyebrow transforms) */
.tl-range-display {
    color: var(--c-dark);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 0.75rem;
}

/* Sidebar card: remove eyebrow bottom margin (gap handles spacing) */
.sidebar-card .section-eyebrow { margin-bottom: 0; }

/* Normalize select font */
select { font-family: var(--font-sans); }

/* ── Two-panel independent scroll ──────────────────────────────────── */
@media (min-width: 768px) {
    main { display: flex; flex-direction: column; }

    .tl-scroll-wrapper {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }
    .tl-scroll-wrapper > .container {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .tl-panel-row {
        flex: 1;
        overflow: hidden;
        align-items: stretch;
    }
    .tl-sidebar-col,
    .tl-results-col {
        overflow-y: auto;
        padding-bottom: 3rem;
    }
    .tl-sidebar-col { scrollbar-width: thin; }
    .tl-results-col { scrollbar-width: thin; }
}

/* ── Difficulty pill toggles ────────────────────────────────────────── */
.tl-level-pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.tl-level-check { display: inline-block; cursor: pointer; }
.tl-level-check input[type=checkbox] { display: none; }
.tl-level-check .level-badge { cursor: pointer; transition: box-shadow 0.15s, opacity 0.15s; }
/* When any pill is selected, fade unselected ones */
.tl-level-pills:has(input:checked) .tl-level-check input:not(:checked) + .level-badge { opacity: 0.4; }
/* Ring on selected pill */
.tl-level-check input:checked + .level-badge { box-shadow: 0 0 0 2px currentColor; }

/* ── Drive-time filter ──────────────────────────────────────────────── */
.tl-location-input {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--c-dark);
    background: var(--c-offwhite);
    outline: none;
    min-width: 0;
    transition: border-color 0.15s;
}
.tl-location-input:focus { border-color: var(--c-teal); }
.tl-location-input::placeholder { color: #bbb; }

.tl-geolocate-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--c-teal);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tl-geolocate-btn:hover { background: var(--c-teal); color: #fff; border-color: var(--c-teal); }
.tl-geolocate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tl-location-status {
    font-size: 0.72rem;
    color: #bbb;
    min-height: 1em;
}
.tl-location-status--active { color: var(--c-teal); }

/* ── Mobile nav toggle ─────────────────────────────────────────────── */
.site-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--c-white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
}

/* ── Homepage / shared responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { gap: 3rem; }
    .section { padding: 4.5rem 0; }
}

@media (max-width: 768px) {
    /* Nav becomes a toggleable dropdown */
    .site-nav { padding: 1.1rem 1.5rem; }
    .site-nav-toggle { display: block; }
    .site-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 1.5rem;
        right: 1.5rem;
        flex-direction: column;
        gap: 0;
        background: var(--c-dark);
        border-radius: var(--radius-card);
        padding: 0.5rem 0;
        box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    }
    .site-nav-links.open { display: flex; }
    .site-nav-links a,
    .site-nav-links button {
        width: 100%;
        text-align: left;
        padding: 0.85rem 1.5rem !important;
        font-size: 1rem;
    }
    .site-nav-links .contents { display: block; width: 100%; }

    /* Sections / layout */
    .section { padding: 3.5rem 0; }
    .container { padding: 0 1.5rem; }
    .section-title { margin-bottom: 1.75rem; }

    /* Cards stack to a single column */
    .cards-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .card-photo { height: 200px; }

    /* About stacks: image above text reads better on mobile */
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-image { order: -1; }

    /* Hero spacing */
    .hero-body { padding: 1.5rem; }
    .hero-search { margin-top: 1.5rem; }
}

@media (max-width: 480px) {
    .hero-search-wrap { padding: 0.3rem 0.3rem 0.3rem 1.1rem; gap: 0.5rem; }
    .hero-search-btn { padding: 0.7rem 1.2rem; }
    .hero-search-wrap input { font-size: 0.9rem; }
}

/* ── Legal pages (privacy, terms, cookies) ─────────────────────────── */
.legal-content {
    max-width: 48rem;
    margin: 0 auto;
    padding: 3rem 1rem;
    font-family: var(--font-sans);
    color: var(--c-dark);
    line-height: 1.7;
}
.legal-content h1 {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}
.legal-content h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}
.legal-content h3 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.legal-content p { margin-bottom: 1rem; }
.legal-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.legal-content ul ul {
    list-style: circle;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.legal-content li { margin-bottom: 0.4rem; }
.legal-content a {
    color: var(--c-teal);
    text-decoration: underline;
}
.legal-content a:hover { color: var(--c-dark); }
.legal-content .legal-date {
    color: var(--c-teal);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ── Footer override ───────────────────────────────────────────────── */
footer {
    background: #0a1b18;
    color: rgba(238,240,230,0.5);
    text-align: center;
    padding: 1.75rem 2rem;
    font-family: var(--font-sans);
    font-size: 0.82rem;
}
.site-footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.site-footer-inner p { margin: 0; }
.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
}
.site-footer-links a { transition: color 0.15s; }
.site-footer-links a:hover { color: var(--c-white); }
@media (min-width: 640px) {
    .site-footer-inner { flex-direction: row; }
}

/* ── Auth / account pages ──────────────────────────────────────────── */
.auth-section { background: var(--c-offwhite); padding: 3rem 0; }
.auth-card {
    background: var(--c-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 2rem 1.5rem;
    max-width: 28rem;
    margin: 0 auto;
}
.auth-card--center { text-align: center; }

.auth-intro { font-size: 0.875rem; color: #6b7280; margin-bottom: 1.5rem; }

.auth-field { margin-bottom: 1.25rem; }
.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-dark);
    margin-bottom: 0.25rem;
}
.auth-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: var(--c-white);
    color: var(--c-dark);
    outline: none;
    transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--c-teal); }
.auth-field-error { font-size: 0.75rem; color: #dc2626; margin-top: 0.25rem; }
.auth-errors {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #b91c1c;
    margin-bottom: 1.25rem;
}

.auth-submit {
    width: 100%;
    background: var(--c-amber);
    color: var(--c-white);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
}
.auth-submit:hover { background: var(--c-amber-dark); }

.auth-btn {
    display: inline-block;
    background: var(--c-amber);
    color: var(--c-white);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: background 0.2s;
}
.auth-btn:hover { background: var(--c-amber-dark); }
.auth-card--center .auth-btn { margin-top: 1.5rem; }

.auth-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
}
.auth-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
    color: #9ca3af;
}
.auth-muted { color: #9ca3af; }
.auth-textlink { color: var(--c-teal); transition: color 0.15s; }
.auth-textlink:hover { color: var(--c-amber); }
.auth-textlink--strong { font-weight: 600; }

.auth-status-icon { font-size: 2.25rem; color: var(--c-teal); margin-bottom: 1rem; display: block; }
.auth-status-icon--error { color: #f87171; }
.auth-status-title { color: var(--c-dark); font-weight: 600; margin-bottom: 0.5rem; }
.auth-status-text { font-size: 0.875rem; color: #6b7280; }
.auth-hint { font-size: 0.75rem; color: #9ca3af; margin-top: 1rem; }
.auth-backlink {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-teal);
    transition: color 0.15s;
}
.auth-backlink:hover { color: var(--c-amber); }

/* ── Trail list layout ─────────────────────────────────────────────── */
.tl-scroll-wrapper { background: var(--c-offwhite); padding-top: 2.5rem; }
.tl-panel-row { display: flex; flex-direction: column; gap: 1.5rem; }
.tl-sidebar-col { width: 100%; flex-shrink: 0; }
.tl-results-col { flex: 1; min-width: 0; }

.tl-drive-card { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.tl-drive-fields { display: flex; flex-direction: column; gap: 0.25rem; }
.tl-drive-fields.is-disabled { opacity: 0.4; pointer-events: none; user-select: none; }
.tl-drive-row { display: flex; gap: 0.375rem; align-items: center; }
.tl-drive-note { font-size: 0.875rem; color: #9ca3af; }
.tl-location-input { flex: 1; }

.tl-select {
    font-size: 0.875rem;
    color: var(--c-dark);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: var(--c-white);
    cursor: pointer;
    outline: none;
}
.tl-select--filled { background: var(--c-offwhite); }

.tl-clear-link {
    font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
    color: #9ca3af;
    align-self: flex-start;
}
.tl-register-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-teal);
    align-self: flex-start;
    transition: color 0.15s;
}
.tl-register-link:hover { color: var(--c-amber); }
.tl-register-link i { font-size: 10px; margin-right: 0.125rem; }

.tl-filters-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--c-white);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--c-dark);
    margin-bottom: 1rem;
    cursor: pointer;
}
.tl-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--c-amber);
    color: var(--c-white);
    font-size: 0.75rem;
    font-weight: 700;
}
.tl-filters-panel { display: none; flex-direction: column; gap: 1.25rem; }
.tl-filters-panel.is-open { display: flex; }

.tl-field { display: flex; flex-direction: column; gap: 0.5rem; }
.tl-eyebrow-row { display: flex; justify-content: space-between; align-items: center; }
.tl-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 0.5rem;
    row-gap: 0.25rem;
}
.tl-month-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 0.125rem 0;
}
.tl-month-name { font-family: var(--font-sans); font-size: 0.875rem; color: var(--c-dark); }

.tl-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
}
.tl-count { font-size: 1rem; font-weight: 600; color: var(--c-dark); }
.tl-count-note { margin-left: 0.5rem; font-size: 0.75rem; color: #9ca3af; font-weight: 400; }
.tl-count-note i { color: var(--c-teal); }

.tl-group { margin-bottom: 2.5rem; }
.tl-group-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--c-offwhite);
}
.tl-empty { text-align: center; padding: 4rem 0; color: #9ca3af; }
.tl-empty i { font-size: 3rem; margin-bottom: 1rem; display: block; color: #e5e7eb; }
.tl-empty p { font-family: var(--font-sans); font-size: 0.875rem; }
.tl-empty a {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--c-teal);
    text-decoration: underline;
    font-size: 0.875rem;
}

/* Trail-list responsive: side-by-side from md up */
@media (min-width: 768px) {
    .tl-panel-row { flex-direction: row; gap: 2.5rem; }
    .tl-sidebar-col { width: 16rem; }
    .tl-filters-toggle { display: none; }
    .tl-filters-panel { display: flex; }
}

/* ── Blog list ─────────────────────────────────────────────────────── */
.blog-list-section { background: var(--c-offwhite); }
.card-date { font-size: 0.75rem; color: #9ca3af; font-family: var(--font-sans); }

/* ── Trail detail hero header row ──────────────────────────────────── */
.trail-hero-row { display: flex; flex-direction: column; gap: 1rem; }
.trail-hero-main { flex: 1; }
.trail-gpx {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.trail-gpx-disabled { opacity: 0.4; pointer-events: none; user-select: none; }
.trail-gpx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    border: 2px solid var(--c-white);
    color: var(--c-white);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    transition: background 0.2s;
}
.trail-gpx-btn:hover { background: rgba(255,255,255,0.1); }
.trail-gpx-reglink {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    transition: color 0.15s;
}
.trail-gpx-reglink:hover { color: var(--c-white); }
.trail-gpx-reglink i { font-size: 10px; margin-right: 0.125rem; }

@media (min-width: 768px) {
    .trail-hero-row {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
    .trail-gpx { align-items: flex-end; }
}
/* ── Cookie consent banner ─────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--c-dark);
    color: var(--c-offwhite);
    border-top: 1px solid rgba(238,240,230,0.15);
    box-shadow: 0 -4px 24px rgba(15,36,32,0.25);
}
.cookie-banner-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.cookie-banner-text {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}
.cookie-banner-title { font-weight: 700; margin-bottom: 0.25rem; }
.cookie-banner-link { color: var(--c-amber); text-decoration: underline; }
.cookie-banner-link:hover { color: var(--c-sage); }
.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cookie-btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.cookie-btn--primary { background: var(--c-amber); color: var(--c-white); }
.cookie-btn--primary:hover { background: var(--c-amber-dark); }
.cookie-btn--ghost {
    background: transparent;
    color: var(--c-offwhite);
    border: 1px solid rgba(238,240,230,0.4);
}
.cookie-btn--ghost:hover { background: rgba(238,240,230,0.1); }
@media (min-width: 640px) {
    .cookie-banner-inner { flex-direction: row; justify-content: space-between; }
    .cookie-banner-text { text-align: left; }
}

/* ── Trail-list notice (drive-time fallback messages) ──────────────── */
.trail-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(217,136,61,0.10);
    border: 1px solid rgba(217,136,61,0.35);
    border-radius: var(--radius-card);
    color: var(--c-dark);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.45;
}
.trail-notice i { color: var(--c-amber); }
