/* ─────────────────────────────────────────────────────────────
   Jovey · blog section stylesheet
   Base tokens / nav / pills / footer mirror index.html so the blog
   inherits the exact landing-page design. Blog-specific styles below.
   ───────────────────────────────────────────────────────────── */
:root {
  --ink: #212226;
  --bg: #F8F9FA;
  --btn: #121317;
  --blue: #3b6e8f;
  --muted: #6a6a71;
  --line: #e1e6ec;
  --card: #ffffff;
  /* three-pillar tag colours — Personal (orange) · Spiritual (magenta) · Vitality (teal) */
  --c-personal:  #D9822B;
  --c-spiritual: #B0519E;
  --c-vitality:  #1FA39A;
  --c-personal-ink:  #B4661A;
  --c-spiritual-ink: #9E3F8E;
  --c-vitality-ink:  #177F77;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Anuphan', 'Helvetica Neue', sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }

/* ── a11y: visible keyboard-focus ring on every interactive element ── */
:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 2px;
}

/* ── a11y: honour prefers-reduced-motion — calm CSS animation/scroll ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* cursor particle field */
#field { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }
.serif { font-family: 'Prata', serif; font-weight: 400; }

/* ─ nav ─ */
nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px clamp(20px, 5vw, 56px);
}
nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
nav .brand img { height: 46px; margin: -3px -8px; }
nav .wordmark {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--blue);
  letter-spacing: 0.5px;
}
nav .links { margin-left: auto; display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); }
nav .links a.plain {
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
nav .links a.plain:hover { opacity: 1; }
nav .links a.plain.active { opacity: 1; color: var(--blue); }
/* small phones: compact the nav so brand + links + pill fit without
   horizontal scroll (375px viewport) */
@media (max-width: 480px) {
  nav { padding: 16px 14px; gap: 8px; }
  nav .brand img { height: 38px; margin: -3px -6px; }
  nav .wordmark { font-size: 21px; }
  nav .links { gap: 10px; }
  nav .links a.plain { font-size: 14px; }
  nav .links .pill.small { font-size: 13px; padding: 8px 14px; }
}

/* pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--btn);
  color: #fff;
  font-family: 'Quicksand', 'Anuphan', sans-serif;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.pill:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(0,0,0,0.45); }
.pill.small { font-size: 14px; padding: 10px 20px; }
.pill.big { font-size: 17px; padding: 16px 34px; }
.pill.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.pill.ghost:hover { box-shadow: 0 14px 24px -14px rgba(40,40,60,0.35); }

/* inline arrow on MindSpend links — scales with text, inherits link colour */
.link-arrow { width: 0.95em; height: 0.95em; vertical-align: -0.1em; flex: 0 0 auto; }

/* section label — reused for eyebrows */
.sec-label {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blue);
}

/* ─ footer ─ */
footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(40px, 8vh, 80px);
  padding: 52px 20px 44px;
  text-align: center;
}
footer img { height: 44px; }
footer .tagline { font-family: 'Prata', serif; font-size: 16px; margin-top: 14px; }
footer .foot-links {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
}
footer .foot-links a { text-decoration: none; opacity: 0.8; }
footer .foot-links a:hover { opacity: 1; }
footer .copy { margin-top: 22px; color: var(--muted); font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   BLOG — shared
   ═══════════════════════════════════════════════════════════════ */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(20px, 6vw, 64px); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s ease, gap 0.2s ease;
}
.back:hover { color: var(--ink); gap: 12px; }

/* image placeholder slot — replace with a real <img> once art is ready */
.img-slot {
  border: 1.5px dashed var(--line);
  border-radius: 24px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(59,110,143,0.05), transparent 60%),
    var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}
.img-slot__inner { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px; }
.img-slot__icon { font-size: 30px; opacity: 0.7; }
.img-slot__label {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--ink);
}
.img-slot__hint { font-size: 12px; opacity: 0.75; max-width: 34ch; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   BLOG — index / listing
   ═══════════════════════════════════════════════════════════════ */
.blog-head { text-align: center; padding: clamp(28px, 6vh, 60px) clamp(20px, 6vw, 64px) clamp(20px, 4vh, 36px); }
.blog-head h1 {
  font-family: 'Prata', serif;
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 52px);
  margin-top: 14px;
  line-height: 1.25;
}
.blog-head p { margin-top: 14px; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); line-height: 1.9; }

/* category filter pills */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto clamp(30px, 5vh, 46px);
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 17px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.filter-pill:hover { color: var(--ink); border-color: #cdd5df; transform: translateY(-1px); }
.filter-pill .fdot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); transition: background 0.2s ease; }
.filter-pill[data-cat="personal"]  .fdot { background: var(--c-personal); }
.filter-pill[data-cat="spiritual"] .fdot { background: var(--c-spiritual); }
.filter-pill[data-cat="vitality"]  .fdot { background: var(--c-vitality); }
.filter-pill.active { color: #fff; border-color: transparent; }
.filter-pill.active .fdot { background: rgba(255,255,255,0.9); }
.filter-pill.active[data-cat="all"]       { background: var(--ink); }
.filter-pill.active[data-cat="personal"]  { background: var(--c-personal); }
.filter-pill.active[data-cat="spiritual"] { background: var(--c-spiritual); }
.filter-pill.active[data-cat="vitality"]  { background: var(--c-vitality); }

.blog-empty {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
  padding: clamp(40px, 8vh, 80px) 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(20px, 3vw, 32px);
  padding-bottom: clamp(40px, 8vh, 90px);
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 26px 40px -24px rgba(40,40,60,0.35); }
.post-card__cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: block;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(59,110,143,0.06), transparent 60%),
    linear-gradient(135deg, #fdfdff, #f1f4f8);
}
.post-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card__cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.post-card h2 {
  font-family: 'Prata', serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
}
.post-card__excerpt { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.8; flex: 1; }
.post-card__foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.post-card__read { font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--blue); }

/* category chip — colour-coded per pillar */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(59,110,143,0.09);
  border-radius: 999px;
  padding: 5px 12px;
  text-decoration: none;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.chip.personal  { color: var(--c-personal-ink);  background: rgba(217,130,43,0.13); }
.chip.spiritual { color: var(--c-spiritual-ink); background: rgba(176,81,158,0.13); }
.chip.vitality  { color: var(--c-vitality-ink);  background: rgba(31,163,154,0.13); }

/* ═══════════════════════════════════════════════════════════════
   BLOG — single post
   ═══════════════════════════════════════════════════════════════ */
.post { max-width: 860px; margin: 0 auto; padding: clamp(8px, 2vh, 20px) clamp(20px, 6vw, 48px) 0; }

.post-hero { text-align: center; padding: clamp(14px, 3vh, 30px) 0 clamp(24px, 4vh, 40px); }
.post-eyebrow {
  display: inline-block;
  font-family: 'Prata', serif;
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--blue);
  letter-spacing: 0.4px;
  margin-bottom: 18px;
}
.post-title {
  font-family: 'Anuphan', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 50px);
  line-height: 1.35;
  letter-spacing: -0.2px;
}
.post-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  font-size: 14px;
  color: var(--muted);
}
.post-meta .by { font-weight: 600; color: var(--ink); }
.post-meta .dot { opacity: 0.5; }
.post-meta .chips { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* featured cover */
/* square/portrait social covers: cap + centre on desktop so they don't dominate
   (full-width on mobile, where the square reads well) */
.post-cover { margin: clamp(10px, 3vh, 26px) auto 0; max-width: 480px; }
.post-cover.img-slot { min-height: clamp(200px, 42vw, 420px); }
.post-cover img { width: 100%; display: block; border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 24px 50px -30px rgba(40,40,60,0.4); }
/* graceful fallback: a missing cover.png removes its <img> (onerror) so the
   figure becomes :empty and renders as a labeled placeholder instead of a broken icon */
.post-cover:empty {
  min-height: clamp(200px, 42vw, 420px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: 24px;
  background: var(--card);
}
.post-cover:empty::after {
  content: "🖼️  วางไฟล์ที่ /assets/blog/10-romanticize/cover.png";
  color: var(--muted); font-size: 13px; padding: 24px; max-width: 42ch; line-height: 1.7;
}

/* the reading sheet — solid surface so text stays crisp over the particle field */
.post-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 60px);
  margin-top: clamp(24px, 4vh, 40px);
  box-shadow: 0 30px 60px -40px rgba(40,40,60,0.3);
}

/* prose */
.prose { font-size: clamp(16px, 1.15vw, 17.5px); line-height: 1.95; color: #34353b; }
.prose p { margin: 0 0 22px; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose .lead { font-size: clamp(17px, 1.4vw, 19px); color: var(--ink); }
.prose h2 {
  font-family: 'Anuphan', sans-serif;
  font-weight: 600;
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.5;
  color: var(--ink);
  margin: clamp(34px, 5vh, 52px) 0 20px;
}
.prose hr { border: none; height: 1px; background: var(--line); margin: clamp(30px, 5vh, 46px) 0; }

/* pull quote */
.pullquote {
  position: relative;
  margin: clamp(30px, 5vh, 44px) 0;
  padding: clamp(22px, 3.5vw, 34px) clamp(24px, 4vw, 40px);
  background: linear-gradient(135deg, rgba(59,110,143,0.06), rgba(177,91,255,0.05));
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: 'Anuphan', sans-serif;
  font-weight: 500;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.8;
  color: var(--ink);
}

/* tips list */
.tips { list-style: none; counter-reset: tip; margin: 8px 0 0; padding: 0; }
.tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(16px, 2.5vw, 24px);
  padding: clamp(20px, 3vh, 28px) 0;
  border-top: 1px solid var(--line);
}
.tip:first-child { border-top: none; padding-top: 6px; }
.tip__num {
  font-family: 'Prata', serif;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1;
  color: var(--blue);
  min-width: clamp(46px, 6vw, 60px);
  height: fit-content;
  padding-top: 2px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.tip__title {
  font-family: 'Quicksand', 'Anuphan', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 8px;
}
.tip__body { margin: 0; color: #40424a; line-height: 1.9; }

/* youtube / follow callout */
.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin: clamp(30px, 5vh, 46px) 0;
  padding: clamp(22px, 3.5vw, 30px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.callout__ic {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: #FF0033;
  color: #fff;
}
.callout__ic svg { width: 26px; height: 26px; display: block; }
.callout__txt { flex: 1; min-width: 200px; }
.callout__txt b { font-family: 'Quicksand', sans-serif; font-size: 16px; display: block; }
.callout__txt span { color: var(--muted); font-size: 14px; }

/* signature */
.post-sign {
  text-align: center;
  font-family: 'Prata', serif;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink);
  margin: clamp(30px, 5vh, 44px) 0 4px !important;
}
.post-sign span { color: var(--blue); margin: 0 8px; }

.post-foot { display: flex; justify-content: center; padding: clamp(28px, 5vh, 48px) 0 clamp(10px, 2vh, 20px); }

@media (max-width: 560px) {
  .tip { grid-template-columns: 1fr; gap: 4px; }
  .tip__num { min-width: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   READING PROGRESS — confetti dots stack left→right as you read,
   + a small circular % gauge. Injected by assets/read-progress.js.
   ═══════════════════════════════════════════════════════════════ */
.read-rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 60;
  pointer-events: none;
}
.read-rail__dot {
  width: 2.5px; height: 12px;              /* vertical confetti bar — 90° */
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--line);
  opacity: 0.5;
  transform: scaleY(0.72);                 /* grows taller when lit */
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}
/* lit = "stacked in": confetti colour, full length, soft neon glow */
.read-rail__dot.on {
  background: var(--c);
  opacity: 1;
  transform: scaleY(1);
  box-shadow: 0 0 6px -2px var(--c);
}

.read-gauge {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.read-gauge.show { opacity: 1; transform: none; }
.read-gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.read-gauge__track { fill: none; stroke: var(--line); stroke-width: 3.5; }
.read-gauge__fill  { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset 0.15s linear; }
.read-gauge__num {
  position: relative;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  background: var(--card);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px -8px rgba(40,40,60,0.4);
}

@media (prefers-reduced-motion: reduce) {
  .read-rail__dot { transition: opacity 0.2s linear, background-color 0.2s linear; transform: none; }
  .read-rail__dot.on { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   LONG-FORM PROSE EXTRAS — bulleted technique lists, quote labels
   + attribution, references. Scoped to avoid the .tips component
   (ol.tips / h3.tip__title live inside .prose): only `.prose ul`
   and `.prose ul li` are styled, never a bare `.prose ol`/`li`.
   ═══════════════════════════════════════════════════════════════ */
.prose ul { margin: 4px 0 24px; padding-left: 1.4em; }
.prose ul li { margin: 0 0 10px; line-height: 1.85; color: #40424a; }
.prose ul li::marker { color: var(--blue); }
.prose ul li:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; color: var(--ink); }

/* small uppercase label inside a pullquote (Problem / Solution / Benefit) */
.pullquote .qlabel {
  display: block;
  margin-bottom: 12px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--c-personal-ink);
}
/* attribution line under a pullquote */
.pullquote cite {
  display: block;
  margin-top: 14px;
  font-style: normal;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}

/* references list */
.refs { list-style: decimal; padding-left: 1.5em; margin: 8px 0 0; font-size: 14px; color: var(--muted); line-height: 1.8; }
.refs li { margin-bottom: 12px; }
.refs li:last-child { margin-bottom: 0; }
.refs a { word-break: break-word; }

/* wiki-map launcher (pops the Obsidian-style graph via assets/graph.js) */
button.pill { cursor: pointer; border: 0; -webkit-appearance: none; appearance: none; }
.map-launch { text-align: center; margin: clamp(-6px, -1vh, 0px) auto clamp(28px, 4.5vh, 44px); }
.map-launch .map-ico { width: 18px; height: 18px; }
.map-launch .pill.ghost { color: var(--ink); }
.map-launch .pill.ghost:hover { border-color: #cdd5df; color: var(--blue); }
