/* ─── Design Tokens ─────────────────────────────────── */
:root {
    --cream:      #eddabc;
    --cream-dark: #d9c49e;
    --rust:       #b16448;
    --rust-dark:  #8a4a33;
    --olive:      #5b5d34;
    --olive-dark: #3f4124;
    --sand:       #f5eed9;
    --text-dark:  #2c2215;
    --text-mid:   #5a4030;
    --white:      #fffdf7;
    --font-display: 'Caveat', cursive;
    --font-body:    'Nunito', sans-serif;
    --transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --radius:       12px;
}

/* ─── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background:  var(--sand);
    color:       var(--text-dark);
    overflow-x:  hidden;
}

/* ─── Shared Atoms ───────────────────────────────────── */
.section-label {
    font-family:    var(--font-body);
    font-size:      0.72rem;
    font-weight:    800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color:          var(--rust);
    display:        block;
    margin-bottom:  0.6rem;
}
.section-title {
    font-family: var(--font-display);
    font-size:   clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    color:       var(--olive);
    line-height: 1.15;
    margin-bottom: 1rem;
}
.section-sub {
    font-size:   0.95rem;
    line-height: 1.75;
    color:       var(--text-mid);
    max-width:   620px;
}
.btn {
    display:         inline-flex;
    align-items:     center;
    gap:             0.5rem;
    font-family:     var(--font-body);
    font-weight:     800;
    font-size:       0.88rem;
    letter-spacing:  0.06em;
    text-transform:  uppercase;
    text-decoration: none;
    padding:         0.85rem 2rem;
    border-radius:   99px;
    border:          none;
    cursor:          pointer;
    transition:      transform 0.2s ease, box-shadow 0.2s ease, background var(--transition);
    width:           fit-content;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background:  var(--rust);
    color:       var(--white);
    box-shadow:  0 6px 24px rgba(177,100,72,0.35);
}
.btn-primary:hover { background: var(--rust-dark); box-shadow: 0 10px 32px rgba(177,100,72,0.5); }
.btn-cream {
    background:  var(--cream);
    color:       var(--olive-dark);
    box-shadow:  0 6px 24px rgba(0,0,0,0.18);
}
.btn-cream:hover { background: var(--white); }
.btn-outline-cream {
    background:  transparent;
    color:       var(--cream);
    border:      2px solid rgba(237,218,188,0.55);
}
.btn-outline-cream:hover { background: rgba(237,218,188,0.12); border-color: var(--cream); }

/* ─── Breadcrumb ─────────────────────────────────────── */
.breadcrumb {
    margin-top:    72px;
    background:    var(--white);
    border-bottom: 1.5px solid rgba(177,100,72,0.1);
    padding:       0.8rem 5%;
}
.breadcrumb-inner {
    max-width:   1200px;
    margin:      0 auto;
    display:     flex;
    align-items: center;
    gap:         0.5rem;
    font-size:   0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color:       var(--text-mid);
}
.breadcrumb-inner a { color: var(--rust); text-decoration: none; }
.breadcrumb-inner a:hover { text-decoration: underline; }
.bc-sep { opacity: 0.4; }

/* ─── Hero ───────────────────────────────────────────── */
.trail-hero {
    background:  var(--white);
    padding:     4rem 5% 3rem;
    text-align:  center;
    border-bottom: 1.5px solid rgba(177,100,72,0.08);
}
.trail-hero-inner { max-width: 680px; margin: 0 auto; }
.trail-hero-badge {
    display:        inline-flex;
    align-items:    center;
    gap:            0.5rem;
    font-size:      0.72rem;
    font-weight:    800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color:          var(--olive);
    background:     rgba(91,93,52,0.08);
    border:         1.5px solid rgba(91,93,52,0.18);
    padding:        0.35rem 1rem;
    border-radius:  99px;
    margin-bottom:  1rem;
}

/* Same shape as .trail-hero-badge, but legible on a dark background */
.trail-cta-badge {
    display:        inline-flex;
    align-items:    center;
    gap:            0.5rem;
    font-size:      0.72rem;
    font-weight:    800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color:          var(--cream);
    background:     rgba(237,218,188,0.12);
    border:         1.5px solid rgba(237,218,188,0.3);
    padding:        0.35rem 1rem;
    border-radius:  99px;
}
.trail-hero h1 {
    font-family: var(--font-display);
    font-size:   clamp(2.6rem, 5.5vw, 4rem);
    font-weight: 700;
    color:       var(--olive);
    line-height: 1.1;
    margin-bottom: 0.8rem;
}
.trail-hero h1 span { color: var(--rust); }
.trail-hero p {
    font-size:   0.98rem;
    line-height: 1.7;
    color:       var(--text-mid);
    max-width:   540px;
    margin:      0 auto;
}

/* ─── Map Section ────────────────────────────────────── */
.trail-map-section { padding: 3rem 5% 5rem; }
.trail-map-wrap {
    max-width:     1200px;
    margin:        0 auto;
    border-radius: 20px;
    overflow:      hidden;
    box-shadow:    0 20px 50px rgba(44,34,21,0.12);
    border:        1.5px solid rgba(177,100,72,0.12);
}
#trailMap {
    width:  100%;
    height: 65vh;
    min-height: 420px;
    background: var(--sand);
}

/* ── Custom marker pin ── */
.trail-pin {
    width:  30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.trail-pin-dot {
    width:         26px;
    height:        26px;
    border-radius: 50% 50% 50% 0;
    transform:     rotate(-45deg);
    background:    var(--rust);
    border:        2.5px solid var(--white);
    box-shadow:    0 3px 10px rgba(44,34,21,0.35);
    display:       flex;
    align-items:   center;
    justify-content: center;
}
.trail-pin-dot span { transform: rotate(45deg); font-size: 0.7rem; }

/* ─── Get On The Map CTA ──────────────────────────────── */
.trail-cta-band {
    background: linear-gradient(140deg, var(--olive-dark) 0%, var(--olive) 55%, #3f5a2a 100%);
    padding:    4.5rem 5%;
    text-align: center;
}
.trail-cta-inner {
    max-width: 620px;
    margin:    0 auto;
    display:   flex;
    flex-direction: column;
    align-items: center;
    gap:       1rem;
}
.trail-cta-inner h2 {
    font-family: var(--font-display);
    font-size:   clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color:       var(--cream);
    line-height: 1.1;
}
.trail-cta-inner p {
    font-size:   0.95rem;
    line-height: 1.7;
    color:       rgba(237,218,188,0.75);
}
.trail-cta-inner p strong { color: var(--cream); }
.trail-cta-btns {
    display:    flex;
    gap:        1rem;
    flex-wrap:  wrap;
    justify-content: center;
    margin-top: 0.4rem;
}

/* ── Cluster badge (overrides Leaflet.markercluster defaults) ── */
.trail-cluster {
    background: var(--olive);
    border:     3px solid var(--cream);
    border-radius: 50%;
    color:      var(--cream);
    font-family: var(--font-body);
    font-weight: 800;
    font-size:  0.85rem;
    display:    flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(44,34,21,0.3);
}

/* ── Leaflet attribution — keep it legible on the light basemap ── */
.leaflet-control-attribution {
    font-family: var(--font-body) !important;
    font-size:   0.68rem !important;
}

/* ── Gesture-handling "tap to explore" overlay — match brand ── */
.leaflet-gesture-handling-screen {
    font-family: var(--font-body) !important;
}

/* ─── Photo Modal (pattern reused from compat-modal.css) ──── */
.trail-modal-backdrop {
    display:         none;
    position:        fixed;
    inset:           0;
    z-index:         1500;
    background:      rgba(44, 34, 21, 0.6);
    backdrop-filter: blur(8px);
    align-items:     center;
    justify-content: center;
    padding:         1.5rem;
}
.trail-modal-backdrop.open {
    display: flex;
    animation: trailBackdropIn 0.25s ease both;
}
@keyframes trailBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.trail-modal {
    background:    var(--white);
    border-radius: 22px;
    width:         100%;
    max-width:     560px;
    max-height:    90vh;
    overflow:      hidden;
    display:       flex;
    flex-direction: column;
    box-shadow:    0 40px 100px rgba(44, 34, 21, 0.35);
    animation:     trailModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes trailModalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.trail-modal-gallery {
    position:        relative;
    flex:            1 1 auto;
    min-height:      0;
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      var(--white);
    overflow:        hidden;
}
.trail-modal-img {
    max-width:  100%;
    max-height: 100%;
    width:      auto;
    height:     auto;
    object-fit: contain;
    display:    block;
}
.trail-modal-arrow {
    position:      absolute;
    top:           50%;
    transform:     translateY(-50%);
    width:         36px;
    height:        36px;
    border-radius: 50%;
    background:    rgba(44,34,21,0.5);
    color:         var(--white);
    border:        none;
    font-size:     1.3rem;
    line-height:   1;
    cursor:        pointer;
    display:       none;
    align-items:   center;
    justify-content: center;
    transition:    background 0.2s ease;
}
.trail-modal-arrow:hover { background: rgba(44,34,21,0.75); }
.trail-modal-arrow-prev { left: 12px; }
.trail-modal-arrow-next { right: 12px; }
.trail-modal-dots {
    position:  absolute;
    bottom:    12px;
    left:      50%;
    transform: translateX(-50%);
    display:   none;
    gap:       0.4rem;
}
.trail-modal-dot {
    width:         7px;
    height:        7px;
    border-radius: 50%;
    background:    rgba(255,255,255,0.5);
    cursor:        pointer;
    transition:    background 0.2s ease, transform 0.2s ease;
}
.trail-modal-dot.active {
    background: var(--white);
    transform:  scale(1.3);
}
.trail-modal-body {
    padding: 1.4rem 1.6rem 1.7rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 0.4rem;
    position: relative;
}
.trail-modal-course {
    font-family: var(--font-display);
    font-size:   1.7rem;
    font-weight: 700;
    color:       var(--olive);
    line-height: 1.1;
}
.trail-modal-loc {
    font-size:      0.72rem;
    font-weight:    800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color:          var(--rust);
}
.trail-modal-caption {
    font-size:   0.85rem;
    line-height: 1.6;
    color:       var(--text-mid);
    margin-top:  0.4rem;
}
.trail-modal-credit {
    display:        none;
    align-items:    center;
    gap:            0.4rem;
    margin-top:     0.7rem;
    font-size:      0.76rem;
    font-weight:    800;
    letter-spacing: 0.04em;
    color:          var(--rust);
    text-decoration: none;
    width:          fit-content;
}
.trail-modal-credit:hover { text-decoration: underline; }
.trail-modal-close {
    position:      absolute;
    top:           1rem;
    right:         1rem;
    width:         36px;
    height:        36px;
    border-radius: 50%;
    background:    var(--white);
    border:        1px solid rgba(177,100,72,0.2);
    color:         var(--text-dark);
    font-size:     1rem;
    cursor:        pointer;
    display:       flex;
    align-items:   center;
    justify-content: center;
    box-shadow:    0 4px 14px rgba(44,34,21,0.2);
    transition:    background 0.2s ease;
}
.trail-modal-close:hover { background: var(--sand); }

/* ─── Footer ─────────────────────────────────────────── */
footer {
    background: var(--text-dark);
    color:      var(--cream);
    padding:    4rem 5% 2rem;
}
.footer-grid {
    display:     grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap:         3rem;
    max-width:   1200px;
    margin:      0 auto;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(237,218,188,0.1);
}
.footer-brand .nav-logo { font-size: 2.2rem; }
.footer-brand p {
    font-size:   0.85rem;
    line-height: 1.7;
    color:       rgba(237,218,188,0.55);
    margin-top:  0.8rem;
    max-width:   280px;
}
.footer-col h4 {
    font-size:      0.72rem;
    font-weight:    800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color:          var(--rust);
    margin-bottom:  1rem;
}
.footer-col a {
    display:     block;
    margin-bottom: 0.6rem;
    font-size:   0.85rem;
    color:       rgba(237,218,188,0.55);
    text-decoration: none;
    transition:  color var(--transition);
}
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding-top:     2rem;
    max-width:       1200px;
    margin:          0 auto;
    font-size:       0.78rem;
    color:           rgba(237,218,188,0.35);
    flex-wrap:       wrap;
    gap:             0.5rem;
}
.social-links { display: flex; gap: 0.8rem; }
.social-links a {
    width:       36px;
    height:      36px;
    border-radius: 50%;
    background:  rgba(237,218,188,0.08);
    border:      1px solid rgba(237,218,188,0.12);
    display:     flex;
    align-items: center;
    justify-content: center;
    font-size:   0.9rem;
    text-decoration: none;
    transition:  background var(--transition);
}
.social-links a:hover { background: var(--rust); }
.nav-logo {
    font-family:     var(--font-display);
    font-size:       2rem;
    font-weight:     700;
    color:           var(--olive);
    letter-spacing:  0.01em;
    text-decoration: none;
}
.nav-logo span { color: var(--rust); }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .trail-hero        { padding: 3rem 4% 2.5rem; }
    .trail-map-section { padding: 2rem 4% 3.5rem; }
    #trailMap           { height: 60vh; min-height: 360px; }
    .footer-grid        { grid-template-columns: 1fr; }
    .trail-modal-backdrop { padding: 0; align-items: flex-end; }
    .trail-modal {
        border-radius: 22px 22px 0 0;
        max-height:    92vh;
    }
}
