/* ============================================================
   Money Matters Magazine Africa — style.css
   Theme: Navy (#1C2D4F) · White (#FFFFFF) · Gold (#D99C25)
   Mobile-first. No dependencies.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --primary:   #1C2D4F;   /* Deep Navy */
  --primary-2: #2A4373;   /* Lighter Navy (hover) */
  --accent:    #D99C25;   /* Gold */
  --accent-2:  #F5D061;   /* Light Gold (hover / underline) */

  /* Neutrals */
  --ink:       #1A1A1A;   /* Body text */
  --ink-2:     #4A4A4A;   /* Secondary text */
  --ink-3:     #767676;   /* Meta text */
  --line:      #E2E6EE;   /* Borders */
  --bg:        #FFFFFF;   /* Page background */
  --surface:   #FFFFFF;   /* Cards */
  --surface-alt: #F4F6FA; /* Subtle panels */

  /* Semantic */
  --success:   #2F7D4F;
  --warning:   #C98A12;
  --error:     #B23B3B;
  --focus:     #2C7BE5;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Shape */
  --radius: 12px;
  --radius-pill: 999px;
  --shadow: 0 4px 12px rgba(28,45,79,.08);
  --shadow-lg: 0 12px 24px rgba(28,45,79,.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--primary); color: #fff; padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-wrap: balance;
}
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); }
h3 { font-size: 1.125rem; }
.display { font-size: clamp(1.75rem, 1.3rem + 2.5vw, 3rem); font-weight: 700; }
.lede { font-size: 1.0625rem; color: var(--ink-2); line-height: 1.5; }
.meta { font-size: .8125rem; color: var(--ink-3); }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 48em) { .container { padding-inline: 2rem; } }
@media (min-width: 64em) { .container { padding-inline: 3rem; } }

/* ============================================================
   HEADER REDESIGN
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Top Utility Bar */
.header-top {
  background: #15223C; /* Slightly darker navy */
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.75rem;
  color: #A3B1C6;
  height: 36px;
  display: flex;
  align-items: center;
}
.header-top__inner {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
}
.header-top__right {
  display: flex; align-items: center; gap: 1rem;
}
.header-top__right a {
  transition: color 0.2s;
}
.header-top__right a:hover {
  color: var(--accent);
}
.search-icon {
  display: flex;
  align-items: center;
}

/* Main Header */
.header-main {
  border-bottom: 2px solid var(--accent);
  height: 72px;
  display: flex;
  align-items: center;
}
.header-main__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.brand { display: inline-flex; align-items: center; }
.logo-img { height: 44px; width: auto; display: block; }
@media (min-width: 48em) { .logo-img { height: 52px; } }

/* Mobile Search */
.mobile-search {
  display: none;
  color: #fff;
  padding: 0.5rem;
}
@media (min-width: 64em) {
  .mobile-search { display: none; }
}

/* Desktop Navigation */
.nav { display: none; }

@media (min-width: 64em) {
  .nav { display: block; }
  .nav-list {
    display: flex; gap: 1.5rem; list-style: none; padding: 0; margin: 0;
  }
  .nav-item { position: relative; }
  
  .nav-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: none; border: none; cursor: pointer;
    color: #fff; font-size: 0.9375rem; font-weight: 500;
    padding: 0.5rem 0; opacity: 0.9;
    transition: opacity 0.2s, color 0.2s;
  }
  
  .nav-link:hover, 
  .nav-item.is-active .nav-link {
    opacity: 1; 
    color: var(--accent-2);
  }
  
  .nav-caret { transition: transform 0.2s; }
  .nav-item.is-active .nav-caret { transform: rotate(180deg); }

  /* Premium Vertical Dropdown */
  .dropdown {
    position: absolute; top: calc(100% + 15px); right: 0; /* Anchored to the right */
    background: var(--surface);
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    list-style: none;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100;
    border-top: 3px solid var(--accent);
  }
  
  /* Hover bridge so it doesn't disappear when moving mouse down */
  .dropdown::before {
    content: ''; position: absolute; top: -20px; left: 0; right: 0; height: 20px;
  }

  .nav-item:hover .dropdown,
  .nav-item.is-active .dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
  }

  .dropdown a {
    display: block; padding: 0.75rem 1.25rem;
    color: var(--primary); font-size: 0.9375rem; font-weight: 500;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
  }
  
  .dropdown a:hover {
    background: var(--surface-alt); 
    color: var(--accent);
    padding-left: 1.5rem;
  }
}

/* Burger Button */
.burger {
  display: inline-grid; gap: 5px; place-content: center;
  width: 40px; height: 40px;
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; cursor: pointer;
}
.burger span { display: block; width: 20px; height: 2px; background: #fff; transition: 0.2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 64em) {
  .burger { display: none; }
}

/* Mobile Menu */
.mobile-nav {
  position: fixed; inset: 152px 0 0 0; /* Accounts for top bar + main header */
  background: var(--primary); padding: 1.5rem; z-index: 99; overflow-y: auto;
}
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav > ul > li > a {
  display: block; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-display); font-size: 1.25rem; color: #fff;
}
.mobile-group { margin-top: 1.5rem; }
.mobile-group-title {
  display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.5rem;
}
.mobile-group ul a {
  display: block; font-size: 1rem; color: #D1D9E6; padding: 0.5rem 0;
}

@media (min-width: 64em) {
  .mobile-nav { display: none !important; }
}

/* ============================================================
   HERO — Featured + side
   ============================================================ */
.hero { padding-block: 1.5rem; display: grid; gap: 1.5rem; }
.hero__side { display: grid; gap: 1rem; }
@media (min-width: 64em) {
  .hero { grid-template-columns: 2fr 1fr; padding-block: 2.5rem; gap: 2rem; align-items: start; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card__link { display: block; height: 100%; }
.card__media { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-alt); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 1rem; display: grid; gap: .5rem; }
.card--featured .card__body { padding: 1.5rem; }
.card--row .card__body { padding: 1rem; }
.card__title { font-size: 1.125rem; line-height: 1.3; }

/* ============================================================
   TAGS — Gold-tinted pills
   ============================================================ */
.tag {
  display: inline-block; align-self: start;
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #FFF8E5;
  color: #7A5A16;
  border: 1px solid var(--accent-2);
}
.tag--policy   { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag--markets  { background: #F3EAD2; color: #7A5A16; border-color: #F5D061; }
.tag--events   { background: #E9E3F5; color: #4A3585; border-color: #C9BEE6; }
.tag--founders { background: #FBE7E1; color: #8A3A22; border-color: #F1C3B4; }
.tag--business { background: #E3EEF7; color: #1F4E79; border-color: #B9D4EA; }

/* ============================================================
   GRID
   ============================================================ */
.grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 48em) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64em) { .grid { grid-template-columns: repeat(3, 1fr); } }

.section-title { margin-bottom: 1rem; }
.latest, .archive, .events, .search, .article, .event { padding-block: 1.5rem; }

/* ============================================================
   ARTICLE LAYOUT + SIDEBAR
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: 1.5rem;
}
@media (min-width: 64em) {
  .article-layout {
    grid-template-columns: 1fr 20rem;
    align-items: start;
  }
}
.article-sidebar { display: grid; gap: 2rem; }

.article__head { display: grid; gap: .75rem; margin-bottom: 1.5rem; max-width: 45rem; }
.article__hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.article__body { max-width: 45rem; font-size: 1.0625rem; }
.article__body p { margin-bottom: 1rem; }
.article__body h2 { margin-top: 2rem; margin-bottom: .75rem; }
.article__body h3 { margin-top: 1.5rem; margin-bottom: .5rem; }
.article__body a { color: var(--primary-2); text-decoration: underline; }
.article__body a:hover { color: var(--accent); }
.article__body blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary);
}
.article__body img { border-radius: var(--radius); margin-block: 1rem; }

/* Most Read Widget */
.most-read {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.most-read h3 {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent);
}
.most-read ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .75rem;
}
.most-read li a {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  color: var(--ink);
  transition: color .2s;
}
.most-read li a:hover .most-read__title {
  color: var(--primary-2);
  text-decoration: underline;
}
.most-read__rank {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary);
  color: var(--accent);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .875rem;
  line-height: 1;
}
.most-read__title {
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.4;
  padding-top: .15rem;
}

/* Related Stories */
.related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.related .section-title { margin-bottom: 1.5rem; }

/* ============================================================
   SHARE BUTTONS
   ============================================================ */
.article__share {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.article__share-label {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: .75rem;
}
.share-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  min-height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .1s;
}
.share-btn:hover { transform: translateY(-1px); border-color: var(--primary); }
.share-btn:active { transform: translateY(0); }
.share-btn--whatsapp:hover  { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn--x:hover         { background: #000;    color: #fff; border-color: #000; }
.share-btn--linkedin:hover  { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.share-btn--facebook:hover  { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-btn--copy:hover      { background: var(--primary); color: #fff; }
.share-btn.is-copied { background: var(--accent); color: var(--primary); border-color: var(--accent); }

@media (max-width: 30em) {
  .share-btn span { display: none; }
  .share-btn { padding: .6rem; min-width: 44px; justify-content: center; }
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 200;
  pointer-events: none;
}
.reading-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(217, 156, 37, 0.6);
}
@media print { .reading-progress { display: none; } }

/* ============================================================
   SEARCH
   ============================================================ */
.search-form { display: flex; gap: .5rem; margin-bottom: 1rem; max-width: 32rem; }
.search-form input {
  flex: 1; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: #fff;
}
.search-form input:focus { border-color: var(--accent); }

/* ============================================================
   BUTTONS — Navy default, Gold hover
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .65rem 1.25rem;
  background: var(--primary); color: #fff;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: .9375rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .1s;
}
.btn:hover { background: var(--accent); color: var(--primary); border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { background: var(--accent); color: var(--primary); border-color: var(--primary); }
.btn--sm { min-height: 36px; padding: .35rem .9rem; font-size: .8125rem; }
.btn--block { width: 100%; }

/* ============================================================
   EVENTS
   ============================================================ */
.event-list { list-style: none; padding: 0; }
.event-list li { border-bottom: 1px solid var(--line); }
.event-list a {
  display: grid; grid-template-columns: 6rem 1fr;
  gap: 1rem; padding: 1rem 0; align-items: baseline;
}
.event-list a:hover span { color: var(--primary-2); text-decoration: underline; }
.event-list time { font-size: .8125rem; color: var(--ink-3); }
.event__head { display: grid; gap: .75rem; max-width: 45rem; margin-bottom: 1.5rem; }
.event__hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--surface-alt);
}
.event__hero img { width: 100%; height: auto; display: block; }

/* Countdown */
.event-countdown {
  margin: 2rem 0; padding: 1.5rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center; background: var(--surface-alt);
}
.event-countdown > p {
  text-transform: uppercase; letter-spacing: .08em;
  font-size: .75rem; color: var(--accent); font-weight: 600;
}
.countdown-units { display: flex; justify-content: center; gap: 1.5rem; margin-top: .75rem; }
.countdown-units span {
  display: flex; flex-direction: column; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3);
}
.countdown-units strong {
  font-family: var(--font-display); font-size: 2rem;
  color: var(--primary); line-height: 1; margin-bottom: 4px;
}

/* ============================================================
   FOOTER — Premium layout
   ============================================================ */
.site-footer {
  background-color: #1C2D4F;
  color: #A3B1C6;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  border-top: 4px solid #D99C25;
  font-size: 0.9375rem;
}
.footer-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 48em) {
  .footer-top {
    grid-template-columns: 1.5fr 2fr;
    gap: 4rem;
  }
}
.footer-brand .footer-logo {
  height: 56px;
  width: auto;
  margin-bottom: 1.25rem;
  display: block;
}
.footer-tagline {
  line-height: 1.6;
  max-width: 24rem;
  font-size: 0.875rem;
}
.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.footer-col h4 {
  color: #D99C25;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.footer-col a {
  color: #A3B1C6;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}
.footer-col a:hover {
  color: #FFFFFF;
  transform: translateX(2px);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8125rem;
  color: #6B7A94;
}
.footer-legal {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.footer-legal a {
  color: inherit;
  transition: color 0.2s;
}
.footer-legal a:hover { color: #FFFFFF; }

/* Inconspicuous Admin Link */
.admin-link {
  opacity: 0.2;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}
.admin-link:hover {
  opacity: 1;
  color: #D99C25 !important;
}

@media (max-width: 47.99em) {
  .footer-links-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 1rem; }
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-page { padding-block: 2rem; }
.admin-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}
.admin-form { display: grid; gap: 1rem; max-width: 32rem; }
.admin-form--wide { max-width: none; }
.admin-form label {
  display: grid; gap: .35rem;
  font-weight: 500; font-size: .9375rem;
}
.admin-form label small { font-weight: 400; color: var(--ink-3); }
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="datetime-local"],
.admin-form textarea,
.admin-form select {
  width: 100%; min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font: inherit;
}
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus { border-color: var(--accent); outline: none; }
.admin-form textarea { resize: vertical; }
.admin-form button { justify-self: start; }

.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  font-size: .9375rem;
}
.admin-table th, .admin-table td {
  padding: .75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--line);
}
.admin-table th { background: var(--surface-alt); font-weight: 600; color: var(--primary); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-actions { display: flex; gap: .75rem; align-items: center; }
.admin-actions form { display: inline; }
.link-danger {
  background: none; border: none; padding: 0;
  color: var(--error); font: inherit; cursor: pointer; text-decoration: underline;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge--draft {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
}
.badge--featured {
  background-color: var(--surface-alt);
  color: var(--primary);
  border: 1px solid var(--line);
}

/* Alerts */
.alert {
  padding: .75rem 1rem; border-radius: 8px;
  margin-bottom: 1rem; list-style: none;
}
.alert--ok  { background: #E8ECF4; color: var(--primary); border: 1px solid #C9D3E6; }
.alert--err { background: #FBE7E1; color: var(--error); border: 1px solid #F1C3B4; }
.alert--err li + li { margin-top: .25rem; }

/* ============================================================
   MISC
   ============================================================ */
.empty-state,
.search-page__count { color: var(--ink-3); padding-block: 1rem; }

/* Card reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   PAGE LAYOUT HELPERS
   ============================================================ */
.page-wrap { padding-block: 2rem; }
.empty-state { padding: 3rem 0; text-align: center; }

/* ============================================================
   STATIC PAGES (About, Contact, Advertise)
   ============================================================ */

/* Page Hero */
.page-hero {
  background-color: var(--primary);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
  border-bottom: 4px solid var(--accent);
}
.page-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  margin-bottom: 1rem;
}
.page-hero .lede {
  color: #D1D9E6;
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.125rem;
}

/* Two Column Layout */
.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-block: 3rem;
}
@media (min-width: 64em) {
  .split-layout {
    grid-template-columns: 1.5fr 1fr;
    gap: 5rem;
  }
}

/* Content Typography (Prose) */
.prose-content h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
}
.prose-content h2:first-child { margin-top: 0; }
.prose-content p {
  margin-bottom: 1.25rem;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.prose-content ul {
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}
.prose-content li {
  margin-bottom: 0.5rem;
  color: var(--ink-2);
}

/* Sidebar Cards (Sticky) */
.sidebar-card {
  background: var(--surface-alt);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  position: sticky;
  top: 100px; /* Sticks below header */
}
.sidebar-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 1rem;
}
.sidebar-card p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  margin-bottom: 1rem;
}

/* Ad Rate Table */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
.rate-table th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 1rem;
  font-weight: 600;
}
.rate-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.rate-table tr:last-child td { border-bottom: none; }
.rate-table tr:nth-child(even) { background: #F9FAFB; }

/* ============================================================
   404 PAGE
   ============================================================ */
.error-page {
  padding-block: 4rem;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
}

.error-hero {
  margin-bottom: 4rem;
}

.error-code {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  opacity: 0.15;
  margin-bottom: -1.5rem;
  user-select: none;
}

.error-hero h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  margin-bottom: 1rem;
}

.error-hero .lede {
  margin-bottom: 2rem;
  color: var(--ink-2);
}

/* Search Bar */
.error-search {
  display: flex;
  gap: 0.5rem;
  max-width: 32rem;
  margin: 0 auto;
}
.error-search input {
  flex: 1;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 1rem;
}
.error-search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Helpful Links */
.error-links h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 1.5rem;
}

.error-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (min-width: 48em) {
  .error-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.error-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.error-card__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--primary);
  transition: background 0.2s, color 0.2s;
}
.error-card:hover .error-card__icon {
  background: var(--accent);
  color: var(--primary);
}
.error-card__icon svg {
  display: block;
}
.error-card__title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.error-card__desc {
  font-size: 0.75rem;
  color: var(--ink-3);
  text-align: center;
}

/* ============================================================
   TRENDING BAR
   ============================================================ */
.trending-bar {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  height: 44px;
  display: flex;
  align-items: center;
}

.trending-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}

.trending-label {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  z-index: 2; /* Stay above the fading edges */
}

.trending-marquee {
  flex: 1;
  overflow: hidden;
  position: relative;
  /* Fade edges */
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.trending-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: marquee 30s linear infinite;
}

/* Pause on hover */
.trending-track:hover {
  animation-play-state: paused;
}

.trending-track a {
  font-size: 0.875rem;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s;
}

.trending-track a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.trending-cat {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 0.5rem;
  letter-spacing: 0.05em;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Mobile optimization */
@media (max-width: 47.99em) {
  .trending-track {
    animation-duration: 20s; /* Faster scroll on mobile */
  }
  .trending-bar {
    height: 40px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .trending-track {
    animation: none;
    overflow-x: auto;
  }
}

/* Magazine Dropdown Overrides */
.magazine-dropdown {
  min-width: 320px !important; /* Make it wider for the descriptions */
  padding: 0 !important;
}

.mag-link {
  display: flex !important;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem !important;
  border-bottom: 1px solid var(--surface-alt);
  border-radius: 0 !important;
}

.mag-link:hover {
  padding-left: 1.5rem !important; /* Keep the slide effect */
}

.mag-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface-alt);
  color: var(--primary);
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.mag-link:hover .mag-icon {
  background: var(--primary);
  color: var(--accent);
}

.mag-link span:not(.mag-icon) {
  display: flex;
  flex-direction: column;
}

.mag-link strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
}

.mag-link small {
  font-size: 0.75rem;
  color: var(--ink-3);
  margin-top: 0.15rem;
}

/* Coming Soon State */
.mag-coming-soon {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  opacity: 0.6;
  cursor: not-allowed;
}

.mag-coming-soon .mag-icon {
  background: transparent;
  border: 1px dashed var(--line);
}

.mag-coming-soon strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.mag-coming-soon small {
  font-size: 0.75rem;
  color: var(--accent); /* Highlight the "Coming Soon" text */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}