@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Special+Elite&display=swap');

/* --- Core Design System Tokens --- */
:root {
  --bg-paper: #faf6ee;
  --bg-darker: #f5eedf;
  --text-dark: #1a1917;
  --text-muted: #5a5752;
  --border-ink: #1a1917;
  --border-light: #d8cfbe;
  --font-serif-header: 'Playfair Display', Georgia, serif;
  --font-serif-body: 'Lora', Georgia, serif;
  --font-typewriter: 'Special Elite', Courier New, monospace;
}

/* --- Base Rules & Resets --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.5rem;
  background-color: var(--bg-paper);
  color: var(--text-dark);
  font-family: var(--font-serif-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Container limits width and centers the paper */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* --- Typography Helpers --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif-header);
  color: var(--text-dark);
  margin-top: 0;
  text-wrap: balance; /* Balanced headings */
}

p {
  text-wrap: pretty; /* Prevent orphans */
}

a {
  color: var(--text-dark);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-ink);
  transition: all 0.2s ease;
}

a:hover {
  background-color: var(--text-dark);
  color: var(--bg-paper);
  border-bottom-style: solid;
}

/* --- Newspaper Layout Elements --- */

/* The main title/header block */
.masthead {
  text-align: center;
  margin-bottom: 0.5rem;
}

.masthead h1 {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: -2px;
  line-height: 0.95;
}

.masthead .sub-tagline {
  font-family: var(--font-typewriter);
  font-size: 1.1rem;
  margin: 0.5rem 0 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* The double line border wrapping date/volume/price */
.newspaper-meta-bar {
  border-top: 4px double var(--border-ink);
  border-bottom: 4px double var(--border-ink);
  padding: 0.5rem 0.75rem;
  margin: 1.5rem 0 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-typewriter);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.meta-bar-item {
  flex: 1;
}
.meta-bar-item.center {
  text-align: center;
}
.meta-bar-item.right {
  text-align: right;
}

/* --- Columns & Grid Structure --- */
.newspaper-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .newspaper-grid {
    grid-template-columns: 3fr 1fr; /* Main story feed + Sidebar */
  }
}

/* Main Section containing stories */
.main-news-stream {
  display: flex;
  flex-direction: column;
}

/* Sidebar styling with vertical borders */
.newspaper-sidebar {
  border-top: 1px solid var(--border-ink);
  padding-top: 2rem;
}

@media (min-width: 900px) {
  .newspaper-sidebar {
    border-top: none;
    border-left: 1px solid var(--border-ink);
    padding-top: 0;
    padding-left: 2rem;
  }
}

/* --- Card Styles (Newspaper Style) --- */

/* Lead Story - taking prominence at the top of the feed */
.lead-story {
  border-bottom: 2px solid var(--border-ink);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.lead-story .story-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.lead-story .story-title a {
  border-bottom: none;
}
.lead-story .story-title a:hover {
  background-color: transparent;
  color: inherit;
  text-decoration: underline;
}

.lead-story .story-meta {
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.lead-story .story-illustration-wrapper {
  border: 1px solid var(--border-ink);
  padding: 8px;
  background-color: #fff;
  margin-bottom: 1.5rem;
}

.lead-story .story-illustration {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: cover;
  filter: grayscale(100%) contrast(110%);
  display: block;
}

.lead-story .story-excerpt {
  text-align: justify;
  hyphens: auto;
  font-size: 1.15rem;
}

/* Grid of secondary stories below the lead */
.secondary-stories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 600px) {
  .secondary-stories-grid {
    grid-template-columns: 1fr 1fr; /* 2-column secondary stories */
  }
}

.story-card {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

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

@media (min-width: 600px) {
  .secondary-stories-grid .story-card {
    border-bottom: none;
    padding-bottom: 0;
  }
  /* Add separation border between secondary stories */
  .secondary-stories-grid .story-card:first-child {
    border-right: 1px solid var(--border-light);
    padding-right: 1.5rem;
  }
}

.story-card .story-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.story-card .story-title a {
  border-bottom: none;
}
.story-card .story-title a:hover {
  background-color: transparent;
  color: inherit;
  text-decoration: underline;
}

.story-card .story-meta {
  font-family: var(--font-typewriter);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.story-card .story-illustration-wrapper {
  border: 1px solid var(--border-ink);
  padding: 4px;
  background-color: #fff;
  margin-bottom: 1rem;
}

.story-card .story-illustration {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: grayscale(100%) contrast(110%);
  display: block;
}

.story-card .story-excerpt {
  text-align: justify;
  hyphens: auto;
  font-size: 0.95rem;
  margin: 0;
}

/* --- Single Post Detail Page --- */
.post-detail {
  max-width: 800px;
  margin: 0 auto;
}

.post-detail-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-ink);
  padding-bottom: 1.5rem;
}

.post-detail-header h2 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.post-detail-meta {
  font-family: var(--font-typewriter);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-detail-illustration-wrapper {
  border: 1px solid var(--border-ink);
  padding: 10px;
  background-color: #fff;
  margin-bottom: 2.5rem;
}

.post-detail-illustration {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  filter: grayscale(100%) contrast(110%);
  display: block;
}

/* Post text layout mimicking columns */
.post-body {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Large screen multi-column reading layout */
@media (min-width: 768px) {
  .post-body-columns {
    column-count: 2;
    column-gap: 2.5rem;
    column-rule: 1px solid var(--border-light);
    text-align: justify;
    hyphens: auto;
  }
}

/* Drop Caps for the first letter of articles */
.post-body p:first-of-type::first-letter,
.lead-story .story-excerpt p:first-of-type::first-letter {
  float: left;
  font-size: 4.5rem;
  line-height: 3.5rem;
  padding-top: 4px;
  padding-right: 10px;
  font-family: var(--font-serif-header);
  font-weight: 900;
  color: var(--text-dark);
}

.post-tags-container {
  margin-top: 3rem;
  border-top: 1px solid var(--border-ink);
  padding-top: 1.5rem;
}

/* --- Sidebar Widgets --- */
.sidebar-widget {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 2rem;
}

.sidebar-widget:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-widget h3 {
  font-family: var(--font-typewriter);
  font-size: 1.1rem;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-ink);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
}

/* Editor Bio Widget */
.editor-bio {
  font-size: 0.95rem;
  line-height: 1.5;
}

.editor-bio p {
  margin: 0 0 1rem 0;
}

/* Tags List / Cloud Widget */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-badge {
  font-family: var(--font-typewriter);
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-ink);
  background-color: var(--bg-darker);
  border-radius: 0; /* Boxy look */
}

.tag-badge:hover {
  background-color: var(--text-dark);
  color: var(--bg-paper);
}

/* --- Navigation & Menu --- */
.newspaper-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-family: var(--font-typewriter);
  font-size: 1rem;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.newspaper-nav a {
  border-bottom: none;
  padding: 0.2rem 0.5rem;
}

.newspaper-nav a.active {
  border-bottom: 2px solid var(--border-ink);
}

/* --- Pagination & Footer --- */
.pagination {
  border-top: 2px solid var(--border-ink);
  padding-top: 1.5rem;
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-typewriter);
  text-transform: uppercase;
}

.pagination a {
  border: 1px solid var(--border-ink);
  padding: 0.5rem 1rem;
  background-color: var(--bg-darker);
}

.pagination span.disabled {
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1rem;
  cursor: not-allowed;
}

.newspaper-footer {
  text-align: center;
  border-top: 4px double var(--border-ink);
  margin-top: 5rem;
  padding: 2rem 0;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- About Page --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 2fr;
  }
}

.about-portrait-wrapper {
  border: 1px solid var(--border-ink);
  padding: 10px;
  background-color: #fff;
  text-align: center;
}

.about-portrait {
  width: 100%;
  height: auto;
  max-width: 280px;
  filter: grayscale(100%) contrast(120%);
}

.about-portrait-caption {
  font-family: var(--font-typewriter);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.about-content {
  font-size: 1.1rem;
  line-height: 1.7;
}

.about-content h2 {
  font-size: 2rem;
  border-bottom: 1px solid var(--border-ink);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-paper);
  border-left: 1px solid var(--border-light);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border: 3px solid var(--bg-paper);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
scrollbar-gutter: stable;
