/* ============ The Beta Bites — newsroom edition ============
   Flat, typographic, newspaper-grounded. No gradients, no glows,
   no shadows, no glass. Rules and type do the work. */
:root {
  --paper: #fdfcfa;
  --ink: #1b1814;
  --ink-soft: #3d3831;
  --muted: #7a7268;
  --rule: #e2dccf;
  --rule-strong: #1b1814;
  --accent: #a93226;            /* flat brick red */
  --accent-ink: #8c271d;
  --maxw: 1080px;
  --maxw-text: 700px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
.article-body a, .further a { color: var(--accent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
main.wrap { padding-top: 1.5rem; padding-bottom: 3.5rem; }

img { display: block; max-width: 100%; }

/* ============ Masthead ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--rule-strong);
}
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.7rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand .beta {
  color: var(--paper);
  background: var(--accent);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.1em 0.42em;
  margin-right: 0.45rem;
  vertical-align: 0.12em;
}
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.9rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.site-nav a:hover { color: var(--accent); }

/* Topic tabs */
.tag-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-top: 1px solid var(--rule);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  scrollbar-width: none;
}
.tag-tabs::-webkit-scrollbar { display: none; }
.tag-tabs a {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-left: 1px solid var(--rule);
}
.tag-tabs a:first-child { border-left: none; padding-left: 0; }
.tag-tabs a:hover { color: var(--accent); }
.tag-tabs a.active { color: var(--accent); }

/* ============ Homepage ============ */
.dateline {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

/* Hero story */
.hero { margin-bottom: 2rem; }
.hero a { text-decoration: none; color: inherit; }
.hero img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.hero .kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0.9rem 0 0.4rem;
}
.hero h2 {
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}
.hero a:hover h2 { color: var(--accent-ink); }
.hero .excerpt { color: var(--ink-soft); font-size: 1.02rem; max-width: 640px; }
.hero .meta { margin-top: 0.5rem; }

/* Story rows */
.story-rows { list-style: none; }
.story-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.story-row .thumb { display: block; }
.story-row .thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.story-row h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.story-row h2 a { text-decoration: none; color: var(--ink); }
.story-row h2 a:hover { color: var(--accent-ink); }
.story-row .excerpt { color: var(--ink-soft); font-size: 0.94rem; }

.meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.meta time { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

.tags { margin-top: 0.5rem; font-size: 0.78rem; }
.tags a {
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-right: 0.7rem;
}
.tags a:hover { color: var(--accent); }
.tags a::before { content: "#"; color: var(--accent); }

/* ============ Article page ============ */
.article { max-width: var(--maxw-text); margin: 0 auto; }
.article .hero-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.article figure.hero { margin: 0 0 1.25rem; }
.photo-credit {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.3rem;
}
.article .tags { margin-bottom: 0.6rem; }
.byline {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.byline .byline-author { color: var(--ink); }
.article h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.article-body { border-top: 2px solid var(--rule-strong); padding-top: 1.5rem; }
.article-body p { margin-bottom: 1.2rem; font-size: 1.05rem; color: var(--ink-soft); }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  color: var(--ink-soft);
  font-style: italic;
}
.article-body blockquote p { margin-bottom: 0; }
.article-body ul { margin: 0 0 1.2rem 1.25rem; }
.article-body li { margin-bottom: 0.45rem; color: var(--ink-soft); }
.article-body strong { color: var(--ink); }

.further {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}
.further h2 {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.further ul { list-style: none; }
.further li { font-size: 0.93rem; margin-bottom: 0.3rem; }

/* Prev / next */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 2.5rem;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}
.pn {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
}
.pn + .pn { border-left: 1px solid var(--rule); }
.pn-older { text-align: right; }
.pn:hover .pn-title { color: var(--accent-ink); }
.pn-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.pn-title { font-family: var(--serif); font-weight: 700; font-size: 0.98rem; line-height: 1.35; }

/* ============ Tag archive ============ */
.tag-head {
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 0.8rem;
  margin-bottom: 0.5rem;
}
.tag-head h1 {
  font-family: var(--serif);
  font-size: 2rem;
  letter-spacing: -0.02em;
}
.tag-head h1::before { content: "#"; color: var(--accent); }
.tag-head p { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ============ Static pages ============ */
.page { max-width: var(--maxw-text); margin: 0 auto; }
.page h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--rule-strong);
}
.page h2 { font-family: var(--serif); font-size: 1.3rem; margin: 1.8rem 0 0.6rem; }
.page p { margin-bottom: 1.05rem; color: var(--ink-soft); }
.page a { color: var(--accent); }

/* ============ Newsletter signup ============ */
.newsletter-block {
  margin-top: 2.5rem;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  padding: 1.75rem 0;
}
.newsletter-block h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}
.newsletter-block p { color: var(--ink-soft); margin-bottom: 1rem; }
.newsletter-compact .newsletter-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.newsletter-compact p { font-size: 0.83rem; margin-bottom: 0.7rem; }
.newsletter-form { display: flex; gap: 0.5rem; max-width: 420px; }
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.newsletter-form input[type="email"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.newsletter-form button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============ Footer ============ */
.site-footer {
  border-top: 2px solid var(--rule-strong);
  padding: 2rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 1.75rem;
}
.footer-name { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.footer-tag { font-size: 0.85rem; margin-top: 0.15rem; }
.footer-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; align-content: flex-start; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  padding-bottom: 1.25rem;
  font-size: 0.8rem;
}

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .wrap { padding: 0 1rem; }
  .hero h2 { font-size: 1.65rem; }
  .hero img { aspect-ratio: 16 / 9; }
  .story-row { grid-template-columns: 1fr; gap: 0.8rem; }
  .story-row .thumb img { aspect-ratio: 21 / 9; }
  .article h1 { font-size: 1.75rem; }
  .brand { font-size: 1.4rem; }
  .prev-next { grid-template-columns: 1fr; }
  .pn + .pn { border-left: none; border-top: 1px solid var(--rule); }
  .pn-older { text-align: left; }
}

/* ============ Dark theme (follows device setting) ============ */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #131109;
    --ink: #ece7da;
    --ink-soft: #c9c2b3;
    --muted: #978d7c;
    --rule: #2c2619;
    --rule-strong: #ece7da;
    --accent: #d9604a;
    --accent-ink: #ef8268;
  }
  .article-body a, .further a, .page a { color: var(--accent); }
  .story-row h2 a:hover, .hero a:hover h2, .pn:hover .pn-title { color: var(--accent-ink); }
}
