/*
Theme Name:  Guardian Style — Pakistan News
Theme URI:   https://www.lifeinpakistan.net
Author:      Life In Pakistan
Description: Fast, mobile-first editorial news theme in a Guardian-inspired style — slab-serif headlines, hairline-ruled story grid, navy masthead with a bold red section band. Lightweight, no framework, optimised for mobile speed.
Version:     2.0.0
License:     GNU General Public License v2
Text Domain: lifeinpakistan
*/

/* ============================================================
   VARIABLES
============================================================ */
:root {
  /* Brand */
  --primary:     #0e7a4b;   /* Pakistan emerald */
  --primary-dk:  #0a5e3a;
  --primary-lt:  #e7f6ee;
  --brand-bright:#19c268;   /* vivid logo-accent green (pops on navy) */
  --navy:        #14213d;   /* masthead / footer ink-blue */
  --navy-2:      #1c2c4d;
  --gold:        #e0aa3e;

  /* Ink + neutrals */
  --ink:         #0e1116;   /* headline near-black */
  --text:        #20242c;   /* body copy */
  --muted:       #6a7180;
  --faint:       #8d93a0;
  --border:      #dad9d2;   /* warm hairline */
  --border-2:    #ebeae4;
  --rule-strong: #16223e;   /* dark top rule on sections */

  /* Surfaces */
  --bg:          #ffffff;
  --paper:       #ffffff;
  --surface:     #f5f4ef;   /* warm off-white */
  --surface-2:   #faf9f5;

  /* Form / state */
  --green:       #1c7d49;

  /* Shape */
  --radius:      3px;
  --radius-md:   4px;
  --shadow:      0 1px 2px rgba(14,17,22,0.05);
  --shadow-md:   0 8px 24px rgba(14,17,22,0.10);

  --max-w:       1240px;
  --font-h:      'Zilla Slab', Georgia, 'Times New Roman', serif;
  --font-b:      'Libre Franklin', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ============================================================
   RESET — mobile overflow prevention first
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-b);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

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

a  { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--primary); color: #fff; }

/* ============================================================
   LAYOUT
============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   TYPOGRAPHY
============================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-h);
  line-height: 1.12;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   TOP BAR (date + social) — desktop only
============================================================ */
.top-bar {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 6px 0;
  display: none;
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top-date {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.62);
}
.top-social { display: flex; gap: 16px; }
.top-social a {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.62);
  transition: color 0.15s;
}
.top-social a:hover { color: var(--gold); }

/* ============================================================
   BREAKING BAR — navy with red label
============================================================ */
.breaking-bar {
  background: var(--navy-2);
  padding: 8px 0;
  overflow: hidden;
}
.breaking-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.breaking-label {
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  padding: 3px 9px;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
}
.breaking-text {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breaking-text a { color: #fff; transition: color 0.15s; }
.breaking-text a:hover { color: var(--gold); }

/* ============================================================
   SITE HEADER (masthead) — sticky navy
============================================================ */
.site-header {
  background: var(--navy);
  position: relative;
  z-index: 998;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 14px;
}

/* Branding / wordmark */
.site-branding a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.site-title {
  font-family: var(--font-h);
  font-size: 25px;
  font-weight: 700;
  color: #fff;
  line-height: 0.95;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-title .accent { color: var(--brand-bright); }
.site-tagline {
  font-family: var(--font-b);
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-top: 4px;
  display: none;
}

/* Search — hidden mobile */
.header-search { display: none; }

/* Hamburger */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: var(--primary);
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: background 0.18s;
}
.menu-toggle:hover { background: var(--primary-dk); }
.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   PRIMARY NAV — the signature RED section band
============================================================ */
.primary-nav {
  background: var(--primary);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(14,17,22,0.16);
}
.nav-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 44px;
}

/* Mobile "Sections" toggle inside the red band */
.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #fff;
  padding: 0 2px;
}
.nav-toggle .nav-toggle-icon { font-size: 11px; transition: transform 0.2s; opacity: 0.9; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { transform: rotate(180deg); }

#primary-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: -16px;
  right: -16px;
  max-height: 72vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--navy);
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--primary);
}
#primary-menu.is-open { display: flex; }

#primary-menu > li { border-bottom: 1px solid rgba(255,255,255,0.08); }
#primary-menu > li > a {
  display: block;
  font-family: var(--font-b);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  padding: 14px 18px;
  transition: color 0.15s, background 0.15s;
}
#primary-menu > li > a:hover { color: #fff; background: rgba(255,255,255,0.06); }

.sub-menu {
  display: none;
  flex-direction: column;
  background: rgba(0,0,0,0.28);
}
.sub-menu.is-open { display: flex; }
.sub-menu li { border-bottom: 1px solid rgba(255,255,255,0.06); }
.sub-menu li a { display: block; padding: 11px 30px; font-size: 13px; color: rgba(255,255,255,0.78); }
.sub-menu li a:hover { color: var(--gold); }

.sub-toggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 50px;
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}

/* ============================================================
   CATEGORY TABS STRIP
============================================================ */
.cat-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-strip .inner {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.cat-strip .inner::-webkit-scrollbar { display: none; }
.cat-strip a {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 11px 14px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.cat-strip a:hover,
.cat-strip a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================================================
   HERO — lead story, editorial dark panel
============================================================ */
.hero-section {
  position: relative;
  background: var(--navy);
  overflow: hidden;
  min-height: 300px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.42;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,33,61,0.40) 0%, rgba(20,33,61,0.78) 60%, rgba(14,17,22,0.94) 100%);
}
.hero-section .container { position: relative; z-index: 2; }
.hero-inner { padding: 40px 0 36px; }

.hero-cat {
  display: inline-block;
  font-family: var(--font-b);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-h);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-wrap: balance;
}
.hero-title a { color: #fff; transition: color 0.15s; }
.hero-title a:hover { color: var(--gold); }
.hero-excerpt {
  font-family: var(--font-b);
  font-size: 14.5px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}
.hero-read-btn {
  background: var(--primary);
  color: #fff !important;
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 9px 16px;
  border-radius: var(--radius);
  margin-left: 4px;
  display: inline-block;
  transition: background 0.18s, transform 0.1s;
}
.hero-read-btn:hover { background: var(--primary-dk) !important; }
.hero-read-btn:active { transform: translateY(1px); }

/* ============================================================
   STATS BAR — thin navy strip, 2x2 mobile
============================================================ */
.stats-bar {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.stat-item {
  padding: 12px 14px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.stat-item:nth-child(2) { border-right: none; }
.stat-item:nth-child(3), .stat-item:nth-child(4) { border-bottom: none; }
.stat-item:nth-child(4) { border-right: none; }
.stat-item .sv {
  display: block;
  font-family: var(--font-h);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.stat-item .sl {
  font-family: var(--font-b);
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

/* ============================================================
   MAIN LAYOUT
============================================================ */
main { width: 100%; }

.content-wrap {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 24px 0 48px;
}
.main-content { width: 100%; min-width: 0; }
.sidebar      { width: 100%; }

/* ============================================================
   SECTION HEADING — editorial label with rule
============================================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-top: 10px;
  border-top: 2px solid var(--rule-strong);
  position: relative;
}
.section-head h2 {
  font-family: var(--font-h);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  padding-top: 4px;
  position: relative;
}
.section-head h2::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 64px;
  height: 4px;
  background: var(--primary);
}
.section-head a {
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--primary);
  transition: color 0.15s;
}
.section-head a:hover { color: var(--primary-dk); text-decoration: underline; }

/* ============================================================
   ARTICLE CARDS — hairline-ruled grid (no boxes)
============================================================ */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.articles-grid > .article-card {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.articles-grid > .article-card:first-child { border-top: none; padding-top: 4px; }

.article-card {
  background: transparent;
  display: flex;
  flex-direction: column;
  transition: none;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 13px;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease, ease); }
.article-card:hover .card-thumb img { transform: scale(1.035); }

.card-body { flex: 1; display: flex; flex-direction: column; }
.card-cat {
  font-family: var(--font-b);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 7px;
}
.card-cat a { color: var(--primary); transition: color 0.15s; }
.card-cat a:hover { color: var(--primary-dk); }
.card-title {
  font-family: var(--font-h);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 7px;
}
.card-title a { transition: color 0.15s; }
.card-title a:hover { color: var(--primary); }
.card-excerpt {
  font-family: var(--font-b);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 11px;
}
.card-meta {
  font-family: var(--font-b);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: auto;
}
.card-meta .sep { color: var(--border); }

/* Featured / lead card */
.article-card.featured {
  border-top: 3px solid var(--primary) !important;
  padding-top: 16px !important;
  margin-bottom: 8px;
}
.article-card.featured .card-thumb { aspect-ratio: 16 / 8; }
.article-card.featured .card-cat { font-size: 11px; }
.article-card.featured .card-title { font-size: 23px; line-height: 1.12; }
.article-card.featured .card-excerpt { font-size: 14.5px; -webkit-line-clamp: 3; }

/* ============================================================
   CATEGORY BOXES — homepage
============================================================ */
.cat-boxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.cat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  position: relative;
}
.cat-box::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.cat-box:hover { background: #fff; border-color: var(--primary); transform: translateY(-2px); }
.cat-box .icon { font-size: 24px; margin-bottom: 8px; line-height: 1; }
.cat-box h3 { font-family: var(--font-h); font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.cat-box p  { font-family: var(--font-b); font-size: 11px; font-weight: 500; color: var(--muted); margin: 0; }

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar-widget {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 22px;
}
.widget-head {
  background: var(--navy);
  padding: 11px 16px;
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #fff;
}
.widget-body { padding: 6px 16px 14px; }

/* Popular posts */
.popular-list { display: flex; flex-direction: column; }
.popular-item {
  display: flex;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-2);
  align-items: flex-start;
}
.popular-item:last-child { border-bottom: none; }
.popular-num {
  font-family: var(--font-h);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.32;
  line-height: 0.9;
  flex-shrink: 0;
  width: 26px;
}
.popular-thumb {
  width: 66px;
  height: 50px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-body { flex: 1; min-width: 0; }
.popular-title {
  font-family: var(--font-h);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.popular-title a:hover { color: var(--primary); }
.popular-date { font-family: var(--font-b); font-size: 11px; color: var(--faint); margin-top: 4px; }

/* Categories widget */
.cat-widget-list { display: flex; flex-direction: column; }
.cat-widget-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-b);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
  transition: color 0.15s;
}
.cat-widget-list a:last-child { border-bottom: none; }
.cat-widget-list a:hover { color: var(--primary); }
.cat-widget-list .count {
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 11px;
}

/* Newsletter */
.newsletter-form { margin-top: 2px; }
.newsletter-form p { font-family: var(--font-b); font-size: 13px; color: var(--muted); margin-bottom: 11px; line-height: 1.5; }
.newsletter-form input {
  width: 100%;
  padding: 11px 12px;
  font-size: 13.5px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.18s;
}
.newsletter-form input:focus { border-color: var(--primary); }
.newsletter-form button {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: var(--radius);
  transition: background 0.18s, transform 0.1s;
}
.newsletter-form button:hover { background: var(--primary-dk); }
.newsletter-form button:active { transform: translateY(1px); }
#newsletter-msg { font-size: 12px; margin-top: 7px; font-weight: 600; }

/* ============================================================
   SINGLE ARTICLE
============================================================ */
.article-cat-pill {
  display: inline-block;
  font-family: var(--font-b);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  padding: 4px 11px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.article-headline {
  font-family: var(--font-h);
  font-size: clamp(26px, 6.5vw, 38px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  text-wrap: balance;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-deck {
  font-family: var(--font-b);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 18px;
}
.article-byline {
  font-family: var(--font-b);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--rule-strong);
  margin-bottom: 22px;
}
.article-byline strong { color: var(--ink); font-weight: 700; }

.share-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.share-btn {
  font-family: var(--font-b);
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.share-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }

.article-content {
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.78;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-content p { margin-bottom: 20px; }
.article-content > p:first-of-type::first-letter {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 3.4em;
  float: left;
  line-height: 0.78;
  margin: 6px 10px 0 0;
  color: var(--primary);
}
.article-content h2 {
  font-family: var(--font-h);
  font-size: 23px;
  color: var(--ink);
  margin: 34px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.article-content h3 { font-family: var(--font-h); font-size: 19px; margin: 26px 0 8px; }
.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { color: var(--primary-dk); }
.article-content ul, .article-content ol { padding-left: 22px; margin-bottom: 20px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 7px; }
.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 6px 0 6px 20px;
  margin: 26px 0;
  font-family: var(--font-h);
  font-size: 21px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.35;
  color: var(--ink);
}
.article-content figure { margin: 24px 0; }
.article-content figure img { border-radius: var(--radius); }
.article-content figcaption { font-family: var(--font-b); font-size: 12px; color: var(--muted); margin-top: 8px; }
/* Table — scrollable on mobile */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.article-content table { width: 100%; border-collapse: collapse; font-family: var(--font-b); font-size: 14px; }
.article-content th { background: var(--navy); color: #fff; padding: 10px 13px; text-align: left; font-size: 12.5px; font-weight: 700; }
.article-content td { padding: 10px 13px; border-bottom: 1px solid var(--border-2); }
.article-content tr:nth-child(even) td { background: var(--surface-2); }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
.article-tag {
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.article-tag:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================================
   BREADCRUMB
============================================================ */
.breadcrumb {
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 14px 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: center;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--faint); }

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 32px 0 8px;
}
.pagination a, .pagination span {
  font-family: var(--font-b);
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  margin-top: 48px;
  border-top: 4px solid var(--primary);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 40px 0 30px;
}
.footer-brand .site-title { font-size: 23px; }
.footer-brand p { font-family: var(--font-b); font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.65; margin-top: 10px; max-width: 320px; }

.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.footer-col h4 {
  font-family: var(--font-b);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a { font-family: var(--font-b); font-size: 13px; color: rgba(255,255,255,0.62); transition: color 0.15s; }
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.09);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.footer-bottom p { font-family: var(--font-b); font-size: 12px; color: rgba(255,255,255,0.42); margin: 0; }
.footer-bottom a { color: var(--gold); }

/* ============================================================
   BACK TO TOP (injected by JS)
============================================================ */
.lip-btt { font-family: var(--font-b) !important; }

/* ============================================================
   UTILITY
============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }

/* WordPress core */
.alignleft  { float: left; margin: 0 20px 12px 0; max-width: 50%; }
.alignright { float: right; margin: 0 0 12px 20px; max-width: 50%; }
.aligncenter { display: block; margin: 0 auto 12px; }
.wp-block-image img { border-radius: var(--radius); max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-family: var(--font-b); font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Performance: defer offscreen paint (footer only — safe, large, below fold) */
.site-footer { content-visibility: auto; contain-intrinsic-size: auto 380px; }

/* ============================================================
   TABLET / DESKTOP — min-width: 768px
============================================================ */
@media (min-width: 768px) {

  .top-bar { display: block; }

  .header-inner { height: 70px; }
  .site-title { font-size: 30px; }
  .site-tagline { display: block; }

  /* Search */
  .header-search {
    display: block;
    flex: 1;
    max-width: 320px;
  }
  .header-search form {
    display: flex;
    border: 1.5px solid rgba(255,255,255,0.22);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
  }
  .header-search form:focus-within { border-color: var(--gold); }
  .header-search input {
    flex: 1;
    padding: 9px 13px;
    font-size: 13.5px;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.08);
    color: #fff;
  }
  .header-search input::placeholder { color: rgba(255,255,255,0.5); }
  .header-search button {
    padding: 9px 15px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    transition: background 0.2s;
  }
  .header-search button:hover { background: var(--primary-dk); }

  /* Desktop nav — horizontal */
  .menu-toggle { display: none !important; }
  .nav-toggle  { display: none !important; }
  .nav-wrap { min-height: 0; }
  #primary-menu {
    display: flex !important;
    position: static;
    flex-direction: row !important;
    max-height: none;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    border-top: none;
    left: 0; right: 0;
  }
  #primary-menu > li { border-bottom: none; position: relative; }
  #primary-menu > li > a {
    padding: 13px 15px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
  }
  #primary-menu > li > a:hover { background: rgba(0,0,0,0.16); color: #fff; }
  #primary-menu > li:first-child > a { padding-left: 0; }
  .sub-toggle { display: none; }

  /* Dropdown */
  .sub-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--navy);
    min-width: 210px;
    border-top: 3px solid var(--primary);
    box-shadow: var(--shadow-md);
    z-index: 500;
    flex-direction: column;
  }
  #primary-menu > li:hover > .sub-menu { display: flex !important; }
  .sub-menu li a { padding: 10px 16px; font-size: 12.5px; }

  /* Layout */
  .content-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 32px 0 60px;
  }
  .sidebar { position: sticky; top: 62px; align-self: start; }

  /* Hero */
  .hero-section { min-height: 420px; }
  .hero-inner { padding: 64px 0 56px; max-width: 660px; }
  .hero-cat { font-size: 11px; }
  .hero-title { font-size: 42px; }
  .hero-excerpt { font-size: 16px; -webkit-line-clamp: 3; }

  /* Stats */
  .stats-inner { grid-template-columns: repeat(4, 1fr); }
  .stat-item { border-bottom: none; padding: 14px 20px; }
  .stat-item:nth-child(2) { border-right: 1px solid rgba(255,255,255,0.07); }
  .stat-item:nth-child(4) { border-right: none; }
  .stat-item .sv { font-size: 22px; }

  /* Cards: 2-col ruled grid with vertical divider */
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 28px;
    row-gap: 0;
  }
  .articles-grid > .article-card { padding: 22px 0; }
  .articles-grid > .article-card:nth-child(1),
  .articles-grid > .article-card:nth-child(2) { border-top: none; padding-top: 4px; }
  /* vertical rule between the two columns */
  .articles-grid > .article-card:nth-child(odd) {
    padding-right: 28px;
    border-right: 1px solid var(--border);
    margin-right: -28px;
  }

  /* Featured spans full width, image beside text */
  .article-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 30px;
    align-items: start;
    border-right: none !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
  }
  .article-card.featured .card-thumb { margin-bottom: 0; aspect-ratio: 16 / 10; }
  .article-card.featured .card-title { font-size: 30px; }
  .article-card.featured .card-excerpt { -webkit-line-clamp: 4; }

  /* Cat boxes */
  .cat-boxes { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* Footer */
  .footer-top { grid-template-columns: 1.4fr 2.4fr; gap: 48px; padding: 52px 0 36px; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
  .footer-bottom { flex-direction: row; justify-content: space-between; }

  /* Article */
  .article-content { font-size: 18px; }
  .article-content h2 { font-size: 25px; }
}

/* ============================================================
   WIDE — min-width: 1024px
============================================================ */
@media (min-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(3, 1fr); column-gap: 32px; }
  /* reset 2-col vertical rule rules */
  .articles-grid > .article-card:nth-child(odd) {
    padding-right: 0;
    border-right: none;
    margin-right: 0;
  }
  .articles-grid > .article-card:nth-child(1),
  .articles-grid > .article-card:nth-child(2),
  .articles-grid > .article-card:nth-child(3) { border-top: none; padding-top: 4px; }
  /* vertical rules between 3 columns */
  .articles-grid > .article-card:not(:nth-child(3n+1)):not(.featured) {
    border-left: 1px solid var(--border);
    padding-left: 32px;
    margin-left: -32px;
  }
  .content-wrap { grid-template-columns: 1fr 320px; gap: 48px; }
  .hero-title { font-size: 48px; }
  .article-card.featured .card-title { font-size: 34px; }
}

/* ============================================================
   MOTION / ACCESSIBILITY
============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   PRINT
============================================================ */
@media print {
  .top-bar, .breaking-bar, .site-header, .primary-nav, .cat-strip,
  .sidebar, .site-footer, .share-bar, .stats-bar, .hero-read-btn { display: none !important; }
  .content-wrap { display: block; }
  .article-content { font-size: 12pt; color: #000; }
}
