/* Asylum News — public site
   A modern news site, not a printed page: sticky nav, cards, a sidebar.
   Keeps the newspaper's ink/paper/red identity in the typography and accent. */

/* Dark is the site's real, default look — not a system-preference fallback.
   A saved choice (see the inline head script + site.js) can opt into light
   via :root[data-theme="light"] below. */
:root {
  --paper: #14120e;
  --surface: #1c1a15;
  --ink: #ece5d6;
  --ink-2: #c3baa8;
  --muted: #928a79;
  --line: #2f2b23;
  --line-2: #423c31;
  --accent: #e0574a;
  --accent-ink: #1b1813;
  --accent-tint: #34201c;
  --ok: #7cc28a;
  --header: #0e0d0a;
  --header-ink: #ece5d6;
  --header-muted: #7d7566;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Archivo Narrow', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --black: 'UnifrakturMaguntia', 'Old English Text MT', serif;

  --wrap: 1180px;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --paper: #f6f3ec;
  --surface: #fffdf9;
  --ink: #1b1813;
  --ink-2: #4a443a;
  --muted: #82796a;
  --line: #e4ddcd;
  --line-2: #d2c9b6;
  --accent: #9e1f16;
  --accent-ink: #fff;
  --accent-tint: #f7e6e1;
  --ok: #2d6a3a;
  --header: #1b1813;
  --header-ink: #f1ece0;
  --header-muted: #a89e8a;
  --shadow: 0 1px 2px rgba(27, 24, 19, .04), 0 8px 24px -12px rgba(27, 24, 19, .12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.head { image-rendering: pixelated; flex: none; border-radius: 3px; display: block; }
.muted { color: var(--muted); }
.center { text-align: center; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

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

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.logo {
  font-family: var(--black);
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  color: var(--header-ink);
  white-space: nowrap;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--header-muted);
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav a:hover { color: var(--header-ink); background: rgba(255, 255, 255, .06); }
.nav a[aria-current='page'] { color: var(--header-ink); background: rgba(255, 255, 255, .1); }

.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  color: var(--header-ink);
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .08); }
.theme-toggle .icon--sun { display: none; }
:root[data-theme='light'] .theme-toggle .icon--moon { display: none; }
:root[data-theme='light'] .theme-toggle .icon--sun { display: block; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  cursor: pointer;
}
.menu-toggle span { display: block; width: 16px; height: 2px; background: var(--header-ink); margin: 0 auto; }

/* ---------- buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 600 14px/1.2 var(--sans);
  padding: 10px 16px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--dark:hover { opacity: .88; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(1.07); }
.btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .22); color: var(--header-ink); }
.btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.btn--block { display: flex; width: 100%; margin-top: 10px; }
.btn--small { padding: 6px 12px; font-size: 13px; }

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 4px 9px;
  border-radius: 5px;
  margin-bottom: 10px;
}
.chip:hover { filter: brightness(0.96); }
.chip--filter {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  gap: 6px;
  margin: 0;
}
.chip--filter span { color: var(--muted); font-weight: 500; }
.chip--filter:hover { border-color: var(--ink); }
.chip--filter[aria-current='page'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--filter[aria-current='page'] span { color: var(--header-muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tags .chip { margin: 0; }
.chip--more { color: var(--muted); background: transparent; border: 1px dashed var(--line-2); }

.linkish {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

/* ---------- headline type ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; margin: 0; text-wrap: balance; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.section-head h2 { font-size: 24px; }
.section-head a { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--accent); white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0 0;
}
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

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

main { padding: 32px 0 64px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
.hero--solo { grid-template-columns: 1fr; }

.hero-main {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
/* Direct child only — the byline avatar is also an <img> nested further in. */
.hero-main > img { width: 100%; aspect-ratio: 16 / 8.5; object-fit: cover; }
.hero-body { padding: 26px 28px 28px; }
.hero-main--plain .hero-body { padding-top: 28px; }
.hero-title { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.08; }
.hero-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero-dek { font-size: 17px; line-height: 1.5; color: var(--ink-2); margin: 12px 0 0; }

.hero-side { display: flex; flex-direction: column; gap: 16px; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 10; background: var(--paper); overflow: hidden; display: flex; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  margin: auto;
  font-family: var(--black);
  font-size: 44px;
  color: var(--line-2);
}
.card-body { padding: 16px 18px 18px; }
.card-title { font-size: 18px; line-height: 1.25; }
.card-title a::after { content: ''; position: absolute; inset: 0; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-dek { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin: 8px 0 0; }
.card--side { flex-direction: row; }
.card--side .card-media { aspect-ratio: auto; width: 120px; flex: none; }
.card--side .card-body { padding: 12px 14px; flex: 1; min-width: 0; }
.card--side .card-title { font-size: 15px; }
.card--side .chip { font-size: 10.5px; margin-bottom: 6px; }
.card--side .meta { font-size: 11.5px; margin-top: 6px; }

/* ---------- rows (article listing) ---------- */

.rows { display: flex; flex-direction: column; gap: 18px; }
.row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.row-media { aspect-ratio: 16 / 11; background: var(--paper); overflow: hidden; display: flex; }
.row-media img { width: 100%; height: 100%; object-fit: cover; }
.row-media .thumb-fallback { font-size: 34px; }
.row-body { padding: 18px 20px 18px 0; min-width: 0; }
.row-title { font-size: 21px; line-height: 1.22; margin-top: 2px; }
.row-title a::after { content: ''; position: absolute; inset: 0; }
.row-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- home grid / sidebar ---------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
.widget {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.widget-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.widget-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.widget-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 500;
}
.widget-list a:hover { background: var(--paper); }
.widget-list a span:first-of-type:not(.count) { flex: 1; }
.widget-list .count { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.widget-list--people a span:nth-child(2) { flex: 1; }

.widget-note { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin: 0; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .chip { margin: 0; gap: 6px; }
.tag-cloud .count { color: var(--muted); font-weight: 500; }

/* ---------- articles / listing page ---------- */

.page-head { max-width: 720px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.08; }
.page-head p { font-size: 16px; color: var(--ink-2); margin: 10px 0 0; }
.writer-head { display: flex; gap: 20px; align-items: center; max-width: none; }
.writer-head .head { width: 80px; height: 80px; }
.writer-head p { margin: 4px 0 0; }
.eyebrow { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0; }

.finder {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.finder input[type='search'] {
  flex: 1;
  font: 15px var(--sans);
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
}
.finder select {
  font: 14px var(--sans);
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}
.finder input:focus, .finder select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-tint); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.results-summary { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; }
.results-summary a { color: var(--accent); font-weight: 600; }

.nothing { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.nothing p { margin: 0 0 16px; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.pager-count { font-family: var(--sans); font-size: 13px; color: var(--muted); }

/* ---------- article ---------- */

.story-head { max-width: 760px; padding-top: 8px; }
.crumbs { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; margin-bottom: 16px; }
.crumbs a:hover { color: var(--accent); }
.story-title { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.05; letter-spacing: -.016em; }
.story-dek { font-size: 19px; line-height: 1.5; color: var(--ink-2); margin: 16px 0 0; }
.story-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.story-bar .meta { margin: 0; font-size: 13.5px; }
.story-head > .tags { margin: 18px 0 0; }

.story-cover { max-width: 960px; margin: 32px auto 0; }
.story-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--radius); }
.story-cover figcaption { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 8px; }

.prose { max-width: 720px; margin: 36px auto 0; font-family: var(--serif); font-size: 19px; line-height: 1.7; }
.prose > * { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 { font-weight: 600; line-height: 1.22; letter-spacing: -.01em; margin: 1.7em 0 .5em; }
.prose h2 { font-size: 28px; }
.prose h3 { font-size: 22px; }
.prose h4 { font-family: var(--sans); font-size: 14.5px; letter-spacing: .09em; text-transform: uppercase; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
.prose img { width: 100%; border-radius: 8px; margin: 1.9em 0 .4em; }
.prose blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-size: 22px;
  line-height: 1.4;
  font-style: italic;
  color: var(--ink-2);
}
.prose blockquote p { margin: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 2.2em 0; }
.prose code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .8em; background: var(--paper); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--paper); padding: 16px 18px; border-radius: 8px; overflow-x: auto; font-size: 15px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15.5px; }
.prose th { text-align: left; border-bottom: 2px solid var(--ink); padding: 8px 10px 6px 0; letter-spacing: .05em; text-transform: uppercase; font-size: 12.5px; }
.prose td { border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; }
.prose mark { background: #f1d98a; color: #1b1813; border-radius: 2px; }

.author {
  max-width: 720px;
  margin: 40px auto 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.author .head { width: 56px; height: 56px; }
.author-label { font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 2px 0 0; }
.author-name { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 2px 0 0; }
.author-name a:hover { text-decoration: underline; }
.author-bio { font-size: 14.5px; color: var(--ink-2); margin: 6px 0 0; }

.related { margin-top: 56px; padding-top: 8px; }

/* ---------- empty / 404 ---------- */

.empty { text-align: center; padding: 80px 0 40px; max-width: 560px; margin: 0 auto; }
.empty-mark { font-family: var(--black); font-size: 34px; color: var(--accent); margin: 0 0 8px; }
.empty h1 { font-size: 32px; line-height: 1.15; margin: 0 0 12px; }
.empty p { color: var(--ink-2); margin: 0 0 20px; }
.empty-widgets { max-width: 360px; margin: 0 auto 60px; }

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

.foot { margin-top: 40px; background: var(--header); color: var(--header-ink); }
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding: 48px 24px 36px;
}
.logo--foot { font-size: 24px; }
.foot-brand p { color: var(--header-muted); font-size: 14px; margin: 10px 0 0; max-width: 260px; }
.foot-grid h4 { font-family: var(--sans); font-weight: 700; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--header-muted); margin: 0 0 12px; }
.foot-grid > div { display: flex; flex-direction: column; gap: 8px; }
.foot-grid a, .foot-grid .linkish { font-size: 14.5px; color: #d7cfbd; }
.foot-grid a:hover, .foot-grid .linkish:hover { color: var(--header-ink); }
.foot-base {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12.5px;
  color: var(--header-muted);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .widget { flex: 1; min-width: 240px; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; overflow-x: auto; }
  .hero-side .card--side { min-width: 280px; flex: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .top-inner { height: 58px; gap: 12px; }
  .logo { font-size: 22px; }
  .nav {
    position: fixed;
    z-index: 50;
    inset: 58px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--header);
    padding: 8px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .4);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform .15s ease, opacity .15s ease;
    overflow: visible;
  }
  .nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 8px; font-size: 15px; }
  .menu-toggle { display: flex; }
  .hide-sm { display: none; }

  main { padding: 22px 0 48px; }
  .hero-main img { aspect-ratio: 16 / 10; }
  .hero-body { padding: 20px 18px 22px; }
  .hero-title { font-size: 25px; }
  .cards { grid-template-columns: 1fr; }
  .row { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .row-body { padding: 12px 14px 12px 0; }
  .row-title { font-size: 17px; }
  .finder { flex-wrap: wrap; }
  .finder input[type='search'] { flex-basis: 100%; }

  .story-title { font-size: 28px; }
  .story-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .prose { font-size: 18px; }
  .story-cover { margin-left: -16px; margin-right: -16px; max-width: none; }
  .story-cover img { border-radius: 0; }
  .story-cover figcaption { padding: 0 16px; }
  .author { flex-direction: column; }

  .foot-grid { grid-template-columns: 1fr 1fr; padding: 36px 16px 24px; }
  .foot-base { flex-direction: column; padding: 16px; }
}
