/* ============================================================
   GRID THEME — Main Stylesheet
   Finance & AI Editorial Magazine Theme
   ============================================================ */

/* ── 1. CSS CUSTOM PROPERTIES ─────────────────────────────── */

:root {
  /* Color palette — clean white editorial */
  --color-bg: #ffffff;
  --color-surface: #f5f5f5;
  --color-ink: #1a1a1a;
  --color-charcoal: #444444;
  --color-muted: #767676;
  --color-border: #e0e0e0;
  --color-border-light: #eeeeee;
  --color-surface-alt: #f0f0f0;

  /* Legacy aliases for compatibility */
  --color-paper: var(--color-bg);
  --color-off-white: var(--color-surface);
  --color-border-muted: var(--color-border);
  --color-on-surface: var(--color-ink);
  --color-on-surface-variant: var(--color-charcoal);

  /* Accent palette */
  --color-accent: #1a5fa8;
  --color-green: #1a6b5c;
  --color-blue: #1a5fa8;
  --color-gold: #b8860b;

  /* Typography */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Spacing */
  --spacing-gutter: 24px;
  --spacing-section: 64px;
  --container-max: 1320px;
  --container-px: 16px;

  /* Easing */
  --ease-hover: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-luxe: cubic-bezier(0.22, 1, 0.36, 1);

  /* Modern surface tokens — radius & elevation */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 10px rgba(17, 17, 17, 0.07);
  --shadow-md: 0 10px 30px rgba(17, 17, 17, 0.12);
}

/* ── 2. RESET & BASE ──────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Sticky footer: #main grows to fill leftover space so the footer
     stays pinned to the bottom on pages with little content. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#main {
  flex: 1 0 auto;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ── 3. LAYOUT ────────────────────────────────────────────── */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

@media (min-width: 640px) {
  .container {
    padding-inline: 32px;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: 40px;
  }
}

/* ── 4. TYPOGRAPHY UTILITIES ──────────────────────────────── */

.label-caps {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  display: inline-block;
}

.body-lg {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
}

.body-sm {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

/* ── 5. BUTTONS ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition:
    background 0.2s var(--ease-hover),
    color 0.2s var(--ease-hover),
    border-color 0.2s var(--ease-hover);
  white-space: nowrap;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: 0;
}

.btn-primary {
  background-color: var(--color-ink);
  color: white;
  border-color: var(--color-ink);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-red {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn-red:hover {
  background-color: #134a85;
  border-color: #134a85;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-ink);
  border-color: var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ── 6. SITE HEADER — SIMPLE SINGLE ROW ──────────────────── */

.grid-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #111111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.2s ease;
}

.grid-header.scrolled {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.grid-header-inner {
  display: flex;
  align-items: center;
  height: 76px;
  gap: 0;
}

/* Logo area */
.grid-logo-area {
  flex-shrink: 0;
  margin-right: 28px;
  display: flex;
  align-items: center;
}

.grid-logo-link {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

.grid-logo-area .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.grid-logo-area .custom-logo,
.grid-logo-img {
  max-height: 60px;
  width: auto;
  display: block;
}

/* Primary nav */
.grid-nav {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.grid-nav-list,
.grid-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.grid-nav-list > li > a,
.grid-nav a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0 12px;
  display: block;
  height: 76px;
  line-height: 76px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.grid-nav-list > li > a:hover,
.grid-nav a:hover,
.grid-nav .current-menu-item > a {
  color: #ffffff;
  border-bottom-color: var(--color-accent);
}

.grid-nav-list .sub-menu,
.grid-nav .sub-menu {
  display: none;
}

/* Header actions */
.grid-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #ffffff;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: all 0.3s ease;
}

@media (max-width: 1023px) {
  .nav-toggle {
    display: flex;
  }

  .grid-nav {
    display: none;
  }

  .grid-logo-area {
    flex: 1;
    margin-right: 0;
  }
}

/* ── 7. MOBILE MENU OVERLAY ───────────────────────────────── */

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-ink);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.mobile-menu.open {
  display: flex;
}

.mobile-nav-list,
.mobile-menu ul {
  text-align: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-list li,
.mobile-menu ul li {
  margin-bottom: 20px;
}

.mobile-nav-list a,
.mobile-menu ul a {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  color: white;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-nav-list a:hover,
.mobile-menu ul a:hover {
  color: var(--color-accent);
}

.mobile-menu-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: white;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  transition: color 0.2s ease;
}

.mobile-menu-close:hover {
  color: var(--color-accent);
}

.mobile-menu-cta {
  margin-top: 16px;
}

/* ── 8. REVEAL ANIMATION ──────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s var(--ease-luxe),
    transform 0.7s var(--ease-luxe);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── 9. CATEGORY BADGE PILLS ──────────────────────────────── */

.cat-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  margin-bottom: 10px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cat-badge:hover {
  opacity: 0.85;
}

.cat-ai {
  background: #1a5fa8;
  color: #fff;
}
.cat-markets {
  background: #1a1a1a;
  color: #fff;
}
.cat-opinion {
  background: #c7232b;
  color: #fff;
}
.cat-macro {
  background: #4b3f8a;
  color: #fff;
}
.cat-interview {
  background: #1a6b5c;
  color: #fff;
}
.cat-data {
  background: #555551;
  color: #fff;
}
.cat-investing {
  background: #1a5fa8;
  color: #fff;
}
.cat-analysis {
  background: #1a5fa8;
  color: #fff;
}
.cat-default {
  background: #1a1a1a;
  color: #fff;
}

/* ── 10. HOMEPAGE CATEGORY SECTIONS ──────────────────────── */

.cat-section {
  padding: 36px 0;
  border-top: 1px solid var(--color-border);
}

/* Section header row */
.cat-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.cat-section-heading {
  padding-left: 16px;
  border-left: 3px solid var(--color-accent);
}

.cat-section-kicker {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.cat-section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  line-height: 1.1;
}

.cat-section-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cat-section-title a:hover {
  color: var(--color-accent);
}

.cat-view-all {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.cat-view-all:hover {
  opacity: 0.7;
}

/* ── 3-column layout: post list | featured post | newsletter ─ */

.cat-section-columns {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1023px) {
  .cat-section-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cat-list-col {
    order: 2;
  }

  .cat-feature-col {
    order: 1;
  }

  .cat-optin {
    order: 3;
  }
}

/* ── Left: list of 3 posts — thumbnail left, title right ──── */

.cat-list-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cat-list-row-link {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.cat-list-row-link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cat-list-row-thumb {
  flex-shrink: 0;
  width: 96px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
}

.cat-list-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.cat-list-row-link:hover .cat-list-row-thumb img {
  transform: scale(1.08);
}

.cat-list-row-body {
  flex: 1;
  min-width: 0;
}

.cat-list-row-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-ink);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.cat-list-row-link:hover .cat-list-row-title {
  color: var(--color-accent);
}

.cat-list-row-date {
  font-size: 11px;
  color: var(--color-muted);
  font-family: var(--font-body);
}

/* ── Middle: one big featured post ─────────────────────────── */

.cat-feature-col {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.cat-feature-col-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--color-surface-alt);
}

.cat-feature-col-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.cat-feature-col-media:hover img {
  transform: scale(1.04);
}

.cat-feature-col-body {
  padding: 28px;
}

@media (max-width: 767px) {
  .cat-feature-col-body {
    padding: 22px;
  }
}

.cat-feature-col-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin-bottom: 10px;
}

.cat-feature-col-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cat-feature-col-title a:hover {
  color: var(--color-accent);
}

.cat-feature-col-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-charcoal);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-feature-col-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  font-family: var(--font-body);
}

/* ── Right: category newsletter card ───────────────────────── */

.cat-optin {
  background: var(--color-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
}

.cat-optin-eyebrow {
  display: block;
  margin-bottom: 10px;
}

.cat-optin-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 8px;
}

.cat-optin-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.55;
  margin-bottom: 20px;
}

.cat-optin .cat-nl-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: none;
}

.cat-optin .cat-nl-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.cat-optin .cat-nl-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.25);
}

.newsletter-privacy-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-muted);
}

.newsletter-privacy-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.newsletter-privacy-note a:hover {
  color: var(--color-accent);
}

.cat-optin .newsletter-privacy-note {
  color: rgba(255, 255, 255, 0.45);
}

.cat-optin .newsletter-privacy-note a:hover {
  color: #ffffff;
}

.cat-nl-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-nl-input,
.newsletter-email-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  outline: none;
  color: var(--color-ink);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.cat-nl-input:focus,
.newsletter-email-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.12);
}

.cat-nl-input::placeholder,
.newsletter-email-input::placeholder {
  color: var(--color-muted);
}

.cat-nl-btn,
.newsletter-submit-btn {
  width: 100%;
  background: var(--color-accent);
  color: white;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 13px;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.cat-nl-btn:hover,
.newsletter-submit-btn:hover {
  background: #134a85;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.cat-nl-btn:disabled,
.newsletter-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── 11. NEWSLETTER FORM (shared) ─────────────────────────── */

.newsletter-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.newsletter-field-error {
  font-size: 12px;
  color: #c7232b;
  display: none;
}

.newsletter-field-error:not(:empty) {
  display: block;
}

.newsletter-status {
  display: none;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: var(--radius-sm);
}

/* Both remaining newsletter forms (sidebar widget, homepage band) sit on
   dark backgrounds, so status colors are tuned for contrast on dark. */
.newsletter-status.is-success {
  background: rgba(46, 204, 113, 0.15);
  color: #7ee8ac;
  border: 1px solid rgba(46, 204, 113, 0.3);
  display: block;
}

.newsletter-status.is-error {
  background: rgba(255, 99, 99, 0.15);
  color: #ff9b9b;
  border: 1px solid rgba(255, 99, 99, 0.3);
  display: block;
}

/* Sidebar newsletter widget (single post) */
.newsletter-widget {
  background: var(--color-ink);
  padding: 32px 28px;
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.newsletter-widget-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.2;
}

.newsletter-widget-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 20px;
  line-height: 1.5;
}

.newsletter-widget .newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 13px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  color: white;
  outline: none;
  border-radius: var(--radius-md);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.newsletter-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.2);
}

.newsletter-btn {
  width: 100%;
  background: var(--color-accent);
  color: white;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.newsletter-btn:hover {
  background: #134a85;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.newsletter-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── 12. GRID FOOTER ──────────────────────────────────────── */

.grid-footer {
  background: #111111;
  color: rgba(255, 255, 255, 0.75);
  padding-top: 36px;
  padding-bottom: 0;
}

.grid-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 28px;
}

@media (min-width: 768px) {
  .grid-footer-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
  }
}

/* Brand column */
.grid-footer-brand {
  flex-shrink: 0;
}

.grid-footer-logo-link {
  display: inline-block;
  margin-bottom: 0;
}

.grid-footer-logo-img,
.grid-footer-brand .custom-logo,
.grid-footer-brand .footer-logo-img {
  display: block;
  max-width: 260px;
  width: auto;
  max-height: 80px;
}

.grid-footer-site-name {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: white;
  text-decoration: none;
  display: block;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.grid-footer-site-name:hover {
  opacity: 0.8;
}

/* Two-menu wrapper — stacks both nav rows vertically */
.grid-footer-menus {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

/* Each nav row */
.grid-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

/* Both nav lists sit side-by-side as one continuous inline row */
.grid-footer-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.grid-footer-nav-list > li {
  display: flex;
  align-items: center;
}

/* Pipe separator after every item except the very last in the last list */
.grid-footer-nav-list > li::after {
  content: "|";
  color: rgba(255, 255, 255, 0.2);
  padding: 0 10px;
  font-size: 11px;
}

.grid-footer-nav-list:last-child > li:last-child::after {
  display: none;
}

.grid-footer-nav-list a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.grid-footer-nav-list a:hover {
  color: white;
}

.grid-footer-nav-list .sub-menu {
  display: none;
}

/* Footer bottom bar */
.grid-footer-bottom {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

@media (min-width: 640px) {
  .grid-footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.grid-footer-legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.grid-footer-legal-link {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 11px;
}

.grid-footer-legal-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── 13. PAGE HERO BAND ───────────────────────────────────── */

.page-hero-band {
  background: var(--color-ink);
}

.page-hero-inner {
  padding-top: 56px;
  padding-bottom: 56px;
}

.page-hero-label {
  color: var(--color-accent);
  margin-bottom: 12px;
}

.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 700;
  color: white;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

/* ── 14. BLOG INDEX ───────────────────────────────────────── */

.grid-blog-index {
  padding-block: var(--spacing-section);
}

.blog-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 640px) {
  .blog-posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
}

@media (min-width: 1024px) {
  .blog-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-post-card .post-thumbnail {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
}

.blog-post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.blog-post-card:hover .post-thumbnail img {
  transform: scale(1.03);
}

.blog-post-card .post-category {
  font-size: 10px;
  color: var(--color-accent);
}

.blog-post-card .post-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-card .post-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-post-card:hover .post-title a {
  color: var(--color-accent);
}

.blog-post-card .post-excerpt {
  font-size: 14px;
  color: var(--color-charcoal);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-weight: 500;
}

.blog-empty {
  padding-block: 80px;
  color: var(--color-charcoal);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  text-decoration: none;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--color-ink);
  color: white;
  border-color: var(--color-ink);
}

/* ── 15. SINGLE POST ──────────────────────────────────────── */

.grid-single {
  padding-top: 40px;
  padding-bottom: var(--spacing-section);
}

@media (max-width: 767px) {
  .grid-single {
    padding-top: 24px;
    padding-bottom: 48px;
  }
}

.single-post-hero-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.single-post-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.single-post-header {
  padding-top: 48px;
  padding-bottom: 0;
}

@media (max-width: 767px) {
  .single-post-header {
    padding-top: 28px;
  }
}

.single-post-category {
  color: var(--color-accent);
  margin-bottom: 12px;
  display: block;
}

.single-post-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.5vw, 56px);
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  margin-top: 12px;
}

@media (max-width: 767px) {
  .single-post-title {
    font-size: clamp(22px, 6.5vw, 34px);
    margin-bottom: 14px;
  }
}

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-charcoal);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-body);
}

@media (max-width: 767px) {
  .single-post-meta {
    margin-bottom: 24px;
    padding-bottom: 16px;
  }
}

.single-post-reading-time {
  font-size: 10px;
}

.single-post-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
}

@media (max-width: 767px) {
  .single-post-content {
    gap: 36px;
  }
}

@media (min-width: 1024px) {
  .single-post-content {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.single-post-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}

@media (min-width: 640px) {
  .single-post-nav {
    flex-direction: row;
    justify-content: space-between;
  }
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  max-width: 280px;
  transition: color 0.2s ease;
}

.post-nav-link:hover {
  color: var(--color-accent);
}

.post-nav-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}

.single-post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (max-width: 767px) {
  .single-post-sidebar {
    gap: 28px;
  }
}

@media (min-width: 1024px) {
  .single-post-sidebar {
    position: sticky;
    top: 80px;
  }
}

.sidebar-dispatch {
  /* related articles wrapper */
}

.sidebar-section-title {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.dispatch-items {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dispatch-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.dispatch-item-link:hover .dispatch-headline {
  color: var(--color-accent);
}

.dispatch-time {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-accent);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dispatch-headline {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-ink);
  transition: color 0.2s ease;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-ink);
  text-decoration: none;
  transition:
    gap 0.2s ease,
    color 0.2s ease;
}

.back-link:hover {
  gap: 12px;
  color: var(--color-accent);
}

/* ── 16. ARTICLE PROSE ────────────────────────────────────── */

.grid-prose {
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-ink);
  max-width: 68ch;
}

@media (max-width: 767px) {
  .grid-prose {
    font-size: 16px;
    line-height: 1.7;
  }
}

.grid-prose h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-ink);
  margin-top: 44px;
  margin-bottom: 14px;
  line-height: 1.2;
}

.grid-prose h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-ink);
  margin-top: 28px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.grid-prose h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink);
  margin-top: 24px;
  margin-bottom: 8px;
}

.grid-prose p {
  margin-bottom: 22px;
}

.grid-prose blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 18px 24px;
  margin: 28px 0;
  background: var(--color-surface-alt);
  font-style: italic;
  font-size: 19px;
  color: var(--color-ink);
  line-height: 1.5;
}

.grid-prose a {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 3px;
}

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

.grid-prose ul,
.grid-prose ol {
  margin-bottom: 22px;
  padding-left: 24px;
}

.grid-prose ul {
  list-style: disc;
}

.grid-prose ol {
  list-style: decimal;
}

.grid-prose li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.grid-prose img {
  width: 100%;
  margin-block: 28px;
  display: block;
}

.grid-prose strong {
  font-weight: 700;
  color: var(--color-ink);
}

.grid-prose code {
  font-family: monospace;
  font-size: 14px;
  background: var(--color-surface-alt);
  padding: 2px 6px;
  border-radius: 2px;
}

.grid-prose pre {
  font-family: monospace;
  font-size: 14px;
  background: var(--color-ink);
  color: white;
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 22px;
}

.grid-prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: 44px;
}

/* ── 17. GENERIC PAGE ─────────────────────────────────────── */

.grid-page-content {
  padding-block: var(--spacing-section);
}

/* ── 18. 404 ──────────────────────────────────────────────── */

.grid-404 {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: var(--spacing-section);
}

.grid-404-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.error-code {
  color: var(--color-accent);
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}

.error-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 11vw, 128px);
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
}

.error-message {
  font-size: 18px;
  color: var(--color-charcoal);
  margin-bottom: 40px;
  max-width: 40ch;
}

/* ── 19. WORDPRESS ALIGNMENT UTILITIES ───────────────────── */

.alignleft {
  float: left;
  margin-right: 24px;
  margin-bottom: 16px;
}

.alignright {
  float: right;
  margin-left: 24px;
  margin-bottom: 16px;
}

.aligncenter {
  display: block;
  margin-inline: auto;
  margin-bottom: 16px;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 13px;
  color: var(--color-charcoal);
  font-style: italic;
  margin-top: 8px;
  text-align: center;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ── 20. HERO SECTION (legacy, kept for compatibility) ────── */

.hero-badge {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ── 21. HOMEPAGE HERO SECTION ────────────────────────────── */

.grid-front-page {
  padding-top: 16px;
}

.hero-section {
  padding: 32px 0 44px;
}

.hero-top {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 28px;
  /* Stretch (default) lets .hero-main-link, which has no in-flow content
     of its own (its image/text are all absolutely positioned), grow to
     exactly match the natural height of the two stacked secondary cards. */
  align-items: stretch;
  margin-bottom: 28px;
}

@media (max-width: 1023px) {
  .hero-top {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
  }
}

/* Main hero post — full-bleed image with text overlaid at the base */
.hero-main-link {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
  background: var(--color-ink);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero-main-link--noimg {
  background: var(--color-ink);
}

@media (max-width: 1023px) {
  .hero-main-link {
    height: auto;
    aspect-ratio: 16 / 10;
  }
}

.hero-main-media {
  position: absolute;
  inset: 0;
}

.hero-main-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-hover);
}

.hero-main-link:hover .hero-main-media img {
  transform: scale(1.04);
}

.hero-main-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.4) 45%,
    rgba(0, 0, 0, 0) 78%
  );
}

.hero-main-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 36px;
}

@media (max-width: 767px) {
  .hero-main-content {
    padding: 22px;
  }
}

.hero-main-content .cat-badge {
  margin-bottom: 14px;
}

.hero-main-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 12px;
}

.hero-main-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 14px;
  max-width: 58ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .hero-main-excerpt {
    display: none;
  }
}

.hero-main-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-body);
}

/* Secondary: 2 stacked cards beside the main hero post */
.hero-secondary {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Below 1024px hero-top stacks into one column, so the 2 secondary posts
   have the full width to run side by side instead of staying stacked. */
@media (max-width: 1023px) {
  .hero-secondary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .hero-secondary {
    grid-template-columns: 1fr;
  }
}

.hero-secondary-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.hero-secondary-link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hero-secondary-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface-alt);
}

.hero-secondary-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-secondary-link:hover .hero-secondary-thumb img {
  transform: scale(1.05);
}

.hero-secondary-body {
  padding: 14px 16px 16px;
}

.hero-secondary-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-ink);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.hero-secondary-link:hover .hero-secondary-title {
  color: var(--color-accent);
}

.hero-secondary-date {
  font-size: 11px;
  color: var(--color-muted);
  font-family: var(--font-body);
}

/* ── 22. SITE-WIDE NEWSLETTER BAND (currently disabled) ───── */

.site-subscribe {
  padding: 64px 0;
  background: var(--color-ink);
  margin-top: 12px;
}

.site-subscribe-inner {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.site-subscribe-eyebrow {
  margin-bottom: 14px;
}

.site-subscribe-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.site-subscribe-desc {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 28px;
}

.site-subscribe .cat-nl-form {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 560px) {
  .site-subscribe .cat-nl-form {
    flex-direction: column;
  }
}

.site-subscribe .cat-nl-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: none;
}

.site-subscribe .cat-nl-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.site-subscribe .cat-nl-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.25);
}

.site-subscribe .cat-nl-btn {
  width: auto;
  flex-shrink: 0;
  padding-inline: 28px;
}

.site-subscribe .newsletter-field-error,
.site-subscribe .newsletter-status {
  flex-basis: 100%;
  width: 100%;
  text-align: left;
}
