/* ============================================================
   XIII.MEDIA — styles.css  (consolidated, no duplicate rules)
   ============================================================ */

:root {
  --red: #c1121f;
  --dark: #2b0004;
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; background: #fff; color: var(--text); }
a { color: inherit; }
.hidden { display: none !important; }

/* ── Header / Topbar ────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--dark); color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }

/* ── Ticker ─────────────────────────────────────────────── */
/* NOTE: animation is intentionally absent — JS drives translateX via RAF */
.ticker-shell { flex: 1; overflow: hidden; }
.ticker-track { overflow: hidden; white-space: nowrap; }
.ticker-line { display: inline-flex; gap: 30px; padding-inline-end: 30px; }
.ticker-item { color: #fff; text-decoration: none; opacity: .95; }

/* ── Desktop Nav ────────────────────────────────────────── */
.desktop-nav {
  display: flex; gap: 8px; overflow: auto; scrollbar-width: none;
  padding: 10px 14px 12px;
  background: #8f2430;
}
.desktop-nav::-webkit-scrollbar { display: none; }
.nav-chip {
  background: #5d1018; color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 9px 12px;
  cursor: pointer; white-space: nowrap; font-size: .92rem;
}
.nav-chip.active { background: var(--red); border-color: var(--red); }

/* ── Main Content ───────────────────────────────────────── */
.page-main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 100px; background: #fff; }
.hero h1 { margin: 0; font-size: 2rem; }
.hero p { margin: 8px 0 0; color: var(--muted); }

/* ── Section subnav chips ───────────────────────────────── */
.section-subnav {
  display: flex; gap: 8px; flex-wrap: wrap;
  overflow: visible; padding: 14px 0 4px;
}
.section-chip {
  border: 1px solid var(--line); background: #fff; color: var(--red);
  border-radius: 999px; padding: 10px 12px;
  white-space: nowrap; cursor: pointer; font-weight: 700;
}
.section-chip.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Tool forms (search / ask) ──────────────────────────── */
.tool-form { display: flex; gap: 10px; margin: 18px 0; }
.tool-form input {
  flex: 1; min-width: 0;
  border: 1px solid #d1d5db; border-radius: 14px;
  padding: 14px 16px; font-size: 1rem;
}
.tool-form button, .primary-btn {
  background: var(--red); color: #fff;
  border: none; border-radius: 14px;
  padding: 14px 18px; font-weight: 700; cursor: pointer;
}

/* ── Cards grid ─────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px; margin-top: 18px;
}
.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: 0 8px 18px rgba(17,24,39,.06);
}
.card:hover { transform: translateY(-2px); transition: .2s ease; }
.card-media { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #fff; border-bottom: 1px solid var(--line); }
.card-fallback {
  width: 100%; aspect-ratio: 16/9;
  display: grid; place-items: center;
  background: #fff; color: var(--red); font-size: 2rem; font-weight: 800;
  border-bottom: 1px solid var(--line);
}
.card-body { padding: 14px 15px 16px; }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.source-badge {
  min-width: 22px; height: 22px; border-radius: 999px;
  background: #f8d7da; color: var(--red);
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; padding: 0 6px;
}
.source-name { color: var(--red); font-size: .82rem; font-weight: 700; }
.card-date { color: var(--muted); font-size: .78rem; margin-bottom: 10px; }
.card-title { font-size: 1rem; line-height: 1.35; margin: 0 0 10px; }
.card-summary { margin: 0; color: #334155; line-height: 1.55; }

/* ── Utility blocks ─────────────────────────────────────── */
.loading-block, .notice {
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 18px;
}
.notice.success { border-color: #86efac; background: #ecfdf5; color: #166534; }
.notice.error { border-color: #fecaca; }

/* ── Article / static pages ─────────────────────────────── */
.article-page, .static-page { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--red); text-decoration: none; font-weight: 700; }
.article-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.source-pill { color: var(--red); font-weight: 700; }
.hero-image img { width: 100%; border-radius: 18px; display: block; max-height: 520px; object-fit: cover; }
.article-body { margin-top: 16px; line-height: 1.75; }
.article-body .lead { font-size: 1.08rem; color: #334155; }
.article-source-link { margin-top: 18px; }
.article-source-link a { color: var(--red); font-weight: 700; }
.video-frame { position: relative; width: 100%; padding-top: 56.25%; margin-top: 16px; border-radius: 18px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Contact form ───────────────────────────────────────── */
.contact-form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form input, .contact-form textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 14px; padding: 12px 14px; font-size: 1rem; }
.contact-form label { display: block; font-weight: 700; margin-bottom: 6px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 22px 16px 120px; text-align: center; background: #fff; }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { color: var(--red); text-decoration: none; font-weight: 700; }
.footer-copy { color: #6b7280; }

/* ── Ask feature ────────────────────────────────────────── */
.ask-answer { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.ask-answer ul { margin: 0; padding-left: 20px; }
.result-list { display: grid; gap: 14px; }
.editable-content h1 { margin-top: 0; }

/* ── Back to top ────────────────────────────────────────── */
.back-to-top {
  position: fixed; right: 18px; bottom: 22px; z-index: 60;
  width: 46px; height: 46px;
  border: none; border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 20px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  cursor: pointer;
}

/* ── Mobile bottom nav ──────────────────────────────────── */
/* Hidden on desktop; shown only in mobile media query below */
.mobile-bottom-nav { display: none; }

/* ── Mobile provinces sub-menu ──────────────────────────── */
/* Desktop: always hidden */
.mobile-subnav { display: none; }

/* ── Responsive: ≤ 760 px ───────────────────────────────── */
@media (max-width: 760px) {
  .desktop-nav { display: none; }
  .page-main { padding-bottom: 130px; }
  .hero h1 { font-size: 1.6rem; }
  .topbar { padding: 10px 12px; }
  .cards-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .back-to-top { display: none; }

  /* Mobile bottom nav bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0;
    padding: 10px 12px;
    background: #a12b38;
    border-top: 1px solid rgba(255,255,255,.15);
    z-index: 80;
    box-shadow: 0 -8px 24px rgba(17,24,39,.08);
  }
  .mobile-tab {
    border: 1px solid rgba(255,255,255,.25);
    background: transparent;
    color: rgba(255,255,255,.85);
    border-radius: 14px;
    padding: 12px 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: .82rem;
  }
  .mobile-tab.active, .mobile-tab.provinces-open {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
  }

  /* Mobile provinces sub-menu — floats above bottom bar */
  .mobile-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
    position: fixed;
    left: 0; right: 0;
    bottom: 74px;
    background: #a12b38;
    border-top: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 -8px 24px rgba(17,24,39,.08);
    padding: 12px;
    z-index: 70;
  }
  .mobile-subnav-chip {
    border: 1px solid rgba(255,255,255,.3);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    padding: 10px 12px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
  }
  .mobile-subnav-chip.active {
    background: #fff;
    color: var(--red);
    border-color: #fff;
  }
}
