/* ============================================================
   Hayate — Japan Travel Guides
   Shared stylesheet. One file for the whole site so every page
   stays consistent, the browser caches it once, and the Content
   Security Policy can forbid inline styles.
   ============================================================ */

/* ---- Self-hosted display face ------------------------------
   Fraunces, served from our own origin instead of Google Fonts.
   One variable file covers the 400 and 600 weights we use, so the
   CSP can drop fonts.googleapis.com / fonts.gstatic.com entirely
   and no visitor IP is handed to a third party. See SECURITY.md. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;          /* variable weight axis */
  font-display: swap;
  src: url("/fonts/fraunces-latin-var.woff2") format("woff2");
}

/* ---- Design tokens ---------------------------------------- */
:root {
  --ink:    #191512;   /* warm near-black: body text, hero ground   */
  --paper:  #F7F3EC;   /* warm off-white: page background, reading   */
  --gold:   #BE9A4E;   /* brand accent (from the pins), used sparingly */
  --cedar:  #2C3A31;   /* deep green: secondary bands, nods to cedar */
  --stone:  #7C7367;   /* muted: captions, meta, hairlines          */
  --paper-dim: #ECE5D8;/* slightly deeper paper for cards            */

  --measure: 34rem;    /* reading column width (~68 chars)          */
  --shell:   62rem;    /* the one content width every left edge sits on */
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  /* Side padding that collapses to --pad on small screens and grows to centre
     the shell on large ones. Applied to every full-width band (top bar, hero,
     content, footer) so they all start at the same x. */
  --gutter: max(var(--pad), calc((100% - var(--shell)) / 2));

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* ---- Reset / base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* Visible keyboard focus — accessibility floor */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---- Top bar ---------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 30%, transparent);
}
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand span { color: var(--gold); }
.nav a {
  text-decoration: none;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--stone);
  margin-left: 1.4rem;
}
.nav a:hover { color: var(--ink); }
@media (max-width: 560px) { .nav a { margin-left: 0.9rem; } .nav a.hide-sm { display: none; } }

/* ---- Eyebrow (echoes the pin badges) ---------------------- */
.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
}

/* ---- Hero ------------------------------------------------- */
.hero {
  position: relative;
  min-height: 68vh;
  display: flex; align-items: flex-end;
  color: var(--paper);
  padding: var(--gutter);
  background: var(--ink);
  overflow: hidden;
}
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.72;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(25,21,18,0.15) 0%,
    rgba(25,21,18,0.55) 55%,
    rgba(25,21,18,0.92) 100%);
}
.hero__inner { position: relative; z-index: 2; max-width: 46rem; }
.hero__route {
  margin: 0 0 0.9rem;
  font-size: 0.85rem; color: color-mix(in srgb, var(--paper) 78%, transparent);
  letter-spacing: 0.02em;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0.4rem 0 0;
  letter-spacing: -0.01em;
}

/* ---- Content column --------------------------------------- */
main { display: block; }
.wrap { padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter); }
/* Left-aligned, not centred: the reading column and the wide sections share a
   left edge with the brand, the hero headline and the footer. */
.col { max-width: var(--measure); }
.col.wide { max-width: var(--shell); }

.lede {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.4;
  font-weight: 400;
}
/* Section headings sit a clear step above the lede, which sits a step above
   the body — without that gap the whole page reads at one pitch. */
.col h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.4vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 3rem 0 0.7rem;
}
.col h3 { font-size: 1.25rem; margin: 2rem 0 0.4rem; }
.col p { margin: 0 0 1.1rem; }
.col ul { padding-left: 1.1rem; margin: 0 0 1.2rem; }
.col li { margin: 0.35rem 0; }

/* Section divider with a gold tick */
.rule {
  border: 0; height: 1px; margin: 2.4rem 0;
  background: color-mix(in srgb, var(--stone) 40%, transparent);
  position: relative;
}
.rule::before {
  content: ""; position: absolute; left: 0; top: -1px;
  width: 2.4rem; height: 3px; background: var(--gold);
}

/* ---- Signature: route strip (echoes pin route notation) --- */
.routestrip {
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: 0.5rem; margin: 1.6rem 0 0;
  list-style: none; padding: 0;
}
.routestrip li {
  flex: 1 1 8rem; min-width: 7rem;
  border: 1px solid color-mix(in srgb, var(--stone) 35%, transparent);
  border-top: 3px solid var(--gold);
  padding: 0.7rem 0.85rem; background: #fff;
  margin: 0;
}
.routestrip .k {
  display: block; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--stone); margin-bottom: 0.15rem;
}
.routestrip .v { font-weight: 600; font-size: 0.95rem; }

/* ---- Destination grid (homepage) -------------------------- */
.grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  margin-top: 1.6rem;
}
.card {
  position: relative; display: block; text-decoration: none;
  aspect-ratio: 3 / 4; overflow: hidden; background: var(--ink);
  color: var(--paper);
}
.card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.8; transition: transform .5s ease, opacity .3s;
}
.card:hover img { transform: scale(1.05); opacity: 0.9; }
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(25,21,18,0.9) 100%);
}
.card__body { position: absolute; z-index: 2; bottom: 0; padding: 1rem; }
/* Both are spans (a card is one <a>, so no block elements inside it) — they
   need display:block or the eyebrow and the title run together on one line. */
.card__eyebrow {
  display: block;
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--gold);
}
.card__title {
  display: block;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  line-height: 1.15; margin: 0.25rem 0 0;
}

/* ---- CTA card (to the free Gumroad guide) ----------------- */
.cta-card {
  background: var(--cedar); color: var(--paper);
  padding: clamp(1.6rem, 5vw, 2.4rem);
  margin: 2.6rem 0; border-radius: 3px;
}
.cta-card .eyebrow { color: var(--gold); background: rgba(190,154,78,0.18); }
.cta-card h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.5rem; margin: 0.7rem 0 0.4rem; line-height: 1.2;
}
.cta-card p { margin: 0 0 1.3rem; color: color-mix(in srgb, var(--paper) 82%, transparent); }
.cta {
  display: inline-block; text-decoration: none;
  background: var(--gold); color: var(--ink);
  font-weight: 700; letter-spacing: 0.02em;
  padding: 0.85rem 1.5rem; border-radius: 2px;
  transition: transform .12s ease, filter .12s ease;
}
.cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cta.ghost {
  background: transparent; color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
}

/* ---- Footer ----------------------------------------------- */
.footer {
  background: var(--ink); color: color-mix(in srgb, var(--paper) 70%, transparent);
  padding: 2.6rem var(--gutter); font-size: 0.85rem;
}
.footer a { color: color-mix(in srgb, var(--paper) 82%, transparent); }
.footer__links a { margin-right: 1.2rem; text-decoration: none; }
.footer__links a:hover { color: var(--gold); }
.footer small { display: block; margin-top: 1rem; color: var(--stone); }

/* ---- Motion preference ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Guide-landing additions (pages synced from japan_trip)
   ============================================================ */

/* "What's inside the full guide" — teaser list, honestly framed */
.whats-inside {
  border: 1px solid color-mix(in srgb, var(--stone) 35%, transparent);
  border-left: 3px solid var(--gold);
  background: var(--paper-dim);
  padding: 1.2rem 1.4rem;
  margin: 1.8rem 0;
}
.whats-inside h2 { margin: 0 0 0.6rem; font-size: 1.2rem; }
.whats-inside ul { margin: 0; padding-left: 1.1rem; }
.whats-inside li { margin: 0.3rem 0; }

/* In-article photograph — one per practical section, so a page about a place
   actually shows the place. Deliberately no gold: the tick above each h2 is
   already carrying that, and the photo should be the loud thing here. */
.shot { margin: 1.9rem 0; }
.shot img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
}
.shot figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem; line-height: 1.45; color: var(--stone);
}

/* No breakout: a photo keeps the reading column's left and right edges at every
   width. Consistency of that left edge beat the drama of a full-bleed image. */

/* Preview gallery — real sample pages from the PDF */
/* One column on a phone so a sample page is actually readable, four across on
   anything desktop-sized so the four pages read as one strip. The middle step
   keeps it from jumping straight from 1 to 4. */
.gallery {
  display: grid; gap: 0.6rem; margin: 1.6rem 0;
  grid-template-columns: 1fr;
}
@media (min-width: 30rem) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery img {
  width: 100%; border: 1px solid color-mix(in srgb, var(--stone) 30%, transparent);
  box-shadow: 0 6px 18px rgba(25,21,18,0.10);
}
.gallery figcaption {
  font-size: 0.72rem; color: var(--stone); margin-top: 0.3rem;
}
figure { margin: 0; }

/* Price note under the CTA button */
.price-note {
  display: block; margin-top: 0.7rem;
  font-size: 0.82rem; color: color-mix(in srgb, var(--paper) 78%, transparent);
}

/* ============================================================
   Destination-page layout: reading column + sticky rail
   The text column keeps its 34rem measure — the rail sits beside
   it on wide screens and disappears entirely on phones, so the
   mobile reading experience is unchanged.
   ============================================================ */
.layout {
  display: grid;
  justify-content: start;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, var(--measure));
}
@media (min-width: 64rem) {
  .layout { grid-template-columns: minmax(0, var(--measure)) 15rem; }
}

/* Anchor targets must clear the sticky top bar when jumped to. */
.col h2[id] { scroll-margin-top: 5rem; }

.rail { display: none; }
@media (min-width: 64rem) {
  .rail {
    display: block;
    position: sticky; top: 4.75rem;
    align-self: start;
    font-size: 0.9rem;
  }
}
.rail__label {
  font-size: 0.66rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--stone);
  margin: 0 0 0.7rem;
}
.rail__toc { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.rail__toc li { margin: 0; }
.rail__toc a {
  display: block; text-decoration: none; color: var(--stone);
  padding: 0.4rem 0 0.4rem 0.85rem;
  border-left: 2px solid color-mix(in srgb, var(--stone) 28%, transparent);
  line-height: 1.35;
  transition: color .15s ease, border-color .15s ease;
}
.rail__toc a:hover { color: var(--ink); border-left-color: var(--gold); }

.rail__card {
  border: 1px solid color-mix(in srgb, var(--stone) 32%, transparent);
  border-top: 3px solid var(--gold);
  background: var(--paper-dim);
  padding: 1rem;
}
.rail__card p { margin: 0 0 0.8rem; font-size: 0.84rem; line-height: 1.5; }
.rail__card .cta { display: block; text-align: center; padding: 0.7rem 0.9rem; font-size: 0.9rem; }

/* ---- Editorial accents ------------------------------------ */
/* Drop cap opening the lede — one gold letter, nothing else. */
.lede--drop::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 600;
  font-size: 2.9em;
  line-height: 0.8;
  color: var(--gold);
  padding: 0.05em 0.1em 0 0;
}

/* Pull quote — lifts one real sentence out of the section above. */
.pullquote {
  margin: 2.4rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 3px solid var(--gold);
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.35;
}
.pullquote p { margin: 0; }
.pullquote cite {
  display: block; margin-top: 0.6rem;
  font-family: var(--body); font-style: normal;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--stone);
}

/* Gold tick above each practical section — echoes .rule::before. */
.col h2.section::before {
  content: ""; display: block;
  width: 2.4rem; height: 3px; background: var(--gold);
  margin-bottom: 0.7rem;
}

/* The honest-warnings section, set on cedar. One dark block partway down the
   page breaks the long run of paper — no new colour, just the token that was
   already there and barely used. */
.caution {
  background: var(--cedar);
  color: color-mix(in srgb, var(--paper) 92%, transparent);
  padding: clamp(1.4rem, 4.5vw, 2.1rem);
  margin: 2.8rem 0;
  border-radius: 3px;
}
.col .caution h2 { margin-top: 0; color: var(--paper); }
.caution p:last-child { margin-bottom: 0; }

/* Fact list — the hard numbers (fares, frequencies, times) pulled out of
   the prose so they stay scannable on a phone. Deliberately quiet: no gold,
   so the route strip remains the one signature device on the page. */
.factlist {
  margin: 1.5rem 0;
  border-top: 1px solid color-mix(in srgb, var(--stone) 32%, transparent);
}
.factlist > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.9rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 22%, transparent);
}
.factlist dt {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--stone);
  padding-top: 0.22rem;
}
.factlist dd { margin: 0; font-size: 0.97rem; }
@media (max-width: 30rem) {
  .factlist > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .factlist dt { padding-top: 0; }
}
