/* =====================================================
   site.css — Main Stylesheet (Premium Redesign)
   ===================================================== */

/* ── Token Imports ────────────────────────────────── */
@import url('tokens/colors.css');
@import url('tokens/typography.css');
@import url('tokens/spacing.css');

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--color-bg);
  line-height: var(--leading-normal);
  caret-color: var(--brand-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--brand-primary-subtle);
  color: var(--color-text-primary);
}

time {
  font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-link-hover); }

img { display: block; width: 100%; height: auto; }

/* ── Utilities ─────────────────────────────────────── */
.mb-4 { margin-bottom: var(--space-4); }
.ms-1 { margin-left: 4px; }
.ms-3 { margin-left: 12px; }
.me-2 { margin-right: 8px; }
.me-1 { margin-right: 4px; }

/* ── Global site gutter ────────────────────────────── */
/* Matches the container-xl px-3 pattern used across public views
   (keeps category hero/tabs/grid aligned with every other surface). */
.site-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── Keyboard focus (PUB-14) ───────────────────────── */
/* Clear 2px outline; parents that clip (cards, article) drop their own
   overflow:hidden in favour of inner image containers doing the clipping,
   so the outline is never cut off at a rounded-corner boundary. */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Public breadcrumb (PUB-11/26) ──────────────────── */
.site-breadcrumb { margin-bottom: var(--space-4); }
.site-breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.site-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.site-breadcrumb-item a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color .15s;
}
.site-breadcrumb-item a:hover { color: var(--brand-primary); }
.site-breadcrumb-item i { font-size: .6rem; color: var(--color-text-muted); }
.site-breadcrumb-current { color: var(--color-text-muted); }
.site-breadcrumb--on-hero .site-breadcrumb-item a { color: rgba(255,255,255,.85); }
.site-breadcrumb--on-hero .site-breadcrumb-item a:hover { color: #fff; text-decoration: underline; }
.site-breadcrumb--on-hero .site-breadcrumb-item i { color: rgba(255,255,255,.5); }
.site-breadcrumb--on-hero .site-breadcrumb-current { color: rgba(255,255,255,.7); }



/* ── Bootstrap container override ─────────────────── */
/* Use container-xl everywhere instead of site-container */
.container-xl { max-width: var(--container-max); }

/* Prevent Bootstrap card from overriding custom cards */
.news-article, .card--standard, .card--featured, .card--horizontal, .card--compact {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* ─────────────────────────────────────────────────────
   HEADER ROW 1 — Logo + Banner Ad
───────────────────────────────────────────────────── */
.site-header-wrap {
  background: var(--brand-surface);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
/* Logo */
.site-logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.site-logo-img {
  height: 64px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}
.site-logo-img--dark { display: none; }
html[data-theme="dark"] .site-logo-img--light { display: none; }
html[data-theme="dark"] .site-logo-img--dark { display: block; }
@media (max-width: 575.98px) {
  .site-logo-img {
    height: 44px;
    max-width: 50vw;
  }
}
.site-logo-text-wrap { line-height: 1.2; }
.site-logo-name {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: var(--weight-black);
  color: var(--brand-primary);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65vw;
}
.site-logo-tagline {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
  letter-spacing: var(--tracking-wide);
}
/* Header ad */
.site-header-ad {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
}
.site-header-ad .ad-slot { margin: 0 0 0 auto; }
.site-header-ad .ad-slot img { max-height: 90px; width: auto; }

/* ─────────────────────────────────────────────────────
   NAV ROW 2 — Sticky brand-color bar
───────────────────────────────────────────────────── */
.site-nav {
  background: color-mix(in srgb, var(--color-nav-bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(0,0,0,.12);
}
.site-nav .navbar-collapse {
  min-width: 0;
}
/* Category links left */
.site-nav-links {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  gap: 2px;
  scrollbar-width: none;
}
.site-nav-links::-webkit-scrollbar { display: none; }
.site-nav-link {
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  height: 44px;
  color: rgba(255,255,255,.92);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  transition: background .15s, color .15s;
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
  position: relative;
}
.site-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--space-3); right: var(--space-3);
  height: 2px;
  background: #fff;
  transform: scaleX(0);
  transition: transform .2s ease-out;
}
.site-nav-link:hover,
.site-nav-link.active {
  background: rgba(0,0,0,.14);
  color: #fff;
}
.site-nav-link.active::after { transform: scaleX(1); }
.site-nav-link:hover { color: #fff; }

/* Right: pills + hamburger */
.site-nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-3);
  border-left: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
}
.site-nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px var(--space-3);
  background: rgba(255,255,255,.18);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  transition: background .15s;
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
}
.site-nav-pill:hover { background: rgba(255,255,255,.30); color: #fff; }

/* Bootstrap navbar-toggler styling for brand nav */
.site-nav-toggler {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 6px 10px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}
.site-nav-toggler span {
  display: block;
  height: 2px;
  background: rgba(255,255,255,.9);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* Mobile dropdown menu */
@media (max-width: 991.98px) {
  .site-nav .navbar-collapse {
    background: var(--color-nav-bg);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .site-nav .site-nav-links {
    flex-direction: column;
    align-items: flex-start;
    overflow: visible;
  }
  .site-nav-link {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    width: 100%;
    height: 40px;
  }
  .site-nav-right {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.12);
    padding: var(--space-3) 0 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* Mobile search affordance (PUB-4): icon in the nav row expands an
   inline search row below the bar on <lg; desktop keeps topic-bar search. */
.site-mobile-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: var(--space-2);
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}
.site-mobile-search-btn:hover { background: rgba(255,255,255,.14); }

/* Theme toggle (P7): sun/moon — mirrors the mobile-search button so the two
   sit as a matched icon cluster in the brand bar (44px tap target, white on
   brand, subtle border + hover). On lg+ flex `order` moves it to the right
   side of the nav row, after the links collapse (space-between container). */
.site-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-right: var(--space-2);
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.site-theme-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
@media (min-width: 992px) {
  .site-theme-toggle {
    order: 5; /* render after the links collapse → right side of the row */
    margin-right: 0;
    margin-left: var(--space-2);
  }
}
.site-mobile-search {
  background: var(--color-nav-bg);
  border-top: 1px solid rgba(255,255,255,.12);
}
.site-mobile-search .form-control {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.site-mobile-search .form-control::placeholder { color: rgba(255,255,255,.6); }
.site-mobile-search .form-control:focus {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.35);
  color: #fff;
  box-shadow: none;
}
.site-mobile-search .btn {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.site-mobile-search .btn:hover { background: rgba(255,255,255,.28); color: #fff; }


/* ─────────────────────────────────────────────────────
   TOPIC BAR ROW 3 — Compact Topic Chips + Search
───────────────────────────────────────────────────── */
.site-topicbar {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-2) 0;
}
/* Compact horizontal topic chips */
.topicbar-topics {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding: 2px 0;
}
.topicbar-topics::-webkit-scrollbar { display: none; }
.topic-circle-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: border-color .15s, background .15s, color .15s;
}
.topic-circle-item:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-tint);
  color: var(--brand-primary);
}
.topic-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topic-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.topic-avatar-initials,
.topic-avatar--cat span {
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
  color: #fff;
  line-height: 1;
}
.topic-avatar--cat { color: #fff; }
.topic-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.topic-circle-item:hover .topic-label { color: var(--brand-primary); }
/* Search */
.topicbar-search {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 6px var(--space-4);
  background: var(--color-surface-2);
  gap: var(--space-2);
  flex-shrink: 0;
  transition: border-color .2s, box-shadow .2s;
}
.topicbar-search:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-tint);
}
.topicbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  width: 200px;
  color: var(--color-text-primary);
}
.topicbar-search input::placeholder { color: var(--color-text-muted); }
.topicbar-search button {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  transition: color .15s;
}
.topicbar-search button:hover { color: var(--brand-primary); }

/* ─────────────────────────────────────────────────────
   POST-NAV AD ROW 4
───────────────────────────────────────────────────── */
.site-postnav-ad {
  background: var(--color-surface-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.site-postnav-ad .ad-slot { margin: 0 auto; }

/* ─────────────────────────────────────────────────────
   BREAKING NEWS TICKER
───────────────────────────────────────────────────── */
.breaking-bar {
  background: var(--color-breaking-bg);
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: var(--text-sm);
  height: 40px;
}
.breaking-label {
  flex-shrink: 0;
  background: rgba(0,0,0,.25);
  color: #fff;
  padding: 0 var(--space-5);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.breaking-label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}
.breaking-ticker-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
}
.breaking-ticker-wrap::-webkit-scrollbar { display: none; }
.breaking-ticker {
  display: flex;
  gap: var(--space-10);
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}
.breaking-ticker:hover { animation-play-state: paused; }
.breaking-ticker a {
  color: rgba(255,255,255,.92);
  font-weight: var(--weight-medium);
  transition: color .15s;
}
.breaking-ticker a:hover { color: #fff; text-decoration: underline; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Ticker accessibility (PUB-3): duplicate set participates in the flex
   layout but is invisible to AT; pause button + reduced-motion. */
.breaking-ticker-dupe { display: contents; }
.breaking-ticker.is-paused { animation-play-state: paused; }
.breaking-pause-btn {
  flex-shrink: 0;
  width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  font-size: .8rem;
  transition: color .15s, background .15s;
}
.breaking-pause-btn:hover { color: #fff; background: rgba(0,0,0,.2); }
@media (prefers-reduced-motion: reduce) {
  .breaking-ticker { animation-duration: 60s; }
  .breaking-ticker-wrap { overflow: hidden; scrollbar-width: none; }
  .breaking-ticker-dupe { display: contents; }
  .breaking-pause-btn { display: inline-flex; }
}

/* ─────────────────────────────────────────────────────
   SECTION HEADER — Broadsheet Top Rule
───────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  border-top: 2px solid var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  gap: var(--space-3);
}
.section-header::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 56px;
  height: 2px;
  background: var(--brand-primary);
}
.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--brand-primary);
  flex-shrink: 0;
}
.section-more {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  text-decoration: none;
}
.section-more:hover {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* ─────────────────────────────────────────────────────
   TOP STORIES SECTION — Asymmetric Lead + 2-Col Subgrid
───────────────────────────────────────────────────── */
.top-stories-section {
  padding: var(--space-6) 0 var(--space-6);
  background: transparent;
  border-bottom: 2px solid var(--color-text-primary);
  margin-bottom: var(--space-6);
}

/* Main column */
.featured-preview {
  padding: var(--space-5) 0;
  text-decoration: none;
}
.featured-preview:first-child,
.featured-preview--lead {
  padding-top: 0;
}
.featured-preview--bordered {
  border-top: 1px solid var(--color-border);
}
.featured-preview-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.featured-preview-link:hover .featured-preview-title {
  color: var(--brand-primary);
}

/* Category label (sharp editorial indicator) */
.featured-preview-cat { text-align: left; margin-bottom: var(--space-2); }
.featured-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--brand-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: 0;
}
.featured-cat-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--brand-primary);
  display: inline-block;
  flex-shrink: 0;
}

/* Featured Title */
.featured-preview-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-black);
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  text-align: left;
  margin: 0 0 var(--space-2);
  transition: color .18s;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
.featured-preview-title--lg {
  font-size: clamp(1.75rem, 3.4vw, 2.65rem);
  margin-bottom: var(--space-3);
}

/* Meta row */
.featured-preview-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.featured-preview--sub .featured-preview-meta {
  margin-bottom: 0;
}
.featured-meta-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.featured-author-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--color-text-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.featured-author-avatar span {
  color: var(--color-bg);
  font-weight: var(--weight-bold);
  font-size: 10px;
}
.featured-author-name {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
}
.featured-meta-sep { color: var(--color-border-strong); font-size: 1em; }
.featured-meta-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Header image */
.featured-preview-img {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-3);
}
.featured-preview-img--sub {
  margin: 0 0 var(--space-3);
}
.featured-preview-img img {
  width: 100%; height: auto;
  max-height: 460px;
  object-fit: cover;
  display: block;
  transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1);
}
.featured-preview-img--sub img {
  max-height: 220px;
}
.featured-preview-link:hover .featured-preview-img img { transform: scale(1.025); }
/* CLS guard: heroes serve the 1200x630 "og" conversion but keep the stored
   original width/height attributes; pre-reserve the og ratio so the browser
   does not repaint between attr ratio and loaded-image ratio. */
img[data-og] { aspect-ratio: 1200 / 630; }

/* Excerpt */
.featured-preview-excerpt {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  text-align: left;
  line-height: var(--leading-normal);
  max-width: 68ch;
  margin: 0 0 var(--space-3);
}
.featured-preview--sub .featured-preview-excerpt {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

/* 2-Column Sub-Feature Deck below Lead */
.featured-subgrid {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
  padding-top: var(--space-4);
}
.featured-preview--sub {
  padding: 0;
}
@media (min-width: 768px) {
  .featured-subgrid-col + .featured-subgrid-col {
    border-left: 1px solid var(--color-border);
  }
}

/* Sidebar cards (remaining headlines) */
.top-stories-sidebar {
  position: sticky;
  top: 60px;
  background: var(--color-surface);
  border-top: 2px solid var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .top-stories-sidebar { position: static; }
}

/* ─────────────────────────────────────────────────────
   CATEGORY SECTION — Unboxed Editorial Grid
───────────────────────────────────────────────────── */
.category-section {
  margin-bottom: 0;
  height: 100%;
  padding: var(--space-2) 0 var(--space-5);
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
@media (max-width: 640px) {
  .category-section {
    padding: var(--space-2) 0 var(--space-4);
    border-radius: 0;
  }
}
.category-section + .category-section {
  margin-top: var(--space-5);
}

/* Homepage row wrapper (new builder) */
.homepage-row-outer {
  padding-block: var(--space-2);
}
.homepage-row-outer.has-bg {
  border-radius: var(--radius-md);
  margin-block: var(--space-2);
}
.homepage-row-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  padding-inline: var(--space-1);
}

/* ─────────────────────────────────────────────────────
   CARDS — Editorial Hairline Cells
───────────────────────────────────────────────────── */
.card-link {
  display: block;
  color: inherit;
  height: 100%;
}
.card-img-wrap {
  overflow: hidden;
  background: var(--color-surface-3);
  border-radius: var(--radius-sm);
  position: relative;
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-link:hover .card-img-wrap img { transform: scale(1.035); }
.card-img-placeholder {
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-surface-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border-strong);
  font-size: 2rem;
}
.card-img-placeholder::after {
  content: '\f1ea'; /* fa-newspaper */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  opacity: .25;
}

.card-body {
  padding: var(--space-3) 0 var(--space-3);
  min-width: 0;
  overflow: hidden;
}

/* Category labels (sharp editorial marker) */
.cat-badge,
.category-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--brand-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: 0;
  border-radius: 0;
  margin-bottom: var(--space-1);
  border: none;
  line-height: 1.3;
  width: fit-content;
}
.cat-badge::before,
.category-label::before {
  content: '';
  width: 5px;
  height: 5px;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}
.cat-badge[style*="background"],
.category-label[style*="background"] {
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.cat-badge[style*="background"]::before,
.category-label[style*="background"]::before {
  display: none;
}

/* Card titles */
.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: var(--tracking-tight);
  transition: color .15s;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
}
.card-link:hover .card-title { color: var(--brand-primary); }
.card-title--lg   { font-size: var(--text-2xl); }
.card-title--hero { font-size: var(--text-3xl); }
.card-title--sm   { font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.card-title--photo { font-size: var(--text-sm); font-weight: var(--weight-medium); }

.card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-2);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  overflow: hidden;
}
.card-author {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.card-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card wrappers — Flat Hairline Editorial Cells */
.card--standard, .card--featured, .cat-grid > .card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  transition: border-color .2s;
}
.card--photo-story {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  position: relative;
}
.card--standard:hover,
.card--featured:hover,
.cat-grid > .card:hover {
  border-bottom-color: var(--brand-primary);
}
.cat-grid > .card:hover .card-title a,
.cat-grid > .card:hover .card-title {
  color: var(--brand-primary) !important;
}
.cat-grid > .card .card-img-wrap {
  height: 180px;
}
.cat-grid > .card:hover .card-img-wrap img {
  transform: scale(1.035);
}

/* ─────────────────────────────────────────────────────
   CARD — Horizontal (list-style)
───────────────────────────────────────────────────── */
.card--horizontal {
  background: var(--color-surface);
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
  overflow: visible;
  transition: background .15s;
}
.card--horizontal:last-child { border-bottom: none; }
.card--horizontal .card-link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: inherit;
  height: auto;
}
.card--horizontal:hover { background: var(--color-surface-2); }
.card--horizontal:hover .card-title { color: var(--brand-primary); }
.card-hlist-img {
  flex-shrink: 0;
  width: 100px;
  height: 70px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-3);
}
.card-hlist-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.card--horizontal:hover .card-hlist-img img { transform: scale(1.06); }
.card-hlist-body { flex: 1; min-width: 0; }

/* ─────────────────────────────────────────────────────
   CARD — Compact (bullet list)
───────────────────────────────────────────────────── */
.card--compact {
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background .15s;
}
.card-link--compact {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
}
.card-link--compact:hover { background: var(--color-surface-2); }
.card-link--compact:hover .card-title--sm { color: var(--brand-primary); }
.compact-bullet {
  color: var(--brand-primary);
  flex-shrink: 0;
  font-size: 0.5rem;
  margin-top: 5px;
  opacity: .8;
}

/* ─────────────────────────────────────────────────────
   CARD — Photo Strip
───────────────────────────────────────────────────── */
.card--photo-story {
  flex: 0 0 220px;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.card-photo-img { height: 150px; overflow: hidden; position: relative; }
.card-photo-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card--photo-story:hover .card-photo-img img { transform: scale(1.06); }
/* Wrapper keeps overflow:hidden (corner radius + image clipping); pull the
   stretched link's focus outline inside so it is not clipped away. */
.card--photo-story :focus-visible { outline-offset: -2px; }
.card-title--photo {
  padding: var(--space-3);
  display: block;
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────────────────
   LAYOUT VARIATIONS
   V1-V4, V6-V7 grids handled by Bootstrap row/col.
   V5: list-horizontal — keep card container styles.
   V8: photo-strip — keep custom scroll.
───────────────────────────────────────────────────── */

/* V5: list-horizontal card container */
.layout-list-horizontal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}
@media (max-width: 576px) {
  .card-hlist-img { width: 80px; height: 58px; }
}

/* Compact-list wrapper */
.compact-list-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

/* Card image height hints (Bootstrap rows don't set heights) */
.card-img-wrap           { height: 190px; }
/* Hero images: clamp to avoid tall crops on mobile (PUB-21) */
.hero-img                { height: clamp(200px, 36vw, 320px) !important; }
.hero-img-full           { height: clamp(200px, 40vw, 360px) !important; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
/* col-md-8 hero card — taller image */
.col-md-8 .card--featured .card-img-wrap { height: 280px; }
/* col-md-4 side cards — shorter image */
.col-md-4 .card--standard .card-img-wrap,
.col-lg-4 .card--standard .card-img-wrap { height: 110px; }

/* Flex distribution for stretched cards so bottom space never pools empty */
.card--featured.h-100 > .card-link,
.card--standard.h-100 > .card-link,
.card--standard.flex-fill > .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card--featured.h-100 .card-body,
.card--standard.h-100 .card-body,
.card--standard.flex-fill .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card--featured.h-100 .card-meta,
.card--standard.h-100 .card-time,
.card--standard.flex-fill .card-time,
.cat-grid > .card .card-body .card-time {
  margin-top: auto;
  padding-top: var(--space-2);
}
.cat-grid > .card .card-body {
  display: flex;
  flex-direction: column;
}

/* Compact placeholders: prevent walls of empty grey boxes when articles have no image */
.hero-img.card-img-placeholder,
.hero-img-full.card-img-placeholder {
  height: clamp(140px, 22vw, 200px) !important;
}
.col-md-4 .card--standard .card-img-placeholder,
.col-md-3 .card--standard .card-img-placeholder,
.col-lg-4 .card--standard .card-img-placeholder {
  display: none;
}
.cat-grid > .card .card-img-placeholder {
  height: 110px;
}
@media (max-width: 640px) {
  .card-img-placeholder:not(.hero-img):not(.hero-img-full) {
    display: none;
  }
}

/* V8: photo-strip — keep horizontal scroll */
.layout-photo-strip-wrap { position: relative; }
.layout-photo-strip {
  display: flex;
  gap: var(--column-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
}
.layout-photo-strip::-webkit-scrollbar { display: none; }
.strip-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 2;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  width: 44px; height: 64px;
  min-width: 44px;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  transition: background .2s;
}
.strip-arrow:hover { background: rgba(0,0,0,.8); }
.strip-arrow--prev { left: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.strip-arrow--next { right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); }

/* ─────────────────────────────────────────────────────
   MAIN PAGE / SIDEBAR
───────────────────────────────────────────────────── */
.site-main { padding: 0 0 var(--space-5); }
.site-main > .container-xl:first-child,
.site-main > .site-container:first-child {
  padding-top: var(--space-4);
}

/* Sidebar */
.site-sidebar { position: sticky; top: 60px; }
.site-sidebar-section { margin-bottom: var(--space-5); }
.site-sidebar-section:last-child { margin-bottom: 0; }
.site-sidebar-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border);
  position: relative;
  letter-spacing: var(--tracking-tight);
}
.site-sidebar-title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 36px; height: 2px;
  background: var(--brand-primary);
}

/* ── Mid-category ad ─── */
.category-mid-ad {
  margin: var(--space-4) 0;
  text-align: center;
}
.category-mid-ad .ad-slot { margin: 0 auto; }

/* ─────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────── */
.footer-ad-row {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  background: var(--color-surface-2);
}

.site-footer { margin-top: 0; }

/* ── Link columns ─── */
.footer-top {
  background: #1C2333;
  padding: var(--space-12) 0 var(--space-8);
  border-top: 3px solid var(--brand-primary);
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.footer-col-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: #F9FAFB;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-links a {
  font-size: var(--text-sm);
  color: #9CA3AF;
  line-height: 1.5;
  transition: color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-links a::before {
  content: '›';
  font-size: 0.9rem;
  color: var(--brand-primary);
  opacity: 0.7;
  transition: opacity .15s;
}
.footer-links a:hover { color: #F9FAFB; }
.footer-links a:hover::before { opacity: 1; }
.site-footer .text-muted { color: #9CA3AF !important; }

/* App download buttons */
.footer-app-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.footer-app-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.footer-app-btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.25); color: #fff; }
.footer-app-btn i { font-size: 1.4rem; flex-shrink: 0; }
.footer-app-btn span { display: flex; flex-direction: column; line-height: 1.2; }
.footer-app-btn small { font-size: 0.6875rem; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
.footer-app-btn strong { font-size: var(--text-sm); }

/* ── Bottom bar ─── */
.footer-bottom-bar {
  background: #111827;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: var(--space-5) 0;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-5);
}
.footer-logo { flex-shrink: 0; text-decoration: none; }
.footer-logo-img { height: 40px; width: auto; object-fit: contain; opacity: .95; }
.footer-logo-img--invert { filter: brightness(0) invert(1); opacity: .85; }
.footer-logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: #fff;
}
.footer-info-block {
  display: flex;
  flex-direction: column;
  font-size: var(--text-xs);
  color: #6B7280;
  border-left: 1px solid rgba(255,255,255,.08);
  padding-left: var(--space-4);
}
.footer-info-label { color: #9CA3AF; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); margin-bottom: 2px; }
.footer-info-value { font-weight: var(--weight-semibold); color: #D1D5DB; }
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: var(--text-xs);
  color: #6B7280;
  border-left: 1px solid rgba(255,255,255,.08);
  padding-left: var(--space-4);
}
.footer-contact a { color: #6B7280; text-decoration: none; transition: color .15s; }
.footer-contact a:hover { color: #F9FAFB; }
.footer-contact i, .footer-contact .fas { margin-right: 4px; color: var(--brand-primary); }
.footer-social {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.footer-social a {
  color: #6B7280;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: color .2s, background .2s, border-color .2s;
}
.footer-social a:hover { color: #fff; background: var(--brand-primary); border-color: var(--brand-primary); }
.footer-copyright {
  font-size: var(--text-xs);
  color: #9CA3AF;
  white-space: nowrap;
}

/* ── Footer responsive ─── */
@media (max-width: 1024px) {
  .footer-columns { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .footer-columns { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom-inner { gap: var(--space-3); }
  .footer-social { margin-left: 0; }
}

/* ─────────────────────────────────────────────────────
   IMPERSONATION BAR
───────────────────────────────────────────────────── */
.impersonation-bar {
  background: #C0392B;
  color: #fff;
  text-align: center;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  position: sticky; top: 0; z-index: 9999;
}

/* ─────────────────────────────────────────────────────
   RESPONSIVE — Global
───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-sidebar { position: static; }
}
@media (max-width: 768px) {
  .site-header-ad { display: none; }
}
@media (max-width: 480px) {
  :root { --gutter: 16px; }
}

/* ─────────────────────────────────────────────────────
   NEWS DETAIL PAGE — Unboxed Editorial Broadsheet
───────────────────────────────────────────────────── */
.news-article {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  border: none;
}

/* Article inner padding */
.news-cat-wrap,
.news-title,
.news-subtitle,
.news-meta-row,
.news-ad-before,
.news-ad-after {
  padding-left: 0;
  padding-right: 0;
}
.news-body {
  padding-left: 0;
  padding-right: 0;
}

/* Category label */
.news-cat-wrap {
  text-align: left;
  padding-top: var(--space-2);
  margin-bottom: var(--space-3);
}
.news-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--brand-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: 0;
  border-radius: 0;
  text-decoration: none;
  transition: color .15s;
}
.news-cat-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--brand-primary);
  display: inline-block;
  flex-shrink: 0;
}
.news-cat-badge:hover {
  color: var(--brand-primary-dark);
}

/* Title */
.news-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  text-align: left;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

/* Subtitle */
.news-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  text-align: left;
  max-width: 66ch;
  margin: 0 0 var(--space-5);
  line-height: var(--leading-normal);
  font-weight: var(--weight-normal);
}

/* Meta row: two-sided newspaper byline bar */
.news-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  margin-bottom: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.news-meta-primary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.news-meta-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.news-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.news-author-avatar span {
  color: var(--color-bg);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
}
.news-author-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.news-author-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}
.news-meta-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.news-meta-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* A−/A+ reader font-size control (byline) */
.news-font-size-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px;
}
.news-font-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.news-font-btn:hover { background: var(--brand-primary-tint); color: var(--brand-primary); }
.news-font-btn:disabled { opacity: .4; cursor: default; }

.news-tag {
  font-size: var(--text-xs);
  background: var(--brand-primary-tint);
  border: 1px solid var(--brand-primary-subtle);
  border-radius: var(--radius-full);
  padding: 3px var(--space-3);
  color: var(--brand-primary);
  font-weight: var(--weight-semibold);
  transition: background .15s, color .15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.news-tag:hover { background: var(--brand-primary); color: #fff; }

/* Header media — edge-to-edge inside article card */
.news-header-image {
  margin: var(--space-6) 0 0;
}
.news-header-image img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
}
.news-header-video {
  margin: var(--space-6) 0 0;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.news-header-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* Article body */
.news-body {
  font-family: var(--font-body);
  font-size: var(--text-article);
  line-height: var(--leading-article);
  color: var(--color-text-primary);
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
  /* Reading measure cap: text column ≤66ch (element box includes the
     space-8 side padding), and never wider than the article column. */
  max-width: min(var(--article-max), calc(66ch + var(--space-8) * 2));
  margin: 0 auto;
  /* Wide tables/pre/long URLs scroll horizontally instead of clipping */
  overflow-x: auto;
}

/* A−/A+ reader font-size control (html[data-font-size] set by font-size.js).
   .news-body inherits 17px via --text-article; scale it in place.
   Steps land ~16 / 17 / 18.5px (A- kept above the 16px research floor). */
html[data-font-size="1"] .news-body { font-size: calc(var(--text-article) * .94); }
html[data-font-size="3"] .news-body { font-size: calc(var(--text-article) * 1.09); }

/* Reading-progress bar (article page only, rendered by news/show) */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--brand-primary);
  z-index: 1200;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .reading-progress { display: none; }
}

/* Wide tables / code blocks: let the cell content scroll inside its box */
.news-body table,
.news-body pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.news-body table { margin: var(--space-5) 0; border-collapse: collapse; }
.news-body p {
  margin-bottom: 1.4em;
}
.news-body h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: var(--weight-bold);
  margin: 2em 0 .7em;
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}
.news-body h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: var(--weight-bold);
  margin: 1.75em 0 .6em;
  color: var(--color-text-primary);
}
.news-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: var(--space-6) auto;
  box-shadow: var(--shadow-md);
}
.news-body blockquote {
  border-left: 1px solid var(--brand-primary);
  background: var(--brand-primary-tint);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 1.05rem;
}
.news-body ul, .news-body ol {
  padding-left: var(--space-6);
  margin-bottom: 1.4em;
}
.news-body li { margin-bottom: .5em; }
.news-body a { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 2px; }
.news-body a:hover { color: var(--brand-primary-dark); }
.news-body strong { font-weight: var(--weight-bold); color: var(--color-text-primary); }

/* Article ads */
.news-ad-before { margin-bottom: 0; text-align: center; padding-top: var(--space-5); }
.news-ad-after  { margin-top: var(--space-4); text-align: center; padding-bottom: var(--space-5); }

/* Share row */
.news-share-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.news-share-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}
.news-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  color: #fff;
  letter-spacing: var(--tracking-wide);
}
.news-share-btn:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }
.news-share-btn--fb   { background: #1877F2; }
.news-share-btn--tw   { background: #000000; }
.news-share-btn--wa   { background: #25D366; }
.news-share-btn--copy { background: var(--color-surface-3); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.news-share-btn--copy:hover { color: var(--color-text-primary); filter: none; }

/* Related news */
.news-related {
  margin: 0;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
.news-related .section-header { margin-bottom: var(--space-5); }

/* ─────────────────────────────────────────────────────
   NEWS DETAIL RESPONSIVE
───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --text-article: 1.0625rem; }
  .news-title { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .news-header-image img { max-height: 280px; }
  .news-article { border-radius: var(--radius-md); }
  .news-related { border-radius: 0 0 var(--radius-md) var(--radius-md); }
}

/* ─────────────────────────────────────────────────────
   AD SLOTS
───────────────────────────────────────────────────── */
.ad-slot {
  display: block;
  text-align: center;
  line-height: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0 auto;
  max-width: min(100%, var(--ad-max-w, 100%));
}
.ad-slot + .ad-slot {
  margin-top: var(--space-3);
}
.ad-slot a {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}
.ad-slot img {
  display: inline-block !important;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: var(--ad-max-h, none);
  object-fit: contain;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

/* Collapse empty ad/widget wrappers so they never add dead margin/padding */
.news-ad-before:empty,
.news-ad-before:not(:has(*)),
.news-ad-after:empty,
.news-ad-after:not(:has(*)),
.category-mid-ad:empty,
.category-mid-ad:not(:has(*)),
.cat-mid-ad:empty,
.cat-mid-ad:not(:has(*)),
.site-sidebar-section:empty,
.site-sidebar-section:not(:has(*)),
.cat-sidebar-section:empty,
.cat-sidebar-section:not(:has(*)),
.site-postnav-ad:empty,
.site-postnav-ad:not(:has(*)),
.footer-ad-row:empty,
.footer-ad-row:not(:has(*)) {
  display: none !important;
}


/* -------------------------------------------------------------------------
   CATEGORY PAGE
------------------------------------------------------------------------- */

/* -- Hero header ----------------------------------------------------- */
.cat-hero {
  background: linear-gradient(135deg, var(--cat-color, var(--brand-primary)) 0%, color-mix(in srgb, var(--cat-color, var(--brand-primary)) 60%, #000) 100%);
  color: #fff;
  padding: var(--space-6) 0 var(--space-5);
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .cat-hero { padding: var(--space-4) 0; }
}
.cat-hero-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 .5rem;
}
.cat-hero-bar {
  display: inline-block;
  width: 5px;
  height: 1.4em;
  background: rgba(255,255,255,.6);
  border-radius: 3px;
  flex-shrink: 0;
}
.cat-hero-desc {
  opacity: .85;
  font-size: var(--text-sm);
  margin: 0;
  max-width: 60ch;
}

/* -- Sub-cat tabs ---------------------------------------------------- */
.cat-tabs-wrap {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  /* PUB-6: stop below the sticky brand nav (46px row) instead of sliding
     underneath it; z-index stays below the nav (200) but above content. */
  top: 46px;
  z-index: 150;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.cat-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: .7rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.cat-tab:hover { color: var(--brand-primary); }
.cat-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* -- Page grid ------------------------------------------------------- */
.cat-page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.75rem;
  padding: 1.5rem 0;
  align-items: start;
}
@media (max-width: 900px) {
  .cat-page-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem 0; }
  /* PUB-7: main content stays first on mobile — drop order:-1 so ads/other
     categories follow the news, matching the article page behaviour. */
}

/* -- Featured article ------------------------------------------------ */
.cat-featured {
  margin-bottom: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .cat-featured { padding: var(--space-4); }
}
.cat-featured-link {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
}
.cat-featured-link:has(.cat-featured-img) {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 640px) {
  .cat-featured-link,
  .cat-featured-link:has(.cat-featured-img) { grid-template-columns: 1fr; }
}
.cat-featured-img {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.cat-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.cat-featured-link:hover .cat-featured-img img { transform: scale(1.03); }
.cat-featured-body { display: flex; flex-direction: column; justify-content: center; gap: .5rem; }
.cat-featured-title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.cat-featured-link:hover .cat-featured-title { color: var(--brand-primary); }
.cat-featured-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}
.cat-meta { font-size: var(--text-xs); color: var(--color-text-muted); }

/* -- News grid ------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.cat-mid-ad { margin: 1.5rem 0; }

/* -- Empty state ----------------------------------------------------- */
.cat-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}

/* -- Pagination ------------------------------------------------------ */
.cat-pagination { margin-top: 2rem; display: flex; justify-content: center; }

/* -- Load-more (P15) — continuous browsing on the /news index ---------
   Mirrors the .section-more pill language but sized as a real action
   button (44px tap target). Brand tokens adapt in dark mode; the filled
   hover state pins to --brand-primary-base (dark override below). */
.load-more-wrap {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.load-more-wrap[hidden] { display: none; }

.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 2rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  color: var(--brand-primary);
  background: transparent;
  border: 1.5px solid var(--brand-primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background .18s, color .18s;
}
.load-more-btn:hover,
.load-more-btn:focus-visible { background: var(--brand-primary); color: #fff; }
.load-more-btn:active { transform: translateY(1px); }
.load-more-btn[disabled] { opacity: .55; cursor: default; pointer-events: none; }
.load-more-btn[hidden] { display: none; }

.load-more-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.load-more-status[hidden] { display: none; }
.load-more-status .fa-spinner { font-size: .85em; }

/* -- Sidebar --------------------------------------------------------- */
.cat-sidebar {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.cat-sidebar-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin: 0 0 .75rem;
}
.cat-other-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-other-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  transition: background .15s;
}
.cat-other-link:hover { background: var(--bg-muted, #f3f4f6); color: var(--brand-primary); }
.cat-other-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-other-count {
  margin-left: auto;
  font-size: .7rem;
  color: var(--color-text-muted);
  background: var(--bg-muted, #f3f4f6);
  padding: .1em .5em;
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────
   MOST READ SIDEBAR WIDGET
───────────────────────────────────────────────────── */
.most-read-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border);
  position: relative;
  letter-spacing: var(--tracking-tight);
}
.most-read-title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 36px; height: 2px;
  background: var(--brand-primary);
}
.most-read-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.most-read-item { border-bottom: 1px solid var(--color-border); }
.most-read-item:last-child { border-bottom: none; }
.most-read-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  color: inherit;
  text-decoration: none;
}
.most-read-rank {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.most-read-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 54px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-3);
}
.most-read-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.most-read-link:hover .most-read-thumb img { transform: scale(1.06); }
.most-read-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.most-read-headline {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.most-read-link:hover .most-read-headline { color: var(--brand-primary); }
.most-read-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─────────────────────────────────────────────────────
   AUTHORS DIRECTORY
───────────────────────────────────────────────────── */
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}
.author-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.author-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.author-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  color: inherit;
  text-decoration: none;
}
.author-card-avatar { width: 64px; height: 64px; }
.author-card-avatar span { font-size: 1.4rem; }
.author-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  margin: 0;
  transition: color .15s;
}
.author-card-link:hover .author-card-name { color: var(--brand-primary); }
.author-card-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.author-card-latest {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-3);
  color: inherit;
  text-decoration: none;
}
.author-card-latest-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-primary);
}
.author-card-latest-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.author-card-latest:hover .author-card-latest-title { color: var(--brand-primary); }

/* ─────────────────────────────────────────────────────
   VIDEO HUB
───────────────────────────────────────────────────── */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.videos-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.videos-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.videos-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.videos-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface-3);
}
.videos-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.videos-card-link:hover .videos-thumb img { transform: scale(1.05); }
.videos-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding-left: 3px; /* optically centre the play glyph */
  transition: background .15s, transform .15s;
}
.videos-card-link:hover .videos-play-btn {
  background: var(--brand-primary);
  transform: translate(-50%, -50%) scale(1.08);
}
.videos-card-body { padding: var(--space-3) var(--space-4) var(--space-4); }
.videos-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2);
  letter-spacing: var(--tracking-tight);
  transition: color .15s;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.videos-card-link:hover .videos-card-title { color: var(--brand-primary); }
.videos-card-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ─────────────────────────────────────────────────────
   VIDEO BADGE — overlay on news-card thumbnails
───────────────────────────────────────────────────── */
.news-card-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  padding-left: 2px;
  pointer-events: none;  /* keep the card's stretched-link as the click target */
  z-index: 2;
  transition: background .15s;
}
.card:hover .news-card-video-badge { background: var(--brand-primary); }

/* ─────────────────────────────────────────────────────
   DARK PALETTE — targeted overrides
   The neutral + brand token swap lives in tokens/colors.css under
   html[data-theme="dark"]. These rules fix the few components that
   hardcode light colors / Bootstrap utilities.
───────────────────────────────────────────────────── */

/* Bootstrap utilities that hardcode light-mode colours
   (BS 5.3 utilities ship with !important — mirror that). */
[data-theme="dark"] .text-dark  { color: var(--color-text-primary) !important; }
[data-theme="dark"] .text-muted { color: var(--color-text-muted) !important; }

/* Image placeholder (articles without a header image) */
[data-theme="dark"] .card-img-placeholder {
  background: linear-gradient(135deg, #2B2B2B 0%, #242424 100%);
  color: #6B7280;
}

/* Filled brand surfaces keep the *actual* brand colour in dark mode so
   white labels/text stay high-contrast. The palette only lightens the
   --brand-primary used for accent text, borders and tints. */
[data-theme="dark"] .section-more:hover,
[data-theme="dark"] .news-tag:hover,
[data-theme="dark"] .news-comment-submit,
[data-theme="dark"] .most-read-rank,
[data-theme="dark"] .load-more-btn:hover,
[data-theme="dark"] .load-more-btn:focus-visible {
  background: var(--brand-primary-base);
}

/* ─────────────────────────────────────────────────────
   ARTICLE GALLERY + LIGHTBOX (P12)
   Grid of thumbnails after the article body; each thumb
   opens a vanilla-JS lightbox. Tokens flip in dark mode.
───────────────────────────────────────────────────── */
.news-gallery {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
  background: transparent;
}
.news-gallery .section-header { margin-bottom: var(--space-5); }

.news-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.news-gallery-item {
  position: relative;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-3);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.news-gallery-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.news-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
/* Expand cue on hover/focus */
.news-gallery-item::after {
  content: '\f00e'; /* fa-search-plus */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%; left: 50%;
  width: 38px; height: 38px;
  transform: translate(-50%, -50%) scale(.7);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}
.news-gallery-item:hover::after,
.news-gallery-item:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.news-gallery-item:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .news-gallery { padding: var(--space-5) var(--space-4); }
  .news-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* Lightbox — fixed overlay, works in both themes (images are images) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 92vh;
}
.lightbox-figure { margin: 0; }
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  object-fit: contain;
  background: #000;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  font-size: var(--text-sm);
  padding-top: var(--space-3);
  opacity: .9;
}
.lightbox-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .28); transform: scale(1.05); }
.lightbox-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox-close { top: -54px; right: 0; }
.lightbox-prev { left: -68px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: -68px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.05); }
/* LOW-6: the -68px offset only clears the backdrop padding on very wide
   viewports; below lg pull the nav buttons inside the stage so they never
   clip off-screen (the phone layout above is then a no-op for prev/next). */
@media (max-width: 991.98px) {
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
  .lightbox-close { top: -54px; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .news-gallery-item,
  .news-gallery-item::after,
  .lightbox-btn,
  .a2hs-banner { transition: none; }
}

/* ─────────────────────────────────────────────────────
   MOBILE ADD-TO-HOMESCREEN (A2HS) BOTTOM BANNER
───────────────────────────────────────────────────── */
.a2hs-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.75rem 0.875rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-top: 2px solid var(--brand-primary);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.14);
  transform: translateY(105%);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}
.a2hs-banner[hidden] {
  display: none !important;
}
.a2hs-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
@media (min-width: 992px) {
  .a2hs-banner {
    display: none !important;
  }
}
.a2hs-banner-inner {
  max-width: 640px;
  margin-inline: auto;
}
.a2hs-banner-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.a2hs-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
.a2hs-banner-copy {
  flex: 1;
  min-width: 0;
}
.a2hs-banner-title {
  font-size: 0.9rem;
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.a2hs-banner-desc {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.a2hs-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}
.a2hs-btn-install {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  min-height: 38px;
  border: none;
  border-radius: 999px;
  background: var(--brand-primary-base);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: var(--weight-bold);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.a2hs-btn-install:hover,
.a2hs-btn-install:focus-visible {
  background: var(--brand-primary-dark-base);
}
.a2hs-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.a2hs-btn-close:hover,
.a2hs-btn-close:focus-visible {
  background: var(--color-surface-3);
  color: var(--color-text-primary);
}
.a2hs-instructions {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}
.a2hs-instructions[hidden] {
  display: none !important;
}
.a2hs-instructions-step {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.45;
}
.a2hs-instructions-step[hidden] {
  display: none !important;
}
.a2hs-step-icon {
  color: var(--brand-primary);
  margin-top: 2px;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.a2hs-instructions-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.a2hs-btn-got-it {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
html[data-theme="dark"] .a2hs-banner {
  background: var(--color-surface-2);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
}
