/*!
 * FitCalc Theme — main stylesheet
 * Package: fitcalc
 * Version: 3.0.0
 * License: GNU General Public License v2 or later
 *
 * Visual language: "Warm Paper"
 *
 * A warm off-white ground instead of cool grey, one vermilion accent, and
 * nothing else. Hairline rules replace cards and shadows; every numeral is
 * tabular so figures never jitter as they count. The temperature lives in the
 * neutrals, not in decoration — that is what makes a single saturated accent
 * read as expensive rather than loud.
 *
 * Two brand tokens, and they are NOT interchangeable:
 *   --brand      a FILL. Button grounds, rules, large figures. White-on-brand
 *                is 3.31:1, which only clears AA for large/bold text.
 *   --brand-ink  TEXT. Links, labels, small figures. 5.18:1 on white.
 */

/* ============================================================ design tokens */
:root {
  /* neutrals — a warm grey scale. This is the whole trick. */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --surface-3: #f1efea;
  --ink: #21211f;
  --ink-2: #43423f;
  --ink-3: #57564f; /* AA on white (7.37), on --surface-2 (6.94) and --surface-3 */
  --ink-4: #64635e; /* AA on white (6.02) and on --surface-3 (5.24) */
  --line: #e0e0de;
  --line-2: #c9c8c3;
  --line-strong: #21211f;

  /* the single accent */
  --brand: #fc5200;
  --brand-ink: #c2410c;
  --brand-soft: #fff1e8;
  /* text sitting ON a --brand fill. Near-black, never white: 4.89:1 vs 3.31:1 */
  --on-brand: #21211f;

  /* inline text links — the only second chromatic colour, strictly reserved */
  --link: #0060d0;

  /* semantic — desaturated so they read as data, not decoration */
  --red: #c2291b;
  --red-soft: #fdf0ee;
  --green: #1d7a45;
  --green-soft: #eef7f1;
  --amber: #8a5a00;
  --amber-soft: #fdf6e7;
  --blue: #0060d0;
  --blue-soft: #eaf2fc;

  /* shape — sharp. Shadows are reserved for genuine elevation only. */
  --radius: 4px;
  --radius-sm: 3px;
  --radius-lg: 6px;
  --shadow: none;
  --shadow-sm: none;
  --ring: 0 0 0 2px #ffffff, 0 0 0 4px var(--brand);

  --maxw: 1240px;
  --content-maxw: 760px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

  /* faint engineering grid — the one decorative texture we allow */
  --grid: repeating-linear-gradient(0deg, rgba(33, 33, 31, .05) 0 1px, transparent 1px 32px),
          repeating-linear-gradient(90deg, rgba(33, 33, 31, .05) 0 1px, transparent 1px 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1c1b19;
    --surface-2: #25241f;
    --surface-3: #302e28;
    --ink: #f7f6f2;
    --ink-2: #c8c6be;
    --ink-3: #a9a79e; /* AA on --bg (7.76) and on --surface (7.14) */
    --ink-4: #948f86; /* AA on --bg (5.82) and on --surface (5.35) */
    --line: #33322d;
    --line-2: #45443d;
    --line-strong: #f7f6f2;
    --brand: #ff6b22;
    --brand-ink: #ff8a4d;
    --brand-soft: #2a1508;
    --on-brand: #131211;
    --link: #5aa9ff;
    --red: #ff8a75;
    --red-soft: #2a1310;
    --green: #5cc98d;
    --green-soft: #0c1f15;
    --amber: #e0b356;
    --amber-soft: #221b08;
    --blue: #5aa9ff;
    --blue-soft: #101c2e;
    --ring: 0 0 0 2px #1c1b19, 0 0 0 4px var(--brand);
    --grid: repeating-linear-gradient(0deg, rgba(247, 246, 242, .05) 0 1px, transparent 1px 32px),
            repeating-linear-gradient(90deg, rgba(247, 246, 242, .05) 0 1px, transparent 1px 32px);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* Every figure anywhere tabulates so nothing shifts as it counts up. Inter
   carries real tabular figures, so one family covers prose and numerals. */
.fc-hero-result .v, .fc-mini .v, .fc-table td.num, .fc-table th.num, .meta time,
.mono-label, .hero .eyebrow, .widget-title, .fc-field label, .fc-field .fc-label,
.fc-hero-result .k, .fc-mini .k, .fc-mini .u, .fc-table th, .brand small,
.fc-unit, .fc-note, .meta, .rp-date, .fc-bar-legend, .fc-hero-result .sub {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "kern" 1;
}

h1, h2, h3, h4 {
  line-height: 1.12;
  margin: 0 0 .55em;
  letter-spacing: -.035em;
  color: var(--ink);
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 6.2vw, 3.6rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-top: 2.4em; }
h3 { font-size: 1.2rem; margin-top: 1.9em; }
p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.15em; }
li { margin-bottom: .45em; }
strong { font-weight: 600; }

/* Monospaced micro-caps — the recurring signature across the whole site. */
.mono-label,
.hero .eyebrow,
.widget-title,
.fc-field label,
.fc-field .fc-label,
.fc-hero-result .k,
.fc-mini .k,
.fc-table th,
.brand small {
  font-family: var(--font-num);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 500;
}

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: static; width: auto; height: auto; clip: auto; margin: 8px;
  display: inline-block; padding: 10px 16px; background: var(--surface);
  border: 2px solid var(--brand); border-radius: var(--radius-sm);
}

/* ============================================================ layout */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
@media (max-width: 620px) { .wrap { padding: 0 18px; } }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.site-header .wrap { display: flex; align-items: center; gap: 22px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 1.18rem; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex: 0 0 32px;
  background: var(--brand);
  display: grid; place-items: center; color: var(--on-brand);
  font-family: var(--font-num); font-size: .82rem; font-weight: 700; letter-spacing: 0;
}
.brand small { display: block; font-size: .58rem; color: var(--ink-3); line-height: 1; letter-spacing: .18em; text-transform: uppercase; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 13px; border-radius: var(--radius-sm);
  font-size: .93rem; font-weight: 500; color: var(--ink-2);
}
.site-nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--brand-ink); }
.site-nav .current-menu-item > a::after, .site-nav .current_page_item > a::after {
  content: ""; display: block; height: 1.5px; background: var(--brand); margin-top: 3px;
}

.nav-toggle {
  margin-left: auto; display: none; background: transparent; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 8px 14px; color: var(--ink);
  font-family: var(--font-num); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
    border-bottom: 1px solid var(--line); display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 6px 18px 16px; gap: 0; }
  .site-nav a { padding: 12px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* ============================================================ hero */
.hero {
  background-color: var(--surface-2);
  background-image: var(--grid);
  background-size: 32px 32px;
  border-bottom: 1px solid var(--line);
  padding: 62px 0 56px;
}
.hero .eyebrow {
  display: inline-block; font-size: .66rem; font-weight: 600;
  background: var(--brand); color: var(--on-brand);
  border: 1px solid var(--brand); border-radius: var(--radius-sm);
  padding: 5px 10px; margin-bottom: 20px;
}
.hero h1 { max-width: 20ch; }
.hero p.lede { font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); max-width: 58ch; margin-bottom: 0; }

.site-main { padding: 44px 0 72px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 52px; align-items: start; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 36px; } .layout .sidebar { order: 2; } }

.content-block { max-width: var(--content-maxw); }

/* ============================================================ cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 22px;
}
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden;
}
.tool-card {
  background: var(--surface); padding: 22px 20px; display: block; color: inherit;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .14s ease;
}
.tool-card:hover { background: var(--surface-2); text-decoration: none; color: inherit; }
.tool-card .t-ico {
  font-family: var(--font-num); font-size: .8rem; font-weight: 600; color: var(--brand-ink);
  border: 1px solid var(--brand); border-radius: var(--radius-sm);
  width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 14px; letter-spacing: 0;
}
.tool-card h3 { font-size: 1.05rem; margin: 0 0 5px; letter-spacing: -.02em; }
.tool-card p { font-size: .92rem; color: var(--ink-3); margin: 0; line-height: 1.5; }

/* ============================================================ calculator UI */
.fc-calc {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; margin: 0 0 30px;
}
.fc-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 15px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.fc-head h2 { font-size: .95rem; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.fc-unit { margin-left: auto; display: flex; align-items: center; gap: 9px; font-family: var(--font-num); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.fc-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 2px; }
.fc-switch button {
  border: 0; background: transparent; font-family: var(--font-num); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
  padding: 5px 13px; border-radius: 1px; cursor: pointer;
}
.fc-switch button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.fc-body { padding: 22px 20px; }
.fc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 620px) { .fc-form { grid-template-columns: minmax(0, 1fr); } }
.fc-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fc-field.full { grid-column: 1 / -1; }
.fc-field label, .fc-label { font-size: .68rem; color: var(--ink-3); }
.fc-field input, .fc-field select {
  width: 100%; font-family: var(--font-num); font-size: .98rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 12px; outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.fc-field input:focus, .fc-field select:focus { border-color: var(--brand); box-shadow: var(--ring); }
.fc-field.has-error input, .fc-field.has-error select { border-color: var(--red); }
.fc-field .fc-hint { font-size: .8rem; color: var(--ink-3); }
.fc-field .fc-err { font-size: .8rem; color: var(--red); display: none; }
.fc-field.has-error .fc-err { display: block; }
.fc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.fc-radios { display: flex; gap: 0; flex-wrap: wrap; }
.fc-radios label {
  flex: 1 1 90px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); padding: 11px 8px; cursor: pointer; margin-right: -1px;
  font-size: .95rem; font-weight: 500; color: var(--ink-2); background: var(--surface);
}
.fc-radios input { position: absolute; opacity: 0; pointer-events: none; }
.fc-radios label:has(input:checked), .fc-radios label.is-on {
  border-color: var(--ink); background: var(--ink); color: var(--surface); position: relative; z-index: 1;
}

.fc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
/* The vermilion is reserved for the one action that matters — "Calculate".
   Reset stays a ghost. --on-brand keeps the label at 4.89:1; white on #fc5200
   is only 3.31:1 and would fail AA at this size. */
.fc-btn {
  border: 1px solid var(--brand); border-radius: var(--radius-sm); padding: 13px 26px;
  font-family: var(--font-num); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  cursor: pointer; background: var(--brand); color: var(--on-brand);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
/* Hover inverts to the ink ground — unmistakable feedback, and it reads. */
.fc-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.fc-btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.fc-btn.ghost:hover { background: var(--surface-3); color: var(--ink); border-color: var(--ink); }
.fc-note { font-family: var(--font-num); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-4); margin-left: auto; }

.fc-empty {
  border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--ink-3);
}

/* ------------------------------------------- results (the hero moment) */
.fc-results { border-top: 1px solid var(--line-strong); background: var(--surface); padding: 26px 20px 24px; }
.fc-results[hidden] { display: none; }

.fc-hero-result {
  text-align: left; padding: 0 0 20px;
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}
.fc-hero-result .k { font-size: .66rem; color: var(--ink-3); margin-bottom: 12px; }
.fc-hero-result .v {
  font-family: var(--font-num);
  font-size: clamp(3.2rem, 13vw, 5.4rem);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.05em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fc-hero-result .u {
  font-family: var(--font-num); font-size: .95rem; color: var(--brand-ink);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 500;
  margin-top: 10px;
}
.fc-hero-result .sub { font-size: .95rem; color: var(--ink-2); margin-top: 12px; max-width: 46ch; }

.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

/* mini figures share one rule-separated row instead of individual boxes */
.fc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fc-mini {
  background: transparent; padding: 16px 14px 15px;
  border-right: 1px solid var(--line);
}
.fc-mini:last-child { border-right: 0; }
.fc-mini .k { font-size: .62rem; color: var(--ink-3); margin-bottom: 8px; }
.fc-mini .v { font-family: var(--font-num); font-size: 1.65rem; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; color: var(--ink); }
.fc-mini .u { font-family: var(--font-num); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-top: 5px; }

.fc-scale { margin-top: 20px; }
.fc-bar {
  position: relative; height: 10px; overflow: hidden; display: flex; border-radius: 0;
  background: linear-gradient(90deg, var(--blue) 0 18.5%, var(--green) 18.5% 25%, var(--green) 25% 30%, var(--amber) 30% 35%, var(--red) 35% 100%);
}
.fc-bar .mark {
  position: absolute; top: -5px; width: 2px; height: 20px; background: var(--ink);
  transform: translateX(-1px);
}
.fc-bar-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .78rem; color: var(--ink-3); margin-top: 10px; }
.fc-bar-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: -1px; }

.fc-table-wrap { overflow-x: auto; margin-top: 12px; }
.fc-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 420px; }
.fc-table caption { text-align: left; font-weight: 600; font-size: .9rem; color: var(--ink-2); padding-bottom: 8px; }
.fc-table th, .fc-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.fc-table th { font-size: .64rem; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.fc-table td.num, .fc-table th.num { text-align: right; font-family: var(--font-num); }
.fc-table tr.is-key td { background: var(--surface-3); font-weight: 600; }

.fc-badge {
  display: inline-block; padding: 4px 10px; border-radius: var(--radius-sm);
  font-family: var(--font-num); font-size: .66rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
}
.fc-badge.ok { border-color: var(--green); color: var(--green); }
.fc-badge.warn { border-color: var(--amber); color: var(--amber); }
.fc-badge.bad { border-color: var(--red); color: var(--red); }

.fc-callout {
  margin-top: 18px; padding: 14px 16px; border-left: 2px solid var(--brand);
  background: var(--surface-2); font-size: .93rem; color: var(--ink-2);
}
.fc-callout.warn { border-left-color: var(--amber); }
.fc-callout p:last-child { margin-bottom: 0; }

@media (max-width: 620px) {
  .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-mini:nth-child(2n) { border-right: 0; }
  .fc-mini:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ============================================================ FAQ */
.faq { margin-top: 16px; border-top: 1px solid var(--line-strong); }
.faq details {
  border-bottom: 1px solid var(--line); background: transparent;
}
.faq summary {
  cursor: pointer; padding: 17px 2px; font-weight: 600; font-size: 1.02rem; list-style: none;
  display: flex; align-items: center; gap: 10px; letter-spacing: -.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--brand-ink); font-size: 1.1rem; font-family: var(--font-num); font-weight: 500;
}
.faq details[open] summary::after { content: "\2013"; }
.faq summary:hover { color: var(--brand-ink); }
.faq .faq-a { padding: 0 2px 18px; color: var(--ink-2); max-width: 62ch; }
.faq .faq-a > :last-child { margin-bottom: 0; }

.disclaimer-box {
  border: 1px solid var(--line-2); border-left: 2px solid var(--amber);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: .92rem; color: var(--ink-2);
  background: var(--surface-2); margin: 26px 0;
}

/* ============================================================ ads */
.ad-slot { margin: 30px 0; text-align: center; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-placeholder {
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--ink-4);
  font-family: var(--font-num); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  padding: 20px; background: var(--surface-2);
}
.ad-slot.sticky-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; background: var(--surface); border-top: 1px solid var(--line); }
body.has-sticky-ad { padding-bottom: 96px; }

/* ============================================================ sidebar */
.sidebar .widget { margin-bottom: 30px; }
.widget-title { font-size: .64rem; color: var(--ink-3); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin: 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget li a { display: block; padding: 11px 2px; font-size: .95rem; color: var(--ink-2); }
.widget li a:hover { color: var(--brand-ink); text-decoration: none; }
.widget li a.is-current { color: var(--brand-ink); }

/* Article list: title then date, so the sidebar reads as a column of links
   rather than a wall of text. */
.sidebar .w-posts li { padding: 12px 2px; display: flex; flex-direction: column; gap: 3px; }
.sidebar .w-posts li a { padding: 0; font-size: .92rem; line-height: 1.35; color: var(--ink); }
.sidebar .w-posts li a:hover { color: var(--brand-ink); }
.sidebar .w-date { font-family: var(--font-num); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }

/* Methodology / trust block. Health numbers invite doubt, so name the
   equations you use instead of asking people to take the result on faith. */
.sidebar .widget-method { border-top: 1px solid var(--line-strong); padding-top: 18px; }
.sidebar .widget-method p { font-size: .88rem; line-height: 1.55; color: var(--ink-3); margin-bottom: 10px; }
.sidebar .widget-method .w-more { margin-bottom: 0; }
.sidebar .widget-method .w-more a {
  font-family: var(--font-num); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--brand-ink);
}

/*
 * Keep the column in view while a long article scrolls past. Deliberately no
 * max-height: the theme's own blocks are short enough to fit any real viewport,
 * and clamping here reintroduces an awkward inner scrollbar. Below 980px the
 * grid collapses to one column and sticky is meaningless, so it is dropped.
 */
@media (min-width: 981px) {
  .layout > .sidebar { position: sticky; top: 84px; }
}

/* ============================================================ posts */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 24px; }
.post-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.post-card .p-body { padding: 20px; }
.post-card h3 { font-size: 1.12rem; margin: 0 0 8px; letter-spacing: -.02em; }
.post-card p { font-size: .93rem; color: var(--ink-3); margin-bottom: 0; }
.meta { font-family: var(--font-num); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.entry-footer { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line-strong); }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 0; }
.tag-list a {
  display: inline-block; padding: 4px 11px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line-2); font-family: var(--font-num); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2);
}
.tag-list a:hover { border-color: var(--brand); color: var(--brand-ink); text-decoration: none; }

/* Article internal linking — keeps crawl depth low for older posts. */
.related-posts { list-style: none; padding: 0; margin: 0 0 26px; border-top: 1px solid var(--line); }
.related-posts li {
  border-bottom: 1px solid var(--line); padding: 13px 2px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
}
.related-posts li:hover { background: var(--surface-2); }
.related-posts a { font-weight: 500; }
.rp-date { flex: none; font-family: var(--font-num); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

.post-nav {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 0 0 30px; padding-top: 20px; border-top: 1px solid var(--line);
}
.post-nav > div { max-width: 48%; }
.post-nav .pn-next { margin-left: auto; text-align: right; }
.post-nav a { font-weight: 500; line-height: 1.45; }
@media (max-width: 640px) {
  .post-nav { flex-direction: column; }
  .post-nav > div { max-width: none; }
  .post-nav .pn-next { text-align: left; }
}
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 34px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-num); font-size: .78rem; }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* ============================================================ footer */
/* Warm linen ground separates the footer from the paper-white body without a
   border doing the work — the same move the band above the fold uses. */
.site-footer { border-top: 1px solid var(--line-strong); background: var(--surface-2); padding: 44px 0 30px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-family: var(--font-num); font-size: .64rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-3); font-weight: 500; margin: 0 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { font-size: .93rem; color: var(--ink-2); }
.site-footer a:hover { color: var(--brand-ink); text-decoration: none; }
.legal {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px;
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--font-num); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4);
}

/* ============================================================ result reveal */
@media (prefers-reduced-motion: no-preference) {
  .fc-results:not([hidden]) { animation: fc-rise .34s cubic-bezier(.2, .7, .3, 1) both; }
  .fc-hero-result .v { font-variant-numeric: tabular-nums; }
}
@keyframes fc-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-results:not([hidden]) { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================ print */
@media print {
  .site-header, .site-footer, .sidebar, .ad-slot, .fc-actions, .nav-toggle { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .layout { display: block; }
  a { color: #000; text-decoration: underline; }
}
