:root {
  /* Colors */
  --color-bg: #fdfdfc;
  --color-text: #121212;
  --color-border: #e2e2e2;
  --color-accent: #8b0000;
  /* Deep Red for links/accents */
  --color-meta: #666666;

  /* Typography */
  --font-serif-headline: 'Georgia', 'Times New Roman', serif;
  /* Placeholder for Cheltenham */
  --font-serif-body: 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-logo: 'Times New Roman', serif;
  /* Placeholder for Blackletter/Old-style */

  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Borders */
  --border-hairline: 1px solid var(--color-border);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  opacity: 0.6;
  text-decoration: none;
}

/* Prevent opacity change on image links */
.shared-image-container a:hover,
.single-image-container a:hover {
  opacity: 1;
}

/* Article Titles Hover */
.article-card {
  transition: opacity 0.2s ease;
}

.article-card:hover h2,
.article-card:hover h3,
.article-card:hover h4,
.article-card.hover-active h2,
.article-card.hover-active h3,
.article-card.hover-active h4 {
  color: #555;
  /* Subtle dark grey */
  opacity: 1;
  /* Reset opacity */
}

.article-card:hover {
  cursor: pointer;
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif-headline);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-meta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.author-name {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Header / Masthead */
header {
  margin-bottom: var(--spacing-lg);
}

.top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: var(--border-hairline);
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.date {
  justify-self: start;
}

.lang-toggle {
  justify-self: center;
  text-align: center;
}

.search-container {
  justify-self: end;
}

.masthead {
  text-align: center;
  padding: var(--spacing-md) 0;
}

.logo {
  font-family: var(--font-logo);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
  /* Ensure no extra font height */
  display: block;
  text-transform: uppercase;
  /* Optional, depending on specific logo style */
}

.logo a:hover {
  color: inherit;
  opacity: 1;
  cursor: pointer;
}

/* Search Styles */
.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-icon {
  cursor: pointer;
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.search-icon:hover {
  opacity: 1;
}

#search-input {
  display: none;
  /* Hidden by default */
  border: none;
  border-bottom: 1px solid #ccc;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 4px;
  outline: none;
  width: 200px;
}

#search-input.active {
  display: block;
}

.nav-bar {
  border-top: var(--border-hairline);
  border-bottom: var(--border-hairline);
  /* Double border effect created by header bottom border + this */
  padding: var(--spacing-sm) 0;
  margin-top: 0;
  /* Removed to balance whitespace */
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
}

.nav-bar a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  /* Reduced by ~25% from 1rem default/implicit */
}

/* Main Grid - 2 Column Layout (75% / 25%) */
.main-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: var(--spacing-lg);
  border-bottom: var(--border-hairline);
  padding-bottom: var(--spacing-lg);
}

/* Left Column (75%) */
.left-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  border-right: var(--border-hairline);
  padding-right: var(--spacing-lg);
}

/* Paired Block (Left Column) */
.paired-block {
  display: grid;
  grid-template-columns: 35fr 65fr;
  /* 35% Text / 65% Image */
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-lg);
  border-bottom: var(--border-hairline);
}

.paired-block:last-child {
  border-bottom: none;
}

.text-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  /* Ensure stack takes full height */
}

/* Condensed Typography for Paired Blocks */
.paired-block h3 {
  font-size: 1.1rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.paired-block p {
  font-size: 0.9rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 0;
  margin-bottom: 0;
}

.paired-block .meta {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.paired-block .author-name {
  font-size: 0.7rem;
  line-height: 1.2;
  margin-top: 2px;
  margin-bottom: 0;
}

.top-article,
.bottom-article {
  flex: 1;
  /* Mechanism for equal height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Center content vertically if needed */
}

.paired-divider {
  border-top: var(--border-hairline);
  margin: var(--spacing-sm) 0;
  /* Reduced margin */
  flex-shrink: 0;
  /* Prevent divider from shrinking */
}

.shared-image-container {
  aspect-ratio: 5/3;
  background-color: #eee;
  overflow: hidden;
}

.shared-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right Column (25%) */
.right-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* Single Block (Right Column) */
.single-block {
  display: grid;
  grid-template-columns: 1fr 80px;
  /* Text vs 1:1 Image */
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-md);
  border-bottom: var(--border-hairline);
  /* Approximate 16:9 feel for the whole block container if needed, 
     but content usually dictates height. 
     We focus on the image being 1:1 and to the right. */
}

.single-block:last-child {
  border-bottom: none;
}

.single-image-container {
  width: 80px;
  height: 80px;
  aspect-ratio: 1/1;
  background-color: #eee;
  overflow: hidden;
}

.single-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .left-column {
    border-right: none;
    padding-right: 0;
  }

  .paired-block {
    grid-template-columns: 1fr;
  }

  .shared-image-container {
    order: -1;
    /* Image on top for mobile */
    aspect-ratio: 5/3;
    width: auto;
    margin-left: -16px;
    margin-right: -16px;
    max-width: none;
    /* Full width on mobile */
  }

  .single-block {
    grid-template-columns: 1fr;
  }

  .single-image-container {
    order: -1;
    width: auto;
    margin-left: -16px;
    margin-right: -16px;
    max-width: none;
    /* Full width on mobile */
    height: auto;
    aspect-ratio: 5/3;
  }

  .article-image {
    width: auto;
    margin-left: -16px;
    margin-right: -16px;
    max-width: none;
    aspect-ratio: 5/3;
    overflow: hidden;
  }

  .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  article.container {
    margin-top: var(--spacing-lg);
  }
}

/* Hide mobile elements by default on desktop */
.mobile-header,
.side-drawer,
.drawer-overlay {
  display: none;
}

/* Mobile Header & Menu - Show only on mobile */
@media (max-width: 768px) {

  .mobile-header,
  .side-drawer,
  .drawer-overlay {
    display: flex;
    /* or block/grid as needed, flex covers header/drawer */
  }

  .drawer-overlay {
    display: block;
    /* Overlay is a block */
  }

  /* Mobile Header & Menu */
  body {
    padding-top: 55px;
    /* Space for fixed header */
  }

  .top-bar,
  .nav-bar,
  .masthead {
    display: none;
    /* Hide desktop header elements */
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: var(--border-hairline);
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
  }

  .mobile-logo {
    font-family: var(--font-logo);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    letter-spacing: -0.02em;
  }

  .hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #000;
  }

  .side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: var(--border-hairline);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .side-drawer.open {
    transform: translateX(0);
  }

  .side-drawer a {
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1rem;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid #eee;
  }

  .drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Article Card Styles */
.article-card {
  margin-bottom: var(--spacing-lg);
}

.article-card h2 {
  font-size: 1.5rem;
}

.article-card.lead h2 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
}

.article-card p {
  font-size: 1rem;
  color: #333;
}

.article-card.lead p {
  font-size: 1.2rem;
  color: #444;
}

.article-image-placeholder {
  background-color: #eee;
  width: 100%;
  height: 300px;
  /* Default for lead, overridden inline for others */
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-family: var(--font-sans);
  overflow: hidden;
  /* Ensure content fits */
}

.article-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-item {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: var(--border-hairline);
}

.sidebar-item:last-child {
  border-bottom: none;
}

/* Search Overlay */
.search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  z-index: 2000;
  justify-content: center;
  align-items: flex-start;
  padding-top: 100px;
  overflow-y: auto;
}

.search-overlay-content {
  width: 100%;
  max-width: 800px;
  position: relative;
  padding: 0 var(--spacing-lg);
}

.close-search {
  position: absolute;
  top: -60px;
  right: var(--spacing-lg);
  font-size: 3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  line-height: 1;
}

#overlay-search-input {
  width: 100%;
  font-size: 2rem;
  font-family: var(--font-serif-headline);
  border: none;
  border-bottom: 2px solid #333;
  padding: var(--spacing-sm) 0;
  background: transparent;
  outline: none;
  margin-bottom: var(--spacing-xl);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.search-result-item a {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: var(--spacing-md);
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}

.search-result-item a:hover {
  background-color: #f9f9f9;
}

.search-result-item h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
  font-family: var(--font-serif-headline);
}

.search-result-item p {
  font-size: 1rem;
  color: #555;
  margin-bottom: var(--spacing-xs);
  font-family: var(--font-serif-body);
}

.search-result-item .meta {
  font-size: 0.8rem;
  color: #999;
}

.no-results {
  text-align: center;
  font-size: 1.2rem;
  color: #777;
  margin-top: var(--spacing-lg);
}