/* ==========================================================================
   NatalPass Journal — shared blog styles
   Palette matches the main site: cream #f0ede6, ink #111112, gold #e8b84b.
   ========================================================================== */

:root {
  --bg: #f0ede6;          /* canvas — same as the main app */
  --ink: #111112;         /* primary text — same as the main app */
  --ink-soft: #4a4944;    /* secondary text */
  --muted: #8a8880;       /* meta, captions, upcoming items */
  --line: rgba(17, 17, 18, 0.13);
  --line-strong: rgba(17, 17, 18, 0.26);
  --gold: #e8b84b;        /* brand accent */
  --gold-ink: #8a6a12;    /* gold dark enough for text contrast on cream */
  --card: #e8e4dc;        /* card surface, slightly deeper than bg */

  --measure: 42rem;       /* ~680px readable column */
  --nav-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --f-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }   /* no smooth scroll — native, instant */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 1.0625rem;            /* 17px base */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Top navigation (used on the article page) -------------------- */

.blog-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  transition: transform 0.4s var(--ease);
}
.blog-nav[data-hidden="true"] { transform: translateY(-100%); }
.blog-nav__brand {
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-size: 1.0625rem;
}
.blog-nav__brand span { color: var(--muted); font-weight: 400; }
/* Prominent variant — black button (used top-left on the article page) */
.blog-nav__brand.is-button {
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  transition: background 0.2s var(--ease);
}
.blog-nav__brand.is-button span { color: rgba(240, 237, 230, 0.6); }
.blog-nav__brand.is-button:hover { background: #000; }
.blog-nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  font-size: 0.9rem;
}
.blog-nav__menu a, .blog-nav__filter {
  text-decoration: none;
  color: var(--ink-soft);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.25s var(--ease);
}
.blog-nav__filter[aria-pressed="true"] { color: var(--ink); }
.blog-nav__filter[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
}
.blog-nav__menu a:hover, .blog-nav__filter:hover { color: var(--ink); }
.blog-nav__service {
  color: var(--bg);
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 1.1rem !important;
  transition: background 0.25s var(--ease);
}
/* Higher specificity than .blog-nav__menu a:hover, so the label stays bright */
.blog-nav__menu a.blog-nav__service:hover { background: #000; color: var(--bg); }

/* ==========================================================================
   BROWSING PAGE — hero section on top, article index below
   ========================================================================== */

/* Primary button — matches the main site (black, 10px radius) */
.btn-primary {
  display: inline-block;
  text-decoration: none;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 10px;
  padding: 0.85rem 1.6rem;
  font-weight: 500;
  font-size: 0.95rem;
  min-height: 44px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-primary:hover { background: #000; transform: translateY(-1px); color: var(--bg); }

.blog-credit { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.01em; }
.blog-footer {
  border-top: 1px solid var(--line);
  padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.25rem, 5vw, 3rem);
  text-align: center;
}

/* Top bar */
.browse__topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem 1.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 5vw, 3rem);
}
.browse__topbar .btn-primary { padding: 0.7rem 1.3rem; font-size: 0.9rem; }
.browse__brand {
  font-weight: 600; letter-spacing: -0.01em; text-decoration: none; font-size: 1.0625rem;
}
.browse__brand span { color: var(--muted); font-weight: 400; }

/* Hero */
.browse__hero {
  position: relative;
  min-height: 82vh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 1.5rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 6rem) clamp(1.25rem, 5vw, 3rem) clamp(3.5rem, 8vh, 5rem);
}
.browse__title {
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 16ch;
}
.browse__sub {
  font-size: clamp(0.95rem, 1.25vw, 1.1rem);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* Scroll cue — dark rounded-square button (matches the app's map controls) */
.browse__scrollcue {
  position: absolute;
  left: 50%; bottom: clamp(1rem, 3vh, 2rem);
  transform: translateX(-50%);
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--ink); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  animation: cuebounce 1.8s var(--ease) infinite;
  transition: background 0.2s var(--ease);
}
.browse__scrollcue:hover { background: #000; }
.browse__scrollcue svg { width: 22px; height: 22px; display: block; }
@keyframes cuebounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 7px); }
}
.browse__hero .btn-primary { align-self: flex-start; margin-top: 0.5rem; }

/* Centered hero variant */
.browse__hero--center { align-items: center; text-align: center; }
.browse__hero--center .browse__title { margin: 0 auto; }
.browse__hero--center .browse__sub { margin: 0 auto; }

/* Article index */
.browse__index {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1.25rem, 5vw, 3rem) clamp(3rem, 9vh, 6rem);
}
.browse__indexhead {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.5rem;
}
.browse__indexhead p {
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.browse__indexhead span { font-size: 0.78rem; color: var(--muted); }

/* ==========================================================================
   ARTICLE PAGE
   ========================================================================== */

.article { padding-top: var(--nav-h); }

.article__header {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(4rem, 16vh, 11rem) clamp(1.25rem, 5vw, 3rem) clamp(2rem, 5vh, 3.5rem);
}
.article__eyebrow {
  font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.5rem;
}
.article__title {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 20ch;
}
.article__meta {
  margin-top: 1.75rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem;
  font-size: 0.85rem; color: var(--muted);
}
.article__rule {
  max-width: 64rem;
  margin: 0 auto;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

/* Full-bleed article photos. */
.figure--full {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: clamp(2.5rem, 6vh, 5rem);
  margin-bottom: clamp(2.5rem, 6vh, 5rem);
  border: 0;
  border-radius: 0;
  background: var(--bg);
}
.figure--full__link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.figure--full img {
  display: block;
  position: static;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 0; border-radius: 0;
  background: var(--bg);
}
.figure--full figcaption {
  position: absolute;
  left: clamp(1.25rem, 5vw, 3rem);
  bottom: clamp(1rem, 3vh, 1.75rem);
  margin: 0;
  color: #fff;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  backdrop-filter: blur(2px);
}

/* Two-column body: pinned section label (left) + prose (right) ------------ */
.article__body {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) clamp(1.25rem, 5vw, 3rem) 2rem;
}
.section {
  display: grid;
  grid-template-columns: 12rem minmax(0, var(--measure));
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(2rem, 5vh, 3.5rem) 0;
  border-top: 1px solid var(--line);
}
.section:first-child { border-top: 0; padding-top: 0; }
.section__label {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
  /* Pinned: stays put while its section's prose scrolls past.
     align-self:start keeps the cell at its content height so sticky has room
     to travel (a stretched grid cell can't stick). */
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.25rem; }
.prose h3 {
  font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600;
  margin-top: 2.25rem;
}
.prose p { font-size: 1.0625rem; line-height: 1.65; color: var(--ink); }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-top: 0.5rem; }
.prose a {
  color: var(--gold-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: opacity 0.2s var(--ease);
}
.prose a:hover { opacity: 0.65; }

/* Unpublished internal link → plain text, never a dead link */
.int-stub {
  color: var(--ink);
  border-bottom: 1px dotted var(--line-strong);
  cursor: default;
}

/* Figures */
figure { margin: 2rem 0; }
figure img, figure svg {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card);
}
figcaption { margin-top: 0.6rem; font-size: 0.82rem; color: var(--muted); }

/* CTA blocks */
.cta {
  margin: 2.5rem 0;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}
.cta--inline { background: transparent; border-style: dashed; }
.cta__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.cta__body { margin-top: 0.6rem; color: var(--ink-soft); }
.cta__btn {
  display: inline-block; margin-top: 1.1rem;
  text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 0.85rem 1.6rem; border-radius: 10px;
  background: var(--ink); color: var(--bg);
  min-height: 44px; line-height: 1.7;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.cta__btn:hover { transform: translateY(-1px); background: #000; }
/* Keep the CTA button readable even inside .prose (override link styling) */
.prose a.cta__btn { color: var(--bg); text-decoration: none; }
.prose a.cta__btn:hover { color: var(--bg); opacity: 1; }

/* FAQ */
.faq { display: grid; gap: 0; }
.faq details { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none;
  font-weight: 500; font-size: 1.05rem; letter-spacing: -0.01em;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin-top: 0.75rem; color: var(--ink-soft); max-width: var(--measure); }

.article__footnote {
  max-width: 64rem; margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  color: var(--muted); font-size: 0.85rem; font-style: italic;
}

/* ---------- "Awards"-style full index of every article ------------------- */
.awards {
  margin-top: clamp(3rem, 10vh, 7rem);
  border-top: 1px solid var(--line-strong);
  padding: clamp(2rem, 6vh, 4rem) clamp(1.25rem, 5vw, 3rem) clamp(3rem, 10vh, 6rem);
}
.awards__head {
  display: flex; justify-content: space-between; align-items: baseline;
  max-width: 76rem; margin: 0 auto 1.5rem;
}
.awards__head h2 { font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; }
.awards__head span { font-size: 0.8rem; color: var(--muted); }
.awards__list { max-width: 76rem; margin: 0 auto; }
.award {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: clamp(1rem, 2.5vh, 1.6rem) 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: padding-left 0.35s var(--ease);
}
.award:hover { padding-left: 0.75rem; }
.award__idx { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.award__title {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.08; letter-spacing: -0.025em; font-weight: 500;
}
.award__year { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.award--upcoming { color: var(--muted); cursor: default; }
.award--upcoming:hover { padding-left: 0; }
.award--upcoming .award__title { font-weight: 400; }
.award--upcoming .award__year::before { content: "soon"; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .browse__hero { min-height: auto; }
}
@media (max-width: 820px) {
  .section { grid-template-columns: 1fr; gap: 0.6rem; }
  .section__label { position: static; color: var(--ink); font-size: 1.05rem; }
  .article__body { padding-left: clamp(1.25rem, 6vw, 2rem); padding-right: clamp(1.25rem, 6vw, 2rem); }
  .award { grid-template-columns: 2rem 1fr; }
  .award__year { grid-column: 2; }
}
@media (max-width: 640px) {
  .blog-nav__menu { gap: 0.85rem; font-size: 0.82rem; }
  .blog-nav__brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
  .browse__scrollcue { animation: none; }
}

/* ── Sticky table of contents (built by blog.js) ── */
.toc-rail {
  display: none;
  position: fixed;
  top: calc(var(--nav-h) + 2rem);
  width: 12rem;
  z-index: 5;
}
body.toc-rail-live .toc-rail { display: flex; flex-direction: column; gap: 0.9rem; }
/* while the rail floats it replaces the in-flow labels; headings stay in the DOM for SEO */
body.toc-rail-live .section__label { opacity: 0; pointer-events: none; }
.toc-rail a {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--muted, #8a8880);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.toc-rail a:hover { color: var(--ink); }
.toc-rail a.active { color: var(--ink); font-weight: 600; }
