/* ============================================================
   datashanks.com — Design System v3  (Flipboard editorial)
   Light background, magazine grid, fixed-ratio card covers
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@700;800&display=swap');

/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════════════ */
:root {
  /* Palette — light editorial */
  --page-bg:      #f5f5f5;
  --surface:      #ffffff;
  --border:       #e8e8e8;
  --border-light: #f0f0f0;

  /* Text */
  --text-1: #1a1a1a;   /* headlines */
  --text-2: #4a4a4a;   /* body / byline */
  --text-3: #888888;   /* timestamps / muted */

  /* Flipboard accent red */
  --red:     #e12828;
  --red-dim: rgba(225,40,40,0.1);

  /* Category colours — kept in sync with main.js */
  --cat-tech:     #7c3aed;
  --cat-data:     #1d6bf3;
  --cat-ai:       #0891b2;
  --cat-cloud:    #374151;
  --cat-pc:       #047857;
  --cat-ibm:      #c2410c;
  --cat-anime:    #b45309;
  --cat-gta:      #b91c1c;
  --cat-gaming:   #15803d;
  --cat-business: #9333ea;
  --cat-manga:    #b45309;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono','Fira Code','Courier New', monospace;

  /* Layout */
  --max-w:     1260px;
  --hdr-h:     56px;
  --gap:       16px;
  --radius:    6px;

  /* Shadow */
  --card-shadow:       0 1px 4px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 6px 24px rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.06);

  /* Transitions */
  --t: 0.2s ease;
}

/* ══════════════════════════════════════════════════════════
   RESET
   ══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: transparent; }

/* ══════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════ */
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  background: var(--page-bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

/* ══════════════════════════════════════════════════════════
   HEADER — Flipboard style: white, thin red bottom bar
   ══════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--hdr-h);
  background: #fff;
  border-bottom: 2px solid var(--red);
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  /* Must be visible so the dropdown panel can extend below the header */
  overflow: visible;
}

.hdr-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  /* Allow dropdown to overflow below the header */
  overflow: visible;
}

/* ── Logo ─────────────────────────────────────────────────── */
.site-logo {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-1);
  flex-shrink: 0;
  transition: opacity var(--t);
}
.site-logo:hover { opacity: 0.75; }
.logo-red { color: var(--red); }

/* ── Primary nav ──────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  /* overflow must stay visible so absolutely-positioned dropdowns
     are not clipped. Horizontal scroll is handled on .hdr-inner
     instead when the viewport is narrow. */
  overflow: visible;
}

/* Top-level nav item wrapper — positions the dropdown */
.nav-item {
  position: relative;
  flex-shrink: 0;
}

.nav-link {
  display: block;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 4px;
  transition: color var(--t), background var(--t);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.nav-link:hover { color: var(--text-1); background: #f3f3f3; }
.nav-link.is-active {
  color: var(--red);
  font-weight: 600;
}

/* Caret on items that have a dropdown */
.nav-item--has-sub > .nav-link::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0.55;
  transition: transform var(--t);
}
.nav-item--has-sub:hover > .nav-link::after,
.nav-item--has-sub:focus-within > .nav-link::after {
  transform: rotate(180deg);
}

/* ── Dropdown panel ────────────────────────────────────────── */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  /* z-index must beat .site-header (100) and any page elements below it.
     The dropdown is inside .site-header's stacking context, so we need
     a value high enough to clear everything rendered after the header. */
  z-index: 9999;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
  padding: 6px 0;
  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Invisible bridge that fills the gap between the nav button and the
   dropdown top edge. Without this, the 6px gap breaks the :hover chain —
   the mouse leaves .nav-item--has-sub before it reaches the panel and
   the dropdown vanishes mid-travel. The ::before spans full width and
   reaches 8px above the dropdown's own top edge (gap + 2px margin). */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

/* Show on hover or keyboard focus-within. Click-pin (.is-open) removed —
   hover is the single consistent mechanism; focus-within handles keyboard. */
.nav-item--has-sub:hover > .nav-dropdown,
.nav-item--has-sub:focus-within > .nav-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.nav-dropdown__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.nav-dropdown__link:hover {
  background: #f5f5f5;
  color: var(--text-1);
}
.nav-dropdown__link.is-active {
  color: var(--red);
  font-weight: 600;
}

.nav-dropdown__swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-dropdown__divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* ── Header actions ───────────────────────────────────────── */
.hdr-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.hdr-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-2);
  transition: color var(--t), background var(--t);
}
.hdr-search-btn:hover { background: #f3f3f3; color: var(--text-1); }

/* ── Hamburger ────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  gap: 5px;
}
.hline {
  width: 18px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.hamburger.is-open .hline:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .hline:nth-child(2) { opacity: 0; }
.hamburger.is-open .hline:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ───────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--hdr-h) 0 0 0;
  z-index: 99;
  background: #fff;
  padding: 8px 0 24px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform var(--t);
  pointer-events: none;
}
.mobile-nav.is-open {
  transform: translateX(0);
  pointer-events: all;
}

/* Top-level group header in mobile nav */
.mob-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-light);
}
.mob-group-header__caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform var(--t);
}
.mob-group.is-open .mob-group-header__caret { transform: rotate(180deg); }

/* Subcategory links inside a mobile group */
.mob-sub-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.mob-group.is-open .mob-sub-list { max-height: 400px; }

.mob-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px 11px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-light);
  transition: color var(--t);
}
.mob-link:hover, .mob-link.is-active { color: var(--red); }

/* "All" top-level links in mobile that aren't grouped */
.mob-link--top {
  padding-left: 20px;
  font-weight: 600;
  font-size: 0.9375rem;
  background: #fafafa;
}

/* ══════════════════════════════════════════════════════════
   SEARCH OVERLAY
   ══════════════════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.search-overlay.is-open { opacity: 1; pointer-events: all; }

.search-box {
  width: 100%;
  max-width: 600px;
  margin: 0 20px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  transform: translateY(-8px);
  transition: transform var(--t);
}
.search-overlay.is-open .search-box { transform: translateY(0); }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-1);
  background: transparent;
}
.search-input::placeholder { color: var(--text-3); }

.search-close {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
  transition: color var(--t);
}
.search-close:hover { color: var(--text-1); }

.search-results { max-height: 380px; overflow-y: auto; }

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--t);
}
.search-result-item:hover { background: #fafafa; }
.search-result-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-1); }
.search-result-meta  { font-size: 0.8rem; color: var(--text-3); }
.search-no-results   { padding: 20px 18px; font-size: 0.9rem; color: var(--text-3); text-align: center; }

/* ══════════════════════════════════════════════════════════
   PAGE WRAP & LAYOUT
   ══════════════════════════════════════════════════════════ */
.main-content { padding: 24px 0 64px; }

.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ══════════════════════════════════════════════════════════
   TOPIC STRIP (category filter chips)
   ══════════════════════════════════════════════════════════ */
.topic-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.topic-chip:hover { border-color: var(--text-3); color: var(--text-1); }
.topic-chip.is-active { background: var(--text-1); color: #fff; border-color: var(--text-1); }

.chip-swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   SECTION DIVIDER (Flipboard-style topic header)
   ══════════════════════════════════════════════════════════ */
.section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.section-divider__label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-1);
  padding-left: 10px;
  border-left: 3px solid var(--red);
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════════════════
   MAGAZINE GRID — Flipboard tile layout
   ══════════════════════════════════════════════════════════ */
.mag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  align-items: start;   /* cards don't stretch to match neighbours */
}

/* ── Hero card: spans all 4 columns ─────────────────────── */
.mag-card--hero {
  grid-column: 1 / -1;
}

/* ══════════════════════════════════════════════════════════
   CARD BASE
   ══════════════════════════════════════════════════════════ */
.mag-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  /* Each card is self-contained; height determined by content */
}
.mag-card:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow: var(--card-shadow-hover);
}
.mag-card:hover .card-cover-img {
  transform: scale(1.04);
}

/* ── Cover image area ─────────────────────────────────────── */
.card-cover {
  position: relative;
  overflow: hidden;
  /* enforce 16:9 aspect ratio via padding trick */
  padding-top: 56.25%;
  flex-shrink: 0;
}

.card-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

/* SVG cover: same constraint */
.card-cover svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Category pill overlaid on cover */
.card-cover-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border-radius: 3px;
  padding: 3px 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Hero card cover — full-bleed with text on top ───────── */
.mag-card--hero .card-cover {
  padding-top: 42%;  /* wider hero: ~2.4:1 ratio */
}

.hero-cover-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.25) 50%, transparent 100%);
}

.hero-cover-cat {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

.hero-cover-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-cover-meta {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.75);
  display: flex;
  gap: 12px;
}

/* ── Card body ────────────────────────────────────────────── */
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-1);
  margin-bottom: 8px;
}

.card-excerpt {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: 12px;
  /* clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-3);
}

.card-byline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.card-read-time {
  white-space: nowrap;
}

/* ── Read badge ───────────────────────────────────────────── */
.read-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.read-badge--unread { background: #f3f3f3; color: var(--text-3); }
.read-badge--read   { background: #dcfce7; color: #15803d; }

/* ══════════════════════════════════════════════════════════
   NO RESULTS
   ══════════════════════════════════════════════════════════ */
.no-results-msg {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-3);
  font-size: 0.9375rem;
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.7);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 20px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  align-items: flex-start;
}

.footer-brand { flex: 2; min-width: 180px; }
.footer-topics { flex: 1; min-width: 100px; }

.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  display: inline-block;
  margin-bottom: 8px;
}
.footer-logo .logo-red { color: var(--red); }

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 12px;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 12px;
}
.footer-legal-links .footer-link {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.55);
  padding-right: 12px;
  margin-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.15);
  line-height: 1.4;
}
.footer-legal-links .footer-link:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}
.footer-legal-links .footer-link:hover { color: #fff; }

.footer-topics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.footer-col-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

.footer-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  transition: color var(--t);
}
.footer-link:hover { color: #fff; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
}

/* ══════════════════════════════════════════════════════════
   ARTICLE PAGE — (unchanged from previous design)
   ══════════════════════════════════════════════════════════ */
.article-page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-3);
  margin-bottom: 32px;
  transition: color var(--t);
}
.back-link:hover { color: var(--red); }
.back-link svg { width: 14px; height: 14px; flex-shrink: 0; }

.article-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-header .cat-tag { margin-bottom: 16px; }

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-1);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-3);
  margin-bottom: 16px;
}
.article-meta-row .sep { opacity: 0.4; }

.article-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.article-tag {
  font-size: 0.75rem;
  color: var(--text-3);
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
}

.read-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--t);
  margin-top: 16px;
}
.read-toggle-btn:hover { border-color: var(--red); color: var(--red); }
.read-toggle-btn.is-read { background: #dcfce7; border-color: #86efac; color: #15803d; }

.article-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-2);
}
.article-body p { margin-bottom: 1.4em; }
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 2.25em;
  margin-bottom: 0.65em;
  line-height: 1.3;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}
.article-body ul, .article-body ol { padding-left: 1.4em; margin-bottom: 1.4em; }
.article-body li { margin-bottom: 0.4em; }
.article-body ul li::marker { color: var(--red); }
.article-body a { color: var(--red); text-decoration: underline; text-decoration-color: rgba(225,40,40,0.3); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--red); }
.article-body strong { color: var(--text-1); }
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: #f5f5f5;
  color: #c2410c;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.article-body pre {
  background: #f8f8f8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}
.article-body pre code { background: none; border: none; padding: 0; color: #374151; }

.author-commentary {
  border-left: 3px solid var(--red);
  background: #fff9f9;
  padding: 20px 24px;
  margin: 36px 0;
  border-radius: 0 6px 6px 0;
}
.author-commentary__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-bottom: 10px;
}
.author-commentary p { font-size: 0.9375rem; line-height: 1.7; color: var(--text-2); margin-bottom: 0; }
.author-commentary p + p { margin-top: 0.75em; }

.related-articles { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.related-articles h2 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 16px; }
.related-articles ul { display: flex; flex-direction: column; gap: 10px; }
.related-articles a { font-size: 0.9375rem; color: var(--text-2); transition: color var(--t); }
.related-articles a:hover { color: var(--red); }

/* ── Cat tag (article page) ─────────────────────────────── */
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
}
.cat-technology { background: rgba(124,58,237,0.1); color: #7c3aed; }
.cat-data-engineering { background: rgba(29,107,243,0.1); color: #1d6bf3; }
.cat-ai  { background: rgba(8,145,178,0.1);   color: #0891b2; }
.cat-cloud { background: rgba(55,65,81,0.1);   color: #374151; }
.cat-pc  { background: rgba(4,120,87,0.1);    color: #047857; }
.cat-ibm { background: rgba(194,65,12,0.1);   color: #c2410c; }
.cat-anime { background: rgba(180,83,9,0.1);  color: #b45309; }
.cat-gta { background: rgba(185,28,28,0.1);   color: #b91c1c; }
/* New subcategory cat-tags */
.cat-gaming  { background: rgba(21,128,61,0.1);  color: #15803d; }
.cat-business{ background: rgba(147,51,234,0.1); color: #9333ea; }
.cat-data    { background: rgba(29,107,243,0.1);  color: #1d6bf3; }
.cat-local-llm { background: rgba(8,145,178,0.1); color: #0891b2; }

/* 404 page */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; min-height: calc(100vh - var(--hdr-h) - 200px); }
.error-code { font-family: var(--font-display); font-size: clamp(6rem,20vw,10rem); font-weight: 800; line-height: 1; color: var(--red); margin-bottom: 16px; }
.error-title { font-size: 1.5rem; font-weight: 700; color: var(--text-1); margin-bottom: 12px; }
.error-message { font-size: 1rem; color: var(--text-3); margin-bottom: 36px; max-width: 400px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 4px; padding: 10px 20px; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none; transition: all var(--t); white-space: nowrap; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #c71f1f; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════════
   AFFILIATE BLOCK — Amazon Recommended Products
   ══════════════════════════════════════════════════════════ */
.affiliate-block {
  margin: 36px 0;
  padding: 20px 24px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}

.affiliate-block__title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #92400e;
  margin-bottom: 8px;
}

.affiliate-block__intro {
  font-size: 0.9rem;
  color: #78350f;
  margin-bottom: 16px;
}

.affiliate-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.affiliate-card {
  background: #fffdf7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  overflow: hidden;
}

.affiliate-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #fef3c7;
}

.affiliate-card__body {
  padding: 14px;
}

.affiliate-card__price {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 4px 8px;
  margin-bottom: 10px;
}

.affiliate-card__link {
  display: block;
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-color: rgba(29,78,216,0.3);
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color var(--t);
  margin-bottom: 8px;
}

.affiliate-card__link:hover { color: #1e40af; text-decoration-color: #1e40af; }

.affiliate-card__desc {
  font-size: 0.875rem;
  color: var(--text-2);
  margin: 0;
}

.affiliate-block__disclosure {
  font-size: 0.75rem;
  color: #92400e;
  opacity: 0.75;
  margin: 0;
  border-top: 1px solid #fde68a;
  padding-top: 10px;
}

/* ══════════════════════════════════════════════════════════
   NEWSLETTER SIGNUP BLOCK
   ══════════════════════════════════════════════════════════ */
.newsletter-signup-wrap {
  margin: 40px 0 0;
  padding: 0 0 40px;
  border-bottom: 1px solid var(--border);
}

/* On article pages, tuck it between sources and related articles */
.newsletter-signup-wrap--article {
  margin: 32px 0;
  border-bottom: none;
  border-top: 1px solid var(--border);
  padding: 32px 0 0;
}

.newsletter-signup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.newsletter-signup__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.newsletter-signup__text {
  flex: 1;
  min-width: 200px;
}
.newsletter-signup__text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.newsletter-signup__text p {
  font-size: 0.875rem;
  color: var(--text-2);
  margin: 0;
}

.newsletter-signup__form {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.newsletter-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-1);
  background: var(--page-bg);
  outline: none;
  width: 220px;
  transition: border-color var(--t);
}
.newsletter-input:focus { border-color: var(--red); }

.newsletter-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t);
}
.newsletter-btn:hover { background: #c71f1f; }

.newsletter-signup__note {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-3);
  margin: -8px 0 0;
}
.newsletter-signup__note a { color: var(--text-3); text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   SOCIAL SHARE BAR
   ══════════════════════════════════════════════════════════ */

.share-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 32px 0 24px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.share-bar__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.share-bar__btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity var(--t), background var(--t);
  text-decoration: none;
}
.share-btn:hover { opacity: 0.85; }

.share-btn--twitter  { background: #000; color: #fff; }
.share-btn--linkedin { background: #0a66c2; color: #fff; }
.share-btn--copy     { background: var(--page-bg); color: var(--text-2); border-color: var(--border); }
.share-btn--native   { background: var(--page-bg); color: var(--text-2); border-color: var(--border); }

/* ══════════════════════════════════════════════════════════
   AD SLOTS — placeholder styling (invisible until filled)
   ══════════════════════════════════════════════════════════ */

/* Homepage leaderboard — sits between header and filter strip */
.ad-slot-leaderboard {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 20px;
  text-align: center;
  min-height: 90px; /* reserve space for 728×90 unit */
}

/* In-content unit — sits above article body */
.ad-slot-in-content {
  margin: 0 0 28px;
  text-align: center;
  min-height: 90px;
}

/* Below-body rectangle — sits below article body, above newsletter */
.ad-slot-below-body {
  margin: 32px 0;
  text-align: center;
  min-height: 250px; /* reserve space for 300×250 unit */
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* ── ≤ 1100px: 3 columns ─────────────────────────────────── */
@media (max-width: 1100px) {
  .mag-grid { grid-template-columns: repeat(3, 1fr); }
  .mag-card--hero { grid-column: 1 / -1; }
}

/* ── ≤ 840px: tablet 2 columns ──────────────────────────── */
@media (max-width: 840px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: block; }

  .mag-grid { grid-template-columns: repeat(2, 1fr); }
  .mag-card--hero { grid-column: 1 / -1; }
  .mag-card--hero .card-cover { padding-top: 50%; }

  .hero-cover-title { font-size: 1.5rem; }

  .footer-inner { flex-direction: column; gap: 28px; }
}

/* ── ≤ 560px: mobile 1 column ───────────────────────────── */
@media (max-width: 560px) {
  .page-wrap { padding: 0 12px; }
  .mag-grid { grid-template-columns: 1fr; gap: 12px; }
  .mag-card--hero .card-cover { padding-top: 56.25%; }
  .hero-cover-text { padding: 16px 18px; }
  .hero-cover-title { font-size: 1.2rem; }

  .topic-strip { gap: 6px; }
  .topic-chip { font-size: 0.75rem; padding: 4px 11px; }

  .footer-inner { padding: 28px 12px 20px; }
  .footer-bottom { flex-direction: column; gap: 4px; text-align: center; padding: 12px; }

  .article-page-wrap { padding: 28px 14px 60px; }

  /* Newsletter signup — stack vertically on mobile */
  .newsletter-signup { padding: 18px 16px; gap: 14px; }
  .newsletter-signup__form { flex-direction: column; width: 100%; }
  .newsletter-input { width: 100%; }
  .newsletter-btn { width: 100%; }

  /* Share bar — stack on mobile */
  .share-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; }
  .share-bar__btns { gap: 6px; }
}
