/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b6b6b;
  --accent: #2a7a6d;
  --accent-dark: #0f3530;
  --accent-light: #e8f4f1;
  --border: #d4d4d4;
  --border-light: #e8e8e8;
  --code-bg: #f5f5f5;
  --sidebar-bg: #fafafa;
  --serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Helvetica Neue', Helvetica, sans-serif;
  --mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
}

html {
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--serif);
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Header === */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
/* Wordmark uses the darker tonal teal (two-tone teal: dark for brand/nav) */
.site-title {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-dark);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}
/* Inline Q mark in the sticky header (QTJ teal square + serif Q) */
.qtj-headermark {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  align-self: center;
  display: block;
}
.site-nav {
  display: flex;
  gap: 28px;
}
.site-nav a {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--accent-dark);
  letter-spacing: 0.01em;
}
.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}
.site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* === Content Layout === */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 60px;
  padding-top: 40px;
  padding-bottom: 80px;
}

/* === Main Column === */
.main-col {
  min-width: 0;
}

.year-heading {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.archive-section {
  margin-bottom: 48px;
}

/* === Article Entries === */
.article-entry {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}
.article-entry:last-child {
  border-bottom: none;
}

.article-date {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.article-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}
.article-title a {
  color: var(--text);
}
.article-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.article-author {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.article-abstract {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.article-tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* === Sidebar === */
.sidebar {
  padding-top: 8px;
}

.sidebar-section {
  margin-bottom: 36px;
}

.sidebar-heading {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.category-list {
  list-style: none;
}
.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}
.category-list li:last-child {
  border-bottom: none;
}
.category-list a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.category-list a:hover {
  color: var(--accent);
}
.category-list .count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-text {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sidebar-link {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
}

.email-text {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Article Page === */
.article-header {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 40px;
}

.article-header .article-tag {
  display: inline-block;
  margin-bottom: 12px;
}

.article-header h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--text);
}

.article-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.article-meta .separator {
  margin: 0 8px;
  color: var(--text-muted);
  opacity: 0.6;
}

.article-abstract-block {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 20px 0;
  border-top: 1px solid var(--border-light);
}

/* === Article Body === */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.article-body h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--text);
}

.article-body h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text);
}

.article-body p {
  margin-bottom: 18px;
  font-size: 1rem;
  line-height: 1.75;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
  line-height: 1.5;
}
.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}
.article-body th {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
}
.article-body td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.article-body .formula {
  display: block;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 20px;
  margin: 24px 0;
  background: var(--code-bg);
  border-radius: 4px;
}

/* === References === */
.references {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.references h3 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.references ol {
  padding-left: 20px;
}
.references li {
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

/* === About Page === */
.page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 0 80px;
}
.page-content h1 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.page-content h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
}
.page-content p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 18px;
}

/* === Contributors === */
.contributor {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-light);
}
.contributor:last-child {
  border-bottom: none;
}
.contributor h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.contributor p {
  font-size: 0.94rem;
  color: var(--text-secondary);
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.site-footer p {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Back Link === */
.back-link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0;
  padding-top: 32px;
}
.back-link:hover {
  color: var(--accent);
}

/* === Selection === */
::selection {
  background: var(--accent-light);
  color: var(--text);
}

/* === Focus States (Accessibility) === */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* === Smooth Scroll === */
html {
  scroll-behavior: smooth;
}

/* === Table Row Hover === */
.article-body tbody tr:hover {
  background: var(--code-bg);
}

/* === Code Block Line Numbers Feel === */
.article-body pre {
  position: relative;
}
.article-body pre::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

/* === Article Entry Hover === */
.article-entry {
  transition: background 0.15s ease;
  padding: 16px;
  margin-left: -16px;
  margin-right: -16px;
  border-radius: 4px;
}
.article-entry:hover {
  background: #fafafa;
}

/* === Back Link Arrow Animation === */
.back-link {
  transition: color 0.15s ease;
}
.back-link:hover {
  text-decoration: none;
}

/* === Formula Block Improvement === */
.article-body .formula {
  border-left: 3px solid var(--accent);
}

/* === Responsive === */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }
  .content-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sidebar {
    border-top: 1px solid var(--border-light);
    padding-top: 32px;
  }
  .article-header h1 {
    font-size: 1.6rem;
  }
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }
  .article-body pre {
    font-size: 0.75rem;
    padding: 16px;
    padding-left: 16px;
  }
  .article-body table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-body th,
  .article-body td {
    padding: 6px 8px;
    white-space: nowrap;
  }
  .article-entry {
    margin-left: -8px;
    margin-right: -8px;
    padding: 12px 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .article-header h1 {
    font-size: 1.35rem;
  }
  .article-body h2 {
    font-size: 1.2rem;
  }
  .site-nav {
    gap: 18px;
  }
}

/* === Print Styles === */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .back-link,
  .site-nav {
    display: none;
  }
  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
  }
  .article-header,
  .article-body {
    max-width: 100%;
  }
  .content-layout {
    grid-template-columns: 1fr;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  .article-body pre {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  .article-body table {
    page-break-inside: avoid;
  }
}


/* === Archive Index: lead/featured + asides (moved from inline) === */
/* QTJ-distinct rhythm. Two-tone teal: --accent-dark for structure, --accent for links. */

.archive-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--text);
  margin: 32px 0 8px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.archive-lede {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 680px;
}

/* Editorial publication notice */
.qtj-disclaimer {
  background: var(--sidebar-bg);
  border-left: 3px solid var(--accent);
  padding: 12px 18px;
  margin: 18px 0;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-secondary);
}
.qtj-disclaimer strong {
  font-style: normal;
  color: var(--accent-dark);
}

/* Featured lead article — breaks the monotone entry ladder */
.qtj-featured {
  margin: 28px 0 44px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--border-light);
}
.qtj-featured-rule {
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  border: 0;
  margin: 0 0 14px;
}
.qtj-featured-kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  margin-bottom: 10px;
  display: block;
}
.qtj-featured-title {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.qtj-featured-title a {
  color: var(--text);
}
.qtj-featured-title a:hover {
  color: var(--accent);
  text-decoration: none;
}
.qtj-featured-meta {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.qtj-featured-abstract {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .archive-title { font-size: 1.9rem; }
  .qtj-featured-title { font-size: 1.5rem; }
  .qtj-featured-abstract { font-size: 1.02rem; }
}


/* === Shared header mark, nav drawer, key-facts & email CTA (moved from per-page inline) === */
/* Premium header system propagated from the homepage to every inner/article page. */

/* Brand wordmark text beside the inline Q-mark (inherits .site-title sizing/colour) */
.qtj-wordmark { display: inline; }

/* Long-content wrap guard (was per-page inline body rule) */
body { overflow-wrap: anywhere; word-break: break-word; }

/* Mobile nav drawer + hamburger (was per-page inline <style>) */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: inherit;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
}
@media (max-width: 768px) {
  .hamburger { display: flex !important; }
  .header-inner { flex-wrap: wrap; }
  nav.site-nav { display: none; width: 100%; flex-direction: column; }
  nav.site-nav.open { display: flex; }
  nav.site-nav a { padding: 0.5rem 0; border-top: 1px solid rgba(0,0,0,0.1); }
}

/* Key-facts / citation blocks (were duplicated inline across utility pages) */
.key-facts {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-left: 3px solid #2a7a6d;
  border-radius: 6px;
  padding: 20px 24px;
  margin: 24px 0;
}
.kf-label {
  font-size: 10px;
  font-family: var(--mono);
  color: #2a7a6d;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.kf-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
}
.key-facts ul { list-style: none; padding-left: 0; margin-bottom: 12px; }
.key-facts li {
  position: relative;
  padding-left: 14px;
  font-size: 0.95rem;
  color: #4a4a4a;
  margin-bottom: 6px;
}
.key-facts li::before { content: '\25aa'; position: absolute; left: 0; color: #2a7a6d; }
.cite-as {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: #6b6b6b;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #e8e8e8;
  word-break: break-word;
  line-height: 1.5;
}
.cite-as strong { color: #1a1a1a; }
.kf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 10px;
  font-family: var(--mono);
  color: #6b6b6b;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Visible provenance note used across editorial analysis articles. */
.qtj-method-note {
  margin: 18px 0 26px;
  padding: 13px 15px;
  border-left: 3px solid var(--accent);
  background: #f4f8f7;
  color: #3f4a48;
  font-size: 0.84rem;
  line-height: 1.6;
}
.qtj-method-note strong {
  color: #163f38;
}

/* Email sign-up CTA (was fully inline-styled per page) */
.eco-footer-cta {
  background: #f6f8f7;
  border-top: 2px solid #2a7a6d;
  padding: 30px 20px;
}
.eco-footer-cta .eco-cta-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.eco-footer-cta .eco-cta-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #2a7a6d;
  text-transform: uppercase;
}
.eco-footer-cta .eco-cta-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #1a1f26;
  font-weight: 600;
}
.eco-footer-cta .eco-cta-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: #555566;
  line-height: 1.55;
}
.eco-footer-cta .eco-cta-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: flex-start;
}
.eco-footer-cta .eco-cta-honey { display: none; }
.eco-footer-cta .eco-cta-srlabel { position: absolute; left: -9999px; }
.eco-footer-cta .eco-cta-email {
  flex: 1 1 240px;
  max-width: 300px;
  padding: 10px 12px;
  border: 1px solid #dcdcdc;
  border-radius: 5px;
  font-size: 14px;
  background: #ffffff;
  color: #1a1f26;
}
.eco-footer-cta .eco-cta-btn {
  padding: 10px 20px;
  background: #2a7a6d;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.eco-footer-cta .eco-cta-consent {
  flex: 1 1 100%;
  display: flex;
  gap: 7px;
  justify-content: center;
  align-items: flex-start;
  font-size: 11px;
  color: #555566;
  margin-top: 4px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
}
.eco-footer-cta .eco-cta-consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.eco-footer-cta .eco-cta-consent a { color: #2a7a6d; }
