/* ============================================================
   THE DEMOCRATIC TIMES — site.css
   Shared stylesheet for all pages
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0D1B2A;
  --navy2: #1B2A3B;
  --red: #C0392B;
  --red2: #E74C3C;
  --gold: #D4AC0D;
  --white: #FFFFFF;
  --offwhite: #F8F9FA;
  --gray: #6C757D;
  --lightgray: #E9ECEF;
  --border: #DEE2E6;
  --text: #212529;
  --textlight: #495057;
}

body { font-family: 'Inter', sans-serif; background: var(--offwhite); color: var(--text); }
a { text-decoration: none; color: inherit; }

/* ── TICKER ─────────────────────────────────────── */
.ticker-wrap {
  background: var(--red);
  color: white;
  overflow: hidden;
  height: 2.4rem;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ticker-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.ticker-label {
  background: var(--navy);
  padding: 0 1.2rem;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 1;
}
.ticker-scroll {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}
.ticker-items {
  display: flex;
  align-items: center;
  animation: ticker 80s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.ticker-items:hover { animation-play-state: paused; }
.ticker-item { padding: 0 2.5rem; }
.ticker-item::after { content: '◆'; margin-left: 2.5rem; opacity: 0.4; font-size: 0.6rem; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── HEADER ─────────────────────────────────────── */
header { background: var(--navy); color: white; padding: 0 2rem; border-bottom: 3px solid var(--gold); }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; font-size: 0.75rem; opacity: 0.6; border-bottom: 1px solid rgba(255,255,255,0.1); }
.header-main { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
.header-logo { display: flex; align-items: center; }
.header-logo img { height: 55px; width: auto; display: block; }
/* Fallback text logo if SVG fails */
.logo { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 900; letter-spacing: -0.02em; }
.logo span { color: var(--gold); }
.header-tagline { font-size: 0.72rem; opacity: 0.5; letter-spacing: 0.15em; text-transform: uppercase; margin-top: 0.2rem; }

/* ── NAV ─────────────────────────────────────────── */
nav { background: var(--navy2); border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; display: flex; gap: 0; overflow-x: auto; }
.nav-btn {
  color: rgba(255,255,255,0.7);
  padding: 0.75rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-block;
  line-height: 1;
}
.nav-btn:hover { color: white; }
.nav-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── CONTAINER ───────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ── PAGE INTRO ──────────────────────────────────── */
.page-intro { padding: 1.25rem 0 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.page-intro h1 { font-family: 'Playfair Display', serif; font-size: 1.75rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.page-intro .page-desc { font-size: 0.9rem; color: var(--textlight); line-height: 1.65; max-width: 760px; }
.page-intro .cat-tag { display: inline-block; padding: 0.2rem 0.75rem; border-radius: 3px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: white; margin-bottom: 0.6rem; }

/* ── HERO ────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; padding: 1.5rem 0; }
.hero-main { background: var(--navy); border-radius: 8px; overflow: hidden; position: relative; min-height: 360px; display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem; color: white; }
.hero-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #0D1B2A 0%, #1a3a5c 50%, #0D1B2A 100%); z-index: 0; }
.hero-content { position: relative; z-index: 1; }
.hero-cat { display: inline-block; background: var(--red); color: white; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.25rem 0.75rem; border-radius: 3px; margin-bottom: 0.75rem; }
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 700; line-height: 1.25; margin-bottom: 0.75rem; }
.hero-title a:hover { color: var(--gold); }
.hero-excerpt { font-size: 0.9rem; opacity: 0.8; line-height: 1.6; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { font-size: 0.75rem; opacity: 0.55; }
.hero-source-badge { display: inline-block; background: rgba(212,172,13,0.2); border: 1px solid var(--gold); color: var(--gold); padding: 0.2rem 0.6rem; border-radius: 3px; font-size: 0.7rem; font-weight: 700; margin-right: 0.5rem; }

.hero-side { display: flex; flex-direction: column; gap: 1rem; }
.hero-side-card { background: white; border-radius: 8px; padding: 1.1rem; border-left: 4px solid var(--red); box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: transform 0.2s; }
.hero-side-card:hover { transform: translateX(3px); }
.hero-side-cat { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--red); letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.hero-side-title { font-size: 0.9rem; font-weight: 600; line-height: 1.4; color: var(--navy); margin-bottom: 0.4rem; }
.hero-side-title a:hover { color: var(--red); }
.hero-side-excerpt { font-size: 0.78rem; color: var(--textlight); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side-meta { font-size: 0.7rem; color: var(--gray); margin-top: 0.5rem; }

/* ── SECTION DIVIDER ─────────────────────────────── */
.section-divider { display: flex; align-items: center; gap: 1rem; padding: 1rem 0 0.75rem; }
.section-divider-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--red); white-space: nowrap; }
.section-divider-line { flex: 1; height: 1px; background: var(--border); }

/* ── ARTICLE GRID ────────────────────────────────── */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding-bottom: 2rem; }
.article-card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column; }
.article-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.article-card-color { height: 5px; }
.article-card-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.article-cat { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin-bottom: 0.5rem; }
.article-title { font-size: 0.95rem; font-weight: 600; line-height: 1.45; color: var(--navy); margin-bottom: 0.6rem; flex: 1; }
.article-title a:hover { color: var(--red); }
.article-excerpt { font-size: 0.8rem; color: var(--textlight); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.75rem; }
.article-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--lightgray); padding-top: 0.6rem; margin-top: auto; }
.article-source { font-size: 0.7rem; font-weight: 600; color: var(--gray); }
.article-date { font-size: 0.7rem; color: var(--gray); }
.article-read-more { font-size: 0.72rem; font-weight: 600; color: var(--red); }
.article-read-more:hover { text-decoration: underline; }

/* ── CATEGORY COLORS ─────────────────────────────── */
.cat-politics { background: #C0392B; }
.cat-economy { background: #16A085; }
.cat-world { background: #2980B9; }
.cat-opinion { background: #8E44AD; }
.cat-elections { background: #E67E22; }
.cat-analysis { background: #27AE60; }
.cat-canada { background: #1A5276; }
.cat-default { background: #7F8C8D; }

/* ── TWO-COL LAYOUT ──────────────────────────────── */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; padding-bottom: 2rem; }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar-section { background: white; border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 1rem; }
.sidebar-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--gold); }
.opinion-item { padding: 0.85rem 0; border-bottom: 1px solid var(--lightgray); }
.opinion-item:last-child { border-bottom: none; padding-bottom: 0; }
.opinion-tag { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: #8E44AD; margin-bottom: 0.3rem; }
.opinion-title { font-size: 0.88rem; font-weight: 600; color: var(--navy); line-height: 1.4; margin-bottom: 0.3rem; }
.opinion-title a:hover { color: var(--red); }
.opinion-excerpt { font-size: 0.75rem; color: var(--textlight); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.opinion-meta { font-size: 0.68rem; color: var(--gray); margin-top: 0.4rem; }

/* ── MUST READS ──────────────────────────────────── */
.must-read-item { display: flex; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--lightgray); align-items: flex-start; }
.must-read-item:last-child { border-bottom: none; }
.must-read-num { font-size: 1.8rem; font-weight: 700; color: var(--lightgray); line-height: 1; min-width: 2rem; }
.must-read-source { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--red); }
.must-read-title { font-size: 0.88rem; font-weight: 600; color: var(--navy); line-height: 1.4; }
.must-read-title a:hover { color: var(--red); }
.must-read-excerpt { font-size: 0.75rem; color: var(--textlight); margin-top: 0.25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── RELATED CATEGORIES SIDEBAR ──────────────────── */
.related-cat-item { padding: 0.7rem 0; border-bottom: 1px solid var(--lightgray); }
.related-cat-item:last-child { border-bottom: none; }
.related-cat-link { display: flex; flex-direction: column; gap: 0.35rem; }
.related-cat-badge { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 3px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: white; letter-spacing: 0.05em; width: fit-content; }
.related-cat-headline { font-size: 0.82rem; color: var(--navy); font-weight: 500; line-height: 1.4; }
.related-cat-headline:hover { color: var(--red); }

/* ── VIDEO SECTION ───────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.video-card {
  background: var(--navy);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.video-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.loading-card { height: 200px; animation: pulse 1.5s ease-in-out infinite; background: var(--lightgray); }
.video-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  overflow: hidden;
}
.video-thumb-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.video-card:hover .video-thumb-wrap img { transform: scale(1.04); }
.video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: background 0.2s;
}
.video-card:hover .video-play-btn { background: rgba(0,0,0,0.15); }
.video-play-btn svg { width: 52px; height: 52px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.video-info { padding: 0.8rem; }
.video-channel { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--gold); letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.video-title { font-size: 0.85rem; font-weight: 600; color: white; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-date { font-size: 0.68rem; color: rgba(255,255,255,0.4); margin-top: 0.4rem; }
/* Inline player overlay */
.video-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.85); z-index:9999; align-items:center; justify-content:center; }
.video-modal.open { display:flex; }
.video-modal-inner { position:relative; width:90vw; max-width:900px; }
.video-modal-inner iframe { width:100%; aspect-ratio:16/9; border:none; border-radius:8px; }
.video-modal-close { position:absolute; top:-2.5rem; right:0; background:none; border:none; color:white; font-size:1.8rem; cursor:pointer; line-height:1; }

@media (max-width: 900px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .video-grid { grid-template-columns: 1fr; } }

/* ── FOOTER ──────────────────────────────────────── */
footer { background: var(--navy); color: rgba(255,255,255,0.45); padding: 2rem; font-size: 0.8rem; border-top: 3px solid var(--gold); }
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: center; margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-nav a { color: rgba(255,255,255,0.65); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; transition: color 0.2s; }
.footer-nav a:hover { color: var(--gold); }
.footer-copy { text-align: center; line-height: 1.8; }
.footer-copy a { color: rgba(255,255,255,0.55); }
.footer-updated { font-size: 0.72rem; margin-top: 0.4rem; }

/* ── LOADING ─────────────────────────────────────── */
.loading-pulse { animation: pulse 1.5s ease-in-out infinite; background: var(--lightgray); border-radius: 4px; height: 1rem; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .article-grid { grid-template-columns: 1fr; }
  .logo { font-size: 1.6rem; }
  header { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .nav-inner { padding: 0 0.5rem; }
  .hero-main { padding: 1.25rem; min-height: 280px; }
}
