/*
Theme Name:  Compliant Drivers
Theme URI:   https://compliantdrivers.com
Author:      Compliant Drivers Editorial Team
Description: Professional trucking compliance niche theme. Steel Navy + Signal Orange. Built for CDL, DOT, FMCSA content — AdSense ready, SEO optimized, fully mobile responsive.
Version:     2.0
License:     GNU General Public License v2 or later
Text Domain: compliantdrivers
Tags:        trucking, compliance, cdl, dot, adsense, seo, responsive
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Colors */
  --navy:       #0D1F3C;
  --navy-mid:   #162B52;
  --navy-light: #1A3A6B;
  --orange:     #E8500A;
  --orange-lt:  #FF6B2B;
  --orange-bg:  rgba(232,80,10,0.08);
  --orange-brd: rgba(232,80,10,0.35);
  --asphalt:    #2C3340;
  --steel:      #6B7585;
  --muted:      #4A5568;
  --text:       #1C2333;
  --white:      #FFFFFF;
  --concrete:   #F5F6F7;
  --border:     #DDE1E8;
  --shadow-sm:  0 1px 4px rgba(13,31,60,0.08);
  --shadow-md:  0 4px 16px rgba(13,31,60,0.12);
  --shadow-lg:  0 8px 32px rgba(13,31,60,0.18);

  /* Typography */
  --f-head: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'Roboto Mono', 'Courier New', monospace;

  /* Spacing */
  --gap:   20px;
  --r:     8px;
  --r-sm:  4px;
  --r-lg:  12px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 2px; }
ul, ol { padding-left: 1.25em; }
strong { font-weight: 600; }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--f-head);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
/* Skip link */
.cd-skip {
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.cd-skip:focus {
  position: fixed; top: 0; left: 0; width: auto; height: auto;
  background: var(--orange); color: var(--white); padding: 10px 18px;
  font-size: 14px; font-weight: 600; z-index: 99999; border-radius: 0 0 6px 0;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.cd-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
#cd-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--orange-lt));
  z-index: 9999; width: 0; transition: width 0.08s linear;
  pointer-events: none;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.cd-back-top {
  position: fixed; bottom: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--orange); color: var(--white);
  border: none; cursor: pointer; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(232,80,10,0.45);
  transition: transform 0.2s, background 0.2s;
  z-index: 900;
}
.cd-back-top:hover { background: var(--orange-lt); transform: translateY(-2px); }
.cd-back-top[hidden] { display: none; }

/* ============================================================
   TOPBAR
   ============================================================ */
.cd-topbar {
  background: var(--navy);
  padding: 6px 0;
  font-family: var(--f-mono);
  font-size: 11px;
  color: #64748B;
  letter-spacing: 0.04em;
}
.cd-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cd-topbar a { color: #94A3B8; transition: color 0.2s; }
.cd-topbar a:hover { color: var(--orange-lt); text-decoration: none; }

/* ============================================================
   HEADER
   ============================================================ */
.cd-header {
  background: var(--navy-mid);
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.28);
  transition: padding 0.3s;
}
.cd-header-scrolled { /* header shrinks on scroll — JS adds this */ }
.cd-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
}

/* LOGO */
.cd-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.cd-logo:hover { text-decoration: none; }
.cd-logo-badge {
  background: var(--orange);
  color: var(--white);
  font-family: var(--f-head);
  font-size: 19px;
  font-weight: 700;
  padding: 5px 10px 5px 13px;
  letter-spacing: 0.06em;
  clip-path: polygon(0 0, 88% 0, 100% 50%, 88% 100%, 0 100%);
  flex-shrink: 0;
  transition: background 0.2s;
}
.cd-logo:hover .cd-logo-badge { background: var(--orange-lt); }
.cd-logo-text { display: flex; flex-direction: column; }
.cd-logo-text strong {
  display: block;
  font-family: var(--f-head);
  font-size: 19px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}
.cd-logo-text small {
  display: block;
  font-family: var(--f-mono);
  font-size: 9px;
  color: #94A3B8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* DESKTOP NAV */
.cd-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.cd-nav a {
  color: #A0AEC0;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.cd-nav a:hover,
.cd-nav a[aria-current="page"],
.cd-nav a.current-menu-item {
  color: var(--orange-lt);
  background: rgba(232,80,10,0.14);
  text-decoration: none;
}
.cd-nav-btn {
  background: var(--orange) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  border-radius: var(--r-sm) !important;
  margin-left: 4px;
  transition: background 0.2s !important;
}
.cd-nav-btn:hover { background: var(--orange-lt) !important; text-decoration: none !important; }

/* SEARCH */
.cd-search-form {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.cd-search-input {
  background: transparent; border: none;
  padding: 7px 10px; font-size: 12px; color: var(--white);
  outline: none; width: 160px; font-family: var(--f-body);
}
.cd-search-input::placeholder { color: #64748B; }
.cd-search-btn {
  background: none; border: none; padding: 7px 10px;
  color: #94A3B8; cursor: pointer; font-size: 13px; line-height: 1;
  transition: color 0.2s;
}
.cd-search-btn:hover { color: var(--orange-lt); }

/* HAMBURGER */
.cd-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 6px; background: none; border: none;
  flex-shrink: 0;
}
.cd-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.cd-mobile-drawer {
  position: fixed; top: 0; right: -100%; width: 280px; height: 100%;
  background: var(--navy-mid); z-index: 1100;
  transition: right 0.32s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto; border-left: 3px solid var(--orange);
}
.cd-mobile-drawer.open { right: 0; }
.cd-drawer-inner { padding: 20px; }
.cd-drawer-close {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  color: var(--white); font-size: 16px; cursor: pointer;
  margin-bottom: 20px; margin-left: auto;
  transition: background 0.2s;
}
.cd-drawer-close:hover { background: rgba(232,80,10,0.3); }
.cd-drawer-nav { list-style: none; padding: 0; }
.cd-drawer-nav li { border-bottom: 1px solid rgba(255,255,255,0.08); }
.cd-drawer-nav a {
  display: block; padding: 13px 0;
  color: #CBD5E1; font-size: 15px; font-weight: 500;
  text-decoration: none; transition: color 0.2s, padding-left 0.2s;
}
.cd-drawer-nav a:hover { color: var(--orange-lt); padding-left: 6px; }

.cd-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 1099; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.cd-drawer-overlay.show { opacity: 1; pointer-events: all; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.cd-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  padding: 64px 0 56px;
  position: relative; overflow: hidden;
}
.cd-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 80px,
    rgba(255,255,255,0.012) 80px, rgba(255,255,255,0.012) 81px);
  pointer-events: none;
}
/* Truck illustration overlay */
.cd-hero::after {
  content: '🚛';
  position: absolute; right: -20px; bottom: -10px;
  font-size: 220px; opacity: 0.035;
  pointer-events: none; line-height: 1;
  filter: grayscale(1);
}
.cd-hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px; align-items: center;
  position: relative;
}
.cd-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange-bg); border: 1px solid var(--orange-brd);
  color: var(--orange-lt);
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 2px; margin-bottom: 20px;
}
.cd-hero h1 {
  font-size: 52px; color: var(--white); margin-bottom: 20px;
  line-height: 1.03; font-family: var(--f-head);
}
.cd-hero h1 em { color: var(--orange); font-style: normal; }
.cd-hero-desc {
  color: #94A3B8; font-size: 15px; line-height: 1.8;
  margin-bottom: 30px; max-width: 480px;
}
.cd-hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.cd-btn-primary {
  background: var(--orange); color: var(--white) !important;
  padding: 12px 26px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px; display: inline-block;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none !important; border: none; cursor: pointer;
}
.cd-btn-primary:hover { background: var(--orange-lt); transform: translateY(-1px); }
.cd-btn-ghost {
  border: 1.5px solid rgba(255,255,255,0.3);
  color: var(--white) !important; padding: 12px 26px;
  border-radius: var(--r-sm); font-weight: 600; font-size: 14px;
  display: inline-block; transition: border-color 0.2s;
  text-decoration: none !important;
}
.cd-btn-ghost:hover { border-color: rgba(255,255,255,0.6); }

/* HERO STATS */
.cd-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cd-stat {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r); padding: 18px 20px;
}
.cd-stat.full { grid-column: 1/-1; }
.cd-stat-num {
  display: block; font-family: var(--f-head);
  font-size: 38px; font-weight: 700; color: var(--orange); line-height: 1;
  margin-bottom: 5px;
}
.cd-stat-lbl {
  display: block; font-family: var(--f-mono); font-size: 10px;
  color: #94A3B8; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============================================================
   TRUST BAR
   ============================================================ */
.cd-trust {
  background: var(--asphalt);
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cd-trust-inner {
  display: flex; gap: 0; flex-wrap: wrap;
  align-items: center; justify-content: center;
}
.cd-trust-item {
  color: #94A3B8; font-size: 11px;
  font-family: var(--f-mono); letter-spacing: 0.04em;
  padding: 4px 16px;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 6px;
}
.cd-trust-item:last-child { border-right: none; }
.cd-trust-item::before { content: '✓'; color: var(--orange); font-weight: 700; }

/* ============================================================
   AD SLOTS — AdSense friendly (responsive)
   ============================================================ */
.cd-ad {
  margin: 20px 0;
  text-align: center;
  overflow: hidden; /* prevent layout shift */
}
.cd-ad-placeholder {
  background: var(--concrete);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  min-height: 90px; display: flex;
  align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 10px;
  color: #CBD5E1; letter-spacing: 0.08em;
  margin: 0;
}
/* Sidebar ad placeholder */
.cd-widget .cd-ad-placeholder { min-height: 250px; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.cd-section-header { margin-bottom: 28px; }
.cd-section-tag {
  display: block; font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--orange);
  margin-bottom: 6px;
}
.cd-section-header h2 {
  font-size: 28px; color: var(--navy);
  font-family: var(--f-head);
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.cd-cats-section { background: var(--concrete); padding: 44px 0; }
.cd-cats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.cd-cat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 12px;
  text-align: center; text-decoration: none !important;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-top: 3px solid var(--border);
  transition: border-top-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cd-cat-card:hover {
  border-top-color: var(--orange);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.cd-cat-icon { font-size: 26px; line-height: 1; }
.cd-cat-name {
  font-family: var(--f-head); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--navy); line-height: 1.3;
}
.cd-cat-count { font-family: var(--f-mono); font-size: 9px; color: var(--steel); }

/* ============================================================
   POST GRID
   ============================================================ */
.cd-posts-section { padding: 48px 0; }
.cd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.cd-no-posts {
  color: var(--steel); font-family: var(--f-mono);
  text-align: center; padding: 48px 0;
}

/* POST CARD */
.cd-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
  display: flex; flex-direction: column;
  position: relative;
}
.cd-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--orange); transform: scaleX(0);
  transform-origin: left; transition: transform 0.3s;
}
.cd-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cd-card:hover::before { transform: scaleX(1); }

/* ── CARD THUMBNAIL — KEY FOR FEATURE IMAGES ── */
.cd-card-thumb-link { display: block; overflow: hidden; }
.cd-card-img {
  width: 100%; height: 180px; object-fit: cover; display: block;
  transition: transform 0.4s;
}
.cd-card:hover .cd-card-img { transform: scale(1.04); }
.cd-card-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}

.cd-card-body {
  padding: 18px;
  display: flex; flex-direction: column; flex: 1;
}
.cd-card-cat {
  display: inline-block;
  background: rgba(13,31,60,0.07); color: var(--navy-mid);
  font-family: var(--f-mono); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px;
  margin-bottom: 10px; text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
}
.cd-card-cat:hover { background: var(--orange-bg); color: var(--orange); }
.cd-card-title {
  font-family: var(--f-head); font-size: 15px; font-weight: 700;
  color: var(--navy); line-height: 1.35; margin-bottom: 10px; flex: 1;
}
.cd-card-title a {
  color: inherit; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.cd-card-title a:hover { color: var(--orange); }
.cd-card-excerpt {
  color: var(--muted); font-size: 13px; line-height: 1.65;
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.cd-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 10px; font-family: var(--f-mono); color: var(--steel);
  margin-top: auto;
}
.cd-card-read {
  color: var(--orange); font-family: var(--f-head);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none;
  transition: color 0.2s;
}
.cd-card-read:hover { color: var(--orange-lt); }

/* PAGINATION */
.cd-pagination { margin-top: 44px; display: flex; justify-content: center; }
.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.page-numbers {
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  font-family: var(--f-mono); font-size: 12px; text-decoration: none;
  transition: all 0.2s;
}
.page-numbers.current { background: var(--orange); color: var(--white); border-color: var(--orange); }
.page-numbers:hover { border-color: var(--orange); color: var(--orange); text-decoration: none; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.cd-breadcrumb-bar {
  background: var(--concrete); border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.cd-breadcrumb { display: flex; }
.cd-breadcrumb ol {
  display: flex; gap: 0; flex-wrap: wrap; align-items: center;
  list-style: none; padding: 0; font-size: 12px; font-family: var(--f-mono);
}
.cd-breadcrumb li { display: flex; align-items: center; }
.cd-breadcrumb li:not(:last-child)::after {
  content: '›'; margin: 0 7px; color: var(--steel);
}
.cd-breadcrumb a { color: var(--orange); text-decoration: none; }
.cd-breadcrumb a:hover { text-decoration: underline; }
.cd-breadcrumb [aria-current] { color: var(--steel); }

/* ============================================================
   ARTICLE HERO
   ============================================================ */
.cd-article-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 40px 0 36px;
}
.cd-article-tag {
  display: inline-block;
  background: rgba(232,80,10,0.18); border: 1px solid rgba(232,80,10,0.4);
  color: var(--orange-lt);
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 2px;
  margin-bottom: 14px; text-decoration: none;
}
.cd-article-hero h1 {
  font-size: 36px; color: var(--white);
  line-height: 1.1; margin-bottom: 18px;
  font-family: var(--f-head);
}
.cd-article-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--f-mono); font-size: 11px; color: #64748B;
}
.cd-article-meta span { display: flex; align-items: center; gap: 5px; }

/* ============================================================
   ARTICLE LAYOUT (content + sidebar)
   ============================================================ */
.cd-article-layout {
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 36px; padding: 40px 0 56px;
  align-items: start;
}

/* ── FEATURED IMAGE ── */
.cd-article-thumb { margin-bottom: 28px; border-radius: var(--r); overflow: hidden; }
.cd-article-thumb-img { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--r); }

/* ── ARTICLE TYPOGRAPHY ── */
.cd-article-content { min-width: 0; }
.cd-article-content > *:first-child { margin-top: 0; }
.cd-article-content h2 {
  font-size: 22px; color: var(--navy);
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
  margin: 36px 0 18px; font-family: var(--f-head);
}
.cd-article-content h3 {
  font-size: 17px; color: var(--navy);
  margin: 28px 0 12px; font-family: var(--f-head);
}
.cd-article-content h4 {
  font-size: 14px; color: var(--navy);
  margin: 20px 0 10px; font-family: var(--f-head); letter-spacing: 0.03em;
}
.cd-article-content p {
  font-size: 15px; line-height: 1.82; color: var(--text); margin-bottom: 18px;
}
.cd-article-content ul,
.cd-article-content ol {
  margin: 0 0 18px 22px; font-size: 15px; line-height: 1.82; color: var(--text);
}
.cd-article-content li { margin-bottom: 7px; }
.cd-article-content a { color: var(--orange); border-bottom: 1px solid rgba(232,80,10,0.28); }
.cd-article-content a:hover { color: var(--orange-lt); border-bottom-color: var(--orange-lt); text-decoration: none; }
.cd-article-content strong { color: var(--navy); font-weight: 600; }
.cd-article-content em { font-style: italic; }

/* ── TABLES ── */
.cd-article-content table {
  width: 100%; border-collapse: collapse; margin: 28px 0;
  font-size: 14px; border-radius: var(--r); overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}
.cd-article-content thead th {
  background: var(--navy); color: var(--white);
  padding: 13px 16px; text-align: left;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.cd-article-content td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: top; line-height: 1.65;
}
.cd-article-content tr:nth-child(even) td { background: var(--concrete); }
.cd-article-content tr:last-child td { border-bottom: none; }
.cd-article-content tr:hover td { background: rgba(232,80,10,0.04); }

/* ── CALLOUT BOXES ── */
.cd-article-content .callout,
.callout {
  border-left: 4px solid var(--orange);
  background: var(--orange-bg); padding: 16px 20px;
  margin: 28px 0; border-radius: 0 var(--r) var(--r) 0;
}
.callout-title {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 7px; display: block;
}
.callout.callout-blue { border-left-color: #185FA5; background: rgba(24,95,165,0.07); }
.callout.callout-blue .callout-title { color: #185FA5; }

/* ── FAQ ── */
.faq-item, .cd-faq-item {
  border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 10px; overflow: hidden;
}
.faq-q, .cd-faq-q {
  background: var(--concrete); padding: 15px 20px;
  font-family: var(--f-head); font-size: 16px; font-weight: 700;
  color: var(--navy); letter-spacing: 0.02em; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none; transition: background 0.2s;
}
.faq-q:hover, .cd-faq-q:hover { background: #EBEEF2; }
.faq-q::after, .cd-faq-q::after {
  content: '+'; color: var(--orange); font-size: 22px;
  line-height: 1; flex-shrink: 0; margin-left: 12px;
  transition: transform 0.25s;
}
.faq-item.open .faq-q::after,
.cd-faq-item.open .cd-faq-q::after { content: '−'; }
.faq-a, .cd-faq-a {
  padding: 16px 20px; font-size: 15px; line-height: 1.8;
  color: var(--text); border-top: 1px solid var(--border); display: none;
}
.faq-item.open .faq-a,
.cd-faq-item.open .cd-faq-a { display: block; }

/* ── PROS CONS ── */
.pros-cons {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px; margin: 28px 0;
}
.pros-box {
  background: rgba(15,110,86,0.07); border: 1px solid rgba(15,110,86,0.22);
  border-radius: var(--r); padding: 20px;
}
.cons-box {
  background: rgba(163,45,45,0.07); border: 1px solid rgba(163,45,45,0.22);
  border-radius: var(--r); padding: 20px;
}
.pros-box h4 { color: #0C6B52; margin-bottom: 12px; }
.cons-box h4 { color: #A32D2D; margin-bottom: 12px; }

/* ── CHECKLIST ── */
.checklist { list-style: none; padding: 0; margin: 0 0 18px 0; }
.checklist li {
  padding: 8px 0 8px 28px; position: relative;
  border-bottom: 1px solid var(--border); font-size: 15px; line-height: 1.7;
}
.checklist li::before { content: '✓'; position: absolute; left: 0; color: var(--orange); font-weight: 700; }

/* ── SOURCES BOX ── */
.cd-article-content div[style*="background:var(--concrete)"],
.cd-sources {
  background: var(--concrete); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 22px;
  margin-top: 32px; font-size: 13px; color: var(--steel); line-height: 1.7;
}

/* ── AUTHOR BOX ── */
.cd-author-box {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--concrete); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 22px; margin: 36px 0;
}
.cd-author-avatar {
  background: var(--navy); color: var(--orange);
  font-family: var(--f-head); font-size: 20px; font-weight: 700;
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cd-author-box strong {
  display: block; font-family: var(--f-head); font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--navy);
  margin-bottom: 5px;
}
.cd-author-box p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.65; }

/* ── POST NAV ── */
.cd-post-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin: 36px 0;
}
.cd-nav-prev, .cd-nav-next {
  background: var(--concrete); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px;
  text-decoration: none; display: block; transition: border-color 0.2s;
}
.cd-nav-prev:hover, .cd-nav-next:hover { border-color: var(--orange); text-decoration: none; }
.cd-nav-next { text-align: right; }
.cd-nav-prev span, .cd-nav-next span {
  display: block; font-family: var(--f-mono);
  font-size: 10px; color: var(--steel); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 5px;
}
.cd-nav-prev strong, .cd-nav-next strong {
  display: block; font-family: var(--f-head); font-size: 14px;
  color: var(--navy); font-weight: 700; line-height: 1.35;
  text-transform: uppercase;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.cd-sidebar { position: sticky; top: 80px; }
.cd-widget {
  background: var(--concrete); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px; margin-bottom: 18px;
}
.cd-widget-title {
  font-family: var(--f-head); font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy);
  padding-bottom: 10px; border-bottom: 2px solid var(--orange);
  margin-bottom: 14px;
}
.cd-toc { list-style: none; padding: 0; }
.cd-toc li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.cd-toc li:last-child { border-bottom: none; }
.cd-toc a { color: var(--muted); font-size: 12px; text-decoration: none; line-height: 1.5; display: block; }
.cd-toc a:hover { color: var(--orange); }
.cd-related { list-style: none; padding: 0; }
.cd-related li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.cd-related li:last-child { border-bottom: none; }
.cd-related a { color: var(--navy); font-size: 12px; text-decoration: none; transition: color 0.2s; }
.cd-related a::before { content: '→ '; color: var(--orange); }
.cd-related a:hover { color: var(--orange); }
.cd-disclaimer { font-size: 12px; color: var(--steel); line-height: 1.65; }
.cd-disclaimer strong {
  display: block; font-family: var(--f-head); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 6px;
}
.cd-disclaimer p { margin: 0; }

/* ============================================================
   PAGE TEMPLATES
   ============================================================ */
.cd-page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 44px 0;
}
.cd-page-hero h1 { color: var(--white); font-size: 34px; }
.cd-page-hero p { color: #94A3B8; margin-top: 12px; font-size: 15px; }
.cd-page-hero-icon { font-size: 44px; margin-bottom: 12px; }
.cd-page-content { padding: 44px 0; max-width: 820px; }

/* 404 */
.cd-404 { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); min-height: 60vh; display: flex; align-items: center; }
.cd-404-inner { text-align: center; padding: 60px 20px; }
.cd-404-num { font-family: var(--f-head); font-size: 100px; font-weight: 700; color: var(--orange); line-height: 1; margin-bottom: 16px; }
.cd-404 h1 { color: var(--white); font-size: 32px; margin-bottom: 12px; }
.cd-404 p { color: #94A3B8; margin-bottom: 28px; }

/* ============================================================
   FOOTER
   ============================================================ */
.cd-footer { background: var(--navy); color: #94A3B8; padding-top: 56px; }
.cd-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; padding-bottom: 44px;
}
.cd-footer-brand .cd-logo { margin-bottom: 14px; }
.cd-footer-brand p { font-size: 13px; line-height: 1.75; color: #64748B; max-width: 240px; }
.cd-footer-trust {
  display: flex; flex-direction: column; gap: 6px; margin-top: 16px;
}
.cd-footer-trust span {
  font-family: var(--f-mono); font-size: 10px;
  color: #475569; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 6px;
}
.cd-footer-trust span::before { content: '✓'; color: var(--orange); }
.cd-footer h3 {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--white); margin-bottom: 14px;
}
.cd-footer ul { list-style: none; padding: 0; }
.cd-footer li { margin-bottom: 8px; }
.cd-footer a { color: #64748B; font-size: 12px; line-height: 1.6; transition: color 0.2s; }
.cd-footer a:hover { color: var(--orange-lt); text-decoration: none; }
.cd-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 0; display: flex; justify-content: space-between;
  font-size: 11px; color: #475569; font-family: var(--f-mono);
  flex-wrap: wrap; gap: 8px;
}
.cd-footer-bottom a { color: #475569; }
.cd-footer-bottom a:hover { color: var(--orange-lt); }

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-field {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 14px; font-family: var(--f-body);
  outline: none;
}
.search-field:focus { border-color: var(--orange); }
.search-submit {
  background: var(--orange); color: var(--white);
  border: none; padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 14px; cursor: pointer; font-family: var(--f-body);
  transition: background 0.2s;
}
.search-submit:hover { background: var(--orange-lt); }

/* ============================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .cd-hero h1 { font-size: 42px; }
  .cd-hero-inner { gap: 36px; }
  .cd-cats-grid { grid-template-columns: repeat(3, 1fr); }
  .cd-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .cd-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .cd-article-layout { grid-template-columns: 1fr 240px; gap: 24px; }
  .cd-search-input { width: 120px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Hide desktop elements */
  .cd-topbar { display: none; }
  .cd-nav { display: none; }
  .cd-search-form { display: none; }
  .cd-hamburger { display: flex; }
  .cd-hero-inner { grid-template-columns: 1fr; }
  .cd-hero-stats { display: none; }
  .cd-hero::after { display: none; }
  .cd-hero { padding: 44px 0 40px; }
  .cd-hero h1 { font-size: 34px; }

  /* Trust bar wrap */
  .cd-trust-inner { gap: 0; }
  .cd-trust-item { padding: 4px 10px; font-size: 10px; }

  /* Categories 2 col */
  .cd-cats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cd-cat-card { padding: 14px 8px; }
  .cd-cat-icon { font-size: 22px; }

  /* Posts 1 col */
  .cd-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Article — single column */
  .cd-article-layout { grid-template-columns: 1fr; }
  .cd-sidebar { display: none; } /* sidebar hidden on mobile */
  .cd-article-hero h1 { font-size: 26px; }
  .cd-article-meta { gap: 8px; font-size: 10px; }

  /* Post nav */
  .cd-post-nav { grid-template-columns: 1fr; }
  .cd-nav-next { text-align: left; }

  /* Pros cons */
  .pros-cons { grid-template-columns: 1fr; }

  /* Table horizontal scroll */
  .cd-article-content table {
    display: block; overflow-x: auto; white-space: nowrap;
    box-shadow: none; border: 1px solid var(--border); border-radius: var(--r);
  }

  /* Footer */
  .cd-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cd-footer-brand p { max-width: 100%; }
  .cd-footer-bottom { flex-direction: column; gap: 6px; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .cd-hero h1 { font-size: 28px; }
  .cd-hero-desc { font-size: 14px; }
  .cd-hero-btns { flex-direction: column; }
  .cd-btn-primary, .cd-btn-ghost { text-align: center; }
  .cd-article-hero h1 { font-size: 22px; }
  .cd-cats-grid { grid-template-columns: repeat(3, 1fr); }
  .cd-cat-name { font-size: 9px; }
  .cd-badge { font-size: 9px; }
  .cd-section-header h2 { font-size: 22px; }
  .cd-author-box { flex-direction: column; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .cd-topbar, .cd-header, .cd-trust, .cd-sidebar,
  .cd-footer, .cd-back-top, #cd-progress,
  .cd-ad, .cd-post-nav { display: none !important; }
  .cd-article-layout { grid-template-columns: 1fr; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  .cd-article-hero { background: none; padding: 0; }
  .cd-article-hero h1, .cd-article-meta { color: #000; }
}

/* ============================================================
   MOBILE FIXES v2 — 100% Mobile Friendly
   ============================================================ */

/* ── TOPBAR RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 860px) {
  .cd-topbar-inner { justify-content: center; }
  .cd-topbar-inner span:first-child { display: none; }
}

/* ── HEADER INNER — prevent overflow on small screens ───────── */
@media (max-width: 768px) {
  .cd-header-inner { padding: 10px 0; }
  .cd-logo-text small { display: none; } /* hide tagline on mobile */
  .cd-logo-badge { font-size: 16px; padding: 4px 8px 4px 10px; }
  .cd-logo-text strong { font-size: 16px; }
}

/* ── HERO MOBILE ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cd-hero { padding: 36px 0 32px; }
  .cd-hero h1 { font-size: 26px; line-height: 1.1; }
  .cd-hero-desc { font-size: 13px; margin-bottom: 22px; }
  .cd-badge { font-size: 9px; padding: 3px 9px; }
  .cd-btn-primary, .cd-btn-ghost {
    padding: 11px 20px; font-size: 13px; width: 100%; text-align: center;
  }
  .cd-hero-btns { flex-direction: column; gap: 10px; }
}

/* ── TRUST BAR MOBILE ───────────────────────────────────────── */
@media (max-width: 600px) {
  .cd-trust-item { font-size: 9px; padding: 3px 8px; }
  .cd-trust-item:nth-child(4),
  .cd-trust-item:nth-child(5) { display: none; } /* show only 3 on mobile */
}

/* ── CATEGORIES MOBILE ──────────────────────────────────────── */
@media (max-width: 480px) {
  .cd-cats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cd-cat-icon { font-size: 20px; }
  .cd-cat-name { font-size: 10px; }
  .cd-cats-section { padding: 32px 0; }
}

/* ── ARTICLE HERO MOBILE ────────────────────────────────────── */
@media (max-width: 600px) {
  .cd-article-hero { padding: 28px 0 24px; }
  .cd-article-hero h1 { font-size: 21px; line-height: 1.15; }
  .cd-article-meta { font-size: 10px; gap: 8px; }
  .cd-article-meta span:nth-child(2) { display: none; } /* hide updated date */
}

/* ── ARTICLE CONTENT MOBILE ─────────────────────────────────── */
@media (max-width: 600px) {
  .cd-article-content h2 { font-size: 19px; margin: 28px 0 14px; }
  .cd-article-content h3 { font-size: 15px; margin: 22px 0 10px; }
  .cd-article-content p  { font-size: 14px; line-height: 1.75; }
  .cd-article-content ul,
  .cd-article-content ol { font-size: 14px; }
  .faq-q, .cd-faq-q     { font-size: 14px; padding: 13px 16px; }
  .faq-a, .cd-faq-a     { font-size: 14px; padding: 13px 16px; }
  .callout               { padding: 14px 16px; }
  .callout-title         { font-size: 10px; }
  .cd-author-box         { padding: 14px 16px; gap: 12px; }
  .cd-author-box p       { font-size: 12px; }
  .cd-article-layout     { padding: 24px 0 40px; }
}

/* ── TABLE MOBILE — horizontal scroll ───────────────────────── */
.cd-article-content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .cd-article-content table {
    min-width: 500px; /* force scroll rather than squish */
  }
  /* Wrap tables automatically */
  .cd-article-content table {
    display: block; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r);
  }
}

/* ── POST CARDS MOBILE ───────────────────────────────────────── */
@media (max-width: 480px) {
  .cd-card-img, .cd-card-placeholder { height: 160px; }
  .cd-card-body { padding: 14px; }
  .cd-card-title { font-size: 14px; }
  .cd-card-excerpt { font-size: 12px; -webkit-line-clamp: 2; }
  .cd-posts-section { padding: 32px 0; }
  .cd-section-header h2 { font-size: 22px; }
}

/* ── FOOTER MOBILE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .cd-footer { padding-top: 36px; }
  .cd-footer h3 { margin-top: 20px; }
  .cd-footer h3:first-child { margin-top: 0; }
  .cd-footer li { margin-bottom: 10px; } /* larger tap targets */
  .cd-footer a { font-size: 13px; }       /* easier to read */
  .cd-footer-bottom { font-size: 10px; text-align: center; }
}

/* ── BREADCRUMB MOBILE ───────────────────────────────────────── */
@media (max-width: 480px) {
  .cd-breadcrumb ol { font-size: 10px; }
  /* truncate long crumbs */
  .cd-breadcrumb li:last-child { 
    max-width: 180px; overflow: hidden; 
    text-overflow: ellipsis; white-space: nowrap; 
  }
}

/* ── POST NAV MOBILE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .cd-post-nav { gap: 10px; }
  .cd-nav-prev, .cd-nav-next { padding: 12px 14px; }
  .cd-nav-prev strong, .cd-nav-next strong { font-size: 12px; }
}

/* ── MOBILE DRAWER LINKS — larger tap area ───────────────────── */
.cd-drawer-nav a { min-height: 48px; display: flex; align-items: center; }

/* ── SEARCH FORM MOBILE ─────────────────────────────────────── */
@media (max-width: 360px) {
  .cd-wrap { padding: 0 14px; }
  .cd-hero h1 { font-size: 23px; }
}

/* ── PAGINATION MOBILE ───────────────────────────────────────── */
@media (max-width: 480px) {
  .page-numbers { padding: 7px 11px; font-size: 11px; }
}

/* ── PROS CONS MOBILE ────────────────────────────────────────── */
@media (max-width: 480px) {
  .pros-cons { gap: 12px; }
  .pros-box, .cons-box { padding: 14px 16px; }
}

/* ── 404 PAGE MOBILE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .cd-404-num { font-size: 72px; }
  .cd-404 h1 { font-size: 24px; }
}

/* ── ACCESSIBILITY — focus styles for keyboard nav ───────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── PREVENT CONTENT JUMP when scrollbar appears ─────────────── */
html { scrollbar-gutter: stable; }

/* ── IMAGE ASPECT RATIO — prevent layout shift (CLS) ─────────── */
.cd-card-thumb-link { aspect-ratio: 16/9; overflow: hidden; display: block; }
.cd-card-img { width: 100%; height: 100%; object-fit: cover; }
.cd-card-placeholder { width: 100%; height: 100%; }

/* ── REDUCED MOTION ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── HIGH CONTRAST MODE SUPPORT ──────────────────────────────── */
@media (forced-colors: active) {
  .cd-logo-badge, .cd-btn-primary, .cd-card-placeholder {
    border: 2px solid ButtonText;
  }
}

