/*
Theme Name: Laopedia
Theme URI: https://example.com/laopedia
Author: Laopedia Editorial Systems
Author URI: https://example.com
Description: A premium Lao-first encyclopedia WordPress theme inspired by authoritative academic reference platforms.
Version: 1.4.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: laopedia
Tags: education, encyclopedia, accessibility-ready, custom-menu, custom-logo, featured-images, block-styles, wide-blocks, translation-ready
*/

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
  --lao-navy:      #072B61;
  --lao-blue:      #0D4DA2;
  --lao-blue-mid:  #1A5CB8;
  --lao-gold:      #C8960C;
  --lao-gold-lt:   #F5A623;
  --lao-bg:        #F7F5F0;
  --lao-bg-warm:   #FEFCF8;
  --lao-text:      #1A1A1A;
  --lao-muted:     #5A6472;
  --lao-border:    #D8D4C8;
  --lao-white:     #FFFFFF;
  --lao-soft-blue: #EBF2FF;
  --lao-shadow:    0 2px 12px rgba(7,43,97,.10);
  --lao-shadow-md: 0 6px 24px rgba(7,43,97,.13);
  --lao-measure:   760px;
  --lao-radius:    4px;
  --lao-font:      "Phetsarath OT","Noto Sans Lao","Lao Sangam MN","Lao MN","Saysettha OT","DejaVu Sans","Arial Unicode MS",sans-serif;
  --lao-max:       1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--lao-text);
  background: var(--lao-bg);
  font-family: var(--lao-font);
  font-synthesis: none;
  font-size: 17px;
  line-height: 1.78;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Force Lao font everywhere */
:lang(lo), [lang="lo"], [lang="lo-LA"],
.article-content, .laopedia-search input,
.primary-menu a, button, input, select, textarea {
  font-family: var(--lao-font);
}

/* Dark mode */
body.dark-mode {
  --lao-bg:        #0F1923;
  --lao-bg-warm:   #121E2B;
  --lao-text:      #E8EFF8;
  --lao-muted:     #8FA3BE;
  --lao-border:    #243348;
  --lao-white:     #162235;
  --lao-soft-blue: #112040;
  --lao-shadow:    0 2px 12px rgba(0,0,0,.30);
  --lao-shadow-md: 0 6px 24px rgba(0,0,0,.36);
}

a { color: var(--lao-blue); text-decoration: none; }
a:hover, a:focus { color: var(--lao-navy); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; z-index: 1000; top: 12px; left: 12px;
  width: auto; height: auto; padding: 10px 16px; clip: auto;
  background: var(--lao-gold); color: #111; border-radius: 4px;
}

/* =====================================================
   LAYOUT HELPERS
   ===================================================== */
.wrap {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
}
.reading-progress {
  position: fixed; z-index: 100; top: 0; left: 0;
  height: 3px; width: 0; background: var(--lao-gold);
  transition: width .1s linear;
}

/* =====================================================
   TOP UTILITY BAR
   ===================================================== */
.topbar {
  background: var(--lao-navy);
  color: rgba(255,255,255,.75);
  font-size: 12.5px;
  letter-spacing: .01em;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 5px 0;
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
}
.topbar a { color: rgba(255,255,255,.75); }
.topbar a:hover { color: #fff; text-decoration: none; }
.topbar__right { display: flex; gap: 14px; }

/* =====================================================
   MAIN HEADER
   ===================================================== */
.site-header {
  position: sticky; z-index: 50; top: 0;
  background: var(--lao-white);
  border-bottom: 3px solid var(--lao-navy);
  box-shadow: 0 2px 8px rgba(7,43,97,.08);
}
.dark-mode .site-header { background: #0F1923; }

.header-main {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 6px 0;
}

/* Logo / branding */
.site-branding {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lao-navy);
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.site-branding:hover { text-decoration: none; color: var(--lao-navy); }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  background: var(--lao-navy); color: var(--lao-gold);
  border-radius: 4px; font-weight: 900; font-size: 20px;
  flex-shrink: 0;
}

/* Header search bar */
.header-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.header-search form {
  display: flex;
  border: 2px solid var(--lao-border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--lao-bg-warm);
  transition: border-color .2s;
}
.header-search form:focus-within { border-color: var(--lao-blue); }
.header-search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-family: var(--lao-font);
  font-size: 15px;
  color: var(--lao-text);
  outline: none;
}
.header-search button {
  border: 0;
  background: var(--lao-navy);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-size: 16px;
  transition: background .2s;
}
.header-search button:hover { background: var(--lao-blue); }

/* Header action buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.icon-button, .menu-toggle {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--lao-border);
  border-radius: 4px;
  background: transparent;
  color: var(--lao-navy);
  font-family: var(--lao-font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.icon-button { width: 36px; padding: 0; }
.menu-toggle { display: none; }
.icon-button:hover, .menu-toggle:hover {
  background: var(--lao-soft-blue);
  border-color: var(--lao-blue);
}
.button, .search-submit {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 16px;
  border: 1px solid var(--lao-border); border-radius: 4px;
  background: var(--lao-white); color: var(--lao-navy);
  font-family: var(--lao-font); font-weight: 700;
  font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.button--primary, .search-submit {
  border-color: var(--lao-navy);
  background: var(--lao-navy);
  color: #fff;
}
.button--primary:hover, .search-submit:hover {
  background: var(--lao-blue-mid);
  border-color: var(--lao-blue-mid);
  color: #fff; text-decoration: none;
}
.button:hover { background: var(--lao-soft-blue); border-color: var(--lao-blue); }
.button.is-saved { background: var(--lao-soft-blue); border-color: var(--lao-blue); }

/* =====================================================
   PRIMARY NAV — now a full-width bar below header
   ===================================================== */
.primary-nav-bar {
  background: var(--lao-bg-warm);
  border-bottom: 1px solid var(--lao-border);
}
.primary-nav-bar__inner {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.primary-nav-bar .primary-navigation {
  flex: 1;
}
.primary-menu {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.primary-menu li { position: relative; }
.primary-menu a {
  display: block;
  padding: 11px 14px;
  color: var(--lao-text);
  font-weight: 650;
  font-size: 15px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.primary-menu a:hover, .primary-menu a:focus {
  color: var(--lao-navy);
  background: var(--lao-soft-blue);
  text-decoration: none;
}
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-parent > a {
  color: var(--lao-navy);
  border-bottom: 2px solid var(--lao-gold);
  font-weight: 800;
}

/* =====================================================
   TOPIC / SUBJECT RAIL
   ===================================================== */
.topic-rail {
  background: var(--lao-navy);
}
.topic-rail__inner {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topic-rail__inner::-webkit-scrollbar { display: none; }
.topic-rail a {
  flex: 0 0 auto;
  padding: 9px 14px;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.1);
}
.topic-rail a:hover, .topic-rail a:focus {
  background: var(--lao-blue-mid);
  color: #fff;
}

/* =====================================================
   HERO BANNER (homepage — no search form)
   ===================================================== */
.hero-banner {
  background: linear-gradient(170deg, var(--lao-navy) 0%, #0b3880 100%);
  padding: clamp(44px,7vw,84px) 0 clamp(36px,5.5vw,68px);
  text-align: center;
}
.hero-banner__inner {
  width: min(700px, calc(100% - 32px));
  margin-inline: auto;
}
.hero-banner .eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--lao-gold-lt);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hero-banner h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(32px,5.2vw,64px);
  line-height: 1.14;
  font-weight: 900;
}
.hero-banner .hero-tagline {
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: clamp(15px,2vw,19px);
  line-height: 1.65;
}

/* =====================================================
   FEATURED IMAGE — universal cover fit for all ratios
   ===================================================== */
/* lede main image */
.lede-main__image {
  position: relative;
  height: 340px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--lao-navy), var(--lao-blue-mid));
}
.lede-main__image .lede-thumb,
.lede-main__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* story-card media — uniform cover for any ratio */
.story-card__media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--lao-navy), var(--lao-blue-mid));
}
.story-card__media .card-thumb,
.story-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* give the media containers explicit heights */
.story-card:not(.story-card--mini) .story-card__media { height: 150px; }
.story-card--mini .story-card__media { height: 88px; }

/* mini-thumb inside mini cards */
.story-card--mini .story-card__media .mini-thumb,
.story-card--mini .story-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =====================================================
   FONT AWESOME CATEGORY ICONS
   ===================================================== */
.category-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  background: #1f5dd0;
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
}
.category-card__icon i {
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

/* Topic card FA icon media */
.story-card__media--icon {
  display: grid;
  place-items: center;
  background: var(--lao-navy);
}
.story-card__media--icon i {
  color: rgba(255,255,255,.75);
  font-size: 36px;
}
.story-card--topic:hover .story-card__media--icon { background: var(--lao-blue-mid); }

/* Suggestions */
.suggestions-panel {
  position: absolute; z-index: 60;
  top: calc(100% + 6px); left: 0; right: 0;
  display: none; overflow: hidden;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: 4px;
  box-shadow: var(--lao-shadow-md);
  text-align: left;
}
.suggestions-panel.is-open { display: block; }
.suggestions-panel a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px;
  color: var(--lao-text);
  border-bottom: 1px solid var(--lao-border);
}
.suggestions-panel a:hover { background: var(--lao-soft-blue); text-decoration: none; }
.suggestions-panel span { color: var(--lao-muted); font-size: 13px; }

/* =====================================================
   TRENDING STRIP
   ===================================================== */
.trending-strip {
  background: var(--lao-bg-warm);
  border-bottom: 1px solid var(--lao-border);
}
.trending-strip__inner {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.trending-strip__inner::-webkit-scrollbar { display: none; }
.trending-strip__label {
  color: var(--lao-gold);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.trending-strip a {
  color: var(--lao-muted);
  font-size: 13.5px;
  font-weight: 650;
  padding: 2px 0;
}
.trending-strip a:hover { color: var(--lao-navy); text-decoration: none; }
.trending-strip .sep { color: var(--lao-border); }

/* =====================================================
   HOMEPAGE SECTIONS
   ===================================================== */
.home-section {
  padding: clamp(24px,4vw,48px) 0;
}
.home-section + .home-section {
  border-top: 1px solid var(--lao-border);
}
.home-section--shaded {
  background: var(--lao-bg-warm);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--lao-navy);
}
.section-head h2 {
  margin: 0;
  color: var(--lao-navy);
  font-size: clamp(20px,2.6vw,28px);
  line-height: 1.25;
  font-weight: 900;
}
.section-head .view-all {
  color: var(--lao-blue);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.section-head .view-all:hover { text-decoration: underline; }

.section-kicker {
  margin: 0;
  color: var(--lao-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* =====================================================
   FEATURED LEDE (top two-column)
   ===================================================== */
.lede-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.lede-main {
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  overflow: hidden;
  box-shadow: var(--lao-shadow);
}
.lede-main__image {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--lao-navy), var(--lao-blue-mid));
  min-height: 300px;
  overflow: hidden;
}
.lede-main__image img {
  width: 100%; height: 340px; object-fit: cover;
}
.lede-main__image .placeholder-text {
  color: rgba(255,255,255,.5);
  font-size: 48px; font-weight: 900;
}
.lede-main__body {
  padding: 24px 28px 28px;
}
.lede-main__body .category-tag {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--lao-blue);
  font-size: 13px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
}
.lede-main__body h2 {
  margin: 0 0 10px;
  color: var(--lao-text);
  font-size: clamp(26px,3.2vw,40px);
  line-height: 1.22; font-weight: 900;
}
.lede-main__body h2 a { color: inherit; }
.lede-main__body h2 a:hover { color: var(--lao-blue); text-decoration: none; }
.lede-main__body .lede-desc {
  margin: 0 0 16px;
  color: #374151;
  font-size: 16px; line-height: 1.7;
}
.dark-mode .lede-main__body .lede-desc { color: var(--lao-muted); }
.lede-main__body .read-link {
  font-weight: 800; font-size: 15px;
  color: var(--lao-blue);
}

/* Rail / sidebar */
.lede-rail {
  display: flex; flex-direction: column; gap: 0;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  overflow: hidden;
  box-shadow: var(--lao-shadow);
}
.lede-rail__header {
  padding: 14px 18px;
  background: var(--lao-navy);
  color: #fff;
  font-weight: 900; font-size: 16px;
}
.lede-rail ul { margin: 0; padding: 0; list-style: none; }
.lede-rail li {
  border-bottom: 1px solid var(--lao-border);
}
.lede-rail li a {
  display: block;
  padding: 13px 18px;
  color: var(--lao-text);
  font-size: 15px; font-weight: 650; line-height: 1.4;
  transition: background .15s;
}
.lede-rail li a:hover {
  background: var(--lao-soft-blue);
  color: var(--lao-navy);
  text-decoration: none;
}
.lede-rail li:last-child { border-bottom: 0; }

/* Mini story cards inside lede */
.mini-stories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

/* =====================================================
   STORY CARDS (grid cards)
   ===================================================== */
.card-grid {
  display: grid;
  gap: 16px;
}
.card-grid--2 { grid-template-columns: repeat(2,1fr); }
.card-grid--3 { grid-template-columns: repeat(3,1fr); }
.card-grid--4 { grid-template-columns: repeat(4,1fr); }

.story-card {
  display: flex; flex-direction: column;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  overflow: hidden;
  color: var(--lao-text);
  box-shadow: var(--lao-shadow);
  transition: box-shadow .2s, transform .2s;
}
.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lao-shadow-md);
  text-decoration: none;
  color: var(--lao-text);
}
.story-card__media {
  display: grid; place-items: center;
  height: 148px; overflow: hidden;
  background: linear-gradient(135deg, var(--lao-navy), var(--lao-blue-mid));
  flex-shrink: 0;
}
.story-card__media img { width: 100%; height: 100%; object-fit: cover; }
.story-card__placeholder {
  color: rgba(255,255,255,.45);
  font-size: 18px; font-weight: 800; text-align: center;
  padding: 8px;
}
.story-card__body {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px 18px; flex: 1;
}
.story-card__cat {
  color: var(--lao-blue);
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
.story-card__title {
  color: var(--lao-navy);
  font-size: 16px; font-weight: 800; line-height: 1.35;
}
.story-card__desc {
  color: var(--lao-muted);
  font-size: 13.5px; line-height: 1.5;
}

/* Mini horizontal card */
.story-card--mini {
  display: grid;
  grid-template-columns: 96px 1fr;
  flex-direction: unset;
}
.story-card--mini .story-card__media { height: 80px; }
.story-card--mini .story-card__body { padding: 10px 12px; }

/* =====================================================
   CATEGORY BROWSE GRID (Britannica style icons)
   ===================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
}
.category-card {
  display: block;
  padding: 20px 16px 18px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-top: 3px solid var(--lao-blue);
  border-radius: var(--lao-radius);
  color: var(--lao-text);
  box-shadow: var(--lao-shadow);
  transition: transform .2s, box-shadow .2s, border-top-color .2s;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--lao-shadow-md);
  border-top-color: var(--lao-gold);
  text-decoration: none;
  color: var(--lao-text);
}
.category-card__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 12px;
  background: var(--lao-soft-blue);
  border-radius: 6px;
  font-size: 22px;
  color: var(--lao-navy);
}
.category-card h3 {
  margin: 0 0 6px;
  color: var(--lao-navy);
  font-size: 18px; line-height: 1.3; font-weight: 800;
}
.category-card p {
  margin: 0 0 10px;
  color: var(--lao-muted);
  font-size: 13.5px; line-height: 1.5;
}
.category-card .cat-count {
  color: var(--lao-blue);
  font-size: 13px; font-weight: 700;
}

/* =====================================================
   ENCYCLOPEDIA EXPLORER (3-col subject tree)
   ===================================================== */
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
}
.explorer-group {
  padding: 18px 20px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-left: 3px solid var(--lao-navy);
  border-radius: var(--lao-radius);
}
.explorer-group h3 {
  margin: 0 0 12px;
  color: var(--lao-navy);
  font-size: 16px; font-weight: 900;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lao-border);
}
.explorer-group ul { margin: 0; padding: 0; list-style: none; }
.explorer-group li { padding: 4px 0; }
.explorer-group li a {
  color: var(--lao-blue);
  font-size: 14px; font-weight: 650;
}
.explorer-group li a:hover { color: var(--lao-navy); text-decoration: underline; }

/* =====================================================
   DAILY FEATURE BLOCK
   ===================================================== */
.daily-feature {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  overflow: hidden;
  box-shadow: var(--lao-shadow);
}
.daily-feature__body {
  padding: clamp(24px,4vw,40px);
}
.daily-feature__body h2 {
  margin: 8px 0 12px;
  color: var(--lao-navy);
  font-size: clamp(24px,3vw,36px);
  line-height: 1.22; font-weight: 900;
}
.daily-feature__body p {
  color: var(--lao-muted);
  font-size: 16px; line-height: 1.7;
  margin: 0 0 20px;
}
.daily-feature__aside {
  padding: clamp(24px,4vw,40px);
  background: linear-gradient(180deg,var(--lao-navy) 0%,#0b3880 100%);
  color: #fff;
}
.daily-feature__aside h4 {
  margin: 0 0 16px;
  color: var(--lao-gold-lt);
  font-size: 15px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-year {
  color: var(--lao-gold-lt);
  font-weight: 900; font-size: 15px;
}
.timeline-item span {
  color: rgba(255,255,255,.85);
  font-size: 14px; line-height: 1.5;
}

/* =====================================================
   ARTICLE GRID (archive/search)
   ===================================================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
}
.article-card {
  display: flex; flex-direction: column;
  padding: 20px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  color: var(--lao-text);
  box-shadow: var(--lao-shadow);
  transition: transform .2s, box-shadow .2s;
  min-height: 180px;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lao-shadow-md);
  text-decoration: none; color: var(--lao-text);
}
.article-card__meta {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  color: var(--lao-muted); font-size: 13px;
  margin-bottom: 8px;
}
.article-card h3 {
  margin: 0 0 8px;
  color: var(--lao-navy);
  font-size: 18px; line-height: 1.3; font-weight: 800;
}
.article-card p { margin: 0; color: var(--lao-muted); font-size: 14px; line-height: 1.6; }
.article-card__footer {
  margin-top: auto; padding-top: 14px;
  color: var(--lao-blue); font-weight: 800; font-size: 14px;
}

/* =====================================================
   SINGLE ARTICLE
   ===================================================== */
.content-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 24px auto 64px;
}
.article-layout {
  display: grid;
  grid-template-columns: 210px minmax(0,760px) 260px;
  gap: 22px;
  align-items: start;
}

.article-main {
  min-width: 0;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  overflow: hidden;
}
.article-head {
  padding: clamp(24px,4vw,40px);
  border-bottom: 1px solid var(--lao-border);
  background: linear-gradient(180deg,#f6f9ff,var(--lao-white));
}
.dark-mode .article-head { background: var(--lao-white); }
.article-kicker {
  margin-bottom: 8px;
  color: var(--lao-blue);
  font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
.article-kicker a { color: inherit; }
.article-title {
  margin: 0 0 10px;
  color: var(--lao-text);
  font-size: clamp(30px,4vw,50px);
  line-height: 1.15; font-weight: 900;
}
.article-subtitle {
  margin: 0 0 16px;
  color: var(--lao-muted);
  font-size: 19px; line-height: 1.6;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  color: var(--lao-muted); font-size: 14px;
  margin-bottom: 14px;
}
.article-tools {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* Article body */
.article-body-pad {
  padding: clamp(22px,3.5vw,38px);
}
.article-content {
  font-size: 17px; line-height: 1.88;
  color: var(--lao-text);
}
.article-content p { margin: 0 0 1.4em; }
.article-content h2, .article-content h3, .article-content h4 {
  color: var(--lao-navy); line-height: 1.35;
  scroll-margin-top: 110px;
}
.article-content h2 { margin-top: 2em; font-size: 28px; border-bottom: 1px solid var(--lao-border); padding-bottom: 8px; }
.article-content h3 { margin-top: 1.6em; font-size: 22px; }

.summary-box {
  margin: 0 0 24px;
  padding: 16px 20px;
  background: #f5f8ff;
  border: 1px solid var(--lao-border);
  border-left: 4px solid var(--lao-gold);
  border-radius: var(--lao-radius);
}
.dark-mode .summary-box { background: var(--lao-soft-blue); }
.summary-box h2 { margin: 0 0 6px; color: var(--lao-navy); font-size: 17px; font-weight: 900; }
.summary-box p { margin: 0; font-size: 15px; line-height: 1.7; }

/* TOC panel */
.sticky-panel {
  position: sticky; top: 96px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
}
.toc-panel { padding: 0; overflow: hidden; }
.toc-panel__header {
  padding: 12px 16px;
  background: var(--lao-navy); color: #fff;
  font-weight: 900; font-size: 15px;
}
.toc-list { margin: 0; padding: 8px 12px 12px; list-style: none; }
.toc-list a {
  display: block; padding: 6px 0;
  color: var(--lao-muted);
  font-size: 14px; font-weight: 650;
  border-bottom: 1px solid var(--lao-border);
}
.toc-list li:last-child a { border-bottom: 0; }
.toc-list a:hover { color: var(--lao-navy); text-decoration: none; }

/* Article rail */
.article-rail { padding: 16px; }
.article-rail h3 {
  margin: 0 0 10px;
  color: var(--lao-navy); font-size: 15px; font-weight: 900;
  padding-bottom: 6px; border-bottom: 1px solid var(--lao-border);
}
.article-rail h3 + h3 { margin-top: 20px; }

.fact-list { margin: 0 0 16px; }
.fact-list div { padding: 8px 0; border-bottom: 1px solid var(--lao-border); }
.fact-list div:last-child { border-bottom: 0; }
.fact-list dt { color: var(--lao-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.fact-list dd { margin: 2px 0 0; color: var(--lao-text); font-weight: 750; font-size: 14px; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a {
  padding: 4px 10px;
  color: var(--lao-navy);
  background: var(--lao-soft-blue);
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.tag-list a:hover { background: var(--lao-navy); color: #fff; text-decoration: none; }

/* Breadcrumb */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  color: var(--lao-muted); font-size: 14px;
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--lao-blue); }
.breadcrumb span { color: var(--lao-muted); }

/* References / related */
.references, .related-articles {
  margin-top: 36px; padding-top: 24px;
  border-top: 1px solid var(--lao-border);
}
.references h2, .related-articles h2 {
  margin: 0 0 16px;
  color: var(--lao-navy); font-size: 22px; font-weight: 900;
}

/* =====================================================
   ARCHIVE / CATEGORY PAGE
   ===================================================== */
.archive-hero {
  background: var(--lao-white);
  border-bottom: 1px solid var(--lao-border);
  padding: clamp(24px,4vw,42px) 0;
}
.archive-hero .page-title {
  margin: 4px 0 8px;
  color: var(--lao-navy);
  font-size: clamp(28px,4vw,48px);
  line-height: 1.2; font-weight: 900;
}
.archive-description {
  max-width: 700px;
  color: var(--lao-muted); font-size: 17px;
}
.archive-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding-top: 28px;
}
.filter-panel {
  padding: 18px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: var(--lao-radius);
  position: sticky; top: 96px;
}
.filter-panel h2 {
  margin: 0 0 14px;
  color: var(--lao-navy); font-size: 17px; font-weight: 900;
  border-bottom: 1px solid var(--lao-border); padding-bottom: 10px;
}
.filter-panel .search-field {
  width: 100%; margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--lao-border); border-radius: 4px;
  font-family: var(--lao-font); font-size: 15px;
}
.filter-hint {
  color: var(--lao-muted); font-size: 13px; line-height: 1.6;
}

/* =====================================================
   SEARCH PAGE
   ===================================================== */
.search-hero {
  background: var(--lao-navy);
  padding: clamp(24px,4vw,42px) 0;
}
.search-hero h1 {
  margin: 0; color: #fff;
  font-size: clamp(22px,3vw,36px); font-weight: 900;
}
.search-hero .search-query-label { color: var(--lao-gold-lt); }

/* =====================================================
   A-Z INDEX
   ===================================================== */
.az-index { display: grid; gap: 0; }

.az-section-heading {
  margin: 28px 0 12px;
  color: var(--lao-navy);
  font-size: 19px; font-weight: 900;
  border-bottom: 2px solid var(--lao-navy);
  padding-bottom: 6px;
}

.az-letters {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 14px 16px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-radius: 4px;
  margin-bottom: 8px;
}
.az-letters a {
  display: grid; place-items: center;
  min-width: 36px; height: 36px;
  color: var(--lao-navy);
  background: var(--lao-soft-blue);
  border-radius: 4px;
  font-weight: 800; font-size: 14px;
  transition: background .15s, color .15s;
}
.az-letters a:hover { background: var(--lao-navy); color: #fff; text-decoration: none; }

.az-group {
  padding: 16px 20px;
  background: var(--lao-white);
  border: 1px solid var(--lao-border);
  border-top: 0;
}
.az-group:first-of-type { border-top: 1px solid var(--lao-border); border-radius: 4px 4px 0 0; }
.az-group:last-of-type  { border-radius: 0 0 4px 4px; }

.az-group__letter {
  margin: 0 0 10px;
  color: var(--lao-navy);
  font-size: 22px; font-weight: 900;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--lao-gold);
  display: inline-block;
  min-width: 36px;
}
.az-group__list {
  columns: 3 240px;
  column-gap: 28px;
  margin: 0; padding: 0; list-style: none;
}
.az-group__list li {
  padding: 4px 0;
  break-inside: avoid;
  border-bottom: 1px solid var(--lao-border);
}
.az-group__list li:last-child { border-bottom: 0; }
.az-group__list a { font-size: 14.5px; font-weight: 650; }
.az-group__list a:hover { color: var(--lao-navy); text-decoration: underline; }
.az-group__empty { margin: 0; color: var(--lao-muted); font-size: 13px; font-style: italic; }

@media (max-width: 600px) {
  .az-group__list { columns: 1; }
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--lao-navy);
  color: #c8d8ee;
}
.footer-inner {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.2fr repeat(4,1fr);
  gap: 28px;
  padding: 48px 0 40px;
}
.footer-inner h2, .footer-inner h3 { color: #fff; margin-top: 0; }
.footer-inner h2 { font-size: 22px; margin-bottom: 10px; }
.footer-inner h3 { font-size: 15px; margin-bottom: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--lao-gold-lt); }
.footer-inner p { font-size: 14px; line-height: 1.65; margin: 0; color: #b0c4df; }
.footer-inner ul { margin: 0; padding: 0; list-style: none; }
.footer-inner li { padding: 4px 0; }
.footer-inner a { color: #b0c4df; font-size: 14px; }
.footer-inner a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  background: #041c40;
  padding: 14px 0;
  color: #7a96b8;
  font-size: 13px;
}
.footer-bottom__inner {
  width: min(var(--lao-max), calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination { margin-top: 32px; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links .page-numbers {
  display: grid; place-items: center;
  min-width: 36px; height: 36px; padding: 0 8px;
  border: 1px solid var(--lao-border);
  border-radius: 4px;
  color: var(--lao-navy); font-weight: 700;
}
.nav-links .current { background: var(--lao-navy); color: #fff; border-color: var(--lao-navy); }
.nav-links a:hover { background: var(--lao-soft-blue); text-decoration: none; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1040px) {
  .article-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .archive-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .footer-inner { grid-template-columns: repeat(2,1fr); }
  .lede-grid { grid-template-columns: 1fr; }
  .daily-feature { grid-template-columns: 1fr; }
  .daily-feature__aside { order: -1; }
}
@media (max-width: 860px) {
  .header-main { flex-wrap: wrap; min-height: auto; padding: 8px 0; }
  .header-search { order: 3; flex: 0 0 100%; max-width: 100%; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .primary-nav-bar .primary-navigation { display: none; }
  .primary-nav-bar .primary-navigation.is-open { display: block; }
  .primary-nav-bar .primary-menu { flex-direction: column; }
  .primary-nav-bar .primary-menu a { padding: 10px 12px; border-bottom: 1px solid var(--lao-border); }
  .category-grid { grid-template-columns: repeat(2,1fr); }
  .explorer-grid { grid-template-columns: repeat(2,1fr); }
  .article-grid { grid-template-columns: repeat(2,1fr); }
  .card-grid--4 { grid-template-columns: repeat(2,1fr); }
  .card-grid--3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar { display: none; }
  .category-grid { grid-template-columns: 1fr; }
  .explorer-grid { grid-template-columns: 1fr; }
  .article-grid, .card-grid--3, .card-grid--4, .card-grid--2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .mini-stories { grid-template-columns: 1fr; }
  .story-card--mini { grid-template-columns: 1fr; }
  .hero-searchbox { flex-direction: column; }
  .hero-searchbox button { width: 100%; padding: 14px; }
  .article-main, .article-body-pad { padding: 18px 16px; }
  .article-head { padding: 20px 16px; }
}
