/* ==========================================================================
   DO RECORD MEDIA CMS - DESIGN SYSTEM & UI KIT
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&display=swap');

:root {
  /* Brand Color Palette */
  --brand-red: #e50914;
  --brand-red-hover: #b90710;
  --brand-gold: #f59e0b;
  --brand-blue: #2563eb;
  --brand-purple: #7c3aed;
  
  /* Theme Light (Default) */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-sidebar: #0f172a;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-on-dark: #f8fafc;
  
  --border-color: #e2e8f0;
  --border-color-dark: #334155;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Status Colors */
  --status-published-bg: #dcfce7;
  --status-published-text: #15803d;
  --status-pending-bg: #fef9c3;
  --status-pending-text: #a16207;
  --status-draft-bg: #e2e8f0;
  --status-draft-text: #475569;
  --status-rejected-bg: #fee2e2;
  --status-rejected-text: #b91c1c;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Responsive typography scale */
  --font-size-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.82rem);
  --font-size-sm: clamp(0.84rem, 0.8rem + 0.18vw, 0.95rem);
  --font-size-body: clamp(0.98rem, 0.92rem + 0.28vw, 1.12rem);
  --font-size-lg: clamp(1.08rem, 0.98rem + 0.42vw, 1.35rem);
  --font-size-h3: clamp(1.18rem, 1.02rem + 0.7vw, 1.65rem);
  --font-size-h2: clamp(1.4rem, 1.1rem + 1.35vw, 2.25rem);
  --font-size-h1: clamp(1.65rem, 1.2rem + 2.1vw, 3rem);
  --font-size-display: clamp(2rem, 1.4rem + 3.2vw, 4rem);
  --leading-tight: 1.18;
  --leading-heading: 1.25;
  --leading-body: 1.65;
}

/* Dark Mode Class Toggle */
body.dark-mode {
  --bg-primary: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-sidebar: #050811;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  
  --border-color: #1f2937;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

html {
  overflow-x: clip;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-size: var(--font-size-body);
  line-height: var(--leading-body);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: clip;
}

h1, h2, h3, .news-headline {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  line-height: var(--leading-heading);
  overflow-wrap: anywhere;
  color: var(--text-main);
}

.brand-logo-font {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  letter-spacing: -0.5px;
}

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

/* Container & Grids */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Public Nav - Permanently Black Header */
.site-header {
  background-color: #0b0f19 !important;
  border-bottom: 1px solid #1e293b !important;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: padding 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: padding, box-shadow;
}

.top-bar {
  background-color: #0b0f19;
  color: #94a3b8;
  font-size: 0.78rem;
  padding: 0.2rem 0;
  line-height: 1.3;
}

.top-bar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breaking-news-ticker {
  background: linear-gradient(90deg, #b90710 0%, #e50914 100%);
  color: white;
  padding: 0.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
}

.breaking-badge {
  background-color: white;
  color: var(--brand-red);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  margin: 0;
  min-height: 50px;
  transition: padding 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.75rem;
  color: #f8fafc;
  text-decoration: none;
  margin: 0;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background-color: var(--brand-red);
  border-radius: 50%;
  display: inline-block;
}

/* Official DO Record Logo SVG styles - Permanently High-Contrast Light on Black */
.logo-img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.login-logo-img {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto 0.75rem auto;
}

.sidebar-logo-img {
  max-width: 165px;
  max-height: 44px;
  height: auto;
  width: auto;
}

.header-logo-link, .footer-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin: 0;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-logo-link {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  margin: 0;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-logo-link:hover, .footer-logo-link:hover {
  opacity: 0.94;
  transform: scale(1.015);
}

.header-logo-img {
  height: 38px;
  width: auto;
  min-width: 180px;
  max-width: 225px;
  display: block;
  object-fit: contain;
  margin: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left center;
}

.footer-logo-img {
  width: 180px;
  max-width: 200px;
  height: auto;
  max-height: 40px;
  height: auto;
  display: block;
  object-fit: contain;
  margin-bottom: 0.85rem;
  filter: brightness(1.15) contrast(1.1);
}

/* Navigation Links - Light against Black Header */
.nav-links {
  display: flex;
  align-self: center;
  gap: 1.25rem;
  align-items: center;
  height: auto;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
  transition: gap 0.25s cubic-bezier(0.4, 0, 0.2, 1), font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links li,
.nav-links a {
  flex: 0 0 auto;
  align-self: center;
  height: fit-content !important;
  min-height: 0;
}

.site-header .nav-links a {
  color: #cbd5e1 !important;
  transition: padding 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease, background-color 0.15s ease;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  height: auto;
  align-items: center;
  line-height: 1.2;
}

.site-header .nav-links a:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.site-header .nav-links a.active {
  color: var(--brand-red) !important;
  background-color: rgba(229, 9, 20, 0.14) !important;
}

/* Global Search Box - Compatible with Black Header */
.search-box {
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.site-header .search-input {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
  padding: 0.35rem 0.85rem 0.35rem 2.2rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  outline: none;
  height: 34px;
  width: 190px;
  transition: padding 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

.site-header .search-input::placeholder {
  color: #94a3b8 !important;
}

.site-header .search-input:focus {
  width: 250px;
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25) !important;
  background-color: #0f172a !important;
}

.site-header .search-icon {
  position: absolute;
  left: 0.8rem;
  color: #94a3b8 !important;
  pointer-events: none;
  font-size: 0.825rem;
}

/* 3-Line Hamburger Button & Dropdown Menu */
.site-header .hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: var(--radius-md);
  color: #f8fafc !important;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  line-height: 1;
  padding: 0;
}

.site-header .hamburger-btn:hover, .site-header .hamburger-btn:focus-visible {
  background-color: #334155 !important;
  border-color: var(--brand-red) !important;
  color: var(--brand-red) !important;
  outline: none;
}

.site-header .hamburger-btn[aria-expanded="true"] {
  background-color: var(--brand-red) !important;
  border-color: var(--brand-red) !important;
  color: white !important;
}

/* Reader Dropdown Menu Panel */
.reader-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 230px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 0.4rem 0;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.reader-dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover, .dropdown-item:focus-visible {
  background-color: var(--bg-surface-elevated);
  color: var(--brand-red);
  outline: none;
}

body.dark-mode .dropdown-item:hover, body.dark-mode .dropdown-item:focus-visible {
  background-color: #1f2937;
  color: #f8fafc;
}

.dropdown-item-highlight {
  color: var(--brand-red);
  font-weight: 700;
}

.dropdown-item-danger {
  color: #ef4444;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.3rem 0;
}

.mobile-only-nav-item {
  display: none;
}

/* Dark Mode Switch Indicator */
.dropdown-theme-btn {
  width: 100%;
}

.theme-switch-indicator {
  position: relative;
  width: 34px;
  height: 18px;
  background-color: #cbd5e1;
  border-radius: 9999px;
  transition: background-color 0.25s ease;
  display: inline-block;
  vertical-align: middle;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.dark-mode .theme-switch-indicator {
  background-color: var(--brand-red);
}

body.dark-mode .theme-switch-thumb {
  transform: translateX(16px);
}

/* Compact Sticky Header State on Scroll Down - Stays Permanently Black */
.site-header.is-compact {
  background-color: #080c14 !important;
  border-bottom: 1px solid #1e293b !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
}

body.dark-mode .site-header.is-compact {
  background-color: #080c14 !important;
  border-bottom: 1px solid #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

.site-header.is-compact .nav-main {
  padding: 0.18rem 0;
  min-height: 42px;
}

.site-header.is-compact .header-logo-link {
  height: 28px;
}

.site-header.is-compact .header-logo-img {
  height: 28px;
  width: auto;
  min-width: 140px;
  max-width: 170px;
}

.site-header.is-compact .nav-links {
  gap: 0.85rem;
  font-size: 0.84rem;
}

.site-header.is-compact .nav-links a {
  padding: 0.2rem 0.4rem;
}

.site-header.is-compact .search-input {
  padding: 0.25rem 0.75rem 0.25rem 2rem;
  font-size: 0.8rem;
  width: 155px;
  height: 30px;
}

.site-header.is-compact .search-input:focus {
  width: 200px;
}

/* Tablet Breakpoint (768px - 992px) */
@media (max-width: 992px) {
  .header-logo-link {
    height: 32px;
  }
  .header-logo-img {
    height: 32px;
    width: auto;
    min-width: 160px;
    max-width: 200px;
  }
  .site-header.is-compact .header-logo-link {
    height: 26px;
  }
  .site-header.is-compact .header-logo-img {
    height: 26px;
    width: auto;
    min-width: 135px;
    max-width: 160px;
  }
  .login-logo-img {
    max-width: 200px;
  }
}

/* Mobile Breakpoint (< 768px) */
@media (max-width: 768px) {
  .header-logo-link {
    height: 28px;
  }
  .header-logo-img {
    height: 28px;
    width: auto;
    min-width: 140px;
    max-width: 180px;
  }
  .site-header .nav-main {
    min-height: 46px;
    padding: 0.3rem 0;
  }
  .site-header.is-compact .nav-main {
    min-height: 40px;
    padding: 0.15rem 0;
  }
  .site-header.is-compact .header-logo-link {
    height: 24px;
  }
  .site-header.is-compact .header-logo-img {
    height: 24px;
    width: auto;
    min-width: 125px;
    max-width: 150px;
  }
  .login-logo-img {
    max-width: 180px;
  }
  .sidebar-logo-img {
    max-width: 140px;
  }
  .footer-logo-img {
    width: 150px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .nav-main,
  .header-logo-img,
  .header-logo-link,
  .nav-links,
  .nav-links a,
  .search-input {
    transition: none !important;
  }
}

/* UI Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-red);
  color: white;
}
.btn-primary:hover {
  background-color: var(--brand-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-dark {
  background-color: #0f172a;
  color: white;
}
.btn-dark:hover {
  background-color: #1e293b;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.btn-success {
  background-color: #16a34a;
  color: white;
}
.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-cat {
  background-color: rgba(229, 9, 20, 0.1);
  color: var(--brand-red);
}

.badge-status-published {
  background-color: var(--status-published-bg);
  color: var(--status-published-text);
}

.badge-status-pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.badge-status-draft {
  background-color: var(--status-draft-bg);
  color: var(--status-draft-text);
}

.badge-status-rejected {
  background-color: var(--status-rejected-bg);
  color: var(--status-rejected-text);
}

/* Cards & Layout */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #0f172a;
}

.article-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-card-img {
  transform: scale(1.05);
}

.article-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-card-title {
  font-size: 1.2rem;
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.author-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* Hero Section */
.hero-news-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin: 1.25rem 0 2rem 0;
}

.hero-featured-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 480px;
  background-color: #0b0f19;
  box-shadow: var(--shadow-lg);
}

.hero-featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: transform 0.5s ease;
}

.hero-featured-card:hover .hero-featured-img {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 2rem 2rem 2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(11, 15, 25, 0.95) 80%);
  color: white;
}

.hero-overlay .badge {
  margin-bottom: 0.75rem;
}

.hero-overlay h1 {
  color: white;
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-overlay p {
  color: #cbd5e1;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Admin & Writer Dashboard Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition-normal);
  z-index: 1100;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-label {
  padding: 0.75rem 1rem 0.35rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  color: #cbd5e1;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  margin-bottom: 0.2rem;
}

.sidebar-link:hover, .sidebar-link.active {
  background-color: #1e293b;
  color: white;
}

.sidebar-link.active {
  border-left: 3px solid var(--brand-red);
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  min-width: 0;
}

.top-nav-admin {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tr:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

body.dark-mode .table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 550px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--bg-surface-elevated);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.mobile-menu-btn {
  display: none;
  padding: 0.35rem 0.65rem;
}

@media (max-width: 992px) {
  .hero-news-grid {
    grid-template-columns: 1fr;
  }
  .hero-featured-card {
    height: 380px;
  }
  .sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    bottom: 0;
  }
  .sidebar.open {
    left: 0;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
  }
  .nav-links.show-mobile {
    display: flex;
  }
}

@media (max-width: 640px) {
  .search-input {
    width: 130px;
  }
  .search-input:focus {
    width: 170px;
  }
}

/* Footer Social Media Icon Buttons */
.footer-social-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.social-icon-link {
  width: 40px;
  height: 40px;
  background-color: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

.social-icon-link:hover, .social-icon-link:focus-visible {
  transform: translateY(-3px) scale(1.08);
  outline: none;
}

.social-youtube:hover, .social-youtube:focus-visible {
  background-color: #ff0000;
  color: #ffffff;
  border-color: #ff0000;
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.4);
}

.social-instagram:hover, .social-instagram:focus-visible {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.4);
}

.social-linkedin:hover, .social-linkedin:focus-visible {
  background-color: #0a66c2;
  color: #ffffff;
  border-color: #0a66c2;
  box-shadow: 0 4px 14px rgba(10, 102, 194, 0.4);
}

.social-twitter:hover, .social-twitter:focus-visible {
  background-color: #1da1f2;
  color: #ffffff;
  border-color: #1da1f2;
  box-shadow: 0 4px 14px rgba(29, 161, 242, 0.4);
}

body.dark-mode .social-icon-link {
  background-color: #111827;
  color: #9ca3af;
  border-color: #1f2937;
}

body.dark-mode .social-icon-link:hover {
  color: #ffffff;
}

/* Web Stories */
.web-stories-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 210px);
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.web-story-card {
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  scroll-snap-align: start;
  isolation: isolate;
}

.web-story-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.web-story-card:hover img,
.web-story-card:focus-visible img {
  transform: scale(1.06);
}

.web-story-card:focus-visible {
  outline: 3px solid var(--brand-red);
  outline-offset: 3px;
}

.web-story-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.05) 30%, rgba(2, 6, 23, 0.92) 100%);
}

.web-story-progress {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  right: 0.65rem;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.85);
}

.web-story-copy {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
}

.web-story-category {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fecaca;
}

.web-story-copy strong {
  display: -webkit-box;
  overflow: hidden;
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.story-template-headline .web-story-copy strong {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-template-headline .web-story-gradient {
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.08) 25%, rgba(127, 29, 29, 0.92) 100%);
}

.story-template-minimal .web-story-gradient {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0) 55%, rgba(2, 6, 23, 0.75) 100%);
}

.story-template-minimal .web-story-category {
  color: #ffffff;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.25rem;
}

/* Web Stories CMS builder and immersive viewer */
.story-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:2rem;align-items:start}.story-editor-card{padding:1.25rem;margin-bottom:1.25rem}.story-editor-card h3{margin:0 0:1rem}.story-editor-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.story-help{font-size:.78rem;color:var(--text-muted);margin:.4rem 0 1rem}.story-page-form{border:1px solid var(--border-color);border-radius:var(--radius-md);padding:1rem;margin:1rem 0;background:var(--bg-surface);cursor:grab}.story-page-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.page-image-preview{width:100%;height:180px;object-fit:cover;border-radius:var(--radius-sm);margin-top:.6rem}.story-preview-panel{position:sticky;top:1.5rem}.story-preview-label{text-align:center;font-size:.7rem;font-weight:800;letter-spacing:.12em;color:var(--text-muted);margin-bottom:.75rem}.story-phone-preview{aspect-ratio:9/16;max-height:700px;position:relative;overflow:hidden;border:9px solid #0f172a;border-radius:28px;background:#111;box-shadow:0 18px 45px rgba(15,23,42,.28);color:#fff}.story-phone-preview>img:first-of-type{width:100%;height:100%;object-fit:cover}.preview-overlay,.story-slide-overlay{position:absolute;inset:0;background:linear-gradient(180deg,rgba(2,6,23,.05),rgba(2,6,23,.8))}.preview-overlay.off,.story-slide-overlay.off{display:none}.preview-progress{position:absolute;z-index:3;top:13px;left:12px;right:12px;display:flex;gap:4px}.preview-progress i,.story-progress i{height:3px;background:rgba(255,255,255,.45);flex:1;border-radius:99px}.preview-progress i.active{background:white}.preview-text{position:absolute;z-index:2;left:1rem;right:1rem}.preview-text.top{top:12%}.preview-text.center{top:42%;transform:translateY(-50%)}.preview-text.bottom{bottom:1rem}.preview-text.center{text-align:center}.preview-text.right{text-align:right}.preview-text h2{margin:.3rem 0;font-size:1.4rem;color:white}.preview-text p{margin:0;font-size:.85rem}.preview-logo{position:absolute;z-index:3;bottom:10px;right:10px;width:82px!important;height:auto!important}.story-search-results button{display:block;width:100%;text-align:left;padding:.5rem;border:0;border-bottom:1px solid var(--border-color);background:var(--bg-surface);cursor:pointer}.story-viewer-body{margin:0;background:#090d16;overflow:hidden}.story-viewer{min-height:100dvh;display:grid;place-items:center;background:radial-gradient(circle,#27364f 0,#090d16 65%)}.story-shell{width:min(100vw,calc(100dvh * .5625));height:100dvh;max-height:900px;position:relative;overflow:hidden;background:#000;color:#fff}.story-slide{position:absolute;inset:0;overflow:hidden}.story-slide>img{width:100%;height:100%;object-fit:cover}.story-slide-copy{position:absolute;z-index:2;left:1.25rem;right:1.25rem}.story-slide.text-top .story-slide-copy{top:15%}.story-slide.text-center .story-slide-copy{top:45%;transform:translateY(-50%)}.story-slide.text-bottom .story-slide-copy{bottom:2.5rem}.story-slide.align-center .story-slide-copy{text-align:center}.story-slide.align-right .story-slide-copy{text-align:right}.story-slide.size-small h1{font-size:1.5rem}.story-slide.size-medium h1{font-size:2rem}.story-slide.size-large h1{font-size:2.55rem}.story-slide h1{color:#fff;line-height:1.12;margin:.3rem 0}.story-slide p{font-size:1rem;line-height:1.45}.story-slide-copy>span{font-size:.75rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.story-progress{position:absolute;z-index:5;top:max(12px,env(safe-area-inset-top));left:12px;right:12px;display:flex;gap:4px}.story-progress i.done{background:#fff}.story-progress i.current{background:linear-gradient(90deg,#fff 0 15%,rgba(255,255,255,.45) 15% 100%)}.story-viewer-top{position:absolute;z-index:5;top:max(28px,calc(env(safe-area-inset-top) + 16px));left:14px;right:14px;display:flex;justify-content:space-between;align-items:center}.story-viewer-top a,.story-viewer-top button{width:34px;height:34px;border-radius:50%;border:0;background:rgba(0,0,0,.35);color:#fff;font-size:1.5rem;display:grid;place-items:center;text-decoration:none}.story-viewer-top img{width:92px;filter:brightness(0) invert(1)}.story-nav{position:absolute;z-index:4;top:50%;transform:translateY(-50%);border:0;background:rgba(0,0,0,.3);color:white;width:40px;height:64px;font-size:2rem}.story-prev{left:0}.story-next{right:0}.story-cta{display:inline-block;margin-top:1rem;padding:.75rem 1rem;border-radius:99px;background:#e50914;color:#fff;font-weight:800;font-size:.8rem;text-decoration:none}.story-toast{position:fixed;z-index:9;bottom:20px;left:50%;transform:translateX(-50%);color:#fff;background:#111827;border-radius:99px;padding:.6rem 1rem}.story-list-row{grid-auto-columns:minmax(180px,230px)}
@media(max-width:900px){.story-editor-layout{grid-template-columns:1fr}.story-preview-panel{position:static;max-width:360px;margin:auto}.story-editor-two-col{grid-template-columns:1fr}.story-shell{width:100vw;max-height:none}.story-viewer{background:#000}.story-nav{display:none}}
.story-editor-card h3{margin:0 0 1rem}

/* Responsive typography scale. Inline legacy values are normalized here so
  public, writer, and admin templates share one readable hierarchy. */
body:not(.story-viewer-body) h1 { font-size: var(--font-size-h1) !important; line-height: var(--leading-tight); }
body:not(.story-viewer-body) h2 { font-size: var(--font-size-h2) !important; line-height: var(--leading-tight); }
body:not(.story-viewer-body) h3 { font-size: var(--font-size-h3) !important; line-height: var(--leading-heading); }
body:not(.story-viewer-body) h4 { font-size: var(--font-size-lg) !important; line-height: var(--leading-heading); }
.container, .main-content { font-size: var(--font-size-body); }
.nav-links, .dropdown-item, .sidebar-link, .btn { font-size: var(--font-size-sm); line-height: 1.3; }
.form-label, .form-control, .table, .table th, .table td { font-size: var(--font-size-sm); }
.form-control { line-height: 1.4; }
.form-control::placeholder { font-size: var(--font-size-sm); }
.story-help, .story-preview-label { font-size: var(--font-size-xs); line-height: 1.45; }
.badge, .sidebar-label { font-size: var(--font-size-xs); line-height: 1.25; }
.article-card-title { font-size: clamp(1.05rem, 0.92rem + 0.55vw, 1.3rem) !important; line-height: 1.3; }
.article-card-excerpt { font-size: var(--font-size-sm); line-height: 1.5; }
.article-card-meta { font-size: var(--font-size-xs); line-height: 1.4; }
.hero-overlay h1 { font-size: clamp(1.55rem, 1.05rem + 2.3vw, 2.65rem) !important; line-height: var(--leading-tight); }
.hero-overlay p { font-size: var(--font-size-lg); line-height: 1.5; }
.article-rich-body { max-width: 70ch; font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.18rem) !important; line-height: 1.75 !important; }
.article-rich-body p, .article-rich-body li { margin-bottom: 1em; }
.article-rich-body img { max-width: 100%; height: auto; }
.article-rich-body pre, .article-rich-body code { white-space: pre-wrap; overflow-wrap: anywhere; }
.story-phone-preview, .story-shell { container-type: size; }
.story-shell { width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9)); aspect-ratio: 9 / 16; max-width: 100vw; max-height: 100dvh; }
.story-phone-preview .preview-text h2 { font-size: clamp(1rem, 7cqw, 1.65rem); line-height: 1.15; }
.story-phone-preview .preview-text p { font-size: clamp(0.78rem, 4cqw, 1rem); line-height: 1.4; }
.story-phone-preview .preview-text small { font-size: clamp(0.62rem, 2.8cqw, 0.8rem); }
.story-slide-copy { font-size: clamp(0.78rem, 3.8cqw, 1rem); line-height: 1.45; }
.story-slide-copy > span { font-size: clamp(0.62rem, 2.5cqw, 0.8rem); line-height: 1.2; }
.story-slide-copy h1 { font-size: clamp(1.2rem, 8cqw, 2.15rem); line-height: 1.12; }
.story-slide.size-small .story-slide-copy h1 { font-size: clamp(1rem, 6cqw, 1.65rem); }
.story-slide.size-medium .story-slide-copy h1 { font-size: clamp(1.2rem, 7cqw, 2.15rem); }
.story-slide.size-large .story-slide-copy h1 { font-size: clamp(1.4rem, 8cqw, 2.55rem); }
.story-slide-copy p { font-size: clamp(0.78rem, 4cqw, 1.05rem); line-height: 1.4; }
.story-cta { font-size: clamp(0.68rem, 3cqw, 0.9rem); line-height: 1.25; }

/* Responsive layout foundation */
img, video, canvas, svg { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
input, select, textarea { box-sizing: border-box; }
body { overflow-wrap: anywhere; }
.container { padding-left: clamp(1rem, 3vw, 1.5rem); padding-right: clamp(1rem, 3vw, 1.5rem); }
.main-content > div:not(.top-nav-admin) { min-width: 0; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.modal-card { max-height: min(90vh, 760px); overflow-y: auto; }
.modal-footer { flex-wrap: wrap; }
.sidebar-backdrop { display: none; }

@media (max-width: 1023px) {
  .site-header .nav-links { display: none; }
  .site-header .header-logo-img { min-width: 0; width: clamp(150px, 24vw, 205px); }
  .site-header .search-input { width: clamp(150px, 22vw, 210px); }
  .site-header .search-input:focus { width: clamp(180px, 30vw, 250px); }
  .mobile-only-nav-item { display: list-item; }

  .app-layout { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min( min(86vw, 300px), 270px );
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 14px 0 35px rgba(0, 0, 0, 0.25);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: block;
    background: rgba(2, 6, 23, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .main-content { width: 100%; }
  .main-content > div[style*="padding: 2rem"] { padding: clamp(1rem, 3vw, 1.5rem) !important; }
  .top-nav-admin { padding: 0.75rem clamp(1rem, 3vw, 1.5rem); gap: 0.75rem; flex-wrap: wrap; }
  .top-nav-admin > div { flex-wrap: wrap; min-width: 0; }
  .user-profile-btn { min-width: 0; }
  .main-content [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 767px) {
  .top-bar { display: none; }
  .site-header .nav-main { gap: 0.5rem; }
  .site-header .header-logo-link { flex: 1 1 auto; min-width: 0; width: auto; }
  .site-header .header-logo-img { width: clamp(135px, 42vw, 180px); min-width: 0; height: auto; }
  .site-header .nav-main > div:last-child { flex: 0 0 auto; min-width: 0; width: auto; gap: 0.4rem !important; }
  .site-header .search-box { flex: 0 0 36px; min-width: 0; width: 36px; }
  .site-header .search-input { width: 36px !important; min-width: 0; height: 38px; padding: 0.35rem 0.2rem 0.35rem 1.75rem; color: transparent !important; cursor: pointer; }
  .site-header .search-box:focus-within { flex-basis: clamp(84px, calc(100vw - 230px), 220px); width: clamp(84px, calc(100vw - 230px), 220px); }
  .site-header .search-box:focus-within .search-input { width: 100% !important; min-width: 0; flex: 1 1 auto; padding: 0.35rem 0.85rem 0.35rem 2.2rem; color: #f8fafc !important; cursor: text; }
  .site-header .search-icon { left: 0.65rem; }
  .site-header .hamburger-btn { width: 42px; height: 42px; }
  .reader-dropdown-menu { position: fixed; top: 4.25rem; right: 1rem; width: min( calc(100vw - 2rem), 320px ); max-height: calc(100vh - 5rem); overflow-y: auto; }
  .hero-news-grid { gap: 1rem; }
  .hero-featured-card { height: min(72vw, 380px); min-height: 290px; }
  .hero-overlay { padding: 1.25rem 1rem 1rem; }
  .hero-overlay h1 { font-size: clamp(1.35rem, 6vw, 2rem); }
  .hero-overlay p { font-size: 0.9rem; }
  .author-inline { min-width: 0; flex-wrap: wrap; }
  .article-card-meta { align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; }
  .article-card-body { padding: 1rem; }
  .web-stories-row { grid-auto-columns: minmax(140px, 42vw); }
  .stories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .web-story-copy { left: 0.7rem; right: 0.7rem; bottom: 0.7rem; }
  .web-story-copy strong { font-size: 0.85rem; }
  .btn { min-height: 42px; white-space: normal; text-align: center; }
  .btn-sm { min-height: 36px; }
  .top-nav-admin .btn { flex: 1 1 auto; }
  .top-nav-admin .user-profile-btn > div { display: none; }
  .top-nav-admin .user-profile-btn { margin-left: auto; }
  .modal-card { width: calc(100% - 2rem); }
  .modal-header, .modal-body, .modal-footer { padding: 1rem; }
  .modal-footer .btn { flex: 1 1 140px; }
  .table-responsive { max-width: 100%; }
  .table { min-width: 640px; }
  .form-control { min-height: 44px; }
  .main-content [style*="display: flex"] { min-width: 0; }
  .main-content [style*="display: flex"] > * { min-width: 0; }
  .story-page-toolbar { align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
  .story-page-toolbar > div { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  .story-editor-card { padding: 1rem; }
  .story-phone-preview { width: min(100%, 340px); max-height: none; margin-inline: auto; }
  .story-preview-panel { width: 100%; }
  .story-viewer-body { overflow: hidden; }
  .story-shell { width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9)); aspect-ratio: 9 / 16; max-width: 100vw; max-height: 100dvh; }
}

@media (max-width: 420px) {
  .container { padding-left: 0.85rem; padding-right: 0.85rem; }
  .site-header .header-logo-img { width: 135px; }
  .stories-grid { grid-template-columns: 1fr 1fr; }
  .footer-social-links { gap: 0.6rem !important; }
  .social-icon-link { width: 42px; height: 42px; }
}

@media (min-width: 1440px) {
  .container { max-width: 1440px; }
}

/* Trending News listing */
.trending-page {
  max-width: 1240px;
  padding-top: clamp(1.25rem, 3vw, 2.5rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.trending-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.trending-breadcrumb a:hover { color: var(--brand-red); }
.trending-breadcrumb i { font-size: 0.65em; color: var(--text-subtle); }
.trending-breadcrumb span { color: var(--text-main); font-weight: 600; }

.trending-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 2px solid var(--brand-red);
  padding-bottom: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.trending-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand-red);
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.trending-page-header h1 {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: var(--font-size-h1) !important;
  font-weight: 800;
  line-height: var(--leading-tight);
}

.trending-page-header p {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin-top: 0.6rem;
}

.trending-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.search-result-count {
  font-size: var(--font-size-sm) !important;
  line-height: 1.4;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.trending-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.trending-card:hover,
.trending-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.trending-card:focus-visible { border-color: var(--brand-red); }

.trending-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-surface-elevated);
}

.trending-card-image img,
.trending-image-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.trending-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.trending-card:hover .trending-card-image img { transform: scale(1.04); }
.trending-card-image img { transition: transform 0.35s ease; }

.trending-rank,
.trending-badge {
  position: absolute;
  top: 0.75rem;
  color: #fff;
  background: rgb(11 15 25 / 0.78);
  backdrop-filter: blur(5px);
  font-size: var(--font-size-xs);
  font-weight: 800;
  line-height: 1.2;
}

.trending-rank {
  left: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
}

.trending-badge {
  right: 0.75rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-full);
}

.trending-badge i { color: #fca5a5; margin-right: 0.2rem; }

.trending-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: clamp(0.9rem, 2vw, 1.25rem);
}

.trending-card-body .badge { margin-bottom: 0.1rem; }
.trending-card-body h2 {
  width: 100%;
  margin: 0;
  font-family: 'Merriweather', serif;
  font-size: clamp(1.05rem, 0.92rem + 0.55vw, 1.35rem) !important;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.trending-card-body p {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.trending-card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  width: 100%;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-subtle);
  font-size: var(--font-size-xs);
  line-height: 1.4;
}

.trending-card-meta strong { color: var(--text-muted); }

.trending-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.trending-page-numbers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.trending-page-numbers a,
.trending-page-current {
  display: inline-grid;
  min-width: 2.25rem;
  min-height: 2.25rem;
  place-items: center;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.trending-page-numbers a:hover { border-color: var(--brand-red); color: var(--brand-red); }
.trending-page-current { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }

.trending-empty-state {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: clamp(2.5rem, 8vw, 5rem) 1rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
}

.trending-empty-state > i { color: var(--brand-red); font-size: 2rem; }
.trending-empty-state h2 { font-size: var(--font-size-h3) !important; }
.trending-empty-state p { font-size: var(--font-size-sm); }

@media (max-width: 1023px) {
  .trending-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .trending-page-header { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .trending-count { white-space: normal; }
  .search-result-count { font-size: var(--font-size-xs) !important; }
  .trending-grid { grid-template-columns: 1fr; }
  .trending-card-body h2 { -webkit-line-clamp: 4; }
  .trending-pagination { justify-content: space-between; }
  .trending-pagination .btn { flex: 1 1 auto; }
  .trending-page-numbers { order: 3; width: 100%; justify-content: center; }
}
