/* Trail to Summit
   Layout: a calm reading column for long trip reports, wide photo grids for browsing,
   and small "blaze" markers (the painted rectangles on New England trail trees) for categories. */
:root {
  --paper: #f3f5f1;
  --surface: #ffffff;
  --ink: #1b2420;
  --muted: #59655e;
  --line: #dbe1da;
  --spruce: #2c5a42;
  --spruce-ink: #ffffff;
  --blaze: #d7a019;
  --shade: rgba(14, 22, 18, .58);

  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --ui: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --read: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.2rem, 5vw, 3.4rem);
  --radius: 6px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111613;
    --surface: #18201b;
    --ink: #e5ebe6;
    --muted: #9aa69f;
    --line: #29332d;
    --spruce: #86c2a1;
    --spruce-ink: #0f1a14;
    --blaze: #e6b63a;
    --shade: rgba(5, 9, 7, .62);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--ui);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--spruce); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blaze); outline-offset: 2px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- Masthead ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 26px; color: var(--spruce); }
.brand-name { font: 700 1.55rem/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.menu-toggle { display: none; font: 600 var(--step--1) var(--ui); letter-spacing: .06em; text-transform: uppercase; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius); padding: 8px 12px; }
.site-nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; color: var(--ink); text-decoration: none; font: 600 1.05rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 12px 10px; }
.site-nav a:hover { color: var(--spruce); }
.has-sub { position: relative; }
.sub { display: none; position: absolute; left: 0; top: 100%; min-width: 240px; list-style: none; margin: 0; padding: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 28px rgba(0,0,0,.12); }
.sub a { font: 500 var(--step-0)/1.3 var(--ui); text-transform: none; letter-spacing: 0; padding: 9px 16px; }
.has-sub:hover > .sub, .has-sub:focus-within > .sub { display: block; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); max-height: calc(100vh - 64px); overflow-y: auto; }
  .site-nav.open { display: block; }
  .site-nav > ul { flex-direction: column; padding: 8px var(--gutter) 20px; }
  .sub { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 8px 12px; min-width: 0; }
  .sub a { padding: 7px 10px; color: var(--muted); }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(78vh, 680px); display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #26342c; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(8,14,11,.72) 100%); }
.hero-copy { position: relative; padding-block: 56px; width: 100%; }
.hero-kicker { font: 600 var(--step--1) var(--ui); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.hero-kicker::before { content: ""; width: 8px; height: 16px; background: var(--blaze); border-radius: 1px; }
.hero-title { font: 700 var(--step-4)/1.02 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0 0 24px; max-width: 16ch; text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn { display: inline-flex; align-items: center; font: 600 var(--step-0)/1 var(--ui); padding: 13px 20px; border-radius: var(--radius); border: 2px solid var(--spruce); background: var(--spruce); color: var(--spruce-ink); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-light { background: #fff; border-color: #fff; color: #1b2420; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.85); color: #fff; }
.btn-quiet { background: transparent; color: var(--spruce); }

/* ---------- Sections ---------- */
.section { padding-block: 48px; }
.section-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-h { font: 700 var(--step-3)/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0; text-wrap: balance; }
.more { font: 600 var(--step--1) var(--ui); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.more::after { content: " →"; }
.eyebrow { font: 600 var(--step--1) var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.lede { font: 400 var(--step-1)/1.55 var(--read); color: var(--muted); max-width: 60ch; margin: 12px 0 0; }

.grid { display: grid; gap: 28px 24px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* Cards */
.card-link { display: grid; gap: 12px; color: inherit; text-decoration: none; }
.card-img { aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; background: var(--line); max-width: 100%; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-link:hover .card-img img { transform: scale(1.03); }
.card-placeholder { display: grid; place-items: center; height: 100%; color: var(--muted); }
.card-placeholder svg { width: 64px; }
.card-body { display: grid; gap: 6px; min-width: 0; }
.card-title { font: 600 1.45rem/1.15 var(--display); margin: 0; text-wrap: balance; }
.card-link:hover .card-title { color: var(--spruce); }

/* Blaze: the painted trail marker used for categories */
.blaze { display: inline-flex; align-items: center; gap: 7px; font: 600 .78rem/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.blaze::before { content: ""; width: 6px; height: 12px; background: var(--blaze); border-radius: 1px; flex: none; }
a.blaze:hover { color: var(--spruce); }

/* Lists band */
.band { background: var(--spruce); color: var(--spruce-ink); }
.band .section-h { color: inherit; }
.lists { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px; align-items: center; padding-block: 48px; }
.lists-copy p { margin: 10px 0 0; opacity: .88; max-width: 40ch; }
.list-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.list-links a { display: flex; align-items: baseline; gap: 12px; color: inherit; text-decoration: none; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); border-radius: var(--radius); padding: 14px 16px; }
.list-links a:hover { border-color: currentColor; }
.list-n { font: 700 2rem/1 var(--display); font-variant-numeric: tabular-nums; min-width: 2.6ch; }
@media (max-width: 760px) { .lists { grid-template-columns: minmax(0, 1fr); } .list-links { grid-template-columns: minmax(0, 1fr); } }

/* Topics */
.topics { display: flex; flex-wrap: wrap; gap: 10px; }
.topic { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; }
.topic:hover { border-color: var(--spruce); }
.blaze-dot { width: 6px; height: 12px; background: var(--blaze); border-radius: 1px; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--step--1); }

/* Signup */
.signup { background: var(--surface); border-top: 1px solid var(--line); }
.signup-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-block: 40px; }
.signup-inner p { margin: 6px 0 0; color: var(--muted); }
.signup-form { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 320px; max-width: 460px; }
.signup-form input { flex: 1 1 200px; min-width: 0; font: 400 var(--step-0) var(--ui); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }

/* ---------- Posts ---------- */
.post-head { padding-block: 44px 24px; }
.post-cats { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.post-title { font: 700 var(--step-4)/1.05 var(--display); margin: 0; text-wrap: balance; }
.post-hero { margin: 0 auto 36px; max-width: 1180px; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.post-hero img { width: 100%; max-height: 72vh; object-fit: cover; border-radius: var(--radius); }
.list-head { padding-block: 44px 8px; }
.list-count { color: var(--muted); margin: 8px 0 0; }

.prose { font: 400 var(--step-1)/1.7 var(--read); padding-bottom: 32px; }
.prose > * { margin-block: 0 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 1.6em 0 .5em; text-wrap: balance; }
.prose h1, .prose h2 { font-size: var(--step-3); }
.prose h3 { font-size: var(--step-2); }
.prose h4 { font-size: var(--step-1); text-transform: uppercase; letter-spacing: .04em; }
.prose img { border-radius: var(--radius); margin-inline: auto; }
.prose p > img:only-child { margin-block: .4em; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font: 400 var(--step--1)/1.45 var(--ui); color: var(--muted); margin-top: 8px; text-align: center; }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.2em; border-left: 4px solid var(--blaze); color: var(--muted); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.prose .gallery figure { margin: 0; }
.prose .gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.prose table { border-collapse: collapse; width: 100%; font: 400 var(--step--1)/1.4 var(--ui); }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; }
.prose .table-wrap, .prose table { display: block; overflow-x: auto; max-width: 100%; }
.prose .video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; }
.prose .video iframe, .prose iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.prose iframe { aspect-ratio: 16 / 9; height: auto; }
.prose .wp-block-media-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 600px) { .prose .wp-block-media-text { grid-template-columns: minmax(0, 1fr); } }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--blaze); padding: 14px 18px; border-radius: var(--radius); font-family: var(--ui); font-size: var(--step-0); }

/* Comments */
.comments { padding-block: 24px 40px; border-top: 1px solid var(--line); }
.comments .section-h { font-size: var(--step-2); margin-bottom: 16px; }
.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.comment-replies { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--line); }
.comment-replies .comment, .comment-nested { background: var(--paper); }
.comment-nested { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.comment-author { font: 600 var(--step-0)/1.2 var(--ui); margin: 0 0 4px; }
.is-host > .comment-author { color: var(--spruce); }
.is-host > .comment-author::before { content: ""; display: inline-block; width: 6px; height: 12px; background: var(--blaze); border-radius: 1px; margin-right: 8px; vertical-align: -1px; }
.comment-text { font: 400 var(--step-0)/1.6 var(--read); }
.comment-text p { margin: 0 0 .6em; }
.comment-text p:last-child { margin-bottom: 0; }
.related { padding-block: 24px 56px; }

/* Link cards */
.link-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: inherit; text-decoration: none; }
.link-card h2 { font: 700 var(--step-2)/1.1 var(--display); margin: 0 0 8px; }
.link-card p { margin: 0; color: var(--muted); }
.link-card:hover { border-color: var(--spruce); }

/* Footer */
.footer { background: #17201b; color: #d5ddd7; margin-top: 0; }
.footer a { color: #e8eee9; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding-block: 44px 28px; }
.footer-brand { font: 700 1.6rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 10px; color: #fff; }
.footer-tag { margin: 0; color: #aab6ae; max-width: 32ch; }
.footer .label { font: 600 var(--step--1) var(--ui); letter-spacing: .12em; text-transform: uppercase; color: #aab6ae; margin: 0 0 10px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 18px 28px; border-top: 1px solid #2b3630; font-size: var(--step--1); color: #93a198; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* Pagefind */
#search { --pagefind-ui-primary: var(--spruce); --pagefind-ui-text: var(--ink); --pagefind-ui-background: var(--surface); --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--paper); --pagefind-ui-font: var(--ui); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
