/* ===== Article layout — extra horizontal padding for breathing room ===== */
.page-header {
  padding-left: clamp(var(--space-md), 18vw, 320px);
  padding-right: clamp(var(--space-md), 18vw, 320px);
}

.strip {
  padding-left: clamp(var(--space-md), 18vw, 320px);
  padding-right: clamp(var(--space-md), 18vw, 320px);
}

.article-body {
  padding: var(--space-lg) clamp(var(--space-md), 18vw, 320px);
}


/* ===== Prose typography ===== */
.article-body p {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

.article-body strong { font-weight: 600; }

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.article-body a:hover {
  color: var(--fg);
  text-decoration-color: var(--accent);
}

/* ===== Headings — h2 gets border divider ===== */
.article-body h2 {
  font-family: var(--serif);
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border);
}

.article-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 1.9vw, 1.65rem);
  font-weight: 400;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

/* ===== Lists ===== */
.article-body ul,
.article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.25rem;
}

.article-body li {
  font-size: 1.25rem;
  line-height: 1.8;
  margin-bottom: 0.35rem;
}

/* ===== Images — full width, left-aligned ===== */
.article-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-md) 0;
}

/* ===== Blockquotes — thick left border, var(--fg) ===== */
.article-body blockquote {
  border-left: 2px solid var(--fg);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--fg-muted);
  font-size: 1.25rem;
  line-height: 1.75;
}

.article-body blockquote strong {
  color: var(--fg);
}

/* ===== Inline code ===== */
.article-body code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  background: rgba(26,26,26,0.06);
  padding: 0.15rem 0.35rem;
  border-radius: 0;
}
body.dark .article-body code {
  background: rgba(232,229,224,0.06);
}

/* ===== Horizontal rules ===== */
.article-body hr {
  border: none;
  border-top: var(--border);
  margin: var(--space-lg) 0;
}

/* ===== Callouts — border-only, no background ===== */
.callout {
  padding: var(--space-sm) var(--space-md);
  margin: 1.5rem 0;
  border-left: 3px solid var(--fg);
  font-size: 1.25rem;
  line-height: 1.7;
}

.callout p {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.callout-warning {
  border-color: var(--callout-warn-border);
}

.callout-info {
  border-color: var(--callout-info-border);
}

/* ===== Tables — full width, bordered ===== */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th {
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: var(--text-xs);
  padding: var(--space-sm) var(--space-sm);
  border-bottom: var(--border-strong);
  white-space: nowrap;
}

td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: var(--border);
  line-height: 1.5;
}

td a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--fg-faint);
}
td a:hover { text-decoration-color: var(--fg); }

/* ===== Prev/next navigation ===== */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--border);
}

.article-nav:empty {
  display: none;
}

.article-nav a {
  padding: var(--space-md);
  text-decoration: none;
  color: var(--fg);
  transition: background 0.2s;
}

.article-nav a:hover {
  background: var(--fg-ghost);
}

.article-nav > :first-child {
  border-right: var(--border);
}

.article-nav-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.article-nav-title {
  font-family: var(--serif);
  font-size: var(--text-lg);
  line-height: 1.3;
}

.article-nav a.next {
  text-align: right;
}

/* ===== Text size toggle — three larger sizes above the 1.25rem default ===== */
body.text-2 .article-body p,
body.text-2 .article-body li,
body.text-2 .article-body blockquote,
body.text-2 .callout,
body.text-2 .callout p { font-size: 1.35rem; }

body.text-2 .article-body h2 { font-size: clamp(2.2rem, 3.8vw, 3.2rem); }
body.text-2 .article-body h3 { font-size: 1.45rem; }

body.text-3 .article-body p,
body.text-3 .article-body li,
body.text-3 .article-body blockquote,
body.text-3 .callout,
body.text-3 .callout p { font-size: 1.45rem; }

body.text-3 .article-body h2 { font-size: clamp(2.4rem, 4vw, 3.4rem); }
body.text-3 .article-body h3 { font-size: 1.55rem; }

body.text-4 .article-body p,
body.text-4 .article-body li,
body.text-4 .article-body blockquote,
body.text-4 .callout,
body.text-4 .callout p { font-size: 1.55rem; }

body.text-4 .article-body h2 { font-size: clamp(2.6rem, 4.2vw, 3.6rem); }
body.text-4 .article-body h3 { font-size: 1.65rem; }

/* ===== Lightbox overlay ===== */
.article-body img { cursor: pointer; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  padding: var(--space-md);
}

.lightbox-overlay img {
  width: 95vw;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  cursor: default;
}

/* ===== Article responsive ===== */
@media (max-width: 768px) {
  .page-header,
  .strip { padding-left: var(--space-md); padding-right: var(--space-md); }
  .article-body { padding-left: var(--space-md); padding-right: var(--space-md); }

  .article-body h2 { font-size: clamp(1.4rem, 6vw, 1.8rem); }
  .article-body h3 { font-size: clamp(1.15rem, 4.5vw, 1.4rem); }

  .article-body p,
  .article-body li,
  .article-body blockquote,
  .callout,
  .callout p { font-size: 0.95rem; }

  table { font-size: 0.8rem; }
  th, td { padding: var(--space-xs); }

  .article-nav {
    grid-template-columns: 1fr;
  }
  .article-nav a:first-child {
    border-right: none;
    border-bottom: var(--border);
  }

  /* Text size toggle — scaled down for mobile */
  body.text-2 .article-body p,
  body.text-2 .article-body li,
  body.text-2 .article-body blockquote,
  body.text-2 .callout,
  body.text-2 .callout p { font-size: 1.2rem; }

  body.text-2 .article-body h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
  body.text-2 .article-body h3 { font-size: 1.3rem; }

  body.text-3 .article-body p,
  body.text-3 .article-body li,
  body.text-3 .article-body blockquote,
  body.text-3 .callout,
  body.text-3 .callout p { font-size: 1.3rem; }

  body.text-3 .article-body h2 { font-size: clamp(2.2rem, 3.8vw, 3rem); }
  body.text-3 .article-body h3 { font-size: 1.4rem; }

  body.text-4 .article-body p,
  body.text-4 .article-body li,
  body.text-4 .article-body blockquote,
  body.text-4 .callout,
  body.text-4 .callout p { font-size: 1.4rem; }

  body.text-4 .article-body h2 { font-size: clamp(2.4rem, 4vw, 3.2rem); }
  body.text-4 .article-body h3 { font-size: 1.5rem; }
}
