/*
Theme Name: Dispatch
Theme URI: https://grandbusinesscenter.com
Author: BestuWP
Author URI: https://bestuwp.com
Description: Fast news/magazine theme. 40/60 hero, 30% sidebar, sticky header, dark footer. Built for Core Web Vitals.
Version: 5.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dispatch
Tags: blog, news, magazine, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, full-width-template, translation-ready
*/

/* ── CSS VARIABLES ─────────────────────────────────────────────────────────── */
:root {
  --paper: #F7F4EE;
  --ink: #14110F;
  --accent: #C8472A;
  --sage: #5B6B5C;
  --surface: #FFFFFF;
  --line: #E3DDD0;
  --max-width: 1200px;
  --sidebar-w: 30%;
  --content-w: calc(70% - 48px);
  --side-pad: 24px;
  --logo-height: 40px;
  --font-body: 'Source Serif 4 Fallback', Georgia, serif;
  --font-headings: 'Source Serif 4 Fallback', Georgia, serif;
  --font-ui: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-size-base: 17px;
  --font-size-heading: 38px;
  --font-size-card: 17px;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 12px rgba(20,17,15,.07);
  --shadow-hover: 0 8px 32px rgba(20,17,15,.13);
  --transition: .18s ease;
}

/* ── RESET ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
body {
  background: #EDEAE4;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-headings); font-weight: 700; line-height: 1.2; color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT FOUNDATION
   Every container uses min(desired, 100%) so it physically cannot exceed
   the viewport on any screen. Same pattern as the working minimal layout.
═══════════════════════════════════════════════════════════════════════════ */
.wrap {
  max-width: min(var(--max-width), 100%);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--side-pad);
  box-sizing: border-box;
  overflow: hidden;
}
.wrap > * { max-width: 100%; box-sizing: border-box; min-width: 0; }

/* Article text alignment */
.article-content { text-align: var(--article-align, left); }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 { text-align: var(--article-align, left); }

/* ── LAYOUT: BOXED (default) ─────────────────────────────────────────────
   White content box centered on grey background. Box never wider than viewport. */
body.dispatch-layout-boxed .site-main,
body:not([class*="dispatch-layout"]) .site-main {
  max-width: min(var(--max-width), 100vw);
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

/* ── LAYOUT: FULL WIDTH ──────────────────────────────────────────────────
   Content stretches edge to edge. Wrap still constrains inner content. */
body.dispatch-layout-full .site-main {
  max-width: 100%;
  width: 100%;
  box-shadow: none;
  overflow: hidden;
}
body.dispatch-layout-full .wrap {
  max-width: min(var(--max-width), 100%);
  padding: 0 var(--side-pad);
}
body.dispatch-layout-full .hero-inner {
  max-width: 100%;
}

/* ── LAYOUT: WIDE ────────────────────────────────────────────────────────
   Larger max-width for big screens. Still capped at 100vw on mobile. */
body.dispatch-layout-wide .site-main {
  max-width: min(var(--desktop-width, 1400px), 100vw);
  width: 100%;
  overflow: hidden;
}
body.dispatch-layout-wide .wrap {
  max-width: min(var(--desktop-width, 1400px), 100%);
  padding: 0 var(--side-pad);
}

/* ── LAYOUT: MAGAZINE ────────────────────────────────────────────────────
   Full-width single-column articles. No sidebar. Grid stays responsive. */
body.dispatch-layout-magazine .site-main {
  max-width: min(var(--max-width), 100vw);
  width: 100%;
  overflow: hidden;
}
body.dispatch-layout-magazine .single-two-col {
  grid-template-columns: minmax(0, 1fr) !important;
}
body.dispatch-layout-magazine .article-sidebar { display: none; }
body.dispatch-layout-magazine .article-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
body.dispatch-layout-magazine .hero-inner { min-height: 400px; }
body.dispatch-layout-magazine .hero-content { padding: 48px var(--side-pad); }

/* ── LAYOUT: MINIMAL ─────────────────────────────────────────────────────
   Narrow reading column. No sidebar. Clean typographic focus.
   This is the reference layout — all others follow its containment pattern. */
body.dispatch-layout-minimal .site-main {
  max-width: min(var(--max-width), 100vw);
  width: 100%;
  overflow: hidden;
  box-shadow: none;
  background: var(--surface);
}
body.dispatch-layout-minimal .single-two-col {
  grid-template-columns: minmax(0, 1fr) !important;
}
body.dispatch-layout-minimal .article-sidebar { display: none; }
body.dispatch-layout-minimal .single-article {
  max-width: min(700px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--side-pad);
  box-sizing: border-box;
}
body.dispatch-layout-minimal .article-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(720px, 100%);
  margin: 0 auto;
}
body.dispatch-layout-minimal .home-hero { background: var(--paper); }
body.dispatch-layout-minimal .hero-inner { min-height: 360px; }

/* ── CONTENT STYLE: CARD ─────────────────────────────────────────────────
   Larger rounded corners, slight lift. */
body.dispatch-style-card .article-card { border-radius: 16px; }
body.dispatch-style-card .article-card:hover { transform: translateY(-4px); }
body.dispatch-style-card .hero-content { border-radius: 0; }
body.dispatch-style-card .card-body { padding: 24px; }
@media (max-width: 767px) {
  body.dispatch-style-card .article-card { border-radius: 12px; }
}

/* ── CONTENT STYLE: FLAT ─────────────────────────────────────────────────
   No borders, no shadows — clean list feel. */
body.dispatch-style-flat .article-card {
  border: none;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}
body.dispatch-style-flat .article-card:hover { transform: none; box-shadow: none; }
body.dispatch-style-flat .article-grid { gap: 0; }
body.dispatch-style-flat .card-thumb { border-radius: 0; }
body.dispatch-style-flat .home-hero { border-bottom: 2px solid var(--accent); }

/* ── CONTENT STYLE: ROUNDED ──────────────────────────────────────────────
   Pill/rounded aesthetic throughout. */
body.dispatch-style-rounded .site-main { border-radius: 20px; overflow: hidden; }
body.dispatch-style-rounded .article-card { border-radius: 20px; }
body.dispatch-style-rounded .card-thumb { border-radius: 20px 20px 0 0; }
body.dispatch-style-rounded .hero-img-link { border-radius: 0; }
@media (max-width: 767px) {
  body.dispatch-style-rounded .site-main { border-radius: 12px; }
  body.dispatch-style-rounded .article-card { border-radius: 14px; }
}

.site-main {
  background: var(--surface);
  max-width: min(var(--max-width), 100vw);
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
  min-height: 60vh;
  overflow: hidden;
}

/* ── HEADER ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(20,17,15,.06);
}
.header-inner {
  max-width: min(var(--max-width), 100%);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--side-pad);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

/* Text logo */
.site-branding a {
  font-family: var(--font-headings);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.site-branding > a::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Image logo */
.site-branding .custom-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.site-branding .custom-logo {
  display: block;
  height: var(--logo-height);
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

/* Navigation */
.primary-nav { flex: 1; display: flex; justify-content: center; overflow: hidden; }
.primary-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.primary-nav a {
  display: block;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.primary-nav a:hover,
.primary-nav li.current-menu-item > a { color: var(--accent); background: rgba(200,71,42,.07); }

.header-date {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--sage);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-left: auto;
  flex-shrink: 0;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px auto;
  border-radius: 2px;
  transition: var(--transition);
}

/* ── HERO (Homepage) ───────────────────────────────────────────────────────── */
.home-hero { background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; width: 100%; }
.hero-inner {
  max-width: min(var(--max-width), 100%);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  min-height: 420px;
  overflow: hidden;
  box-sizing: border-box;
}
.hero-img-link {
  flex: 0 0 40%;
  width: 40%;
  min-width: 0;
  max-width: 40%;
  position: relative;
  overflow: hidden;
  background: var(--paper);
  display: block;
  box-sizing: border-box;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.hero-img-link:hover .hero-img { transform: scale(1.02); }
.hero-img-placeholder { position: absolute; inset: 0; background: var(--paper); }
.hero-content {
  flex: 1 1 60%;
  min-width: 0;
  max-width: 60%;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}
.hero-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.accent-bar { display: inline-block; width: 24px; height: 3px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.eyebrow-label { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.hero-title { font-size: clamp(18px, 4vw, var(--font-size-heading)); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 14px; overflow-wrap: break-word; word-break: break-word; max-width: 100%; }
.hero-title a:hover { color: var(--accent); }
.hero-excerpt { font-size: 16px; color: var(--sage); line-height: 1.7; margin-bottom: 20px; }
.hero-meta { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 12px; color: var(--sage); margin-bottom: 24px; }
.meta-dot { color: var(--line); }
.hero-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius);
  transition: background var(--transition);
  align-self: flex-start;
}
.hero-read-more:hover { background: var(--ink); color: #fff; }

/* ── ARTICLE GRID ──────────────────────────────────────────────────────────── */
.section-header { padding: 36px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.section-header h2 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--sage); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-bottom: 40px; width: 100%; box-sizing: border-box; }
.article-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow var(--transition), transform var(--transition); width: 100%; box-sizing: border-box; min-width: 0; }
.article-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card-thumb { position: relative; padding-top: 62.5%; overflow: hidden; background: var(--paper); }
.card-thumb a { position: absolute; inset: 0; }
.card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.article-card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-placeholder { position: absolute; inset: 0; background: var(--paper); }
.card-category-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.card-body { padding: 16px; min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
.card-body h3 { font-size: clamp(13px, 2.5vw, var(--font-size-card)); font-weight: 700; line-height: 1.3; margin-bottom: 8px; overflow-wrap: break-word; word-break: break-word; }
.card-body h3 a:hover { color: var(--accent); }
.card-excerpt { font-size: 13.5px; color: var(--sage); line-height: 1.6; margin-bottom: 12px; }
.card-footer { display: flex; justify-content: space-between; font-family: var(--font-ui); font-size: 11px; color: var(--sage); margin-bottom: 12px; }
.card-read-more { font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--accent); }
.card-read-more:hover { color: var(--ink); }

/* ── PAGINATION ────────────────────────────────────────────────────────────── */
.pagination { padding: 36px 0; width: 100%; }
.pagination .nav-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.pagination .nav-links a,
.pagination .nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
  transition: var(--transition);
}
.pagination .nav-links a:hover,
.pagination .nav-links .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .nav-links .dots { border-color: transparent; background: transparent; cursor: default; }

/* ── SINGLE POST ───────────────────────────────────────────────────────────── */
.single-page-wrap { overflow: hidden; width: 100%; max-width: 100vw; }
.breadcrumbs { padding: 16px 0; font-family: var(--font-ui); font-size: 12px; color: var(--sage); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; width: 100%; box-sizing: border-box; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--line); }
.single-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--sidebar-w, 30%)); gap: 40px; padding-bottom: 60px; align-items: start; width: 100%; max-width: 100%; overflow: hidden; box-sizing: border-box; }
.single-article { min-width: 0; width: 100%; max-width: 100%; overflow: hidden; }
.article-header { margin-bottom: 28px; }
.eyebrow-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.eyebrow-rule { display: inline-block; width: 24px; height: 3px; background: var(--accent); border-radius: 2px; }
.category-tag { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.single-article h1 { font-size: clamp(20px, 4vw, var(--font-size-heading)); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 16px; overflow-wrap: break-word; word-break: break-word; max-width: 100%; width: 100%; box-sizing: border-box; }
.deck { font-size: clamp(15px, 2.5vw, 19px); color: var(--sage); line-height: 1.7; border-left: 3px solid var(--accent); padding-left: 16px; margin-top: 16px; overflow-wrap: break-word; word-break: break-word; max-width: 100%; width: 100%; box-sizing: border-box; }
.article-byline { display: flex; align-items: center; gap: 14px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.author-avatar { flex-shrink: 0; }
.author-avatar img { border-radius: 50%; }
.byline-name a { font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--ink); }
.byline-name a:hover { color: var(--accent); }
.byline-meta { font-family: var(--font-ui); font-size: 12px; color: var(--sage); margin-top: 2px; }
.reading-badge { margin-left: auto; flex-shrink: 0; font-family: var(--font-ui); font-size: 11px; font-weight: 700; color: var(--sage); background: var(--paper); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); }
.article-featured-image { margin-bottom: 32px; border-radius: var(--radius); overflow: hidden; }
.article-featured-image img { width: 100%; max-width: 100% !important; height: auto !important; border-radius: var(--radius); display: block; }
.article-featured-image figcaption { font-family: var(--font-ui); font-size: 12px; color: var(--sage); padding: 8px 0; }
.article-featured-image--inline { margin: 32px 0; }
.article-content { font-size: var(--font-size-base); line-height: 1.8; width: 100%; max-width: 100%; overflow: hidden; overflow-wrap: break-word; word-break: break-word; box-sizing: border-box; }
.article-content p { margin-bottom: 1.4em; overflow-wrap: break-word; word-break: break-word; max-width: 100%; }
.article-content h2 { font-size: clamp(18px, 4vw, 26px); font-weight: 700; margin: 1.8em 0 .8em; overflow-wrap: break-word; word-break: break-word; max-width: 100%; width: 100%; box-sizing: border-box; }
.article-content h3 { font-size: clamp(16px, 3.5vw, 21px); font-weight: 700; margin: 1.6em 0 .7em; overflow-wrap: break-word; word-break: break-word; max-width: 100%; width: 100%; box-sizing: border-box; }
.article-content h4 { font-size: clamp(15px, 3vw, 18px); font-weight: 700; margin: 1.4em 0 .6em; overflow-wrap: break-word; word-break: break-word; max-width: 100%; width: 100%; box-sizing: border-box; }
.article-content ul, .article-content ol { margin: 0 0 1.4em 1.4em; }
.article-content li { margin-bottom: .5em; }
.article-content blockquote { border-left: 4px solid var(--accent); padding: 16px 24px; margin: 2em 0; background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; }
.article-content blockquote p { margin: 0; font-size: 18px; font-style: italic; color: var(--ink); }
.article-content code { font-family: var(--font-mono); font-size: .88em; background: var(--paper); padding: 2px 6px; border-radius: var(--radius-sm); }
.article-content pre { background: var(--ink); color: var(--paper); padding: 24px; border-radius: var(--radius); overflow-x: auto; margin: 1.8em 0; }
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; word-break: break-word; }
.article-content img { border-radius: var(--radius); margin: 1.8em auto; width: auto; max-width: 100% !important; height: auto !important; display: block; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.tag-pill { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 5px 12px; border-radius: 20px; transition: var(--transition); }
.tag-pill:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.author-box { display: flex; gap: 20px; padding: 28px; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); margin: 36px 0; }
.author-box-avatar { flex-shrink: 0; }
.author-box-avatar img { border-radius: 50%; }
.author-box-name a { font-family: var(--font-ui); font-size: 15px; font-weight: 800; color: var(--ink); }
.author-box-name a:hover { color: var(--accent); }
.author-box-bio { font-size: 14px; color: var(--sage); line-height: 1.7; margin: 6px 0 12px; }
.author-box-links { display: flex; gap: 8px; flex-wrap: wrap; }
.author-social-link { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--accent); }
.author-social-link:hover { color: var(--ink); }
.comments-area { margin-top: 48px; }
.page-links { margin: 2em 0; font-family: var(--font-ui); font-size: 13px; }

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
.article-sidebar { position: sticky; top: 80px; }
.sidebar-widget { margin-bottom: 36px; }
.sidebar-widget-title { font-family: var(--font-ui); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.sidebar-widget-cat { color: var(--ink); font-size: 11px; }
.sidebar-post-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.sidebar-post-item { display: flex; gap: 12px; align-items: flex-start; }
.sidebar-post-thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; display: block; }
.sidebar-post-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); transition: transform .3s ease; }
.sidebar-post-thumb:hover img { transform: scale(1.06); }
.sidebar-post-body { flex: 1; min-width: 0; }
.sidebar-post-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; display: block; }
.sidebar-post-title:hover { color: var(--accent); }
.sidebar-post-date { font-family: var(--font-ui); font-size: 11px; color: var(--sage); margin-top: 4px; }
.sidebar-more-link { display: inline-block; margin-top: 14px; font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--accent); }
.sidebar-more-link:hover { color: var(--ink); }
.widget { margin-bottom: 32px; }
.widget-title { font-family: var(--font-ui); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* ── ARCHIVE ───────────────────────────────────────────────────────────────── */
.archive-header-wrap { padding: 44px 0 36px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.archive-eyebrow { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 8px; }
.archive-header-wrap h1 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.archive-description { font-size: 15px; color: var(--sage); margin-top: 10px; line-height: 1.7; }

/* ── AUTHOR PAGE ───────────────────────────────────────────────────────────── */
.author-page-wrap { max-width: min(var(--max-width), 100%); width: 100%; margin: 0 auto; padding: 0 var(--side-pad) 80px; box-sizing: border-box; overflow: hidden; }
.author-hero { display: flex; align-items: flex-start; gap: 32px; padding: 48px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 48px; flex-wrap: wrap; }
.author-hero-avatar img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-hero-info { flex: 1; min-width: 0; }
.author-hero-name { font-size: 36px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.author-hero-role { font-family: var(--font-ui); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 16px; }
.author-hero-bio { font-size: 16px; line-height: 1.75; color: var(--sage); max-width: 640px; margin-bottom: 20px; }
.author-hero-links { display: flex; gap: 10px; flex-wrap: wrap; }
.author-hero-link { font-family: var(--font-ui); font-size: 12px; font-weight: 600; padding: 6px 14px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); transition: var(--transition); }
.author-hero-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.author-posts-heading { font-size: 22px; font-weight: 700; margin-bottom: 28px; }

/* ── PAGE ──────────────────────────────────────────────────────────────────── */
.page-wrap { max-width: min(760px, 100%); width: 100%; margin: 0 auto; padding: 44px var(--side-pad) 80px; box-sizing: border-box; overflow: hidden; }
.page-wrap h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }

/* ── FOOTER ────────────────────────────────────────────────────────────────── */
.site-footer { background: #12100e; color: var(--paper); }
.footer-top-bar { background: var(--accent); height: 4px; }
.footer-inner { max-width: min(var(--max-width), 100%); width: 100%; margin: 0 auto; padding: 56px var(--side-pad) 32px; box-sizing: border-box; display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 48px; align-items: start; overflow: hidden; }
.footer-logo { font-family: var(--font-headings); font-size: 22px; font-weight: 800; color: var(--paper); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.footer-logo::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.footer-tagline { font-size: 14px; color: #8a837c; line-height: 1.7; max-width: 280px; margin-bottom: 20px; }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); color: #8a837c; font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; transition: border-color var(--transition), color var(--transition), background var(--transition); }
.footer-social-link:hover { border-color: var(--accent); color: var(--paper); background: rgba(200,71,42,.15); }
.footer-col h4 { font-family: var(--font-ui); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 13.5px; color: #8a837c; transition: color var(--transition); }
.footer-col a:hover { color: var(--paper); }
.footer-bottom { max-width: min(var(--max-width), 100%); width: 100%; margin: 0 auto; padding: 20px var(--side-pad); box-sizing: border-box; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: space-between; align-items: center; font-family: var(--font-ui); font-size: 12px; color: #5a5450; flex-wrap: wrap; gap: 8px; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: #5a5450; transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--paper); }

/* ── LAZY LOAD ─────────────────────────────────────────────────────────────── */
img.dispatch-lazy { opacity: 0; transition: opacity .4s ease; }
img.dispatch-lazy.loaded { opacity: 1; }

/* ── SEARCH ────────────────────────────────────────────────────────────────── */
.search-page-wrap { max-width: min(var(--max-width), 100%); width: 100%; margin: 0 auto; padding: 44px var(--side-pad) 80px; box-sizing: border-box; overflow: hidden; }
.search-header { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.search-header h1 { font-size: 30px; font-weight: 800; }
.search-header h1 em { font-style: normal; color: var(--accent); }

/* ══════════════════════════════════════════════════════════════════════════════
   GLOBAL OVERFLOW CONTAINMENT
   Prevents ANY element from ever escaping the viewport horizontally.
══════════════════════════════════════════════════════════════════════════════ */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* All text elements wrap and break properly — never overflow */
h1, h2, h3, h4, h5, h6,
p, li, td, th, dt, dd,
.hero-title, .single-article h1,
.card-body h3, .sidebar-post-title,
.author-hero-name, .byline-meta,
.breadcrumbs, .footer-tagline {
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  max-width: 100%;
}

/* All images always stay inside their container */
img, video, iframe, embed, object, svg {
  display: block;
  max-width: 100% !important;
  height: auto;
}

/* Tables scroll horizontally inside their container */
table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* Code blocks scroll, never overflow */
pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}

/* Flex and grid children: never let them break out */
.header-inner,
.hero-inner,
.single-two-col,
.article-grid,
.footer-inner,
.article-byline,
.author-box,
.author-hero,
.sidebar-post-item,
.single-article,
.article-content,
.hero-content,
.card-body {
  min-width: 0;
  box-sizing: border-box;
}

/* ── RESPONSIVE BREAKPOINTS ────────────────────────────────────────────────────
   Breakpoints are generated dynamically from Customizer settings in functions.php
   (dispatch-breakpoints style block). Hardcoded fallbacks below are overridden.
   ─────────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Fallback (overridden by dynamic breakpoints from functions.php)
   Same containment rules as the working minimal layout.
═══════════════════════════════════════════════════════════════════════════ */

/* ── TABLET ≤ 1023px ── */
@media (max-width: 1023px) {
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .single-two-col { grid-template-columns: minmax(0, 1fr) !important; }
  .article-sidebar { position: static; }
  .header-date { display: none; }
  .nav-toggle { display: flex; flex-direction: column; justify-content: center; }
  .primary-nav {
    display: none; position: fixed;
    top: 64px; left: 0; right: 0; width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-sizing: border-box;
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; padding: 8px 0; width: 100%; }
  .primary-nav a { padding: 12px 24px; border-radius: 0; border-left: 3px solid transparent; white-space: normal; box-sizing: border-box; }
  .hero-content { padding: 32px 28px; }
}

/* ── MOBILE ≤ 767px ── */
@media (max-width: 767px) {
  :root { --side-pad: 16px; --font-size-base: 16px; }

  /* Header */
  .header-inner { height: 56px; gap: 8px; padding: 0 var(--side-pad); box-sizing: border-box; }
  .site-branding a { font-size: 16px; }
  .site-branding .custom-logo { max-width: 150px; height: auto; }
  .primary-nav { top: 56px; }

  /* Hero: stack image on top, content below */
  .hero-inner { flex-direction: column; min-height: auto; width: 100%; overflow: hidden; }
  .hero-img-link { flex: 0 0 auto; width: 100%; max-width: 100%; height: 200px; position: relative; }
  .hero-img-placeholder { min-height: 200px; position: static; }
  .hero-content { flex: 0 0 auto; width: 100%; max-width: 100%; padding: 20px var(--side-pad); box-sizing: border-box; }

  /* Grid */
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .section-header { padding: 20px 0 12px; }

  /* Cards */
  .card-body { padding: 14px; }
  .card-thumb { padding-top: 56%; }

  /* Single article */
  .single-two-col { grid-template-columns: minmax(0, 1fr) !important; }
  .article-byline { flex-wrap: wrap; gap: 8px; }
  .reading-badge { margin-left: 0; }
  .article-content blockquote { padding: 12px 14px; }
  .article-content pre { padding: 14px; font-size: 13px; }

  /* Author box */
  .author-box { flex-direction: column; gap: 12px; padding: 16px; }
  .author-box-avatar img { width: 56px !important; height: 56px !important; }

  /* Sidebar */
  .sidebar-post-item { gap: 10px; }
  .sidebar-post-title { font-size: 13px; }

  /* Author page */
  .author-hero { flex-direction: column; gap: 16px; padding: 24px 0 20px; }
  .author-hero-avatar img { width: 72px !important; height: 72px !important; }
  .author-hero-bio { font-size: 14px; max-width: 100%; }

  /* Footer */
  .footer-inner { grid-template-columns: minmax(0, 1fr); padding: 32px var(--side-pad) 20px; gap: 24px; }
  .footer-bottom { padding: 14px var(--side-pad); flex-direction: column; align-items: flex-start; gap: 6px; box-sizing: border-box; }
  .footer-logo { font-size: 18px; }
  .footer-tagline { max-width: 100%; font-size: 13px; }

  /* Pages */
  .page-wrap { padding: 28px var(--side-pad) 48px; }
  .page-wrap h1 { font-size: clamp(22px, 6vw, 32px); }
  .search-page-wrap { padding: 28px var(--side-pad) 48px; }
  .archive-header-wrap { padding: 28px 0 24px; }
  .archive-header-wrap h1 { font-size: clamp(22px, 6vw, 30px); }

  /* Breadcrumbs */
  .breadcrumbs { font-size: 11px; gap: 3px; padding: 10px 0; }
}

/* ── SMALL MOBILE ≤ 480px ── */
@media (max-width: 480px) {
  :root { --side-pad: 12px; }
  .site-branding a { font-size: 14px; }
  .site-branding .custom-logo { max-width: 120px; }
  .hero-img-link { height: 170px; }
  .hero-content { padding: 16px var(--side-pad); }
  .article-card:hover { transform: none; } /* disable hover lift on touch */
  .card-body { padding: 12px; }
  .single-article .article-byline { gap: 6px; }
  .footer-social-link { width: 32px; height: 32px; font-size: 10px; }
  .pagination .nav-links { gap: 3px; }
  .pagination .nav-links a,
  .pagination .nav-links span { min-width: 30px; height: 30px; font-size: 11px; padding: 0 5px; }
}

/* ── EXTRA SMALL ≤ 360px ── */
@media (max-width: 360px) {
  :root { --side-pad: 10px; --font-size-base: 15px; }
  .hero-img-link { height: 150px; }
  .hero-content { padding: 14px var(--side-pad); }
  .hero-excerpt { display: none; }
  .nav-toggle { width: 30px; height: 30px; }
}

