/*
 * The Fréson Studio, in the Newsprint edition of the Fréson Stylebook
 * (yannicfreson.be/content/stylebook.ts): black ink on white paper, amber only as a fill
 * (the flag) and in the wordmark, every rule solid black, every corner square.
 */

@font-face {
  font-family: "Balbek";
  src: url("/fonts/Balbek.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-400-italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #000000;
  --accent: #f8a20c;
  --on-accent: #000000;
  --ink-muted: rgba(0, 0, 0, 0.6);
  --font-balbek: "Balbek", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-news: "Newsreader", Georgia, "Times New Roman", serif;
  --rule-hairline: 0.0625rem;
  --rule-heavy: 0.1875rem;
  color-scheme: light;
}

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

html { background: var(--bg); color: var(--ink); }

/* The paper's black frame, as on the dev site. */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-news);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  border: 0.5rem solid var(--ink);
}

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding-block: 1rem 2rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.balbek { font-family: var(--font-balbek); font-weight: 400; line-height: 1.05; }
.smallcaps { font-variant-caps: all-small-caps; letter-spacing: 0.05em; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.875rem; }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.15em; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 0.12em; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

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

.strip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: var(--rule-hairline) solid var(--ink);
  padding-bottom: 0.4rem;
  font-size: 0.95rem;
}

.nameplate { padding: 1.25rem 0 1rem; }
.wordmark { display: block; height: clamp(4.5rem, 12vw, 7.5rem); width: auto; margin: 0 auto; }

/* The thick-and-thin rule under a nameplate: 3px, a 3px gap, 1px. */
.rule-double {
  height: 0.4375rem;
  border-top: var(--rule-heavy) solid var(--ink);
  border-bottom: var(--rule-hairline) solid var(--ink);
}

.lede { padding: 2rem 0 1.75rem; border-bottom: var(--rule-hairline) solid var(--ink); }
.flag {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-balbek);
  line-height: 1;
  padding: 0.3em 0.45em 0.15em;
  font-size: 1.05rem;
}
.lede h1 { font-size: clamp(3rem, 9vw, 6.5rem); margin-top: 0.6rem; text-wrap: balance; }
.standfirst { margin-top: 0.75rem; font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.35; max-width: 40ch; }

/* Three doors, three columns ruled apart, as stories on a front page. */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.door {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem 1.5rem 1.75rem;
  text-decoration: none;
  min-width: 0;
}
.door + .door { border-left: var(--rule-hairline) solid var(--ink); }
.door:first-child { padding-left: 0; }
.door:last-child { padding-right: 0; }
.kicker { line-height: 1; }
.door-title { font-size: clamp(1.5rem, 2.4vw, 1.9rem); text-wrap: balance; }
.door-body { text-wrap: pretty; }
.door-jump {
  margin-top: auto;
  padding-top: 0.5rem;
  font-style: italic;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.15em;
}
.door-jump::after { content: "\2192"; font-style: normal; margin-left: 0.3em; }
.door:hover .door-jump { text-decoration-color: var(--accent); text-decoration-thickness: 0.12em; }
.door:hover .door-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }
.door:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.colophon { margin-top: 1rem; text-align: center; }
.colophon .rule-double { margin-bottom: 1rem; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.colophon .small { margin-top: 0.75rem; }

@media (max-width: 52rem) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .door { padding: 1.5rem 0; }
  .door + .door { border-left: 0; border-top: var(--rule-hairline) solid var(--ink); }
  .strip-middle { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .door-jump::after { display: inline-block; transition: transform 150ms ease-out; }
  .door:hover .door-jump::after { transform: translateX(0.2em); }
}
