/* ==========================================================================
   dr. Petru Dániel Vaida — site stylesheet
   Inherits the infographic brand system: Playfair Display / Source Sans 3,
   off-white ground, brick red accent, deep green payoff.
   No external requests. No trackers. No web fonts from third parties.
   ========================================================================== */

@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/playfair-var.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/sourcesans-var.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ground:      #f8f7f4;   /* off-white page */
  --ground-warm: #f1efe9;   /* panel fill */
  --ink:         #1a1a18;   /* body text */
  --ink-soft:    #55534d;   /* secondary text */
  --rule:        #d9d5cc;   /* hairlines */
  --brick:       #c0392b;   /* accent / red flags */
  --brick-pale:  #faece7;   /* red-flag panel */
  --green:       #1e4a2c;   /* payoff / reassurance */
  --green-mid:   #2e7d46;
  --green-pale:  #e1f5ee;
  --amber-pale:  #fff8e7;

  --measure: 34rem;         /* ~62 characters */
  --gap: 1.6rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 1.12rem;      /* ~19px — presbyopic readers */
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 1.4rem; }
.measure { max-width: var(--measure); }

main { padding-bottom: 5rem; }

section { margin: 3.4rem 0; }
section:first-of-type { margin-top: 2.4rem; }

/* ---------- typography ---------- */

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 0.7em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 6.2vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 4.2vw, 2rem); margin-top: 0; }
h3 {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.4em;
}

p { margin: 0 0 1.15em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }
em { font-style: italic; }

a { color: var(--brick); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--brick); outline-offset: 3px; border-radius: 2px; }

/* Eyebrow: marks the *function* of the section, not decoration */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.55rem;
}

.lede {
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: var(--measure);
}

.aside { font-size: 0.96rem; color: var(--ink-soft); }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  background: var(--ground);
}
.masthead .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wordmark {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark:hover { text-decoration: none; }
.wordmark span { display: block; font-family: 'Source Sans 3', sans-serif; font-weight: 400; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }
.langswitch { font-size: 0.85rem; letter-spacing: 0.06em; }
.langswitch a { color: var(--ink-soft); text-decoration: none; padding: 0 0.15rem; }
.langswitch a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- hero ---------- */

.hero { margin: 3rem 0 3.6rem; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .recognition {
  font-size: 1.28rem;
  line-height: 1.55;
  border-left: 3px solid var(--brick);
  padding-left: 1.1rem;
  margin: 0 0 1.6rem;
  max-width: var(--measure);
}

/* ---------- THE SIGNATURE: harta amețelii ---------- */
/* A 2x2 clinical map. Rows = duration. Columns = trigger.
   This is not decoration — it is the actual diagnostic axis the page argues for. */

.map {
  margin: 2.2rem 0;
  border: 1px solid var(--rule);
  background: #fff;
}
.map__head {
  display: grid;
  grid-template-columns: 8.5rem 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.map__head div {
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-left: 1px solid var(--rule);
}
.map__head div:first-child { border-left: 0; background: var(--ground-warm); }

.map__row { display: grid; grid-template-columns: 8.5rem 1fr 1fr; border-bottom: 1px solid var(--rule); }
.map__row:last-child { border-bottom: 0; }
.map__label {
  padding: 1rem 0.9rem;
  background: var(--ground-warm);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.32;
}
.map__label small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.78rem; margin-top: 0.25rem; }
.map__cell { padding: 1rem 0.9rem; border-left: 1px solid var(--rule); font-size: 0.95rem; line-height: 1.45; }
.map__cell ul { margin: 0; padding: 0; list-style: none; }
.map__cell li { margin-bottom: 0.42rem; }
.map__cell li:last-child { margin-bottom: 0; }
.map__cell a { text-decoration: none; border-bottom: 1px solid rgba(192,57,43,0.35); }
.map__cell a:hover { border-bottom-color: var(--brick); }
.map__cell .flag { color: var(--brick); font-weight: 700; }
.map__cell .muted { color: var(--ink-soft); }

@media (max-width: 42rem) {
  .map__head { display: none; }
  .map__row { grid-template-columns: 1fr; }
  .map__label { border-bottom: 1px solid var(--rule); }
  .map__cell { border-left: 0; border-bottom: 1px solid var(--rule); }
  .map__row:last-child .map__cell:last-child { border-bottom: 0; }
  .map__cell::before {
    content: attr(data-col);
    display: block;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--ink-soft); margin-bottom: 0.45rem;
  }
}

/* ---------- panels ---------- */

.panel { padding: 1.5rem 1.5rem; margin: 2rem 0; border: 1px solid var(--rule); background: var(--ground-warm); }
.panel h2, .panel h3 { margin-top: 0; }
.panel p { max-width: none; }

.panel--red { background: var(--brick-pale); border-color: rgba(192,57,43,0.35); }
.panel--red h2 { color: var(--brick); }
.panel--red ul { margin: 0.6rem 0 0; padding-left: 1.15rem; }
.panel--red li { margin-bottom: 0.5rem; }
.panel--red li::marker { color: var(--brick); }

.panel--green { background: var(--green); border-color: var(--green); color: #fff; }
.panel--green h2 { color: #fff; }
.panel--green p { color: rgba(255,255,255,0.92); }
.panel--green strong { color: #fff; }

/* ---------- myth list ---------- */

.myth { border-top: 1px solid var(--rule); padding: 1.35rem 0; }
.myth:last-of-type { border-bottom: 1px solid var(--rule); }
.myth__claim {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.24rem;
  line-height: 1.3;
  margin: 0 0 0.55rem;
}
.myth__claim::before {
  content: '×';
  color: var(--brick);
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  margin-right: 0.5rem;
}
.myth p { margin-bottom: 0; }

/* ---------- condition index ---------- */

.index { border-top: 2px solid var(--ink); margin-top: 1.4rem; }
.index a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
}
.index a:hover { background: var(--ground-warm); }
.index a:hover .index__name { color: var(--brick); }
.index__name { font-weight: 700; }
.index__gloss { font-size: 0.93rem; color: var(--ink-soft); text-align: right; }

/* ---------- sources ---------- */

.sources { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }
.sources h2 { font-size: 1.05rem; font-family: 'Source Sans 3', sans-serif; font-weight: 700; letter-spacing: 0.02em; }
.sources ol { padding-left: 1.2rem; margin: 0; }
.sources li { margin-bottom: 0.5rem; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-size: 0.9rem; color: var(--ink-soft); }
.foot p { max-width: var(--measure); }
.foot .disclaimer { font-size: 0.85rem; }
.foot .version { font-size: 0.72rem; letter-spacing: 0.06em; margin-top: 1.4rem; }

/* ---------- skip link ---------- */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--ink); color: #fff; padding: 0.6rem 1rem; }
