/* =====================================================================
   The Shapewear Guide / Shapewearguiden — design system (Gruven Method)
   Token catalog is the ONLY place raw hex/rgb/px-scale values live.
   Direction: editorial/type-led (magazine) + comparison-table clarity.
   Typefaces: Fraunces (display) + Libre Franklin (text), self-hosted.
   ===================================================================== */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('/fonts/librefranklin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Franklin';
  src: url('/fonts/librefranklin-italic.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ---- Palette (semantic names; hex lives ONLY here) ---- */
  --paper: #faf6f3;        /* warm paper white, low chroma (not beige/AI-cream) */
  --surface: #ffffff;      /* raised cards */
  --surface-2: #f3ece8;    /* neutral inset / table head / footer */
  --brand-tint: #f3e5ea;   /* soft brand wash */
  --brand-tint-2: #fbf1f4; /* faint brand wash */
  --gold-tint: #f3ead2;    /* award accent bg */

  --ink: #241d20;          /* primary text (warm near-black, never #000) */
  --ink-2: #574d52;        /* secondary text */
  --ink-3: #726268;        /* meta / faint (AA on paper for small text) */
  --line: #e8ddd8;         /* hairline */
  --line-2: #d6c7c1;       /* stronger divider */

  --brand: #8a3a56;        /* rosewood — mature, feminine-serious */
  --brand-deep: #6d2c43;   /* hover / active */
  --brand-ink: #5e2439;    /* brand text on light (higher contrast) */
  --on-brand: #ffffff;     /* text on brand fill */
  --pos: #2e6b4a;          /* verified / pro */
  --neg: #a1512f;          /* con / caution */
  --gold: #8a5e1a;         /* award accent (rule/mark) */
  --focus: #6d2c43;        /* focus ring */

  /* ---- Spacing ramp ---- */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem;

  /* ---- Type scale (roles) ---- */
  --fs-meta: .8125rem; --fs-sm: .9375rem; --fs-body: 1.0625rem; --fs-lead: 1.1875rem;
  --fs-h3: 1.3125rem; --fs-h2: 1.6rem; --fs-h1: 2.4rem; --fs-display: 3rem;

  /* ---- Typefaces ---- */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-text: 'Libre Franklin', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* ---- Radius (one per component class) ---- */
  --r-sm: .375rem; --r-md: .625rem; --r-lg: 1rem; --r-pill: 999px;

  /* ---- Elevation (light-from-above, warm low-chroma) ---- */
  --sh-1: 0 1px 2px rgba(60, 28, 40, .06);
  --sh-2: 0 2px 10px rgba(60, 28, 40, .07), 0 1px 3px rgba(60, 28, 40, .05);
  --sh-3: 0 14px 36px rgba(60, 28, 40, .13), 0 3px 8px rgba(60, 28, 40, .06);

  /* ---- Layout ---- */
  --wrap: 46rem;           /* main column */
  --measure: 40rem;        /* prose cap (~66ch) */
  --t: 160ms cubic-bezier(.2, .6, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: var(--fs-body); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-5); }

h1, h2, h3 { font-family: var(--font-display); font-optical-sizing: auto; color: var(--ink); font-weight: 560; line-height: 1.2; }
h2 { font-size: var(--fs-h2); margin: var(--sp-7) 0 var(--sp-3); letter-spacing: -.01em; }
h3 { font-size: var(--fs-h3); margin: var(--sp-5) 0 var(--sp-2); }
p { margin: 0 0 var(--sp-4); }
strong { font-weight: 600; }
a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }

/* ---- Skip link ---- */
.skip {
  position: absolute; left: var(--sp-3); top: var(--sp-3); z-index: 50;
  background: var(--brand); color: var(--on-brand); text-decoration: none;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md);
  transform: translateY(-160%); transition: transform var(--t);
}
.skip:focus { transform: translateY(0); }

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) var(--sp-5); }
.logo { font-family: var(--font-display); font-optical-sizing: auto; font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--brand); }
.site-header nav { display: flex; gap: var(--sp-5); }
.site-header nav a { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; padding: var(--sp-2) 0; }
.site-header nav a:hover { color: var(--brand); }

/* ---- Page hero ---- */
.article { padding-bottom: var(--sp-8); }
.article section[id] { scroll-margin-top: var(--sp-7); }
.crumbs { font-size: var(--fs-meta); color: var(--ink-3); padding-top: var(--sp-5); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.phero { padding: var(--sp-7) 0 var(--sp-5); }
.kicker { margin: 0 0 var(--sp-3); font-size: var(--fs-meta); font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--brand); }
.phero h1 { margin: 0 0 var(--sp-4); font-size: clamp(var(--fs-h1), 4vw + 1rem, var(--fs-display)); line-height: 1.12; letter-spacing: -.015em; }
.phero .lead { max-width: 36rem; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); }
.trust { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: var(--sp-5) 0 0; padding: 0; list-style: none; font-size: var(--fs-meta); color: var(--ink-3); }
.trust span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.trust span::before { content: ""; width: .4rem; height: .4rem; border-radius: var(--r-pill); background: var(--brand); }

/* ---- Prose ---- */
.article section p, .faq .faq-a p, .pick-say, .verdict-body > p, .note, ul.checks { max-width: var(--measure); }
ul.checks { list-style: none; padding: 0; margin: var(--sp-4) 0; }
ul.checks li { position: relative; padding-left: var(--sp-5); margin: var(--sp-2) 0; }
ul.checks li::before { content: ""; position: absolute; left: 0; top: .62em; width: .5rem; height: .5rem; border-radius: 2px; background: var(--brand); }
.note { background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: var(--r-sm); padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0; font-size: var(--fs-sm); }
.note strong:first-child { color: var(--brand-ink); }
.note--care { border-left-color: var(--neg); }
.note--care strong:first-child { color: var(--neg); }

/* ---- Affiliate disclosure ---- */
.discl { display: flex; gap: var(--sp-3); align-items: flex-start; background: var(--brand-tint-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); margin: var(--sp-5) 0; font-size: var(--fs-sm); color: var(--ink-2); }
.discl-tag { flex: none; background: var(--brand); color: var(--on-brand); font-size: var(--fs-meta); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); }
.discl p { margin: 0; }

/* ---- Verdict box (carries the single primary action) ---- */
.verdict { margin: var(--sp-6) 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
.verdict-label { margin: 0; padding: var(--sp-3) var(--sp-5); background: var(--brand); color: var(--on-brand); font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .02em; }
.verdict-body { padding: var(--sp-5); }
.verdict-body > p { margin-top: 0; }
.verdict-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.verdict-pick-txt { display: flex; flex-direction: column; gap: var(--sp-1); }
.verdict-pick-k { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--ink-3); }
.verdict-pick-txt strong { font-family: var(--font-display); font-weight: 560; font-size: var(--fs-h3); line-height: 1.15; }
.verdict-pick-w { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 2.75rem; padding: var(--sp-3) var(--sp-5); font-family: var(--font-text); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; border: 1px solid transparent; border-radius: var(--r-md); cursor: pointer; transition: transform var(--t), background var(--t), border-color var(--t), color var(--t); }
.btn span[aria-hidden] { transition: transform var(--t); }
.btn:hover span[aria-hidden] { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); color: var(--on-brand); }
.btn-secondary { background: var(--surface); color: var(--brand-ink); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--brand-tint-2); border-color: var(--brand); color: var(--brand-deep); }
.rl { font-size: var(--fs-meta); color: var(--ink-3); }
.pick-cta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); }

/* ---- Recommendation cards ---- */
.picks-h { margin: var(--sp-7) 0 var(--sp-3); font-size: var(--fs-h2); }
.picks { display: flex; flex-direction: column; gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-6); }
.pick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--sh-1); }
.pick--spotlight { position: relative; background: var(--brand-tint-2); border-color: var(--brand); box-shadow: var(--sh-3); }
.pick--spotlight::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gold); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.pick-badge { display: inline-block; margin: 0 0 var(--sp-2); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-meta); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-tint); border-radius: var(--r-pill); }
.pick--spotlight .pick-badge { color: var(--ink); background: var(--gold-tint); }
.pick h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-h3); }
.pick-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--ink-3); }
.pick-meta span:first-child { color: var(--ink-2); font-weight: 600; }
.pick-say { margin: 0 0 var(--sp-3); }
.pick-list { list-style: none; padding: 0; margin: 0 0 var(--sp-4); display: grid; gap: var(--sp-1); }
.pick-list li { position: relative; padding-left: var(--sp-5); font-size: var(--fs-sm); }
.pick-list .pro::before { content: "\2713"; position: absolute; left: 0; color: var(--pos); font-weight: 700; }
/* Cons carry the editorial weight here, so they must not read as a fainter
   pro at a glance: distinct glyph, distinct colour, and the caution colour on
   the text itself rather than only on the marker. */
.pick-list .con { color: var(--neg); }
.pick-list .con::before { content: "\00d7"; position: absolute; left: .05em; color: var(--neg); font-weight: 700; }

/* ---- Table of contents ---- */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0; }
.toc-h { margin: 0 0 var(--sp-2); font-size: var(--fs-meta); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.toc ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: var(--sp-6); }
.toc li { margin: var(--sp-1) 0; break-inside: avoid; }
.toc a { font-size: var(--fs-sm); }

/* ---- Tables (comparison + sources) ---- */
.table-scroll { overflow-x: auto; margin: var(--sp-5) 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
/* The comparison table is the one element the 46rem reading measure is wrong
   for: six columns clipped the "Bedst til" verdict off-screen on a desktop
   that had room to spare. Let it break out of the measure once there is room,
   and keep the horizontal-scroll fallback for everything narrower. */
@media (min-width: 64rem) {
  .table-scroll { --bleed: min(68rem, calc(100vw - var(--sp-8))); width: var(--bleed); margin-left: calc(50% - var(--bleed) / 2); }
}
table.cmp { border-collapse: collapse; width: 100%; min-width: 42rem; font-size: var(--fs-sm); }
.cmp caption { text-align: left; caption-side: top; padding: var(--sp-3) var(--sp-4); font-weight: 600; color: var(--ink-2); font-size: var(--fs-sm); }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.cmp thead th { background: var(--surface-2); font-family: var(--font-text); font-weight: 600; font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); white-space: nowrap; }
.cmp tbody th { font-weight: 600; color: var(--ink); }
/* Price is the axis the table is sorted on — align the digits so the ramp is
   readable as a column, and give the verdict column the closing emphasis. */
.cmp td:nth-child(5) { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand-ink); white-space: nowrap; }
.cmp td:nth-child(6) { color: var(--ink); }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }
.cmp tbody tr:hover { background: var(--brand-tint-2); }
.table-note { margin: calc(-1 * var(--sp-3)) 0 var(--sp-5); font-size: var(--fs-meta); color: var(--ink-3); }

/* ---- Source ledger (priser & kilder) ---- */
/* The source ledger is the site's trust centrepiece and it is long (one entry
   per offer, unverified ones included). Each entry is a discrete card with a
   left rule that encodes the outcome, so a reader can scan for the gaps. */
.ledger { display: grid; gap: var(--sp-4); margin: var(--sp-5) 0; }
@media (min-width: 64rem) {
  .ledger { --bleed: min(68rem, calc(100vw - var(--sp-8))); width: var(--bleed); margin-left: calc(50% - var(--bleed) / 2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.led-item { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--pos); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); display: grid; align-content: start; gap: var(--sp-2); }
.led-item--none { border-left-color: var(--neg); background: var(--surface-2); }
.led-h { margin: 0; font-family: var(--font-display); font-optical-sizing: auto; font-weight: 560; font-size: var(--fs-h3); line-height: 1.2; color: var(--ink); }
.led-h span { font-family: var(--font-text); font-weight: 400; font-size: var(--fs-sm); color: var(--ink-2); }
.led-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); }
.led-price { margin: 0; font-weight: 700; font-size: var(--fs-lead); color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.led-price.led-none { color: var(--neg); font-size: var(--fs-body); font-weight: 600; }
.led-meta { margin: 0; font-size: var(--fs-meta); color: var(--ink-3); }
.led-note { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); max-width: var(--measure); }
.led-note:empty { display: none; }
.stamp { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-meta); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); }
.stamp-ok { color: var(--pos); background: var(--surface-2); }
.stamp-no { color: var(--neg); background: var(--surface-2); }

/* ---- FAQ ---- */
.faq { margin: var(--sp-7) 0 0; }
.faq details { margin: var(--sp-2) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 600; font-size: 1.3em; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq .faq-a { padding: 0 var(--sp-5) var(--sp-4); color: var(--ink-2); }
.faq .faq-a p { margin: 0; }

/* ---- Related ---- */
.related { margin: var(--sp-7) 0 0; }
.related-list { list-style: none; padding: 0; margin: var(--sp-4) 0 0; }
.related-list li { border-top: 1px solid var(--line); }
.related-list li:last-child { border-bottom: 1px solid var(--line); }
.related-list a { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) 0; text-decoration: none; color: var(--ink); }
.related-list a strong { font-family: var(--font-display); font-weight: 560; font-size: var(--fs-h3); color: var(--ink); }
.related-list a span { font-size: var(--fs-sm); color: var(--ink-2); }
.related-list a:hover strong { color: var(--brand-deep); }

/* ---- Guides index (editorial list, not bento) ---- */
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 var(--sp-6); margin: var(--sp-4) 0 0; }
.gcard { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.gcard strong { font-family: var(--font-display); font-weight: 560; font-size: var(--fs-h3); }
.gcard span { font-size: var(--fs-sm); color: var(--ink-2); }
.gcard:not(.soon):hover strong { color: var(--brand-deep); }
.gcard.soon strong, .gcard.soon span { color: var(--ink-3); }
.gcard.soon em { font-style: normal; font-size: var(--fs-meta); color: var(--brand); font-weight: 600; }

/* ---- Footer ---- */
.site-footer { margin-top: var(--sp-9); background: var(--surface-2); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.site-footer .wrap { padding: var(--sp-6) var(--sp-5); }
.foot-brand { margin: 0 0 var(--sp-3); font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); color: var(--ink); }
.foot-brand span { color: var(--brand); }
.foot-discl { margin: 0 0 var(--sp-4); }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); }
.foot-nav a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.foot-nav a:hover { color: var(--brand-deep); }
.foot-copy { margin: 0; font-size: var(--fs-meta); color: var(--ink-3); }

/* ---- Focus + motion ---- */
a:focus-visible, .btn:focus-visible, summary:focus-visible, .skip:focus-visible, .gcard:focus-visible, .table-scroll:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Responsive ---- */
@media (max-width: 40rem) {
  :root { --fs-h1: 2rem; --fs-h2: 1.4rem; --fs-display: 2.3rem; }
  .wrap { padding: 0 var(--sp-4); }
  .phero { padding: var(--sp-6) 0 var(--sp-4); }
  .verdict-pick { flex-direction: column; align-items: flex-start; }
  .toc ul { columns: 1; }
  /* Logo + four nav items do not fit on one 360px line. Wrap the nav onto its
     own row rather than letting it push the page sideways. */
  .bar { flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) var(--sp-4); }
  .site-header nav { width: 100%; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
  .site-header nav a { padding: 0 0 var(--sp-1); }
}
