/* ========================================================================
   EventCast — Event Sources Shared Design System
   Applied to all regional Event Sources directory pages for visual consistency.
   Each page may add a single <style> block for regional accents only.
   ======================================================================== */

/* ── Design Tokens ───────────────────────────────────────────────────── */
:root {
  --bg: #08090d;
  --surface: #0f1018;
  --card: #141620;
  --border: #1f2235;
  --accent: #3a7bd5;
  --accent2: #e84545;
  --gold: #f5c842;
  --glow: rgba(58, 123, 213, 0.12);
  --text: #e2e4f0;
  --muted: #686b88;
  --highlight: rgba(58, 123, 213, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 100px;
  --max-width: 1400px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────────────────────────────────── */
body, .filter-btn, .card-name, .card-desc, .card-url,
.section-count, .section-sub, .section-badge,
.stat-label, header p, footer {
  font-family: 'Barlow', sans-serif !important;
}

header h1, .section-title, .stat-num {
  font-family: 'DM Serif Display', serif !important;
}

.filter-label, .eyebrow, .sub-region, .sub-region-label, .header-eyebrow {
  font-family: 'Bebas Neue', sans-serif !important;
  letter-spacing: 2px;
}

/* ── Back-Home Button ────────────────────────────────────────────────── */
.back-home-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 28px;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.back-home-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--glow);
}

/* ── Regional Color Bar (top accent stripe) ──────────────────────────── */
.region-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 50%, var(--accent2) 100%);
  opacity: 0.85;
}

/* ── Page Header ─────────────────────────────────────────────────────── */
header {
  background: linear-gradient(150deg, #08090d 0%, #0d1228 45%, #120d10 100%);
  border-bottom: 1px solid var(--border);
  padding: 60px 48px 48px;
  position: relative;
  overflow: hidden;
}

header::before {
  content: attr(data-watermark);
  position: absolute;
  font-size: 540px;
  opacity: 0.018;
  color: var(--accent);
  right: -60px;
  top: -180px;
  line-height: 1;
  pointer-events: none;
  font-family: serif;
}

header::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 400px;
  background: radial-gradient(ellipse, var(--glow) 0%, transparent 65%);
  left: -80px;
  bottom: -80px;
  pointer-events: none;
}

.eyebrow, .header-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

header h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.08;
  max-width: 780px;
  position: relative;
  letter-spacing: -0.5px;
}

header h1 em, header h1 span {
  color: var(--accent);
  font-style: italic;
}

header p {
  color: var(--muted);
  margin-top: 16px;
  font-size: 0.93rem;
  max-width: 640px;
  position: relative;
  line-height: 1.7;
}

/* ── Stats Bar ───────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 0;
  margin-top: 36px;
  flex-wrap: wrap;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.015);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 24px;
  flex: 1;
  min-width: 100px;
  border-right: 1px solid var(--border);
}

.stat:last-child { border-right: none; }

.stat-num {
  font-size: 2rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* ── Filter Bar ──────────────────────────────────────────────────────── */
.filters {
  padding: 18px 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: sticky;
  top: 56px;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.filter-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-right: 6px;
}

.filter-btn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  font-family: 'Barlow', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: rgba(58, 123, 213, 0.5);
  color: var(--text);
  background: var(--glow);
}

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--highlight);
}

/* ── Main Content ────────────────────────────────────────────────────── */
.main {
  padding: 40px 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── Section ─────────────────────────────────────────────────────────── */
.section {
  margin-bottom: 52px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.section-count, .section-sub, .section-badge {
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ── Card Grid ───────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.22s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.22s ease;
  transform-origin: bottom;
}

.card:hover {
  border-color: var(--accent);
  background: rgba(30, 30, 50, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card:hover::before {
  transform: scaleY(1);
}

.card-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: 4px;
}

.card-url {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.card-url:hover {
  opacity: 1;
  text-decoration: underline;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.55;
}

/* ── Tags ────────────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.tag {
  font-size: 0.67rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(58, 123, 213, 0.12);
  color: #8fb4e8;
  border: 1px solid rgba(58, 123, 213, 0.22);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ── Info Note ────────────────────────────────────────────────────────── */
.note, .info-box {
  background: rgba(245, 200, 66, 0.06);
  border: 1px solid rgba(245, 200, 66, 0.18);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: #b8a860;
  margin-bottom: 18px;
  line-height: 1.55;
}

/* ── Sub-region Dividers ─────────────────────────────────────────────── */
.sub-region, .sub-region-label, .country-divider {
  font-size: 0.9rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-region::before, .sub-region-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--accent);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  line-height: 1.6;
}

/* ── Hidden Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Global Header (Inline Nav) ──────────────────────────────────────── */
.ec-global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 12, 20, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #23263a;
}

.ec-global-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ec-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #e8ebff;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}

.ec-brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
}

.ec-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ec-nav-toggle {
  display: none;
  border: 1px solid #313756;
  background: #13182a;
  color: #e8ebff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.ec-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.ec-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ec-nav-links a,
.ec-hub-trigger {
  color: #9ba3c7;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-block;
  font-family: 'Barlow', sans-serif;
  transition: all 0.15s ease;
}

.ec-nav-links a:hover,
.ec-hub-trigger:hover {
  color: #eef1ff;
  border-color: #2f3552;
  background: #171c2e;
}

.ec-hub-wrap { position: relative; }

.ec-hub-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ec-hub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #13182a;
  border: 1px solid #2f3552;
  border-radius: var(--radius-md);
  padding: 8px 0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  max-height: 70vh;
  overflow-y: auto;
}

.ec-hub-wrap.open .ec-hub-menu { display: block; }

.ec-hub-menu a {
  display: block;
  padding: 8px 14px;
  border-radius: 0;
  color: #9ba3c7;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.12s;
}

.ec-hub-menu a:hover {
  background: #1b2138;
  color: #eef1ff;
}

.ec-hub-group {
  padding: 10px 14px 4px;
  color: #6f7ca9;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ec-hub-sub { padding-left: 26px !important; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ec-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .ec-nav {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .ec-nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    background: #111628;
    border: 1px solid #2f3552;
    border-radius: var(--radius-md);
    padding: 8px;
  }

  .ec-nav.open .ec-nav-links { display: flex; }

  .ec-nav-links li { width: 100%; }

  .ec-nav-links a,
  .ec-hub-trigger { width: 100%; text-align: left; }

  .ec-hub-wrap { width: 100%; }

  .ec-hub-menu {
    position: static;
    display: none;
    box-shadow: none;
    margin-top: 6px;
  }

  .ec-hub-wrap.open .ec-hub-menu { display: block; }

  .filters { top: 98px !important; }
}

@media (max-width: 720px) {
  header { padding: 40px 24px 36px; }
  .filters { padding: 14px 20px; gap: 6px; }
  .main { padding: 28px 20px; }
  .stats-bar { max-width: 100%; }
  .stat { padding: 12px 16px; min-width: 80px; }
  .stat-num { font-size: 1.5rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
}

@media (max-width: 480px) {
  header { padding: 28px 16px 28px; }
  .filters { padding: 12px 16px; }
  .main { padding: 20px 16px; }
  header h1 { font-size: 1.8rem; }
  .stats-bar { flex-direction: column; }
  .stat { border-right: none !important; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
  .grid { grid-template-columns: 1fr; }
  .section-header { flex-wrap: wrap; }
  .section-count, .section-sub, .section-badge { margin-left: 0; }
}
