/*
Theme Name: AEC Blog
Theme URI: https://aec.llc/blog/
Author: AEC International
Author URI: https://aec.llc
Description: Custom WordPress theme for AEC International blog. Mirrors the aec.llc static site design system — navy/gold palette, Inter font, practitioner-authority voice.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: Proprietary
License URI: https://aec.llc/Legal-and-policy/terms.html
Text Domain: aec-blog
*/

/* =========================================
   GOOGLE FONTS
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================
   DESIGN TOKENS
   Mirrored from /css/global.css on aec.llc
========================================= */
:root {
  /* Brand */
  --navy: #0F3B63;
  --gold: #F5B800;
  --gold-dark: #D9A400;

  /* Neutrals */
  --ink: #0a0f1a;
  --muted: #5a667b;
  --card: #ffffff;
  --section: #f6f8fb;
  --border: #e5e9f2;
  --ring: #b7e4e4;

  /* Cert page accents */
  --teal: #0ea5a5;
  --teal-hover: #0c9292;

  /* Layout */
  --radius: 16px;
  --radius-sm: 8px;
  --radius-btn: 4px;
  --gap: 24px;
  --max: 1200px;
  --max-header: 1300px;

  /* Backgrounds */
  --util-bg: #081c36;
  --footer-bg: #111f3a;
}

/* =========================================
   RESET
========================================= */
html { box-sizing: border-box; height: 100%; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  padding-top: 117px; /* util bar 32px + header 85px */
}

main { flex: 1; }
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

/* =========================================
   LAYOUT
========================================= */
.container {
  max-width: var(--max);
  margin-inline: auto;
  padding: 0 20px;
}

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

section {
  padding: 56px 0;
}

/* =========================================
   TYPOGRAPHY
========================================= */
h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(24px, 3.6vw, 34px);
  margin-bottom: 18px;
  line-height: 1.2;
}

h3 {
  font-size: clamp(18px, 2.4vw, 22px);
  margin-bottom: 12px;
  line-height: 1.3;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* =========================================
   UTILITY BAR
========================================= */
.util-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: var(--util-bg);
  border-bottom: 1px solid rgba(255,255,255,.07);
  z-index: 1001;
}

.util-inner {
  max-width: var(--max-header);
  margin: 0 auto;
  padding: 0 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.util-tagline {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.util-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.util-divider {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,.15);
}

.util-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  letter-spacing: .03em;
  transition: color .15s ease;
}

.util-link:hover { color: #fff; }

.util-link svg {
  opacity: .7;
  flex-shrink: 0;
}

.util-link:hover svg { opacity: 1; }

/* =========================================
   SITE HEADER
========================================= */
.site-header {
  position: fixed;
  top: 32px;
  left: 0;
  width: 100%;
  height: 85px;
  background: #fff;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.header-inner {
  max-width: var(--max-header);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  width: 90px;
  display: block;
}

/* =========================================
   MAIN NAV (full mega menu system)
========================================= */
.main-nav {
  flex: 1;
  margin-left: 60px;
}

.nav-list {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: rgba(15,59,99,.8);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

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

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--gold);
  transition: width .2s ease;
}

.nav-link:hover::after { width: 100%; }

/* =========================================
   MEGA PANEL
========================================= */
.mega-panel {
  position: absolute;
  top: 117px;
  left: 0;
  width: 100%;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  border-top: 3px solid var(--gold);
}

.mega-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-inner {
  max-width: var(--max-header);
  margin: 0 auto;
  padding: 36px 48px;
  display: flex;
  gap: 0;
  align-items: flex-start;
}

/* Multi-column layout for Training/Industries */
.mega-columns-wrap {
  flex: 1;
  display: flex;
  gap: 0;
  padding-right: 40px;
  border-right: 1px solid var(--border);
  margin-right: 40px;
}

.mega-column {
  flex: 1;
  padding-right: 40px;
  border-right: 1px solid var(--border);
  margin-right: 40px;
}

.mega-column:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.mega-column h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 20px 0;
  color: var(--muted);
}

.mega-link-item {
  margin-bottom: 12px;
}

.mega-link-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  transition: color .15s ease;
  margin-bottom: 3px;
}

.mega-link-title:hover {
  color: var(--gold-dark);
}

/* Mega grid — compact multi-column (Certifications) */
.mega-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 32px;
  padding-right: 40px;
  border-right: 1px solid var(--border);
  margin-right: 40px;
}

.mega-grid-group h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 6px 0;
  color: var(--muted);
}

.mega-grid-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  padding: 2px 0;
  transition: color .15s ease;
  line-height: 1.7;
}

.mega-grid-link:hover {
  color: var(--gold-dark);
}

/* Featured blog card in mega menu */
.mega-featured {
  width: 260px;
  flex-shrink: 0;
}

.mega-featured-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.mega-featured-card {
  display: block;
  background: var(--navy);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.mega-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,59,99,.18);
}

.mega-featured-tag {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.mega-featured-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 10px;
}

.mega-featured-desc {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin-bottom: 14px;
}

.mega-featured-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .02em;
}

/* Mega bottom bar */
.mega-bottom-bar {
  border-top: 1px solid var(--border);
  padding: 12px 48px;
  background: var(--section);
}

.mega-bottom-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  transition: color .15s ease;
}

.mega-bottom-link:hover {
  color: var(--gold-dark);
}

/* =========================================
   RESOURCES DROPDOWN
========================================= */
.has-dropdown {
  position: relative;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 240px;
  padding: 8px 0;
  z-index: 1100;
  margin-top: 6px;
}

.nav-dropdown.open {
  display: block;
}

.nav-dropdown-link {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: background .12s ease, color .12s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown-link:hover {
  background: var(--section);
  color: var(--navy);
}

.nav-dropdown-viewall {
  font-weight: 700;
  color: var(--navy);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* =========================================
   LANGUAGE SELECTOR
========================================= */
.lang-selector { position: relative; }

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  letter-spacing: .03em;
  transition: color .15s ease;
}

.lang-trigger:hover { color: #fff; }

.lang-flag { font-size: 13px; line-height: 1; }
.lang-current { letter-spacing: .05em; }

.lang-chevron {
  color: rgba(255,255,255,.4);
  transition: transform .2s ease;
}

.lang-trigger[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-width: 160px;
  z-index: 2000;
}

.lang-dropdown.open { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .12s ease;
}

.lang-option:hover { background: var(--section); }
.lang-option.active { background: #eef3fb; }

.lang-opt-flag { font-size: 15px; line-height: 1; flex-shrink: 0; }
.lang-opt-name { flex: 1; font-size: 13px; color: var(--ink); font-weight: 500; }
.lang-opt-code { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .05em; }

/* Header CTAs */
.header-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  padding: 11px 28px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  border: 2px solid var(--navy);
  display: inline-block;
  transition: all .2s ease;
}

.btn-primary:hover {
  background: #0a2744;
  border-color: #0a2744;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  padding: 11px 28px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  border: 2px solid rgba(15,59,99,.4);
  display: inline-block;
  transition: all .2s ease;
}

.btn-ghost:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: rgba(15,59,99,.05);
}

.btn-ghost-header {
  background: transparent;
  color: var(--navy);
  padding: 11px 28px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  border: 2px solid rgba(15,59,99,.4);
  display: inline-block;
  transition: all .2s ease;
}

.btn-ghost-header:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: rgba(15,59,99,.05);
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.mobile-toggle span {
  width: 26px;
  height: 2px;
  background: var(--navy);
  display: block;
  transition: all .3s ease;
}

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed;
  top: 117px;
  left: 0;
  width: 100%;
  height: calc(100vh - 117px);
  background: var(--navy);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: all .3s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.mobile-nav.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mobile-nav nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 16px;
}

.mobile-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.mobile-section:last-child { border-bottom: none; }

.mobile-section h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 12px 0;
  letter-spacing: .05em;
}

.mobile-section a {
  display: block;
  color: rgba(255,255,255,.85);
  font-size: 15px;
  padding: 8px 0;
  transition: color .2s ease;
}

.mobile-section a:hover { color: #fff; }

.mobile-cta {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  background: #0a1a30;
  border-top: 1px solid rgba(255,255,255,.1);
}

.mobile-cta .btn-primary,
.mobile-cta .btn-ghost,
.mobile-cta .btn-ghost-header {
  text-align: center;
  flex: 1;
  padding: 12px 16px;
  font-size: 13px;
}

.mobile-cta .btn-ghost,
.mobile-cta .btn-ghost-header {
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

.mobile-cta .btn-ghost:hover,
.mobile-cta .btn-ghost-header:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255,255,255,.06);
}

/* =========================================
   BLOG HERO (compact strip)
========================================= */
.blog-hero {
  background: linear-gradient(135deg, #0b2346, #0f2f4f);
  color: #fff;
  padding: 24px 0;
  border-bottom: 2px solid var(--gold);
}

.blog-hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.blog-hero h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .01em;
  white-space: nowrap;
}

.blog-hero p {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  margin: 0;
  letter-spacing: .02em;
}

/* =========================================
   CONTENT LAYOUT (with sidebar)
========================================= */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* =========================================
   POST CARDS
========================================= */
.post-grid {
  display: grid;
  gap: var(--gap);
}

.post-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.post-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(10,15,26,.06);
}

/* Image link wrapper — block, no underline */
.post-card-image-link,
.post-latest-image-link {
  display: block;
  line-height: 0; /* collapse whitespace around img */
}

.post-card-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}

.post-card-image-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--navy), #1a4f7a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-image-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: .3;
  color: #fff;
}

.post-card-body {
  padding: 20px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.post-card-category {
  display: inline-block;
  background: rgba(15,59,99,.08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 3px;
  transition: background .15s ease;
}

.post-card-category:hover {
  background: rgba(15,59,99,.14);
}

/* Title is now an <a> — style as block heading */
a.post-card-title {
  display: block;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--ink);
  transition: color .15s ease;
}

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

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

a.post-card-readmore {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .02em;
  transition: color .15s ease;
}

a.post-card-readmore:hover { color: var(--gold-dark); }

/* Latest post (first post on homepage, full-width stacked) */
.post-latest {
  grid-column: 1 / -1;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
}

.post-latest:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(10,15,26,.06);
}

.post-latest .post-latest-image-link {
  display: block;
  line-height: 0;
}

.post-latest .post-card-image,
.post-latest .post-card-image-placeholder {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
}

.post-latest .post-card-body {
  padding: 28px 32px 32px;
}

.post-latest a.post-card-title {
  font-size: 24px;
  line-height: 1.3;
}

.post-latest .post-card-excerpt {
  font-size: 15px;
  -webkit-line-clamp: 3;
}

/* =========================================
   SINGLE POST
========================================= */
.single-header {
  background: linear-gradient(135deg, #0b2346, #0f2f4f);
  color: #fff;
  padding: 56px 0 44px;
  border-bottom: 2px solid var(--gold);
}

.single-header .breadcrumbs {
  color: rgba(255,255,255,.5);
}

.single-header .breadcrumbs a {
  color: rgba(255,255,255,.6);
}

.single-header .breadcrumbs a:hover {
  color: #fff;
}

.single-header .post-card-category {
  margin-bottom: 16px;
  background: rgba(255,255,255,.12);
  color: #fff;
}

.single-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  max-width: 720px;
  color: #fff;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: rgba(255,255,255,.55);
  margin-top: 16px;
}

.single-meta .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
}

/* Single post featured image */
.single-featured-image {
  margin-bottom: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.single-featured-img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
}

.single-content {
  max-width: 720px;
}

.single-content h2 {
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--navy);
}

.single-content h3 {
  font-size: 20px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.single-content p {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 20px;
}

.single-content ul,
.single-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.single-content li {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 8px;
}

.single-content blockquote {
  border-left: 3px solid var(--gold);
  margin: 32px 0;
  padding: 16px 24px;
  background: var(--section);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 16px;
  color: var(--ink);
  font-style: italic;
}

.single-content img {
  border-radius: var(--radius-sm);
  margin: 24px 0;
}

.single-content a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-content a:hover {
  color: var(--gold-dark);
}

/* Tags under post */
.single-tags {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  background: rgba(15,59,99,.06);
  padding: 5px 12px;
  border-radius: 4px;
  transition: background .15s ease;
}

.single-tag:hover {
  background: rgba(15,59,99,.12);
}

/* Post navigation (prev/next) */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background .15s ease;
}

.post-nav-item:hover { background: var(--section); }

.post-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.post-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}

.post-nav-item.next { text-align: right; }

/* =========================================
   SIDEBAR
========================================= */
.sidebar {
  position: sticky;
  top: 140px;
}

.sidebar-widget {
  margin-bottom: 32px;
}

.sidebar-widget-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}

/* Category list */
.sidebar-categories {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-categories li {
  border-bottom: 1px solid var(--border);
}

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

.sidebar-categories a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: color .15s ease;
}

.sidebar-categories a:hover { color: var(--navy); }

.sidebar-categories .count {
  font-size: 12px;
  color: var(--muted);
  background: var(--section);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Recent posts */
.sidebar-recent-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.sidebar-recent-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-recent-thumb-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--navy), #1a4f7a);
  flex-shrink: 0;
}

.sidebar-recent-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 4px;
  transition: color .15s ease;
}

.sidebar-recent-title:hover { color: var(--navy); }

.sidebar-recent-date {
  font-size: 11px;
  color: var(--muted);
}

/* CTA widget */
.sidebar-cta {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  text-align: center;
}

.sidebar-cta h3 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}

.sidebar-cta p {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: 16px;
  line-height: 1.5;
}

.sidebar-cta .btn-gold {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 10px 24px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  transition: background .2s ease;
}

.sidebar-cta .btn-gold:hover {
  background: var(--gold-dark);
}

/* =========================================
   PAGINATION
========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all .15s ease;
}

.pagination a {
  color: var(--ink);
  border: 1px solid var(--border);
}

.pagination a:hover {
  background: var(--section);
  border-color: var(--navy);
  color: var(--navy);
}

.pagination .current {
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
}

.pagination .dots {
  color: var(--muted);
  border: none;
}

/* =========================================
   ARCHIVE HEADER
========================================= */
.archive-hero {
  background: linear-gradient(135deg, #0b2346, #0f2f4f);
  color: #fff;
  border-bottom: 2px solid var(--gold);
}

.archive-header {
  padding: 32px 0 28px;
}

.archive-header .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.5);
  margin-bottom: 6px;
}

.archive-header h1 {
  font-size: clamp(24px, 3.6vw, 34px);
  margin-bottom: 8px;
  color: #fff;
}

.archive-header .desc {
  font-size: 15px;
  color: rgba(255,255,255,.6);
  max-width: 560px;
}

/* Search form inside dark header */
.archive-hero .search-form input[type="search"] {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
  color: #fff;
}

.archive-hero .search-form input[type="search"]::placeholder {
  color: rgba(255,255,255,.35);
}

.archive-hero .search-form input[type="search"]:focus {
  border-color: var(--gold);
}

/* =========================================
   SEARCH
========================================= */
.search-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .2s ease;
}

.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--navy);
}

.search-form button {
  padding: 10px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}

.search-form button:hover { background: #0a2744; }

/* =========================================
   FOOTER
========================================= */
footer {
  background: var(--footer-bg);
  color: #cbd5e1;
}

footer .cols {
  display: grid;
  gap: 24px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 36px 0;
}

footer a {
  color: #dbe6ff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.8;
  opacity: .85;
  transition: color .2s ease, opacity .2s ease;
}

footer a:hover { color: #fff; opacity: 1; }

footer strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
}

footer .small {
  font-size: 12px;
  opacity: .8;
  line-height: 1.6;
}

.spacer-8 { height: 8px; }

/* Newsletter */
.footer-newsletter {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 28px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-newsletter-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  margin-bottom: 4px;
}

.footer-newsletter-left .small { opacity: .7; }

.footer-newsletter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-newsletter-form input[type="email"] {
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.07);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  min-width: 220px;
  transition: border-color .2s ease;
}

.footer-newsletter-form input[type="email"]::placeholder {
  color: rgba(255,255,255,.35);
}

.footer-newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--gold);
}

.footer-newsletter-form button {
  padding: 10px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}

.footer-newsletter-form button:hover { background: #0a2744; }

#newsletterMessage {
  display: none;
  width: 100%;
  font-size: 13px;
  margin-top: 4px;
}

/* Legal */
.footer-legal-notice {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 20px 0;
}

.footer-legal-notice .small {
  opacity: .6;
  max-width: 780px;
}

.impartiality-statement {
  font-size: 13px;
  color: rgba(199,208,230,.8);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 16px 0;
  line-height: 1.6;
}

.impartiality-statement p { margin: 0; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================
   404 PAGE
========================================= */
.page-404 {
  text-align: center;
  padding: 80px 0;
}

.page-404 h1 {
  font-size: 72px;
  color: var(--navy);
  margin-bottom: 8px;
}

.page-404 p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* =========================================
   FOCUS & ACCESSIBILITY
========================================= */
a:focus,
button:focus,
input:focus {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 1024px) {
  .header-inner { padding: 0 24px; }
  .util-inner { padding: 0 24px; }
  .container-wide { padding: 0 24px; }

  .main-nav,
  .header-cta { display: none; }

  .mobile-toggle { display: flex; }

  .mega-panel { display: none !important; }
  .has-dropdown .nav-dropdown { display: none !important; }

  .mega-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
    padding-right: 24px;
    margin-right: 24px;
  }

  .mega-bottom-bar { padding: 12px 24px; }

  .blog-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .sidebar-widget { margin-bottom: 0; }

  footer .cols { grid-template-columns: 1fr 1fr; }

  .post-latest .post-card-image,
  .post-latest .post-card-image-placeholder {
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 640px) {
  body { padding-top: 107px; }

  .util-bar { height: 32px; }
  .site-header { top: 32px; height: 75px; }

  .util-inner { padding: 0 16px; }
  .header-inner { padding: 0 16px; }
  .container-wide { padding: 0 16px; }

  .util-tagline { display: none; }

  .logo img { width: 75px; }

  .mobile-nav {
    top: 107px;
    height: calc(100vh - 107px);
  }

  .post-grid.cols-2 { grid-template-columns: 1fr; }

  .sidebar { grid-template-columns: 1fr; }

  .post-nav { grid-template-columns: 1fr; }

  footer .cols { grid-template-columns: 1fr; }

  .footer-newsletter {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-newsletter-form {
    width: 100%;
  }

  .footer-newsletter-form input[type="email"] {
    width: 100%;
    min-width: unset;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }

  .blog-hero .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .blog-hero h1 { font-size: 18px; }

  .archive-header { padding: 28px 0 24px; }
}