@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 300 500;
  font-display: swap;
}

/* Gabriela Junqueira, book. One family, white paper, one red. */

:root {
  --paper: #fff;
  --ink: #141414;
  --quiet: #6b6b6b;
  --red: #9e2b20; /* pau-brasil */
  --pad: 16px;
  --bar: 52px;
  --foot: 44px;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
@media (min-width: 900px) { :root { --pad: 28px; font-size: 16px; } }

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; background: var(--paper); }
h1, p, dl, dd, figure, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }
a:hover, button:hover { color: var(--red); }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--pad); top: 8px; z-index: 10; background: var(--paper); }

.quiet { color: var(--quiet); }

/* ---------- bar ---------- */

.bar {
  position: relative; z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "name mail" "nav nav";
  row-gap: 6px;
  column-gap: 1.5em;
  padding: 12px var(--pad) 10px;
  background: var(--paper);
}
.bar .name { grid-area: name; }
.bar nav { grid-area: nav; display: flex; gap: 1.2em; justify-content: flex-start; }
.bar .mail { grid-area: mail; color: var(--quiet); font-size: 13px; justify-self: end; align-self: baseline; }
.bar nav a[aria-current] { color: var(--red); }

@media (min-width: 900px) {
  .bar {
    position: sticky; top: 0;
    height: var(--bar);
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "name nav mail";
    align-items: center;
    padding-block: 0;
  }
  .bar nav { justify-content: flex-start; gap: 1.4em; margin-left: 3.2em; }
  .bar .mail { justify-self: end; align-self: center; font-size: inherit; color: inherit; }
}

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

.foot {
  display: flex; justify-content: space-between;
  padding: 28px var(--pad) 24px;
  font-size: 13px;
}
.upd { color: var(--red); }
.turn { display: none; gap: 1.1em; align-items: baseline; }
.paged .turn { display: flex; }
.turn button { font-size: 13px; }
.turn button:disabled { visibility: hidden; }
.count { color: var(--quiet); }

/* ---------- book: phone and no-JS reading is one long column ---------- */

.book { display: block; }
.spread { display: block; }
.page { margin-bottom: 44px; }
.plate { position: relative; }
.plate img { width: 100%; }
figcaption {
  display: flex; gap: .6em; align-items: baseline;
  padding: 8px var(--pad) 0;
  font-size: 13px;
  color: var(--quiet);
}
figcaption .no { color: var(--ink); }
.flip { margin-left: auto; font-size: 13px; }
.flip::before { content: "[ "; } .flip::after { content: " ]"; }

.colophon { padding: 28px var(--pad) 6px; }
.colophon h1 {
  font-weight: 400;
  font-size: clamp(30px, 8vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 72;
  margin-bottom: 14px;
}
.colophon p + p { margin-top: 10px; font-size: 13.5px; }
.colophon a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.ph { position: relative; }
.verso {
  position: absolute; inset: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 24px;
  display: flex; align-items: flex-end;
}
.verso dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; font-size: 14px; }
.verso dt { color: var(--quiet); }

/* ---------- book: desktop spreads, one at a time (JS adds .paged) ---------- */

.paged .book {
  --h: calc(100svh - var(--bar) - var(--foot) - 36px);
  height: calc(100svh - var(--bar) - var(--foot));
  padding: 18px var(--pad);
}
.paged .spread { display: none; height: 100%; }
.paged .spread.on {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(20px, 2.4vw, 44px);
  animation: turn .14s linear;
}
.paged .page { margin: 0; display: flex; align-items: flex-end; min-width: 0; height: 100%; }
.paged .page-l { justify-content: flex-end; }
.paged .page-r { justify-content: flex-start; }
.paged .plate { display: flex; flex-direction: column; max-height: 100%; }
.paged .ph { min-height: 0; }
.paged .plate img {
  width: auto;
  max-width: 100%;
  max-height: calc(var(--h) - 30px);
  object-fit: contain;
}
.paged figcaption { padding: 8px 0 0; }
.paged .colophon { padding: 0 0 0 2px; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.paged .colophon { max-width: 30em; margin-left: auto; margin-right: 12%; }
.paged .colophon h1 { font-size: 36px; margin-bottom: 14px; }
.paged .colophon p + p { font-size: 14px; }
.paged .foot { height: var(--foot); padding-block: 0; align-items: center; }
.paged .book a, .paged .book button { cursor: pointer; }

@keyframes turn { from { opacity: .35; } }

.cursor {
  position: fixed; left: 0; top: 0; z-index: 6;
  pointer-events: none;
  font-size: 14px;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  mix-blend-mode: difference;
  color: #fff;
}
.cursor[hidden] { display: none; }

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

.index { padding: 8px var(--pad) 0; }
.density { display: flex; gap: 1em; justify-content: flex-end; font-size: 13px; margin-bottom: 18px; color: var(--quiet); }
.density [aria-pressed="true"] { color: var(--red); }
.sheet { list-style: none; display: grid; gap: 28px 12px; align-items: end; }
.sheet.d-s { grid-template-columns: repeat(3, 1fr); }
.sheet.d-m { grid-template-columns: repeat(2, 1fr); }
.sheet.d-l { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .sheet { gap: 40px 20px; }
  .sheet.d-s { grid-template-columns: repeat(8, 1fr); }
  .sheet.d-m { grid-template-columns: repeat(5, 1fr); }
  .sheet.d-l { grid-template-columns: repeat(3, 1fr); }
}
.sheet a { display: block; }
.sheet a > span { display: flex; gap: .6em; padding-top: 7px; font-size: 13px; color: var(--quiet); }
.sheet a:hover > span { color: var(--red); }
.sheet .no { color: var(--ink); }
.sheet.d-s a > span { font-size: 12px; }

/* ---------- info ---------- */

.info { padding: 0 0 12px; }
.info-plate { margin-bottom: 28px; }
.info-text { padding: 0 var(--pad); }
.info h1 { font-weight: 300; font-size: 34px; line-height: 1.05; font-variation-settings: "opsz" 72; margin-bottom: 26px; }
.facts > div { display: grid; grid-template-columns: 1fr; padding: 10px 0; border-top: 1px solid #e4e4e4; }
.facts > div:last-child { border-bottom: 1px solid #e4e4e4; }
.facts dt { color: var(--quiet); font-size: 13px; }
.facts dt span { color: #9a9a9a; }
.contact { margin-top: 32px; }
.contact a { font-size: 19px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.contact p + p { margin-top: 8px; font-size: 13.5px; }

@media (min-width: 900px) {
  .info {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(32px, 5vw, 96px);
    align-items: end;
    padding: 18px var(--pad) 0;
    min-height: calc(100svh - var(--bar) - var(--foot));
  }
  .info-plate { margin: 0; }
  .info-plate img { max-height: calc(100svh - var(--bar) - var(--foot) - 36px); width: auto; }
  .info-text { padding: 0 0 4px; max-width: 34em; }
  .info h1 { font-size: 52px; }
  .facts > div { grid-template-columns: 13em 1fr; align-items: baseline; }
  .facts dt { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .paged .spread.on { animation: none; }
}

/* back page */
.closing { padding-top: 0; }
.closing p:first-child { font-size: 19px; }
.paged .closing { margin-left: 0; margin-right: auto; padding-left: 12%; }
@media (max-width: 899px) { .colophon:not(.closing) { padding-bottom: 0; margin-bottom: 24px; } }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* full-width spread (landscape frame) */
.paged .spread.full.on { grid-template-columns: 1fr; }
.paged .page-full { justify-content: center; }

/* ---------- press ---------- */

.press { padding: 8px var(--pad) 0; }
.entry { padding: 22px 0 40px; border-top: 1px solid var(--ink); }
.entry header { display: grid; grid-template-columns: 5.5em 1fr; column-gap: 1em; align-items: baseline; }
.entry .when { color: var(--red); font-size: 13px; grid-row: span 2; }
.entry h2 { margin: 0; font-weight: 400; font-size: 26px; line-height: 1.1; font-variation-settings: "opsz" 60; }
.entry .outlet { color: var(--quiet); font-size: 14px; }
.entry .sum { margin: 14px 0 20px; max-width: 36em; }
.sheets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-items: end; }
.sheets.n1 { grid-template-columns: 1fr; }
.creds { display: grid; grid-template-columns: auto 1fr; gap: 3px 18px; margin: 18px 0 10px; font-size: 14px; }
.creds dt { color: var(--quiet); }
.links { display: flex; flex-wrap: wrap; gap: 4px 1.4em; font-size: 14px; }
.links a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (min-width: 900px) {
  .press { padding-top: 18px; }
  .entry { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 48px; padding: 26px 0 64px; }
  .entry header { grid-template-columns: 6em 1fr; grid-column: 1; align-self: start; }
  .entry h2 { font-size: 32px; }
  .entry .sum, .entry .creds, .entry .links { grid-column: 1; }
  .entry .sheets { grid-column: 2; grid-row: 1 / span 5; grid-template-columns: repeat(4, 1fr); }
  .entry .sheets.n1 { grid-template-columns: 1fr; }
  .entry .sheets.n3, .entry .sheets.n4 { grid-template-columns: repeat(3, 1fr); }
  .entry .sheets.n1 figure { max-width: 820px; }
  .entry .sheets figure:has(img[width="4096"]) { grid-column: 1 / -1; }
}
.sheets figure:has(img[width="4096"]) { grid-column: 1 / -1; }

/* ---------- film ---------- */

.film { padding: 8px var(--pad) 0; display: grid; gap: 36px; }
.screen { position: relative; background: #000; cursor: pointer; }
.screen { width: fit-content; max-width: 100%; }
.clip video { display: block; width: 100%; height: auto; }
.screen progress { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 1px; border: 0; appearance: none; background: transparent; }
.screen progress::-webkit-progress-bar { background: transparent; }
.screen progress::-webkit-progress-value { background: #fff; }
.screen progress::-moz-progress-bar { background: #fff; }
.ctl { display: flex; justify-content: space-between; gap: 1em; }
.play::before { content: "[ "; } .play::after { content: " ]"; }
.clip figcaption { padding: 8px 0 0; flex-direction: column; gap: 2px; color: var(--ink); font-size: 14px; }
.clip figcaption a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (min-width: 900px) {
  .film { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; padding-top: 18px; align-items: start; max-width: 1360px; margin: 0 auto; }
  .clip video { width: auto; max-width: 100%; height: calc(100svh - var(--bar) - var(--foot) - 100px); }
  .clip { justify-self: center; }
}

.verso[hidden] { display: none; }

.pub { color: var(--red); margin-left: auto; }
.pub + .flip { margin-left: 1em; }
.lost { min-height: 50svh; padding: 18vh var(--pad) 0; font-size: 19px; }
.lost a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* tablets: pair the pages */
@media (min-width: 600px) and (max-width: 899px) {
  .spread:not(.full):not(.opening) { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; padding: 0 var(--pad); }
  .spread:not(.full):not(.opening) figcaption { padding-inline: 0; }
  .spread:not(.full):not(.opening) .closing { padding: 0 0 44px 12px; align-self: end; }
}
