/* Acervo Preto: "Lama, ocre e ráfia".
   Colours from bògòlanfini and Kuba textiles; square forms only. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage-grotesque-opsz.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/static/fonts/literata-opsz.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/static/fonts/literata-opsz-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ---- Colour tokens ---- */

:root {
  color-scheme: light;
  --bg: #f3ede3;
  --surface: #e7dcc9;
  --ink: #1e140d;
  --muted: #6b5546;
  --strong: #3b2416;
  --line: #d6c7b0;
  --field: #8c7764;
  --accent: #c98a1b;
  --accent-text: #8a5a12;
  --red: #8e2c1b;
  --primary: #3b2416;
  --on-primary: #f3ede3;
  --on-accent: #1e140d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a120c;
    --surface: #261a11;
    --ink: #f1e8da;
    --muted: #bfae98;
    --strong: #e0a43a;
    --line: #4a3727;
    --field: #7a6450;
    --accent: #e0a43a;
    --accent-text: #eec67a;
    --red: #d9694e;
    --primary: #e0a43a;
    --on-primary: #1e140d;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a120c;
  --surface: #261a11;
  --ink: #f1e8da;
  --muted: #bfae98;
  --strong: #e0a43a;
  --line: #4a3727;
  --field: #7a6450;
  --accent: #e0a43a;
  --accent-text: #eec67a;
  --red: #d9694e;
  --primary: #e0a43a;
  --on-primary: #1e140d;
}

/* ---- Base ---- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

.reading {
  font-family: "Literata", Georgia, serif;
}

.kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Band: woven strips across the top of every page ---- */

.band {
  display: block;
  width: 100%;
  height: 16px;
  flex: none;
}

/* ---- Header ---- */

.site-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--strong);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-decoration: none;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-ground {
  fill: var(--strong);
}

.logo-line {
  stroke: var(--bg);
}

.logo-dot {
  fill: var(--bg);
}

.logo-dot-accent {
  fill: var(--accent);
}

.nav-main {
  display: none;
}

.nav-main a,
.menu-panel a {
  display: block;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.nav-main a[aria-current="page"],
.menu-panel a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

.button-suggest {
  display: none;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--field);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

/* The theme form has one button per direction; CSS shows the right one,
   so it works without JavaScript and before any cookie exists. */
.theme-toggle {
  margin: 0;
  display: flex;
}

.theme-to-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-to-light {
    display: flex;
  }

  :root:not([data-theme="light"]) .theme-to-dark {
    display: none;
  }
}

:root[data-theme="dark"] .theme-to-light {
  display: flex;
}

:root[data-theme="dark"] .theme-to-dark {
  display: none;
}

.menu {
  position: relative;
}

.menu summary {
  list-style: none;
  border: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  z-index: 10;
  min-width: 240px;
  padding: 8px;
  background: var(--bg);
  border: 2px solid var(--strong);
}

.menu-panel .button-suggest {
  display: block;
  margin-top: 8px;
  text-align: center;
}

@media (min-width: 900px) {
  .site-header {
    gap: 40px;
    padding: 20px 72px;
  }

  .logo {
    flex: none;
    font-size: 24px;
  }

  .nav-main {
    display: flex;
    gap: 8px;
    flex: 1;
  }

  .button-suggest {
    display: block;
  }

  .menu {
    display: none;
  }
}

/* ---- Main and footer ---- */

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 40px 16px 56px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding: 24px 16px;
  border-top: 2px solid var(--strong);
  font-size: 14px;
  color: var(--muted);
}

@media (min-width: 900px) {
  .site-main {
    padding: 64px 72px 96px;
  }

  .site-footer {
    padding: 28px 72px;
  }
}

/* ---- Search ---- */

.search {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--field);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}

.search button {
  height: 52px;
  padding: 0 22px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ---- Page not found ---- */

.not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 900px;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.not-found p {
  margin: 0;
  max-width: 640px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--muted);
}

.broken-line {
  width: min(300px, 70vw);
  height: auto;
  fill: none;
  stroke: var(--strong);
  stroke-width: 5;
}

.broken-line .seam {
  stroke: var(--accent);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-weight: 600;
}

/* ---- Shared pieces ---- */

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

.small {
  font-size: 14px;
  line-height: 1.5;
}

h2,
.h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
}

.h3 {
  font-size: 22px;
  font-weight: 600;
}

.h4 {
  font-size: 18px;
  font-weight: 700;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.badge {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.button-primary {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-link,
.chip-filled {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
  text-decoration: none;
}

.chip-link {
  border: 1px solid var(--field);
  background: var(--bg);
  font-weight: 600;
}

.chip-filled {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

.card,
.card-outline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
}

.card {
  background: var(--surface);
}

.card-outline {
  border: 1px solid var(--line);
}

.card h2 {
  font-size: 24px;
}

.card p,
.card-outline p {
  margin: 0;
}

.text-link {
  align-self: flex-start;
  padding: 10px 0;
  font-weight: 600;
}

.motif-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.band-thin {
  height: 12px;
}

/* ---- Book page ---- */

.book-title {
  font-family: "Literata", Georgia, serif;
  font-style: italic;
  font-weight: 600;
}

.book-top,
.book-body {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

.book-cover {
  margin: 0;
  width: 200px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.book-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
}

.book-cover a {
  color: var(--muted);
}

.cover-placeholder {
  aspect-ratio: 2 / 3;
  display: flex;
  background: #3b2416 url("/static/pontos.svg");
}

.cover-placeholder-label {
  margin: auto 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: #f3ede3;
  color: #1e140d;
  font-size: 14px;
  font-weight: 600;
}

.cover-placeholder-label .book-title {
  font-size: 20px;
  line-height: 1.1;
}

.cover-placeholder.book-card-cover,
.cover-placeholder.week-cover {
  display: flex;
  background: #3b2416 url("/static/pontos.svg");
}

.book-card-cover .cover-placeholder-label,
.week-cover .cover-placeholder-label {
  margin: auto 8px 8px;
  padding: 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.book-card-cover .cover-placeholder-label .book-title,
.week-cover .cover-placeholder-label .book-title {
  font-size: 15px;
}

.book-summary {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-summary h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.book-subtitle,
.book-authors,
.book-credits,
.book-summary > p {
  margin: 0;
}

.book-subtitle {
  font-size: 20px;
  line-height: 1.4;
  color: var(--muted);
}

.book-authors {
  font-size: 22px;
  font-weight: 600;
}

.book-authors a {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.book-credits {
  color: var(--muted);
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 12px 0 0;
  padding: 20px 0;
  border-top: 2px solid var(--strong);
  border-bottom: 1px solid var(--line);
}

.details dt {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.details dd {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.availability {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
  padding: 24px;
  background: var(--surface);
  border-left: 6px solid var(--accent);
}

.availability p {
  margin: 0;
  color: var(--muted);
}

.availability-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.availability h2 {
  font-size: 22px;
}

.book-main {
  flex: 2 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.book-aside {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.book-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prose p {
  margin: 0 0 1em;
  max-width: 640px;
  font-size: 19px;
  line-height: 1.6;
}

.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  text-decoration: none;
}

.source-kind {
  font-weight: 600;
}

.related {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
}

.book-card-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.book-card-title {
  font-family: "Literata", Georgia, serif;
  font-style: italic;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

@media (min-width: 900px) {
  .book-top,
  .book-body {
    gap: 56px;
  }

  .book-cover {
    width: 340px;
  }

  .book-summary h1 {
    font-size: 72px;
  }

  .details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .site-main {
    gap: 64px;
  }
}

/* No synopsis or temas yet: the author card and sources share the row. */
.book-main:empty {
  display: none;
}

.book-main:empty + .book-aside {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
}

.book-main:empty + .book-aside > * {
  flex: 1 1 320px;
}

/* ---- Person page ---- */

.person-photo {
  margin: 0;
  width: 160px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.person-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
}

.person-photo a {
  color: var(--muted);
}

.photo-placeholder {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
}

.initials {
  position: relative;
  margin: auto;
  width: 46%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3ede3;
  color: #1e140d;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.person-name {
  margin: 0;
  font-size: 44px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.book-summary > .badge {
  margin: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
}

.plain-list .book-title {
  font-size: 17px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border-left: 3px solid var(--strong);
}

.moment {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 20px 24px;
}

.moment::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  width: 13px;
  height: 13px;
  background: var(--strong);
}

.moment-book::before {
  background: var(--accent);
}

.moment-year {
  font-size: 22px;
  font-weight: 800;
}

.moment-text {
  font-size: 16px;
  line-height: 1.4;
}

.moment-book .moment-text {
  font-family: "Literata", Georgia, serif;
  font-style: italic;
}

@media (min-width: 900px) {
  .person-photo {
    width: 300px;
  }

  .initials {
    font-size: 48px;
  }

  .person-name {
    font-size: 80px;
  }

  .book-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline ol {
    flex-direction: row;
    border-left: none;
    border-top: 3px solid var(--strong);
  }

  .moment {
    flex: 1 1 0;
    min-width: 0;
    padding: 24px 24px 0 0;
  }

  .moment::before {
    left: 0;
    top: -8px;
  }
}

/* ---- Book list, search and filters ---- */

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.list-head p {
  margin: 0;
}

.page-title {
  margin: 0;
  font-size: 48px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-form-wide {
  display: none;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 32px;
  padding: 20px;
  background: var(--surface);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: none;
}

.filter-field legend {
  padding: 0;
  margin-bottom: 10px;
}

.filter-field select {
  height: 44px;
  min-width: 170px;
  padding: 0 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.chip-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip-radio label {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--field);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.chip-radio input:checked + label {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.chip-radio input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-weight: 600;
}

.filter-actions .button-primary {
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-toggle summary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--field);
  font-weight: 700;
  cursor: pointer;
}

.filter-toggle[open] summary {
  margin-bottom: 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  background: var(--surface);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.empty-state .broken-line {
  width: 120px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .page-title {
    font-size: 64px;
  }

  .filter-form-wide {
    display: flex;
  }

  .filter-form-phone {
    display: none;
  }

  .book-grid-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ---- Tema page ---- */

.theme-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 56px;
}

.theme-text {
  flex: 3 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-text .badge {
  margin: 0;
}

.theme-lead {
  margin: 0;
  max-width: 680px;
  font-size: 21px;
  line-height: 1.55;
}

.theme-motif {
  display: none;
  position: relative;
  flex: 1 1 280px;
  min-height: 280px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-right: 16px;
  border: 1px solid var(--field);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.person-chip-initials {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--strong);
  color: var(--bg);
  font-size: 14px;
  font-weight: 800;
}

.theme-list,
.related-themes {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.related-themes {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .theme-motif {
    display: block;
  }

  .book-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

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

.index-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}

.index-intro p {
  margin: 0;
}

.theme-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  text-decoration: none;
}

.theme-card-art {
  position: relative;
  display: block;
  min-height: 120px;
}

.theme-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 28px;
}

.theme-card-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

.theme-card-name-big {
  font-size: 32px;
}

.theme-card-count {
  margin-top: auto;
  font-size: 15px;
  font-weight: 600;
}

@media (min-width: 900px) {
  .theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .theme-card-featured {
    grid-column: 1 / -1;
  }

  .theme-card-featured .theme-card {
    flex-direction: row;
  }

  .theme-card-featured .theme-card-art {
    flex: 0 0 38%;
  }
}

/* ---- People list ---- */

.letter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.letter-bar a {
  min-width: 36px;
  height: 44px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.letter-bar a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.person-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person-card {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  text-decoration: none;
}

.person-card-photo {
  width: 64px;
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  background: var(--strong);
  color: var(--bg);
  font-size: 20px;
  font-weight: 800;
}

.person-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.person-card-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

@media (min-width: 900px) {
  .person-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- Publishers ---- */

.publisher-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 28px;
  background: var(--surface);
}

.publisher-card h2,
.publisher-card p {
  margin: 0;
}

.publisher-links {
  margin-top: auto;
  padding-top: 8px;
  font-size: 15px;
}

/* ---- Home ---- */

.home-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
}

.home-hero p {
  margin: 0;
}

.home-title {
  margin: 0;
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.badge-red {
  margin: 0;
  color: var(--red);
}

.week-frame {
  position: relative;
  display: flex;
  padding: 12px;
}

.week-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg);
}

.week-cover {
  display: block;
  width: 140px;
  flex: none;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.week-text {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.week-text p {
  margin: 0;
}

.week-title {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
}

.week-author {
  font-size: 20px;
  font-weight: 600;
}

.week-note p {
  max-width: 600px;
  font-size: 18px;
  line-height: 1.6;
}

.home-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.theme-grid-plain .theme-card-small {
  height: 100%;
}

.home-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  background: var(--surface);
}

.home-suggest h2,
.home-suggest p {
  margin: 0;
}

.home-suggest > div {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-suggest-always {
  display: block;
}

@media (min-width: 900px) {
  .home-title {
    font-size: 72px;
  }

  .week-frame {
    padding: 24px;
  }

  .week-card {
    gap: 48px;
    padding: 40px;
  }

  .week-cover {
    width: 240px;
  }

  .week-title {
    font-size: 56px;
  }

  .home-suggest {
    padding: 40px;
  }
}

/* ---- About ---- */

.about {
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
  align-items: flex-start;
}

.about-toc {
  display: none;
}

.about-body {
  flex: 1 1 560px;
  min-width: 0;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-margin-top: 24px;
}

.about-section h3 {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 600;
}

.about-section p {
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
}

.about-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 19px;
  line-height: 1.6;
}

@media (min-width: 900px) {
  .about-toc {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
    border-top: 2px solid var(--strong);
  }

  .about-toc .kicker {
    padding-bottom: 8px;
  }

  .about-toc a {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 500;
    text-decoration: none;
  }
}

/* ---- Suggestion form ---- */

.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 64px;
  align-items: flex-start;
}

.suggest-main {
  flex: 2 1 560px;
  min-width: 0;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.suggest-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.suggest-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggest-field label {
  font-size: 15px;
  font-weight: 700;
}

.suggest-field input,
.suggest-field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--field);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}

.suggest-field input {
  height: 52px;
}

.suggest-field textarea {
  line-height: 1.5;
  resize: vertical;
}

.suggest-field [aria-invalid="true"] {
  border: 2px solid var(--red);
}

.field-error {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
}

.error-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  border: 2px solid var(--red);
}

.error-summary strong {
  color: var(--red);
  font-size: 18px;
}

.error-summary ul,
.error-summary p {
  margin: 0;
  padding-left: 18px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.suggest-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.suggest-submit .button-primary {
  border: none;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.thanks {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
}

.thanks p {
  margin: 0;
}

.steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 17px;
}

/* ---- Curators' panel ---- */

/* Phones: the sidebar is a top bar with a nav strip that scrolls
   sideways; from 900px it is a column on the left. */

.admin-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  background: #3b2416;
  color: #f3ede3;
}

.admin-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-brand-sub {
  color: #f3ede3;
  opacity: 0.75;
}

.admin-nav {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  gap: 2px;
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
}

.admin-nav a {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
  color: #f3ede3;
  font-weight: 500;
  text-decoration: none;
}

.admin-nav a[aria-current="page"] {
  background: #c98a1b;
  color: #1e140d;
  font-weight: 700;
}

.admin-side-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.admin-side-foot form {
  margin: 0;
}

.admin-theme {
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #6b5546;
  background: transparent;
  color: #f3ede3;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px 40px;
}

@media (min-width: 900px) {
  body.admin {
    flex-direction: row;
  }

  .admin-side {
    flex: 0 0 248px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 24px 16px;
  }

  .admin-brand {
    padding: 0 12px 20px;
  }

  .admin-nav {
    order: 0;
    flex: none;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .admin-side-foot {
    margin-top: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 12px 0;
    border-top: 1px solid #6b5546;
  }

  .admin-main {
    gap: 28px;
    padding: 40px 48px;
  }

  .admin-title {
    font-size: 40px;
  }
}

.admin-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--surface);
  font-weight: 600;
  text-decoration: none;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
}

.admin-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

@media (min-width: 900px) {
  .admin-table {
    display: table;
  }
}

.admin-table th {
  padding: 12px 14px;
  border-bottom: 2px solid var(--strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

:root[data-theme="dark"] .admin-side {
  background: #0f0a06;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .admin-side {
    background: #0f0a06;
  }
}

.admin-badge {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
}

.queue-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.block {
  display: block;
}

.pre-line {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.review {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.review-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sent {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
}

.sent dt {
  font-weight: 700;
}

.sent dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.reject-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.reject-form label {
  font-size: 14px;
  font-weight: 700;
}

.reject-form select,
.reject-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.button-danger {
  height: 44px;
  border: 2px solid var(--red);
  background: transparent;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---- Admin editors ---- */

.editor {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editor-grid {
  display: grid;
  gap: 18px 20px;
}

@media (min-width: 640px) {
  .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .editor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.editor-grid input,
.editor-grid select,
.editor-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.editor-grid [aria-invalid="true"] {
  border: 2px solid var(--red);
}

.editor-wide {
  grid-column: 1 / -1;
}

.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  background: var(--bg);
  border-top: 2px solid var(--strong);
}

.save-bar .button-primary,
.link-row .button-primary {
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-row form {
  margin: 0;
}

.link-row .chip-link {
  font: inherit;
  cursor: pointer;
}

.saved-banner {
  padding: 16px 20px;
  border-left: 6px solid var(--accent);
  background: var(--surface);
}

.diff-before {
  color: var(--red);
  text-decoration: line-through;
}

.diff-after {
  font-weight: 700;
}

.links-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 0 0 14px;
  border: 1px solid var(--field);
  font-size: 15px;
  font-weight: 600;
}

.link-chip form {
  margin: 0;
}

.link-chip button {
  min-width: 44px;
  min-height: 42px;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.link-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.link-add select,
.link-add input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.link-add .chip-link {
  font: inherit;
  cursor: pointer;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.name-with-tag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.term-actions summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}

.term-actions[open] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.term-actions form {
  margin: 0;
}

.chip-link.danger {
  border-color: var(--red);
  color: var(--red);
}

.week-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week-slot h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.week-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.week-form select,
.week-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.week-form [aria-invalid="true"] {
  border: 2px solid var(--red);
}

.week-form .button-primary {
  align-self: flex-start;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.week-slot .section-head form {
  margin: 0;
}

.week-slot .chip-link {
  font: inherit;
  cursor: pointer;
}

.lookup-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.lookup-bar input[type="search"] {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.lookup-bar .chip-link {
  font: inherit;
  cursor: pointer;
}

.cover-preview {
  display: block;
  width: 160px;
  height: auto;
  border: 1px solid var(--line);
}

.reference-list {
  margin: 0;
}

.reference-list dt {
  font-weight: 700;
}

.reference-list dd {
  margin: 4px 0 0;
}

.reference-list blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.cover-choices {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .cover-choices {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.cover-current form {
  margin: 0;
}

.cover-current .chip-link {
  font: inherit;
  cursor: pointer;
}

.cover-current,
.cover-pick {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover-pick .week-form input,
.image-upload input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.editor > .button-primary {
  align-self: flex-start;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
