/* AI for Mortals — Editorial Stylesheet */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-tint: #f3ede4;
  --ink: #1a1816;
  --ink-secondary: #4a453e;
  --ink-muted: #6e675e;
  --rule: #e4dbd0;
  --rule-strong: #23201d;
  --accent: #c4452b;
  --accent-hover: #9e341e;
  --accent-soft: #fdf1ee;
  --sage-bg: #eef3ef;
  --sage-ink: #2c4a35;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --measure: 680px;
  --wide: 780px;
  --radius: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.68;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Reading Progress Bar (Articles) */
.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* Page Container */
.container {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 24px;
}

.measure {
  max-width: var(--measure);
  margin: 0 auto;
}

/* Masthead (Index) */
.masthead {
  padding: 40px 0 24px;
  border-bottom: 3px double var(--rule-strong);
  text-align: center;
}

.masthead-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.masthead-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
}

.masthead-title a {
  color: inherit;
  text-decoration: none;
}

.masthead-tagline {
  margin: 10px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-secondary);
}

/* Compact Top Bar (Posts) */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.topbar-back {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-back:hover {
  text-decoration: underline;
}

/* Editor's Opener */
.opener {
  padding: 36px 0 30px;
  border-bottom: 1px solid var(--rule);
}

.opener-greeting {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink);
}

.opener p {
  margin: 0 0 14px;
  font-size: 1.06rem;
  color: var(--ink-secondary);
}

.opener p:last-child {
  margin-bottom: 0;
}

/* In This Edition Index */
.toc-box {
  margin: 28px 0 12px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.toc-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.toc-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.96rem;
  line-height: 1.45;
}

.toc-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  flex-shrink: 0;
  width: 22px;
}

.toc-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Newsletter Story Blocks */
.edition-stories {
  padding: 12px 0 24px;
}

.story-card {
  padding: 38px 0;
  border-bottom: 1px solid var(--rule);
}

.story-card:last-child {
  border-bottom: none;
}

.story-kicker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.story-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.story-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.story-headline {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3.2vw, 2.05rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.story-headline a {
  color: inherit;
  text-decoration: none;
}

.story-headline a:hover {
  color: var(--accent);
}

.story-body p {
  margin: 0 0 15px;
  font-size: 1.035rem;
  color: var(--ink-secondary);
}

.story-body p strong {
  color: var(--ink);
}

/* Takeaway Callout */
.takeaway {
  margin: 20px 0 22px;
  padding: 16px 20px;
  background: var(--surface-tint);
  border-left: 3.5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.96rem;
  color: var(--ink);
}

.takeaway-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

/* CTA Link to Full Post */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.read-more:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.read-more-meta {
  font-weight: 400;
  opacity: 0.72;
  font-size: 0.84rem;
}

/* Lead Story Accent */
.story-card.lead-story {
  background: var(--surface);
  margin: 24px -26px 8px;
  padding: 36px 26px 34px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(26, 24, 22, 0.04);
}

.lead-story .story-index {
  background: var(--accent);
}

/* Sign-off */
.signoff {
  margin: 20px 0 48px;
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
}

.signoff h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0 0 10px;
}

.signoff p {
  margin: 0 0 12px;
  color: var(--ink-secondary);
  font-size: 0.98rem;
}

.signoff p:last-child {
  margin-bottom: 0;
}

/* Full Blog Post Styles */
.article-header {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--rule);
}

.article-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.article-title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.article-deck {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: 1.24rem;
  line-height: 1.48;
  color: var(--ink-secondary);
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.86rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.article-content {
  padding: 34px 0 24px;
  font-size: 1.07rem;
  line-height: 1.76;
  color: var(--ink-secondary);
}

.article-content p {
  margin: 0 0 20px;
}

.article-content strong {
  color: var(--ink);
}

.article-content h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 36px 0 14px;
}

.article-content ul, .article-content ol {
  margin: 0 0 22px;
  padding-left: 22px;
}

.article-content li {
  margin-bottom: 10px;
}

/* Data Highlight Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 28px 0 30px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-secondary);
}

/* Pull Quote */
.pull-quote {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--surface);
  border-left: 4px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.pull-quote p {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 10px;
}

.pull-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Practical Box */
.action-box {
  margin: 32px 0;
  padding: 24px 26px;
  background: var(--sage-bg);
  border: 1px solid #d5e2d8;
  border-radius: 12px;
  color: var(--ink);
}

.action-box h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sage-ink);
}

.action-box p, .action-box li {
  font-size: 0.98rem;
  color: #243328;
  margin-bottom: 8px;
}

.action-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.action-box li:last-child, .action-box p:last-child {
  margin-bottom: 0;
}

/* Sources Box */
.sources-box {
  margin: 36px 0 32px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.sources-box h3 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.sources-list a {
  word-break: break-word;
}

/* Post Footer Navigation */
.post-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 32px 0 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.post-nav-card {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-nav-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.post-nav-dir {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.post-nav-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 44px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.site-footer p {
  margin: 4px 0;
}

/* Responsive Tweaks */
@media (max-width: 740px) {
  .story-card.lead-story {
    margin: 20px -12px 8px;
    padding: 26px 18px;
  }

  .masthead {
    padding: 28px 0 20px;
  }

  .masthead-meta {
    justify-content: center;
    text-align: center;
  }

  .article-header {
    padding: 32px 0 22px;
  }
}
