/* Peaks & Pints route download pages.
   Colours mirror the app (src/theme/tokens.ts) and the company website.
   Sizes are in rem so they follow the reader's text-size setting. */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/dm-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/dm-serif-display-latin.woff2) format('woff2');
}

:root {
  --bg: #FAF7F0;
  --bg-alt: #F1EDE3;
  --surface: #FFFFFF;
  --text: #22302F;
  --text-muted: #5C6B6A;
  --on-brand: #FFFFFF;
  --brand: #456573;
  --brand-strong: #2F4856;
  --accent: #C98A2D;
  --accent-soft: #F4E3C8;
  --accent-text: #8A5A14;
  --moss: #5F7A4E;
  --border: #D8D2C5;
  --card-shadow: 0 2px 12px rgba(28,46,56,0.07), 0 0 0 1px rgba(28,46,56,0.055);
  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Always light, even when the phone is set to dark mode. */
  color-scheme: only light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; }
p, ul, ol { margin: 0; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 1rem; top: 0; z-index: 10; transform: translateY(-120%);
  background: var(--brand-strong); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: 0 0 10px 10px; font-weight: 600; text-decoration: none;
}
.skip-link { max-width: calc(100% - 2rem); }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip-link:focus { transform: none; }

.wrap { width: 100%; max-width: 40rem; margin: 0 auto; padding-inline: 1.25rem; }

/* Hero: short photo with the wordmark over a soft shade */
.hero { position: relative; }
.hero-img { display: block; width: 100%; aspect-ratio: 2 / 1; max-height: 22.5rem; object-fit: cover; background: var(--bg-alt); }
.hero-missing { display: grid; place-items: center; }
.hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4.5rem; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(16,24,23,.55), rgba(16,24,23,0));
}
.brand {
  position: absolute; top: .625rem; left: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding-right: .5rem; max-width: calc(100% - 2rem);
  font-family: var(--serif); font-size: 1.25rem; color: #FFFFFF; text-decoration: none; letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.brand:hover { color: #FFFFFF; }
.brand img { width: 1.625rem; height: 1.625rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.brand:focus-visible { outline-color: #FFFFFF; }

main { display: grid; gap: 1.125rem; padding-block: 1.125rem 2.5rem; }
/* Grid columns may shrink below their longest word, so large text wraps instead of widening the page. */
main, .route-head, .download, .help, .card, .share, .after, .links { grid-template-columns: minmax(0, 1fr); }

/* First screen: name, description, facts */
.route-head { display: grid; gap: .5rem; text-align: center; }
h1 { font-size: clamp(1.875rem, 8vw, 2.75rem); letter-spacing: -0.02em; overflow-wrap: break-word; hyphens: auto; }
.route-head .intro { max-width: 34em; margin-inline: auto; }
.summary {
  list-style: none; padding: .75rem .25rem; margin-top: .375rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr)); row-gap: .75rem;
  background: var(--surface); border-radius: 1rem; box-shadow: var(--card-shadow); text-align: center;
}
.summary li { padding: 0 .375rem; display: grid; gap: .125rem; align-content: start; justify-items: center; min-width: 0; }
.label { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); overflow-wrap: anywhere; }
.summary .value { font-size: clamp(1rem, 4.6vw, 1.1875rem); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary .sub { font-size: .8125rem; color: var(--text-muted); }

/* Download: the one thing the page is for */
.download { background: var(--brand-strong); color: var(--on-brand); border-radius: 1.375rem; padding: 1rem 1.125rem .25rem; display: grid; gap: .25rem; }
.btn-download {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .625rem;
  min-height: 3.75rem; padding: .875rem 1.375rem; border-radius: 1.875rem;
  background: var(--accent); color: #22302F;
  font-size: 1.125rem; font-weight: 600; text-decoration: none; text-align: center;
}
.btn-download:hover { background: #D9A14B; color: #22302F; }
.btn-download svg { width: 1.375rem; height: 1.375rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-download .size { font-weight: 500; opacity: .85; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: .75rem 1.25rem;
  border-radius: 999px; border: 2px solid currentColor; color: inherit; font-weight: 600; text-decoration: none;
}

/* Help: plain rows split by hairlines, so the button stays the only solid shape */
.help { display: grid; margin-top: .5rem; }
.help details { border-top: 1px solid rgba(255,255,255,.16); }
.help summary {
  list-style: none; cursor: pointer; min-height: 3rem; padding: .75rem .125rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  font-size: .9375rem; font-weight: 600;
}
.help summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after {
  content: ''; width: .5rem; height: .5rem; flex-shrink: 0; margin-right: .25rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px);
}
.help details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.help details > :not(summary) { margin-inline: .125rem; }
.help details > :last-child { margin-bottom: .875rem; }
.help details > * + * { margin-top: .5rem; }
.help p, .help li { font-size: .9375rem; line-height: 1.5; }
.download .note { color: inherit; opacity: .88; font-size: .875rem; }
.download :focus-visible, .site-footer :focus-visible { outline-color: #FFFFFF; }

.btn-quiet, .btn-share {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .5rem 1.125rem; border-radius: 999px;
  font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
  background: transparent; color: inherit; border: 1.5px solid currentColor;
}
.url-box label { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 600; }
.url-box input {
  width: 100%; min-height: 2.75rem; padding: .5rem .75rem; border-radius: .625rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9375rem;
}
.status { font-size: .875rem; font-weight: 600; min-height: 0; }
.status:empty { display: none; }

/* Share: a text link under the download button, so it never competes with it */
.share { display: grid; gap: .5rem; justify-items: center; text-align: center; }
.share:has(.btn-share:not([hidden])) { margin-top: .25rem; }
.btn-share { border: 0; padding-inline: .75rem; }
.btn-share:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-share svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share .url-box { width: 100%; text-align: left; }

/* Supporting cards */
.card { background: var(--surface); border-radius: 1.25rem; padding: 1.25rem; box-shadow: var(--card-shadow); display: grid; gap: .75rem; }
.card h2 { font-size: 1.375rem; }
.intro { font-size: 1rem; color: var(--text-muted); }
.route-map { background: var(--bg-alt); border-radius: .875rem; padding: .375rem; }
.route-map svg { width: 100%; height: auto; display: block; }
.route-map .line-halo { fill: none; stroke: var(--surface); stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; }
.route-map .line { fill: none; stroke: var(--moss); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.route-map .start { fill: var(--brand); stroke: var(--surface); stroke-width: 3; }
.route-map .pub { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem 1rem; font-size: .875rem; color: var(--text-muted); }
.legend li { display: flex; align-items: center; gap: .5rem; }
.legend i { width: .75rem; height: .75rem; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.legend .k-start { background: var(--brand); }
.legend .k-pub { background: var(--accent); }
.route-notes { font-size: .9375rem; display: grid; gap: .25rem; }
.source { font-size: .75rem; color: var(--text-muted); }

.pub-card { background: var(--accent-soft); box-shadow: none; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: -.375rem; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { font-size: .875rem; font-weight: 600; background: var(--surface); padding: .375rem .75rem; border-radius: 999px; }
.links { display: grid; gap: .625rem; }
.link-btn {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 3rem; padding: .625rem 1.125rem;
  border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none;
  border: 1px solid var(--border);
}
.link-btn:hover { border-color: var(--brand); color: var(--text); }

.steps { padding-left: 1.3em; display: grid; gap: .25rem; }
.steps li::marker { font-weight: 600; }
.note { font-size: .875rem; color: var(--text-muted); }

/* Feedback and follow */
.after { display: grid; gap: .375rem; text-align: center; font-size: .9375rem; color: var(--text-muted); padding-top: .25rem; }
.after a { font-weight: 600; }
.safety { font-size: .875rem; color: var(--text-muted); text-align: center; padding-inline: .5rem; }

/* Draft builds only */
.draft-banner { background: #F6E1DB; color: #7A2E1F; border-radius: .875rem; padding: .75rem .875rem; font-size: .875rem; font-weight: 600; }
.tbc { background: #F6E1DB; color: #7A2E1F; border-radius: 6px; padding: 0 6px; font-weight: 600; }

/* Footer */
.site-footer { background: #2F4856; color: rgba(255,255,255,.78); padding-block: 1.75rem 2.25rem; font-size: .8125rem; line-height: 1.7; }
.site-footer .wrap { display: grid; gap: .25rem; grid-template-columns: minmax(0, 1fr); }
.site-footer a, .after a { overflow-wrap: anywhere; }
.site-footer a { color: #FFFFFF; }
.footer-wordmark { font-family: var(--serif); font-size: 1.25rem; color: #FFFFFF; margin-bottom: .25rem; }

/* Index page */
.site-header { padding-block: .875rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wordmark { font-family: var(--serif); font-size: 1.375rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.header-tag { font-size: .8125rem; font-weight: 600; color: var(--text-muted); }
.hero-text { display: grid; gap: .75rem; padding-block: 1rem .25rem; }
.hero-text .eyebrow { color: var(--brand); margin-bottom: 0; }

@media (max-width: 22.5rem) {
  .btn-download { font-size: 1.0625rem; padding-inline: 1rem; gap: .5rem; }
  .download { padding: .875rem; }
}
@media (min-width: 40rem) {
  .links { grid-template-columns: 1fr 1fr; }
  .pub-card .links { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
