/* ================================================================
   PAGE 19 — STYLESHEET
   Structure:
   1.  Design Tokens (CSS Variables)
   2.  Reset & Base
   3.  Utility Classes
   4.  Typography
   5.  Buttons
   6.  Badges / Labels
   7.  Breaking News Ticker
   8.  Navigation — Top
   9.  Navigation — Admin Bar
   10. Navigation — Section Nav
   11. Navigation — Mobile
   12. Search Overlay
   13. Auth Modal
   14. Toast Notifications
   15. Hero Layout
   16. Article Cards
   17. Placeholder Images
   18. Grid Layouts
   19. Section Headers
   20. Stats Strip
   21. Opinion Section
   22. Page Layout (main + sidebar)
   23. Sidebar Widgets
   24. Article Page
   25. About Page
   26. Admin Dashboard
   27. Footer
   28. Animations
   29. Responsive — Tablet (≤1024px)
   30. Responsive — Mobile (≤768px)
================================================================ */

/* ================================================================
   1. DESIGN TOKENS
================================================================ */
:root {
  /* Brand colours */
  --primary-bg:       #ffffff;
  --secondary-bg:     #f8f8f8;
  --card-bg:          #f0f0f0;
  --accent-primary:   #07a7e5;
  --accent-secondary: #0084c7;
  --text-primary:     #0a0a0a;
  --text-secondary:   #4a4a4a;
  --text-muted:       #888888;
  --border-color:     #e0e0e0;

  /* Category colours */
  --cat-politics: #d63d3d;
  --cat-culture:  #7c4dbd;
  --cat-health:   #1cb886;
  --cat-opinion:  #e07b00;
  --cat-world:    #0084c7;
  --cat-rights:   #07a7e5;
  --cat-work:     #444444;
  --cat-feature:  #b5380f;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Source Sans 3', system-ui, -apple-system, sans-serif;

  /* Layout */
  --max-width: 1280px;
  --gutter:    clamp(16px, 4vw, 40px);
  --gap:       24px;
  --nav-h:     60px;
  --ticker-h:  38px;

  /* Shape */
  --radius:    4px;
  --radius-lg: 8px;
  --radius-xl: 14px;

  /* Effects */
  --shadow:      0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.12);
  --transition:  0.18s ease;
}

/* ================================================================
   2. 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-sans);
  background-color: var(--primary-bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Focus styles — accessible, on-brand */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ================================================================
   3. UTILITY CLASSES
================================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 16px;
}

.fade-in {
  animation: fadeIn 0.3s ease both;
}

/* ================================================================
   4. TYPOGRAPHY — shared text patterns
================================================================ */
.standfirst {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta .author {
  font-weight: 600;
  color: var(--text-secondary);
}

.meta .dot {
  opacity: 0.4;
}

/* ================================================================
   5. BUTTONS
================================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  letter-spacing: 0.02em;
  transition: background var(--transition), transform 0.1s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover  { background: var(--accent-secondary); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: border-color var(--transition), color var(--transition);
  cursor: pointer;
  background: none;
}
.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
  background: none;
  border: none;
  cursor: pointer;
}
.btn-icon:hover {
  background: var(--card-bg);
  color: var(--accent-primary);
}

.btn-block {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}

.btn-success {
  background: var(--cat-health);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-success:hover { background: #16967a; }

.btn-danger {
  background: var(--cat-politics);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-danger:hover { background: #b52e2e; }

.btn-edit {
  background: var(--accent-primary);
  color: #fff;
  padding: 5px 11px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-edit:hover { background: var(--accent-secondary); }

.read-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
}
.read-link:hover { text-decoration: underline; }

/* ================================================================
   6. BADGES / CATEGORY LABELS
================================================================ */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--accent-primary);
  color: #fff;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-politics { background: var(--cat-politics); }
.badge-culture  { background: var(--cat-culture); }
.badge-health   { background: var(--cat-health); }
.badge-opinion  { background: var(--cat-opinion); }
.badge-world    { background: var(--cat-world); }
.badge-rights   { background: var(--cat-rights); }
.badge-work     { background: var(--cat-work); }
.badge-feature  { background: var(--cat-feature); }

/* ================================================================
   7. BREAKING NEWS TICKER
================================================================ */
.ticker-wrap {
  background: var(--accent-primary);
  height: var(--ticker-h);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-label {
  background: var(--accent-secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-track {
  overflow: hidden;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-content {
  display: flex;
  white-space: nowrap;
  animation: ticker 70s linear infinite;
}

.ticker-content span {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 0 32px;
}

.ticker-content span::after {
  content: '·';
  margin-left: 32px;
  opacity: 0.5;
}

.ticker-wrap:hover .ticker-content {
  animation-play-state: paused;
}

/* ================================================================
   8. NAVIGATION — TOP BAR
================================================================ */
.nav-top {
  border-bottom: 1px solid var(--border-color);
  background: var(--primary-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-logo {
  flex-shrink: 0;
  height: 40px;
  display: flex;
  align-items: center;
}
.nav-logo svg {
  height: 34px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 9px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
  background: rgba(7, 167, 229, 0.07);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Auth indicator (logged-in avatar + name) */
.auth-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 20px;
  transition: background var(--transition);
  background: none;
  border: none;
}
.auth-indicator:hover { background: var(--card-bg); }

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* User dropdown menu */
.user-dropdown {
  position: fixed;
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  min-width: 180px;
  overflow: hidden;
}

.user-dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}
.user-dropdown-header .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-dropdown-header .email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  transition: background var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
.user-dropdown-item:hover { background: var(--secondary-bg); }
.user-dropdown-item.admin  { color: var(--accent-primary); font-weight: 600; }
.user-dropdown-item.danger {
  color: var(--cat-politics);
  border-top: 1px solid var(--border-color);
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  background: none;
  border: none;
}
.nav-hamburger:hover { background: var(--card-bg); }

.ham-icon {
  width: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ham-icon span {
  display: block;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: 0.2s;
}

/* ================================================================
   9. ADMIN BAR
================================================================ */
.admin-bar {
  background: var(--text-primary);
  color: #fff;
  padding: 8px 0;
  display: none; /* shown via .visible class when admin */
}
.admin-bar.visible { display: block; }

.admin-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-bar-info span   { font-size: 12px; opacity: 0.7; }
.admin-bar-info strong { font-size: 12px; color: var(--accent-primary); }

.admin-bar-actions { display: flex; gap: 8px; }

.admin-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
  border: none;
}
.admin-btn-blue    { background: var(--accent-primary); color: #fff; }
.admin-btn-blue:hover { background: var(--accent-secondary); }
.admin-btn-outline { border: 1px solid rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.8); background: none; }
.admin-btn-outline:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }

/* ================================================================
   10. SECTION NAV (topic bar)
================================================================ */
.section-nav {
  border-bottom: 1px solid var(--border-color);
  background: var(--secondary-bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }

.section-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  min-width: max-content;
}

.topic-link {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 11px 12px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  display: inline-block;
}
.topic-link:hover  { color: var(--text-primary); border-bottom-color: var(--border-color); }
.topic-link.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

/* ================================================================
   11. MOBILE NAV
================================================================ */
.mob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: none;
  backdrop-filter: blur(2px);
}
.mob-overlay.open { display: block; }

.mob-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--primary-bg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 20px;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}
.mob-panel.open { transform: translateX(0); }

.mob-panel-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}
.mob-panel-head button {
  font-size: 18px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.mob-panel-head button:hover { background: var(--card-bg); }

.mob-link {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  transition: color var(--transition);
}
.mob-link:hover { color: var(--accent-primary); }

/* ================================================================
   12. SEARCH OVERLAY
================================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  z-index: 400;
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }

.search-box {
  width: 100%;
  max-width: 640px;
  padding: 0 20px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-bg);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 24px;
}
.search-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-input-wrap input {
  flex: 1;
  font-size: 18px;
  font-family: inherit;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
}
.search-input-wrap button {
  color: var(--text-muted);
  font-size: 20px;
  transition: color var(--transition);
}
.search-input-wrap button:hover { color: var(--text-primary); }

.search-results { color: #fff; }
.search-results h3 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 12px;
  font-family: var(--font-sans);
  font-weight: 700;
}

.search-result-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: opacity var(--transition);
}
.search-result-item:hover { opacity: 0.8; }
.search-result-item .r-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 4px;
}
.search-result-item .r-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-serif);
  line-height: 1.3;
}

/* ================================================================
   13. AUTH MODAL
================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--primary-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: modalIn 0.2s ease both;
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-header h2 { font-size: 22px; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--card-bg); color: var(--text-primary); }

.modal-body { padding: 20px 24px 28px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--primary-bg);
  transition: border-color var(--transition);
}
.form-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(7, 167, 229, 0.12);
  outline: none;
}

.form-error {
  font-size: 12px;
  color: var(--cat-politics);
  margin-top: 6px;
  display: none;
}
.form-error.visible { display: block; }

.modal-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}
.modal-footer a { color: var(--accent-primary); font-weight: 600; }
.modal-footer a:hover { text-decoration: underline; }

/* ================================================================
   14. TOAST NOTIFICATIONS
================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease both, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: var(--cat-health); }
.toast.error   { background: var(--cat-politics); }
.toast.info    { background: var(--accent-primary); }

/* ================================================================
   15. HERO LAYOUT
================================================================ */
.hero {
  padding: 32px 0 0;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0 var(--gap);
  padding-bottom: 32px;
}

.hero-lead { cursor: pointer; }

.hero-lead-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card-bg);
  border-radius: var(--radius);
  position: relative;
}
.hero-lead-img .badge {
  position: absolute;
  top: 14px;
  left: 14px;
}

.hero-lead h1 {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.15;
  margin: 16px 0 10px;
}
.hero-lead h1 a:hover { color: var(--accent-primary); }

.hero-lead .standfirst {
  max-width: 560px;
  margin-bottom: 14px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ================================================================
   16. ARTICLE CARDS
================================================================ */

/* Standard card */
.card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.card-img {
  overflow: hidden;
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
  position: relative;
}
.card-img-ratio { aspect-ratio: 3 / 2; }
.card-img-wide  { aspect-ratio: 16 / 9; }
.card-img-sq    { aspect-ratio: 1 / 1; }
.card-img-tall  { aspect-ratio: 4 / 3; }

.card-img img,
.card-img .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}
.card:hover .card-img img,
.card:hover .card-img .ph { transform: scale(1.04); }

.card-img .badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.card h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 7px;
  color: var(--text-primary);
}
.card h3 a:hover { color: var(--accent-primary); }

.card-lead {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
  flex: 1;
}

/* Horizontal card — small (sidebar / hero side) */
.card-h {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}
.card-h:last-child { border-bottom: none; padding-bottom: 0; }
.card-h .card-img  { margin-bottom: 0; aspect-ratio: 4 / 3; }
.card-h h3         { font-size: 14px; margin-bottom: 4px; }
.card-h:hover .card-img .ph { transform: scale(1.04); }

/* Horizontal card — large (long reads) */
.card-h-lg {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  cursor: pointer;
}
.card-h-lg:first-child { padding-top: 0; }
.card-h-lg:last-child  { border-bottom: none; }
.card-h-lg .card-img   { margin-bottom: 0; aspect-ratio: 4 / 3; border-radius: var(--radius); }
.card-h-lg h3          { font-size: 20px; margin-bottom: 8px; }
.card-h-lg p           { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 10px; }
.card-h-lg:hover .card-img .ph { opacity: 0.88; }

/* ================================================================
   17. PLACEHOLDER IMAGES
================================================================ */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.ph svg { opacity: 0.2; }

.ph-1 { background: linear-gradient(135deg, #e8f5fd, #c5e8f7); }
.ph-2 { background: linear-gradient(135deg, #f0e8fd, #d9c5f7); }
.ph-3 { background: linear-gradient(135deg, #fde8f0, #f7c5d9); }
.ph-4 { background: linear-gradient(135deg, #e8fdf0, #c5f7d9); }
.ph-5 { background: linear-gradient(135deg, #fdf3e8, #f7dec5); }
.ph-6 { background: linear-gradient(135deg, #f8e8e8, #f4c5c5); }
.ph-7 { background: linear-gradient(135deg, #eaf0fd, #c5d8f7); }
.ph-8 { background: linear-gradient(135deg, #f5fde8, #d9f5b0); }
.ph-9 { background: linear-gradient(135deg, #fdf5e8, #f7e5c5); }

/* ================================================================
   18. GRID LAYOUTS
================================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

/* ================================================================
   19. SECTION HEADERS
================================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 16px;
}
.section-header h2 { font-size: 20px; font-weight: 700; }
.section-header .line { flex: 1; height: 1px; background: var(--border-color); }
.section-header .see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
}
.section-header .see-all:hover { text-decoration: underline; }

/* Page header (category / about) */
.page-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border-color);
}
.page-header-accent {
  width: 48px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
  margin-bottom: 12px;
}
.page-header h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; }
.page-header p  { font-size: 15px; color: var(--text-secondary); max-width: 560px; margin-top: 8px; line-height: 1.6; }
.page-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ================================================================
   20. STATS STRIP
================================================================ */
.stats-strip {
  background: var(--accent-primary);
  color: #fff;
  padding: 28px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  text-align: center;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.3;
  max-width: 120px;
  margin: 0 auto;
}

/* ================================================================
   21. OPINION SECTION
================================================================ */
.opinion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.opinion-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.opinion-card:last-child { border-bottom: none; }

.opinion-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(7, 167, 229, 0.1);
  flex-shrink: 0;
  border: 2px solid var(--border-color);
}

.author-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.author-role { font-size: 11px; color: var(--text-muted); }

.opinion-card blockquote {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  border-left: 3px solid var(--accent-primary);
  padding-left: 12px;
  font-style: italic;
}
.opinion-card blockquote a:hover { color: var(--accent-primary); }

/* ================================================================
   22. PAGE LAYOUT — main content + sidebar
================================================================ */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0 40px;
  padding-bottom: 60px;
}

/* ================================================================
   23. SIDEBAR WIDGETS
================================================================ */
.widget {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}
.widget:last-child { border-bottom: none; }

.widget-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* Newsletter */
.nl-widget {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.nl-widget p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0 14px;
  line-height: 1.5;
}

.nl-form { display: flex; flex-direction: column; gap: 8px; }
.nl-form input[type="email"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--primary-bg);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.nl-form input[type="email"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(7, 167, 229, 0.1);
  outline: none;
}
.nl-form button {
  background: var(--accent-primary);
  color: #fff;
  padding: 9px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.nl-form button:hover { background: var(--accent-secondary); }

/* Trending */
.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}
.trending-item:last-child { border-bottom: none; }

.trending-num {
  font-size: 18px;
  font-family: var(--font-serif);
  font-weight: 900;
  color: var(--accent-primary);
  line-height: 1;
  min-width: 20px;
  opacity: 0.5;
}

.trending-item h4 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.trending-item h4:hover { color: var(--accent-primary); }
.trending-item .t-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.tag:hover {
  background: rgba(7, 167, 229, 0.08);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ================================================================
   24. ARTICLE PAGE
================================================================ */
.article-page { padding: 40px 0 60px; }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0 60px;
}

.article-header { margin-bottom: 28px; }

.article-header h1 {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  margin: 12px 0 16px;
}

.article-header .standfirst {
  font-size: 18px;
  font-style: italic;
  margin-bottom: 18px;
}

.article-header .meta {
  font-size: 13px;
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.article-hero-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 24px 0;
  background: var(--card-bg);
}
.article-hero-img .ph,
.article-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}
.article-content p            { margin-bottom: 24px; }
.article-content h2           { font-size: 24px; font-weight: 700; margin: 32px 0 16px; }
.article-content h3           { font-size: 20px; font-weight: 700; margin: 28px 0 12px; }
.article-content ul           { margin: 0 0 24px 24px; list-style: disc; }
.article-content ul li        { margin-bottom: 8px; color: var(--text-secondary); }
.article-content blockquote {
  border-left: 4px solid var(--accent-primary);
  padding: 12px 20px;
  margin: 28px 0;
  background: var(--secondary-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content blockquote p {
  font-size: 18px;
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Admin controls on article page */
.article-admin-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* ================================================================
   25. ABOUT PAGE
================================================================ */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.team-card {
  text-align: center;
  padding: 24px;
  background: var(--secondary-bg);
  border-radius: var(--radius-lg);
}
.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(7, 167, 229, 0.12);
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
  border: 3px solid rgba(7, 167, 229, 0.2);
}
.team-card h3   { font-size: 16px; font-weight: 700; margin-bottom: 4px; font-family: var(--font-sans); }
.team-card .role { font-size: 13px; color: var(--accent-primary); font-weight: 600; margin-bottom: 8px; }
.team-card p    { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.value-card {
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--accent-primary);
}
.value-card h3 { font-size: 16px; margin-bottom: 8px; font-family: var(--font-sans); font-weight: 700; }
.value-card p  { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ================================================================
   26. ADMIN DASHBOARD
================================================================ */
.admin-page { padding: 40px 0 60px; }
.admin-header { margin-bottom: 32px; }
.admin-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.admin-header p  { font-size: 14px; color: var(--text-secondary); }

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.admin-stat {
  background: var(--secondary-bg);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-color);
}
.admin-stat .n     { font-size: 28px; font-weight: 700; font-family: var(--font-serif); color: var(--text-primary); }
.admin-stat .l     { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-stat .delta { font-size: 11px; font-weight: 600; color: var(--cat-health); margin-top: 4px; }

/* Composer */
.composer {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.composer h2 { font-size: 18px; margin-bottom: 20px; font-family: var(--font-sans); font-weight: 700; }

.field        { margin-bottom: 18px; }
.field label  { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--primary-bg);
  transition: border-color var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(7, 167, 229, 0.1);
  outline: none;
}
.field textarea { resize: vertical; min-height: 200px; line-height: 1.6; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.compose-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.compose-error   { font-size: 13px; color: var(--cat-politics); display: none; margin-bottom: 12px; }

/* Articles table */
.articles-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.articles-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color);
  background: var(--secondary-bg);
}
.articles-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.articles-table tr:last-child td { border-bottom: none; }
.articles-table tr:hover td     { background: var(--secondary-bg); }

.article-title-cell { font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.article-title-cell small { font-weight: 400; color: var(--text-muted); font-size: 12px; display: block; margin-top: 2px; }
.article-title-cell .link { color: var(--accent-primary); cursor: pointer; }
.article-title-cell .link:hover { text-decoration: underline; }

.table-actions { display: flex; gap: 6px; align-items: center; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state h2 { font-size: 24px; margin-bottom: 10px; color: var(--text-secondary); }
.empty-state p  { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }

/* ================================================================
   27. FOOTER
================================================================ */
.footer {
  background: var(--text-primary);
  color: #ccc;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 240px 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.footer-logo { height: 30px; width: auto; margin-bottom: 14px; }

.footer-brand-desc {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 18px;
}

.social-links { display: flex; gap: 8px; }
.social-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.social-link:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
  font-family: var(--font-sans);
}
.footer-col li { margin-bottom: 8px; }
.footer-col a  {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent-primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 12px; color: rgba(255, 255, 255, 0.25); }

.footer-bottom-nav { display: flex; gap: 16px; }
.footer-bottom-nav a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  transition: color var(--transition);
}
.footer-bottom-nav a:hover { color: rgba(255, 255, 255, 0.7); }

/* ================================================================
   28. ANIMATIONS
================================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

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

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes toastOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ================================================================
   29. RESPONSIVE — TABLET (≤1024px)
================================================================ */
@media (max-width: 1024px) {
  .hero-grid        { grid-template-columns: 1fr 260px; }
  .grid-3           { grid-template-columns: 1fr 1fr; }
  .grid-4           { grid-template-columns: 1fr 1fr; }
  .opinion-grid     { grid-template-columns: 1fr 1fr; }
  .page-layout      { grid-template-columns: 1fr 260px; }
  .article-layout   { grid-template-columns: 1fr 260px; }
  .stats-grid       { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-grid      { grid-template-columns: 1fr 1fr; gap: 24px; }
  .team-grid        { grid-template-columns: 1fr 1fr; }
  .admin-stats-row  { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   30. RESPONSIVE — MOBILE (≤768px)
================================================================ */
@media (max-width: 768px) {
  :root { --nav-h: 54px; }

  /* Nav */
  .nav-links { display: none; }
  .nav-actions .btn-primary,
  .nav-actions .btn-outline { display: none; }
  .nav-hamburger { display: flex; }

  /* Layout */
  .hero-grid        { grid-template-columns: 1fr; }
  .hero-side        { display: none; }
  .grid-2,
  .grid-3           { grid-template-columns: 1fr; }
  .grid-4           { grid-template-columns: 1fr 1fr; }
  .opinion-grid     { grid-template-columns: 1fr; }
  .page-layout,
  .article-layout   { grid-template-columns: 1fr; }

  /* Hide sidebar on mobile */
  .sidebar          { display: none; }

  /* Footer */
  .footer-grid      { grid-template-columns: 1fr; }

  /* Stats */
  .stats-grid       { grid-template-columns: 1fr 1fr; }

  /* Long reads */
  .card-h-lg        { grid-template-columns: 110px 1fr; }
  .card-h-lg h3     { font-size: 16px; }

  /* Team */
  .team-grid        { grid-template-columns: 1fr; }

  /* Admin */
  .admin-stats-row  { grid-template-columns: 1fr 1fr; }
  .field-row        { grid-template-columns: 1fr; }

  /* Toast */
  .toast-container  { bottom: 12px; right: 12px; left: 12px; }
  .toast            { max-width: 100%; }
}
