/* The Indie Feed - newspaper reader */

:root {
  color-scheme: light dark;
  --paper: #ecebe5;
  --paper-soft: #e0ddd0;
  --ink: #15161a;
  --ink-muted: #525257;
  --ink-faint: #77736b;
  --rule: #15161a;
  --rule-soft: #c9c5b9;
  --accent: #7d2e21;
  --accent-ink: #fff8ea;
  --hover: rgba(21, 22, 26, 0.055);
  --shadow: rgba(21, 22, 26, 0.12);
  --measure: 73ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15161a;
    --paper-soft: #202127;
    --ink: #ecebe5;
    --ink-muted: #c7c2b6;
    --ink-faint: #918d84;
    --rule: #ecebe5;
    --rule-soft: #3a3b42;
    --accent: #d49a74;
    --accent-ink: #15161a;
    --hover: rgba(236, 235, 229, 0.07);
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #ecebe5;
  --paper-soft: #e0ddd0;
  --ink: #15161a;
  --ink-muted: #525257;
  --ink-faint: #77736b;
  --rule: #15161a;
  --rule-soft: #c9c5b9;
  --accent: #7d2e21;
  --accent-ink: #fff8ea;
  --hover: rgba(21, 22, 26, 0.055);
  --shadow: rgba(21, 22, 26, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15161a;
  --paper-soft: #202127;
  --ink: #ecebe5;
  --ink-muted: #c7c2b6;
  --ink-faint: #918d84;
  --rule: #ecebe5;
  --rule-soft: #3a3b42;
  --accent: #d49a74;
  --accent-ink: #15161a;
  --hover: rgba(236, 235, 229, 0.07);
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 28px clamp(16px, 4vw, 48px) 40px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(125, 46, 33, 0.08), transparent 28%),
    linear-gradient(90deg, rgba(21, 22, 26, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 7px 7px, auto;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header,
main,
footer {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-link,
.back-link,
.button-link {
  text-decoration: none;
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
}

.button-link:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.theme-control {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--rule);
  background: var(--paper-soft);
}

.theme-control__label {
  padding: 0 10px;
  color: var(--ink-muted);
  font-weight: 700;
}

.theme-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--rule-soft);
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.theme-control button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.masthead,
.article-masthead {
  padding: clamp(22px, 5vw, 44px) 0 18px;
  text-align: center;
}

.edition-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 4px double var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.edition-strip--bottom {
  border-top: 1px solid var(--rule);
  border-bottom: 4px double var(--rule);
}

.masthead h1 {
  margin: 12px 0 6px;
  font-size: clamp(48px, 12vw, 132px);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.masthead p {
  max-width: 720px;
  margin: 0 auto 18px;
  color: var(--ink-muted);
  font-size: clamp(18px, 2.5vw, 28px);
  font-style: italic;
  line-height: 1.25;
}

.edition-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.82fr);
  gap: clamp(24px, 4vw, 48px);
  margin-top: 36px;
  padding-top: 20px;
  border-top: 4px double var(--rule);
}

.section-kicker,
.section-rule h2,
.department-card__number {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.section-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
}

.lead-story {
  min-width: 0;
  padding-right: clamp(0px, 2vw, 28px);
  border-right: 1px solid var(--rule-soft);
}

.lead-story__link,
.department-card__link {
  display: block;
  text-decoration: none;
}

.lead-story__link:hover,
.department-card__link:hover {
  background: var(--hover);
}

.lead-story h2 {
  max-width: 780px;
  margin: 8px 0 12px;
  font-size: clamp(36px, 5.2vw, 72px);
  line-height: 0.96;
}

.lead-story__link > p {
  max-width: 74ch;
  margin: 0;
  color: var(--ink-muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.48;
}

.lead-story__link > p::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  color: var(--accent);
  font-size: 4.1em;
  font-weight: 900;
  line-height: 0.72;
}

.departments {
  min-width: 0;
}

.section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 4px double var(--rule);
}

.section-rule h2 {
  margin: 0;
  padding: 8px 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.department-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.department-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.department-card:first-child {
  padding-top: 0;
}

.department-card__number {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
}

.department-card h3 {
  margin: 7px 0 8px;
  font-size: clamp(22px, 2.3vw, 31px);
  line-height: 1;
}

.department-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.48;
}

.archive-section {
  margin-top: clamp(36px, 7vw, 76px);
}

.article-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 0;
}

.article-card {
  border-bottom: 1px solid var(--rule-soft);
}

.article-card a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: clamp(14px, 3vw, 28px);
  padding: clamp(14px, 3vw, 24px) 0;
  text-decoration: none;
}

.article-card a:hover {
  background: var(--hover);
}

.article-card__number {
  color: var(--accent);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.article-card h2 {
  max-width: 900px;
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
}

.article-card p {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.6vw, 18px);
}

.article-masthead {
  max-width: 900px;
  margin: 0 auto;
  border-bottom: 4px double var(--rule);
}

.article-masthead .kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-masthead h1 {
  margin: 0 auto 14px;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.96;
}

.article-masthead time {
  display: block;
  color: var(--ink-faint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.article-body {
  width: min(var(--measure), 100%);
  margin: clamp(28px, 6vw, 54px) auto 0;
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.78;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  line-height: 1.06;
}

.article-body h1 {
  margin: 42px 0 16px;
  font-size: clamp(36px, 5vw, 58px);
}

.article-body h2 {
  margin: 42px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  font-size: clamp(28px, 4vw, 42px);
}

.article-body h3 {
  margin: 32px 0 10px;
  font-size: clamp(23px, 3vw, 31px);
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre {
  margin-top: 0;
  margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
  padding-left: 28px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.article-body code {
  padding: 0.12em 0.28em;
  border: 1px solid var(--rule-soft);
  background: var(--paper-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86em;
}

.article-body pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--rule-soft);
  background: var(--paper-soft);
  box-shadow: inset 0 0 0 1px var(--shadow);
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.article-body blockquote {
  padding: 12px 0 12px 22px;
  border-left: 4px double var(--rule);
  color: var(--ink-muted);
  font-size: 1.08em;
  font-style: italic;
}

.article-body img {
  max-width: 100%;
  height: auto;
  margin: 22px 0;
  border: 1px solid var(--rule-soft);
}

footer {
  margin-top: clamp(42px, 8vw, 82px);
  padding-top: 18px;
  border-top: 4px double var(--rule);
  color: var(--ink-faint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .article-list {
    border-bottom: 2px solid var(--rule);
  }
}

@media (max-width: 720px) {
  body {
    padding: 16px 14px 30px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar__actions {
    justify-content: flex-start;
  }

  .theme-control {
    width: 100%;
    overflow-x: auto;
  }

  .edition-strip {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .edition-layout {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .lead-story {
    padding-right: 0;
    padding-bottom: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
  }

  .article-card a {
    grid-template-columns: 1fr;
  }

  .article-card__number {
    text-align: left;
  }
}
