/* ============================================================
   Cerritos News — Professional Design System v4.0
   Inspired by NYT, WaPo, CNN, BBC News
   ============================================================ */

:root {
  /* Modern Newsroom palette (fast, clean, high-contrast) */
  --primary:    #0b1220;
  --primary-l:  #111b2e;
  --accent:     #0077ff;
  --accent-l:   #2f92ff;
  --accent-d:   #0056c7;
  --bg:         #fbfcfe;
  --bg-warm:    #f3f6fb;
  --bg-alt:     #e9eef7;
  --white:      #ffffff;
  --text:       #101828;
  --text-l:     #344054;
  --text-m:     #667085;
  --text-i:     #98a2b3;
  --border:     #e4e7ec;
  --border-l:   #f2f4f7;
  --green:      #059669;
  --green-l:    #d1fae5;
  --amber:      #d97706;
  --amber-l:    #fef3c7;
  --blue:       #2563eb;
  --blue-l:     #dbeafe;
  --purple:     #7c3aed;
  --purple-l:   #ede9fe;
  --shadow-sm:  0 1px 2px rgba(16,24,40,0.06);
  --shadow:     0 10px 24px rgba(16,24,40,0.08);
  --shadow-md:  0 18px 50px rgba(16,24,40,0.12);
  --shadow-lg:  0 26px 80px rgba(16,24,40,0.16);
  --r-sm:       6px;
  --r:          12px;
  --r-md:       16px;
  --r-lg:       20px;
  --r-xl:       28px;
  --sans:       'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif:      'Fraunces', 'Georgia', 'Times New Roman', serif;
  --mono:       'JetBrains Mono', monospace;
  --max:        1200px;

  /* Legacy aliases */
  --cn-navy: var(--primary); --cn-navy-light: var(--primary-l);
  --cn-blue: var(--accent); --cn-blue-light: var(--accent-l);
  --cn-crimson: var(--accent); --cn-green: var(--green);
  --cn-yellow: var(--amber); --cn-orange: var(--amber);
  --cn-purple: var(--purple); --cn-pink: var(--accent);
  --cn-teal: var(--green); --cn-gray-50: var(--bg-warm);
  --cn-gray-100: var(--bg-alt); --cn-gray-200: var(--border);
  --cn-gray-300: #d1d5db; --cn-gray-400: var(--text-m);
  --cn-gray-500: var(--text-l); --cn-gray-600: var(--text);
  --cn-gray-700: var(--primary); --cn-gray-800: var(--primary);
  --cn-gray-900: var(--primary); --cn-white: var(--white);
  --cn-font-sans: var(--sans); --cn-font-serif: var(--serif);
  --cn-shadow-sm: var(--shadow-sm); --cn-shadow: var(--shadow);
  --cn-shadow-md: var(--shadow-md); --cn-shadow-lg: var(--shadow-lg);
  --cn-radius-sm: var(--r-sm); --cn-radius: var(--r);
  --cn-radius-lg: var(--r-md); --cn-radius-xl: var(--r-lg);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); line-height: 1.2; font-weight: 700; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 0; }
.section-sm { padding: 24px 0; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.section-header h2 { font-size: 1.25rem; }
.section-header .view-all { font-size: 0.8125rem; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 4px; transition: gap 0.2s; }
.section-header .view-all:hover { gap: 8px; }

.ticker { background: var(--accent); color: #fff; height: 36px; overflow: hidden; display: flex; align-items: center; font-size: 0.8125rem; }
.ticker-label { background: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 0.6875rem; padding: 0 16px; height: 100%; display: flex; align-items: center; flex-shrink: 0; }
.ticker-items { display: flex; overflow: hidden; flex: 1; padding: 0 16px; }
.ticker-items a { white-space: nowrap; padding: 0 24px; border-left: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); }
.ticker-items a:hover { color: #fff; text-decoration: underline; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.card { background: var(--white); border-radius: var(--r-md); overflow: hidden; box-shadow: none; border: 1px solid var(--border); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: rgba(0,119,255,0.28); }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-family: var(--serif); font-size: 1rem; font-weight: 700; line-height: 1.3; margin: 6px 0; }
.card-title a:hover { color: var(--accent); }
.card-text { font-size: 0.875rem; color: var(--text-l); line-height: 1.5; flex: 1; }
.card-meta { font-size: 0.75rem; color: var(--text-i); margin-top: 10px; display: flex; align-items: center; gap: 8px; }

.hero-card { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 520px; display: flex; align-items: flex-end; cursor: pointer; border: 1px solid rgba(255,255,255,0.08); }
.hero-card .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.hero-card:hover .hero-img { transform: scale(1.03); }
.hero-card .hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0.05) 90%); }
.hero-card .hero-content { position: relative; z-index: 1; padding: 32px; width: 100%; color: #fff; }
.hero-card .hero-tag { display: inline-block; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 4px 12px; border-radius: 100px; margin-bottom: 10px; }
.hero-card .hero-title { font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 8px; letter-spacing: -0.01em; }
.hero-card .hero-excerpt { font-size: 0.9375rem; opacity: 0.85; margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card .hero-meta { font-size: 0.8125rem; opacity: 0.7; display: flex; gap: 10px; }

.badge { display: inline-block; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 10px; border-radius: 100px; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-green { background: #d1fae5; color: #059669; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-yellow { background: #fef3c7; color: #d97706; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--r); font-size: 0.875rem; font-weight: 600; border: none; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,119,255,0.18); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-l); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--r-md); }
.btn-block { width: 100%; justify-content: center; }
.btn-navy, .btn-crimson { background: var(--accent); color: #fff; }
.btn-navy:hover, .btn-crimson:hover { background: var(--accent-d); }

.list-card { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-l); align-items: flex-start; }
.list-card:last-child { border-bottom: none; }
.list-card-img { width: 90px; height: 68px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; }
.list-card-body { flex: 1; min-width: 0; }
.list-card-title { font-family: var(--serif); font-size: 0.9375rem; font-weight: 700; line-height: 1.3; }
.list-card-title a:hover { color: var(--accent); }
.list-card-meta { font-size: 0.75rem; color: var(--text-i); margin-top: 4px; }

.trending { background: var(--white); border-radius: var(--r-md); padding: 20px; border: 1px solid var(--border); }
.trending h3 { font-family: var(--serif); font-size: 1rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.trending-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-l); }
.trending-item:last-child { border-bottom: none; }
.trending-num { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--accent); opacity: 0.3; line-height: 1; min-width: 24px; }
.trending-title { font-size: 0.875rem; font-weight: 600; line-height: 1.35; }
.trending-title a:hover { color: var(--accent); }

.widget { background: var(--white); border-radius: var(--r-md); padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; }
.widget h3 { font-family: var(--serif); font-size: 1rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }

.weather { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-l) 100%); border-radius: var(--r-lg); padding: 20px; color: #fff; position: relative; overflow: hidden; }
.weather::before { content: ''; position: absolute; top: -30px; right: -30px; width: 100px; height: 100px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.weather-city { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: 0.6; }
.weather-temp { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.weather-desc { font-size: 0.875rem; opacity: 0.8; }
.weather-details { display: flex; gap: 8px; font-size: 0.75rem; opacity: 0.5; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.15); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.form-group label span { color: var(--accent); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--white); color: var(--text); outline: none; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,30,58,0.1); }
.form-group textarea { min-height: 120px; resize: vertical; }

.alert { padding: 12px 16px; border-radius: var(--r); font-size: 0.875rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: var(--green-l); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--blue-l); color: #1e40af; border: 1px solid #bfdbfe; }

.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span, .pagination .page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; border-radius: var(--r); font-size: 0.875rem; font-weight: 600; }
.pagination a, .pagination .page-link { background: var(--white); border: 1px solid var(--border); color: var(--text); }
.pagination a:hover, .pagination .page-link:hover { background: var(--bg-warm); border-color: var(--accent); color: var(--accent); }
.pagination .current, .pagination .page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.newsletter { background: var(--primary); border-radius: var(--r-lg); padding: 40px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.newsletter::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(196,30,58,0.15) 0%, transparent 70%); }
.newsletter h2 { font-size: 1.5rem; margin-bottom: 8px; position: relative; }
.newsletter p { opacity: 0.7; font-size: 0.9375rem; margin-bottom: 20px; position: relative; }
.newsletter form { display: flex; gap: 8px; max-width: 440px; margin: 0 auto; position: relative; }
.newsletter input { flex: 1; padding: 12px 16px; border: 1.5px solid rgba(255,255,255,0.2); border-radius: var(--r); background: rgba(255,255,255,0.1); color: #fff; outline: none; }
.newsletter input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter input:focus { border-color: var(--accent); }

.error-404 { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.error-404-num { font-family: var(--serif); font-size: clamp(5rem, 15vw, 10rem); font-weight: 700; line-height: 1; color: var(--accent); }

.empty { text-align: center; padding: 48px 20px; color: var(--text-m); }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty h3 { font-family: var(--serif); font-size: 1.125rem; margin-bottom: 6px; color: var(--text); }

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .section { padding: 28px 0; }
  .hero-card { min-height: 400px; }
  .hero-card .hero-content { padding: 24px; }
  .newsletter { padding: 28px 20px; }
  .newsletter form { flex-direction: column; }
}

/* Mobile bottom navigation safe-area spacing */
@media (max-width: 900px) {
  body { padding-bottom: 74px; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.text-center { text-align: center; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 24px; }

/* ============================================================
   Modern Newsroom shared page layout
   ============================================================ */
.page-hero{
  padding: 34px 0 18px;
  background:
    radial-gradient(1200px 420px at 20% 0%, rgba(0,119,255,0.10) 0%, transparent 60%),
    radial-gradient(900px 360px at 95% 10%, rgba(17,27,46,0.12) 0%, transparent 55%),
    linear-gradient(#ffffff, #ffffff);
  border-bottom: 1px solid var(--border);
}
.page-hero__inner{ display:flex; align-items:flex-end; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.page-kicker{
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-m);
  margin-bottom: 10px;
}
.page-kicker a{ color: var(--text-m); }
.page-kicker a:hover{ color: var(--accent); }
.page-title{
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3.8vw, 2.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.page-subtitle{
  max-width: 72ch;
  color: var(--text-l);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}
.subnav{
  position: sticky;
  top: 72px;
  z-index: 25;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.subnav__inner{ display:flex; gap:8px; padding: 10px 0; overflow:auto; }
.subnav__link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-l);
  white-space: nowrap;
  background: var(--white);
}
.subnav__link:hover{ border-color: rgba(0,119,255,0.32); color: var(--accent); }
.subnav__link.active{ background: rgba(0,119,255,0.10); border-color: rgba(0,119,255,0.32); color: var(--accent); }
.dot{ width:7px; height:7px; border-radius:999px; background: var(--accent); flex-shrink:0; }

.stack{ display:flex; flex-direction:column; gap:12px; }
.lead-grid{ display:grid; grid-template-columns: 1.35fr 0.65fr; gap: 18px; align-items:start; }
@media (max-width: 900px){ .lead-grid{ grid-template-columns: 1fr; } .subnav{ top: 62px; } }
