/* Plain on purpose: the drawing is the point. System fonts only (no third-party requests). */

:root {
  --ground: #e1e5de;
  --sheet: #ffffff;
  --label: #f6f7f2;
  --ink: #1d1f1e;
  --muted: #566059;
  --line: #b4bdb4;
  --link: #1f5a56;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #171a18;
    --label: #222723;
    --ink: #e3e7e1;
    --muted: #9ba59f;
    --line: #3a423d;
    --link: #86c9c1;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--sheet); color: #1d1f1e; padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---- header and footer ---- */

.site-header, .site-footer {
  max-width: 52rem; margin: 0 auto; padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  font-family: var(--sans); font-size: 0.9rem;
}
.brand {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700;
  color: var(--ink); text-decoration: none;
}
.site-nav, .footer-links { display: flex; gap: 1.25rem; }
.site-nav a, .footer-links a { color: var(--muted); }
.site-nav a:hover, .footer-links a:hover { color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; color: var(--muted); padding-bottom: 2.5rem; }

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

main { max-width: 52rem; margin: 0 auto; padding: 0.5rem 1.25rem 0; }

.meta {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--sans); font-size: 0.85rem; color: var(--muted);
  margin: 0.5rem 0 0.6rem;
}

h1.cartoon-title {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 400;
  margin: 0 0 0.9rem; color: var(--muted);
}

/* ---- the cartoon with arrows ---- */

.stage {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
  grid-template-areas: "prev sheet next";
  align-items: center;
  gap: 0.5rem;
}
.sheet {
  grid-area: sheet;
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 0.75rem;
}
.sheet img { display: block; width: 100%; height: auto; }

.arrow {
  display: flex; align-items: center; justify-content: center;
  min-height: 3.25rem; min-width: 3.25rem;
  font-family: var(--sans); text-decoration: none; color: var(--ink);
}
.arrow-prev { grid-area: prev; }
.arrow-next { grid-area: next; }
.arrow .glyph { width: 2rem; height: 2rem; }
.arrow-label { display: none; }
a.arrow:hover .glyph { color: var(--link); }
.arrow.is-off { opacity: 0.2; }

/* The caption is a flat, clinical line: it gets a placard under the sheet. */
.placard {
  max-width: 34rem; margin: 1.1rem auto 0;
  background: var(--label); border: 1px solid var(--line);
  padding: 0.95rem 1.25rem;
  font-size: 1.25rem; font-style: italic; line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}

@media (max-width: 40rem) {
  .stage {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "sheet sheet" "prev next";
    gap: 0.75rem;
  }
  .arrow {
    border: 1px solid var(--line); background: var(--label);
    min-height: 3rem; gap: 0.5rem;
  }
  .arrow .glyph { width: 1.25rem; height: 1.25rem; }
  .arrow-label { display: inline; font-size: 0.95rem; }
  .placard { font-size: 1.15rem; }
}

/* ---- story and notes ---- */

.story { max-width: 38rem; margin: 2.25rem auto 0; }
.story h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.story p { margin: 0 0 0.75rem; }
.source { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }

.ad { max-width: 38rem; margin: 2.5rem auto 0; min-height: 6rem; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-label { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); margin: 0 0 0.3rem; }

.disclosure {
  max-width: 38rem; margin: 2rem auto 0;
  font-family: var(--sans); font-size: 0.85rem; color: var(--muted);
}

/* ---- archive ---- */

h1.page-title { font-size: 1.6rem; margin: 1rem 0 0.5rem; }
.archive h2 { font-size: 1.05rem; margin: 2rem 0 0.75rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
.grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem;
}
.grid a { display: block; text-decoration: none; color: var(--ink); }
.grid .thumb { display: block; background: var(--sheet); border: 1px solid var(--line); padding: 0.4rem; }
.grid img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.grid .t { display: block; font-size: 0.95rem; line-height: 1.3; margin-top: 0.35rem; }
.grid .d { display: block; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.grid a:hover .t { text-decoration: underline; }

/* ---- text pages ---- */

.prose { max-width: 38rem; margin: 0 auto; }
.prose h1 { font-size: 1.6rem; margin: 1rem 0 0.75rem; }
.prose h2 { font-size: 1.15rem; margin: 2rem 0 0.4rem; }
.prose p, .prose ul { margin: 0 0 0.9rem; }

.empty { max-width: 34rem; margin: 4rem auto; text-align: center; }
.empty h1 { font-size: 1.5rem; }
