/* ==========================================================================
   SOURCE2SEA — pages.css
   Page-specific styles that don't belong in components.css.
   Organised by page.
   ========================================================================== */


/* ==========================================================================
   SHARED — Inner page hero (used on story, expeditions, supporters, sponsor)
   ========================================================================== */

.page-hero {
  position: relative;
  padding-bottom: var(--space-20);
  background-color: var(--colour-dark-1);
  overflow: hidden;
}

/* At ≥1025px the banner is sticky — add its height to the section scroll offset */
@media (min-width: 1025px) {
  .exp-section {
    scroll-margin-top: 300px; /* nav (64) + banner (40) + compact anchor nav (56) + 40px breathing room */
  }
}

/* At desktop the nav + banner are both fixed — push content clear of both */
@media (min-width: 1025px) {
  .page-hero {
    padding-top: calc(var(--nav-height) + var(--banner-height) + var(--space-16));
  }
}

/* At ≤1024px the banner is in-flow — just need breathing room */
@media (max-width: 1024px) {
  .page-hero {
    padding-top: var(--space-20);
  }
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(227, 82, 5, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .container {
  padding-inline: var(--space-16);
}

@media (max-width: 1024px) {
  .page-hero .container {
    padding-inline: var(--space-12);
    text-align: center;
  }

  .page-hero__title {
    max-width: 100%;
    margin-inline: auto;
  }

  .page-hero__lead {
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .page-hero .container {
    padding-inline: var(--space-8);
  }
}

.page-hero__eyebrow {
  margin-bottom: var(--space-4);
}

.page-hero__title {
  color: var(--colour-text-light);
  margin-bottom: var(--space-6);
  max-width: 16ch;
}

.page-hero__lead {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: rgba(240, 235, 226, 0.75);
  max-width: 800px;
  line-height: var(--leading-normal);
}


/* ==========================================================================
   MY STORY PAGE — Editorial Timeline Layout
   ========================================================================== */

/* Full-bleed image sections: remove section padding so image fills edge-to-edge */
.section--story-img {
  padding-block: 0;
}

/* ── Story block: base ── */
.story-block {
  position: relative;
}

/* ── Two-column split for image sections ── */
.story-block--img-left,
.story-block--img-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 540px;
}

.story-block--img-left  .story-block__media   { order: 1; }
.story-block--img-left  .story-block__content { order: 2; }
.story-block--img-right .story-block__content { order: 1; border-left: none; border-right: 2px solid rgba(227, 82, 5, 0.3); z-index: 1; }
.story-block--img-right .story-block__media   { order: 2; }

.story-block--img-right .story-block__content::after {
  left: auto;
  right: -5px;
}

/* ── Media column — full-bleed image ── */
.story-block__media {
  position: relative;
  overflow: hidden;
}

.story-block__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  will-change: transform;
}

/* ── Content column ── */
.story-block__content {
  position: relative;
  padding: var(--space-16) var(--space-20) var(--space-16) var(--space-16);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Timeline spine */
  border-left: 2px solid rgba(227, 82, 5, 0.3);
}

/* Timeline node dot */
.story-block__content::after {
  content: '';
  position: absolute;
  left: -5px;
  top: var(--space-8);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--colour-orange);
  box-shadow: 0 0 0 3px rgba(227, 82, 5, 0.15);
}

/* Decorative chapter number — large, faded, behind content */
.story-block__content[data-chapter]::before {
  content: attr(data-chapter);
  position: absolute;
  bottom: var(--space-16);
  right: var(--space-6);
  font-family: var(--font-serif);
  font-size: clamp(6rem, 14vw, 12rem);
  font-weight: 700;
  color: var(--colour-orange);
  opacity: 0.07;
  line-height: 0.85;
  letter-spacing: var(--tracking-tight);
  pointer-events: none;
  user-select: none;
}

/* ── Text-only blocks (inside .container) ── */
.story-block--text .story-block__content {
  padding: 0 0 0 var(--space-10);
  max-width: 800px;
  margin-inline: auto;
  justify-content: flex-start;
  border-left: none; /* line moved to story-block--text::before */
}

.story-block--text .story-block__content::after {
  display: none; /* dot moved with the line */
}

/* Line sits halfway between content left edge and container left edge */
.story-block--text::before {
  content: '';
  position: absolute;
  left: calc(25% - 200px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(227, 82, 5, 0.3);
  pointer-events: none;
}

/* Dot anchored to the line */
.story-block--text::after {
  content: '';
  position: absolute;
  left: calc(25% - 204px);
  top: var(--space-8);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--colour-orange);
  box-shadow: 0 0 0 3px rgba(227, 82, 5, 0.15);
  pointer-events: none;
}

/* ── Full-height timeline: zero section padding, move it into the content block ── */
.section--story-text {
  padding-block: 0;
}

.section--story-text .story-block--text .story-block__content {
  padding-block: var(--space-20);
}

/* ── Source2Sea wordmark in mission section ── */
.story__brand-logo {
  width: 50%;
  min-width: 300px;
  height: auto;
  display: block;
  margin-top: 0;
  margin-bottom: var(--space-8);
}

/* ── MS Society logo inline within content ── */
.story__ms-logo {
  width: 140px;
  height: auto;
  display: block;
  margin-top: var(--space-8);
  margin-bottom: var(--space-2);
}

.story-block__logo {
  display: none;
  flex-shrink: 0;
  width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-block__logo img {
  width: 100%;
  height: auto;
}

.story-block__content p + p {
  margin-top: var(--space-4);
}

/* ── Stat callouts ── */
.story-stats {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  margin-block: var(--space-6) var(--space-8);
  padding-block: var(--space-5);
  border-top: 1px solid rgba(26, 21, 16, 0.1);
  border-bottom: 1px solid rgba(26, 21, 16, 0.1);
}

.story-stat__number {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--colour-orange);
  line-height: 1;
  display: block;
}

.story-stat__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(26, 21, 16, 0.5);
  display: block;
  margin-top: var(--space-1);
}

.section--dark .story-stats {
  border-color: rgba(240, 235, 226, 0.1);
}

.section--dark .story-stat__label {
  color: rgba(240, 235, 226, 0.5);
}

/* ── Pull quote ── */
.story__pull-quote {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-style: italic;
  color: var(--colour-orange);
  line-height: var(--leading-tight);
  border-left: 3px solid var(--colour-orange);
  padding-left: var(--space-6);
  margin-block: var(--space-10);
}

/* ── CTA block ── */
.story__cta-block {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-10);
}

/* ── Tablet + mobile: stack image above content ── */
@media (max-width: 1024px) {
  .story-block--img-left,
  .story-block--img-right {
    grid-template-columns: 1fr;
    min-height: unset;
    max-height: none;
    overflow: visible;
  }

  .story-block__media {
    height: 400px;
    order: 1 !important;
  }

  .story-block--img-left .story-block__image {
    object-position: center 40%;
  }

  .story-block--img-right .story-block__image {
    object-position: center 25%;
  }

  .story-block--img-left .story-block__content,
  .story-block--img-right .story-block__content {
    order: 2 !important;
    margin-inline: var(--space-10);
  }

  .story-block--img-left .story-block__content {
    border-left: none;
    border-right: 2px solid rgba(227, 82, 5, 0.3);
  }

  .story-block--img-left .story-block__content::after {
    left: auto;
    right: -5px;
  }

  .story-block__content {
    padding: var(--space-12) var(--space-16) var(--space-12) var(--space-12);
    justify-content: flex-start;
  }

  .story-block__content[data-chapter]::before {
    font-size: clamp(4rem, 20vw, 7rem);
    bottom: var(--space-2);
    right: var(--space-4);
  }

  .story-block--text .story-block__content {
    padding: 0 var(--space-6) 0 var(--space-12);
  }

  /* At ≤1024px the formula left: calc(25% - 200px) goes off-screen — use a fixed offset instead */
  .story-block--text::before {
    left: var(--space-4); /* 16px + 24px container padding = 40px from viewport, matching img-block inset */
  }

  .story-block--text::after {
    left: calc(var(--space-4) - 3px); /* centres 8px dot on 2px line */
  }
}

@media (max-width: 640px) {
  .story-block__media {
    height: 280px;
  }

  .story-block__content {
    padding: var(--space-10) 0 var(--space-10) 0;
    border-left: none;
    border-right: none;
  }

  .story-block--img-left .story-block__content,
  .story-block--img-right .story-block__content {
    border-right: none;
    margin-inline: var(--space-6); /* margin provides the edge spacing */
  }

  .story-block__content::after,
  .story-block--text::before,
  .story-block--text::after {
    display: none;
  }

  /* Container provides 24px edge spacing — zero out inline padding so text aligns with img blocks */
  .story-block--text .story-block__content {
    padding: 0;
  }

  .story-block__logo {
    display: none;
  }
}

@media (max-width: 375px) {
  .story__cta-block {
    flex-direction: column;
    align-items: center;
  }

  .story__cta-block .btn {
    width: 75%;
    text-align: center;
  }
}


/* ==========================================================================
   EXPEDITIONS PAGE
   ========================================================================== */

/* ── Expedition intro ── */
.noscript-warning {
  background-color: #fffbeb;
  border-bottom: 2px solid #f59e0b;
  padding-block: var(--space-6);
  color: #78350f;
  font-size: 0.9rem;
  text-align: center;
  margin-top: var(--nav-height);
}

@media (min-width: 1025px) {
  .noscript-warning {
    margin-top: calc(var(--nav-height) + var(--banner-height));
  }
}

.exp-intro {
  background-color: var(--colour-bg);
  padding-block: var(--space-12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
}

.exp-intro__eyebrow {
  margin-bottom: var(--space-4);
}

.exp-intro__text {
  max-width: 60ch;
  margin-inline: auto;
  color: var(--colour-text-muted);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

/* ── Anchor navigation ── */
.exp-anchor-nav {
  background-color: var(--colour-dark-1);
  border-bottom: 1px solid rgba(240, 235, 226, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: calc(var(--nav-height) + var(--banner-height));
  z-index: calc(var(--z-nav) - 2);
  transition: box-shadow var(--transition-base);
}

.exp-anchor-nav__inner {
  display: flex;
  gap: 0;
  min-width: max-content;
  width: 100%;
  padding-block: 0;
}

.exp-anchor-nav__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4);
  text-decoration: none;
  border-right: 1px solid rgba(240, 235, 226, 0.06);
  transition: background-color var(--transition-base),
              padding var(--transition-base);
}

/* Compact state — triggered by JS when the nav starts sticking */
.exp-anchor-nav--compact {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.exp-anchor-nav--compact .exp-anchor-nav__link {
  padding-block: var(--space-2);
}

.exp-anchor-nav .status {
  overflow: hidden;
  max-height: 3em;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.exp-anchor-nav--compact .status {
  max-height: 0;
  opacity: 0;
}

.exp-anchor-nav__link:last-child {
  border-right: none;
}

.exp-anchor-nav__link:hover {
  background-color: rgba(240, 235, 226, 0.04);
}

.exp-anchor-nav__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(240, 235, 226, 0.3);
  letter-spacing: var(--tracking-wider);
}

.exp-anchor-nav__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--colour-text-light);
  line-height: 1;
}

/* ── Mobile dropdown toggle — hidden above 640px ── */
.exp-anchor-nav__toggle {
  display: none;
}

@media (max-width: 640px) {
  .exp-anchor-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--colour-text-light);
  }

  .exp-anchor-nav__toggle-icon {
    font-size: var(--text-sm);
    transition: transform 0.2s ease;
  }

  .exp-anchor-nav--open .exp-anchor-nav__toggle-icon {
    transform: rotate(180deg);
  }

  /* Always show year and status in the dropdown regardless of compact state */
  .exp-anchor-nav--compact .exp-anchor-nav__num,
  .exp-anchor-nav--compact .status {
    max-height: 3em;
    opacity: 1;
  }

  /* Keep dropdown link padding consistent when nav is in compact/sticky state */
  .exp-anchor-nav--compact .exp-anchor-nav__link {
    padding: var(--space-4) var(--space-6);
  }

  /* Allow absolutely-positioned dropdown to escape the sticky bar */
  .exp-anchor-nav {
    overflow: visible;
  }

  /* Links hidden by default, shown as vertical list when open — floats over content */
  .exp-anchor-nav__inner {
    display: none;
    flex-direction: column;
    min-width: unset;
    border-top: 1px solid rgba(240, 235, 226, 0.06);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--colour-dark-1);
    z-index: 10;
  }

  .exp-anchor-nav--open .exp-anchor-nav__inner {
    display: flex;
  }

  .exp-anchor-nav__link {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    border-right: none;
    border-bottom: 1px solid rgba(240, 235, 226, 0.06);
    align-items: center;
  }

  .exp-anchor-nav__link:last-child {
    border-bottom: none;
  }
}

/* ── Individual expedition sections ── */
.exp-section {
  scroll-margin-top: 160px; /* nav (64) + compact anchor nav (~56) + 40px breathing room */
  position: relative;
  overflow: hidden;
}

/* Large decorative year — behind the heading, overflows downward and is
   naturally covered by the map via DOM paint order (both at z-index: 1) */
.exp-section__header[data-num]::before {
  content: attr(data-num);
  position: absolute;
  top: -0.1em;
  right: 0;
  font-family: var(--font-serif);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: var(--colour-orange);
  opacity: 0.13;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  pointer-events: none;
  user-select: none;
}

.exp-section__header {
  position: relative;
  margin-bottom: var(--space-10);
  z-index: 1;
}

.exp-map-wrap,
.exp-disc-stats,
.exp-section__body {
  position: relative;
  z-index: 1;
}

.exp-section__top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.exp-section__location {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(26, 21, 16, 0.5);
  letter-spacing: var(--tracking-wide);
}

.section--dark .exp-section__location {
  color: rgba(240, 235, 226, 0.45);
}

.exp-section__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--colour-text-dark);
  line-height: var(--leading-tight);
  position: relative;
}

/* ── Map container ── */
.exp-map-wrap {
  margin-bottom: var(--space-6);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.exp-map {
  width: 100%;
  height: 500px;
  background-color: var(--colour-dark-3);
  display: block;
}

/* ── Map legend ── */
.exp-map-legend {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background-color: var(--colour-dark-2);
}

.exp-map-legend__item {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(240, 235, 226, 0.7);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.exp-map-legend__item::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.exp-map-legend__item--hike::before  { background-color: #4a7c59; }
.exp-map-legend__item--kayak::before { background-color: #2d7dd2; }
.exp-map-legend__item--cycle::before { background-color: #E35205; }

/* ── Source / Sea callout markers ── */
/* ── Reset map button ── */
.exp-map-reset {
  padding: 4px 10px;
  background: #fff;
  border: 1px solid rgba(26, 21, 16, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(26, 21, 16, 0.65);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: color 0.15s, box-shadow 0.15s;
}

.exp-map-reset:hover {
  color: rgba(26, 21, 16, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ── Combined controls wrapper ── */
.exp-map-controls {
  display: flex;
  flex-direction: row;
  gap: var(--space-2);
}

/* ── Fullscreen button ── */
.exp-map-fullscreen {
  width: 32px;
  height: 32px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(26, 21, 16, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(26, 21, 16, 0.6);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exp-map-fullscreen svg {
  width: 100%;
  height: 100%;
  display: block;
}

.exp-map-fullscreen:hover {
  color: rgba(26, 21, 16, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Expanded state — wrap fills the viewport below the nav */
.exp-map--expanded {
  position: fixed !important;
  top: var(--nav-height) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: calc(100dvh - var(--nav-height)) !important;
  z-index: calc(var(--z-nav) + 10) !important;
  border-radius: 0 !important;
}

.exp-map--expanded .exp-map {
  width: 100% !important;
  height: 100% !important;
}

/* ── Expanded map info panel (legend + stats) ── */
.exp-map-panel {
  display: none;
  position: absolute;
  bottom: var(--space-6);
  left: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  background: rgba(26, 21, 16, 0.88);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  padding: 0 var(--space-6);
  pointer-events: none;
}

.exp-map-panel--visible {
  display: block;
}

.exp-map-panel__legend {
  display: flex;
  justify-content: space-around;
  padding-block: var(--space-2);
  border-bottom: 1px solid rgba(240, 235, 226, 0.1);
}

.exp-map-panel__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(240, 235, 226, 0.7);
}

.exp-map-panel__swatch {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.exp-map-panel__stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-1) var(--space-4);
  padding-block: var(--space-2);
}

@media (max-width: 640px) {
  .exp-map-panel__stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

.exp-map-panel__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.exp-map-panel__stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--colour-text-light);
  line-height: 1;
}

.exp-map-panel__stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(240, 235, 226, 0.4);
  margin-top: var(--space-1);
}

/* Prevent body scroll while a map is expanded */
body.exp-map-open {
  overflow: hidden;
}

.exp-map-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
}

.exp-map-marker__label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1510;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 8px;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.exp-map-marker__stem {
  width: 1px;
  height: 14px;
  background: rgba(0, 0, 0, 0.35);
}

.exp-map-marker__pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.exp-map-marker--start  .exp-map-marker__pin { background-color: #4a7c59; }
.exp-map-marker--finish .exp-map-marker__pin { background-color: #E35205; }


/* ── Route Coming Soon placeholder ── */
.exp-map-placeholder {
  width: 100%;
  height: 500px;
  background-color: var(--colour-dark-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.exp-map-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,   transparent, transparent 39px, rgba(240,235,226,0.03) 39px, rgba(240,235,226,0.03) 40px),
    repeating-linear-gradient(90deg,  transparent, transparent 39px, rgba(240,235,226,0.03) 39px, rgba(240,235,226,0.03) 40px);
  pointer-events: none;
}

.exp-map-placeholder__inner {
  text-align: center;
  position: relative;
  z-index: 1;
}

.exp-map-placeholder__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: rgba(240, 235, 226, 0.4);
  margin-bottom: var(--space-2);
}

.exp-map-placeholder__sub {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: rgba(240, 235, 226, 0.2);
  letter-spacing: var(--tracking-wide);
  max-width: 40ch;
  line-height: var(--leading-normal);
  margin-inline: auto;
}

/* ── Elevation profile chart ── */
.exp-elevation-wrap {
  display: flex;
  flex-direction: column;
  padding-top: var(--space-2);
  background-color: rgba(26, 21, 16, 0.04);
  border: 1px solid var(--colour-dark-2);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

.exp-elevation-chart {
  display: flex;
  align-items: stretch;
  padding: 0 var(--space-3);
}

.exp-elevation-labels {
  position: relative;
  width: 38px;
  flex-shrink: 0;
}

.exp-elevation-label {
  position: absolute;
  right: 5px;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  color: rgba(26, 21, 16, 0.45);
  font-family: var(--font-mono);
}

.exp-elevation {
  display: block;
  flex: 1;
  min-width: 0;
  height: 110px;
}

.exp-elevation-footer {
  padding: 0 var(--space-3) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-align: center;
  color: rgba(26, 21, 16, 0.45);
}

/* ── Completed expedition story CTA ── */
.exp-section__story {
  border-top: 1px solid rgba(26, 21, 16, 0.08);
  border-bottom: 1px solid rgba(26, 21, 16, 0.08);
  padding-block: var(--space-8);
  margin-block: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}

.exp-section__story-text {
  color: rgba(26, 21, 16, 0.65);
  line-height: var(--leading-relaxed);
  max-width: 52ch;
  margin: 0;
}

/* ── Next expedition link ── */
.exp-section__next {
  text-align: right;
  padding-top: var(--space-6);
}

.exp-next-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--colour-orange);
  text-decoration: none;
}

.exp-next-link:hover {
  text-decoration: underline;
}

/* ── Expedition summary stats ── */
.exp-summary-stats {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding-block: var(--space-6);
  border-top: 1px solid rgba(26, 21, 16, 0.08);
  text-align: center;
}

.section--warm .exp-summary-stats {
  border-color: rgba(26, 21, 16, 0.1);
}

.exp-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  border-right: 1px solid rgba(26, 21, 16, 0.1);
  padding-inline: var(--space-6);
}

.exp-summary-stat:last-child {
  border-right: none;
}

.exp-summary-stat__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
}

.exp-summary-stat__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(26, 21, 16, 0.45);
}

/* ── Discipline distance stats ── */
.exp-disc-stats {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
  padding-block: var(--space-6);
  border-top: 1px solid rgba(26, 21, 16, 0.08);
  border-bottom: 1px solid rgba(26, 21, 16, 0.08);
  text-align: center;
}

.section--warm .exp-disc-stats {
  border-color: rgba(26, 21, 16, 0.1);
}

.exp-disc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  border-right: 1px solid rgba(26, 21, 16, 0.1);
  padding-inline: var(--space-6);
}

.exp-disc-stat:last-child {
  border-right: none;
}

.exp-disc-stat__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
}

.exp-disc-stat__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(26, 21, 16, 0.45);
}

.exp-disc-stat--hike  .exp-disc-stat__value { color: #4a7c59; }
.exp-disc-stat--kayak .exp-disc-stat__value { color: #2d7dd2; }
.exp-disc-stat--cycle .exp-disc-stat__value { color: #E35205; }

/* ── Route description ── */
.exp-section__body {
  max-width: 800px;
  margin-inline: auto;
}


/* ==========================================================================
   FAQ PAGE
   ========================================================================== */

.faq {
  max-width: 760px;
  margin-inline: auto;
}

.faq-group {
  margin-bottom: var(--space-12);
}

.faq-group__label {
  margin-bottom: var(--space-4);
  color: var(--colour-text-muted);
}

.faq-item {
  border-bottom: 1px solid var(--colour-light-3);
}

.faq-item:first-of-type {
  border-top: 1px solid var(--colour-light-3);
}

.faq-item__trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding-block: var(--space-5);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--colour-text-dark);
  line-height: 1.4;
}

.faq-item__trigger:hover {
  color: var(--colour-orange);
}

.faq-item__icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.3s ease;
  color: var(--colour-orange);
}

.faq-item__trigger[aria-expanded="true"] .faq-item__icon {
  transform: rotate(45deg);
}

/* Default state (no JS): all answers visible */
.faq-item__body {
  overflow: hidden;
}

.faq-item__inner {
  padding-bottom: var(--space-6);
}

.faq-item__inner p {
  color: var(--colour-text-mid);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.faq-item__inner p:last-child {
  margin-bottom: 0;
}

/* JS-enhanced state: collapse and animate */
.faq--js .faq-item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.faq--js .faq-item__body.is-open {
  grid-template-rows: 1fr;
}

.faq--js .faq-item__inner {
  overflow: hidden;
  padding-bottom: 0;
  transition: padding-bottom 0.35s ease;
}

.faq--js .faq-item__body.is-open .faq-item__inner {
  padding-bottom: var(--space-6);
}

.exp-section__body p + p {
  margin-top: var(--space-4);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  /* Banner is in-flow at this breakpoint and scrolls away — anchor nav only needs to clear the fixed nav */
  .exp-anchor-nav {
    top: var(--nav-height);
  }

}

@media (max-width: 768px) {
  .exp-map,
  .exp-map-placeholder {
    height: 320px;
  }

  .exp-anchor-nav__link {
    padding: var(--space-4) var(--space-6);
  }

  .exp-section__body {
    padding-inline: var(--space-6);
  }
}

@media (max-width: 468px) {
  /* Force both stat rows onto a single 3-column line — disc stats wrap below 468px, summary stats below 375px */
  .exp-summary-stats,
  .exp-disc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    flex-wrap: unset;
  }

  .exp-summary-stat,
  .exp-disc-stat {
    padding-inline: var(--space-2);
    border-right: 1px solid rgba(26, 21, 16, 0.1);
  }

  .exp-summary-stat:last-child,
  .exp-disc-stat:last-child {
    border-right: none;
  }
}


/* ==========================================================================
   SUPPORTERS PAGE
   ========================================================================== */

/* ── Major supporter cards — 2-column, centred if odd ── */
.major-supporters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}

.major-supporter-card {
  flex: 0 0 calc(50% - var(--space-3));
  background-color: var(--colour-light-1);
  border: 1px solid var(--colour-light-3);
  border-top: 4px solid var(--colour-orange);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  transition: box-shadow var(--transition-base);
}

.major-supporter-card:hover {
  box-shadow: var(--shadow-md);
}

.major-supporter-card__logo {
  width: 220px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.major-supporter-card__logo img {
  max-width: 200px;
  max-height: 120px;
  object-fit: contain;
}

.major-supporter-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.major-supporter-card__type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--colour-orange);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--space-1);
}

.major-supporter-card__name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--colour-text-dark);
  margin-bottom: var(--space-3);
}

.major-supporter-card__desc {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  color: var(--colour-text-mid);
  margin-bottom: var(--space-4);
  text-align: justify;
}

.major-supporter-card__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--colour-orange);
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-top: auto;
}

.major-supporter-card__link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .major-supporter-card {
    flex: 0 0 100%;
  }
}

/* ── Compact supporter grid — 3-column, centred if less than full row ── */
.supporters-compact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.supporter-compact {
  flex: 0 0 calc((100% - 2 * var(--space-4)) / 3);
  background-color: var(--colour-light-2);
  border: 1px solid var(--colour-light-3);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  transition: border-color var(--transition-base);
}

.supporter-compact:hover {
  border-color: rgba(227, 82, 5, 0.3);
}

.supporter-compact__logo {
  flex-shrink: 0;
  width: 120px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.supporter-compact__logo img {
  max-width: 110px;
  max-height: 68px;
  object-fit: contain;
}

.supporter-compact__body {
  width: 100%;
}

.supporter-compact__name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--colour-text-dark);
  display: block;
  margin-bottom: var(--space-1);
}

.supporter-compact__desc {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--colour-text-mid);
  margin-bottom: var(--space-2);
}

.supporter-compact__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--colour-orange);
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
}

.supporter-compact__link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .supporter-compact {
    flex: 0 0 calc((100% - var(--space-4)) / 2);
  }
}

@media (max-width: 480px) {
  .supporter-compact {
    flex: 0 0 100%;
  }
}

/* ── Legacy grid ── */
.supporters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

@media (max-width: 900px) {
  .supporters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .supporters-grid {
    grid-template-columns: 1fr;
  }
}

.supporter-card {
  background-color: var(--colour-light-2);
  border: 1px solid rgba(26, 21, 16, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.supporter-card:hover {
  border-color: rgba(227, 82, 5, 0.3);
  transform: translateY(-2px);
}

.supporter-card__logo {
  width: 140px;
  height: 80px;
  object-fit: contain;
  display: block;
}

.supporter-card__logo-placeholder {
  width: 140px;
  height: 80px;
  background-color: rgba(26, 21, 16, 0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(26, 21, 16, 0.35);
  text-align: center;
  padding: var(--space-2);
}

.supporter-card__name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--colour-text-dark);
}

.supporter-card__type {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--colour-orange);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.supporter-card__desc {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(26, 21, 16, 0.6);
  line-height: var(--leading-normal);
}

.supporter-card__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--colour-orange);
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
}

.supporter-card__link:hover {
  text-decoration: underline;
}

.become-supporter {
  background-color: var(--colour-dark-1);
  border-radius: var(--radius-md);
  padding: var(--space-12) var(--space-10);
  text-align: center;
}

@media (min-width: 1025px) {
  .become-supporter {
    border-radius: 0;
    padding: var(--space-12) 0;
  }
}

.become-supporter__title {
  color: var(--colour-text-light);
  margin-bottom: var(--space-4);
}

.become-supporter__text {
  color: rgba(240, 235, 226, 0.7);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  max-width: 48ch;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-normal);
}


/* ==========================================================================
   SUPPORT ME PAGE
   ========================================================================== */

.support-costs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

@media (max-width: 640px) {
  .kit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .kit-grid {
    grid-template-columns: 1fr;
  }
}

.kit-card {
  padding: var(--space-8) var(--space-6);
  background-color: rgba(26, 21, 16, 0.06);
  border-radius: var(--radius-md);
  border-left: 2px solid var(--colour-orange);
}

.kit-card__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--colour-dark-1);
  margin-bottom: var(--space-4);
}

.kit-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.kit-card__list li {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: rgba(26, 21, 16, 0.65);
  padding-left: var(--space-4);
  position: relative;
  line-height: var(--leading-normal);
}

.kit-card__list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--colour-orange);
}

.kit-card__more {
  color: var(--colour-orange) !important;
  font-style: italic;
}

.kit-card__more::before {
  display: none;
}

@media (max-width: 900px) {
  .support-costs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .support-costs {
    grid-template-columns: 1fr;
  }
}

.support-cost {
  padding: var(--space-6);
  background-color: rgba(26, 21, 16, 0.06);
  border-radius: var(--radius-md);
  border-left: 2px solid var(--colour-orange);
}

.support-cost__label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--colour-dark-1);
  margin-bottom: var(--space-2);
}

.support-cost__desc {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: rgba(26, 21, 16, 0.65);
  line-height: var(--leading-normal);
  margin: 0;
}

.sponsor-contact {
  text-align: center;
}

.sponsor-contact__title {
  margin-bottom: var(--space-4);
}

.sponsor-contact__text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: rgba(240, 235, 226, 0.65);
  max-width: 48ch;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-normal);
}


/* ==========================================================================
   STORY PAGE — desktop spacing fixes
   ========================================================================== */

@media (min-width: 1025px) {
  /* Diagnosis section: extra space between last paragraph and section bottom.
     Padding on the content column expands the grid row, so the image stretches to match. */
  .story-block__content[data-chapter="01"] {
    padding-bottom: var(--space-16);
  }

  /* Support the mission section: space between h2 and body text */
  #donate-cta .section-header h2 {
    margin-bottom: var(--space-6);
  }
}


/* ==========================================================================
   EXPEDITIONS PAGE — Map popup styles
   Override Leaflet defaults for both route popups and segment popups.
   ========================================================================== */

/* ── Route popup (click on a river line) ── */
.map-popup-wrapper .leaflet-popup-content-wrapper {
  background: var(--colour-dark-1);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  padding: 0;
  border: 1px solid rgba(240, 235, 226, 0.1);
}

.map-popup-wrapper .leaflet-popup-tip {
  background: var(--colour-dark-1);
}

.map-popup-wrapper .leaflet-popup-content {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  min-width: 200px;
}

.map-popup {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.map-popup__name {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--colour-text-light);
  margin-bottom: var(--space-1);
}

.map-popup__meta {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(240, 235, 226, 0.55);
  letter-spacing: var(--tracking-wide);
}

.map-popup__disc {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(240, 235, 226, 0.4);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-top: var(--space-1);
}

.map-popup__link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--colour-orange);
  text-decoration: none;
  margin-top: var(--space-3);
}

.map-popup__link:hover {
  text-decoration: underline;
}

/* ── Segment popup (click on a track segment) ── */
.seg-popup-wrapper .leaflet-popup-content-wrapper {
  background: rgba(26, 21, 16, 0.95);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  padding: 0;
  border: 1px solid rgba(240, 235, 226, 0.1);
}

.seg-popup-wrapper .leaflet-popup-tip {
  background: rgba(26, 21, 16, 0.95);
}

.seg-popup-wrapper .leaflet-popup-content {
  margin: 0;
  padding: var(--space-3) var(--space-5);
}

.seg-popup {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.seg-popup__disc {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.seg-popup__dist {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--colour-text-light);
}


/* ==========================================================================
   HOME — Latest expedition story
   ========================================================================== */

.latest-story {
  background-color: var(--colour-dark-2);
  color: var(--colour-text-light);
}

.latest-story__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.latest-story__image-wrap {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  line-height: 0;
}

.latest-story__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.latest-story__image-wrap:hover .latest-story__image {
  transform: scale(1.03);
}

.latest-story__eyebrow {
  display: block;
  margin-bottom: var(--space-3);
}

.latest-story__title {
  font-size: var(--text-3xl);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.latest-story__text {
  color: rgba(240, 235, 226, 0.7);
  margin-bottom: var(--space-6);
  max-width: 52ch;
}

/* Mobile: stack image above content, center-aligned */
@media (max-width: 768px) {
  .latest-story__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .latest-story__content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .latest-story__title {
    font-size: var(--text-2xl);
  }
}
