/* ═══════════════════════════════════════════════════════════════
   report.css — Shared stylesheet for all MOJ Scouting Report files
   Ministry of Justice Strategic Scouting 2026
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --navy: #0B1F4B;
  --blue: #1A3A8F;
  --light-blue: #2E5FD4;
  --accent: #C9A227;
  --accent-gold: #C9A227;
  --teal: #0891B2;
  --accent-teal: #0891B2;
  --light: #F8FAFC;
  --light-gray: #F8FAFC;
  --border: #E2E8F0;
  --text: #1E293B;
  --muted: #64748B;
  --enforcement: #DC2626;
  --service: #059669;
}

body {
  font-family: 'Heebo', sans-serif;
  background: var(--light);
  color: var(--text);
  line-height: 1.7;
}

/* ═══════════════════════════════
   TOPBAR (topic pages)
   ═══════════════════════════════ */
.topbar {
  background: var(--navy);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color .2s;
}
.topbar a:hover { color: white; }
.topbar-sep { color: rgba(255,255,255,0.3); font-size: 0.75rem; }
.topbar-title {
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ═══════════════════════════════
   HERO (topic pages)
   ═══════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 60%, var(--light-blue) 100%);
  color: white;
  padding: 64px 40px 52px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
}
.hero h1 span { color: var(--accent); }
.hero-desc {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 700px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* ── Category & ItemType badges in hero ── */
.meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.cat-badge.type {
  background: rgba(201,162,39,0.25);
  border-color: rgba(201,162,39,0.5);
  color: #FFD97A;
}

/* ── KPIs ── */
.hero-kpis {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.kpi {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 16px 24px;
  min-width: 140px;
}
.kpi .kpi-val {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi .kpi-label {
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1.3;
}

/* ═══════════════════════════════
   INDEX HERO (index.html only)
   ═══════════════════════════════ */
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  padding: 6px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero.index-hero { text-align: center; padding: 80px 40px 60px; }
.hero.index-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.hero.index-hero h1 span { color: var(--accent-gold); }
.hero-sub {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent-gold);
  line-height: 1;
}
.hero-stat .lbl {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 4px;
}

/* ═══════════════════════════════
   CONTAINER
   ═══════════════════════════════ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ═══════════════════════════════
   SECTION HEADER (index.html)
   ═══════════════════════════════ */
.section-header { padding: 56px 0 32px; }
.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.domain-badge.enforcement { background: #FEF2F2; color: var(--enforcement); border: 1px solid #FECACA; }
.domain-badge.service { background: #ECFDF5; color: var(--service); border: 1px solid #A7F3D0; }
.section-header h2 { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.section-header p { color: var(--muted); font-size: 0.95rem; }

/* ═══════════════════════════════
   CARDS GRID (index.html)
   ═══════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding-bottom: 16px;
}
.topic-card {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(11,31,75,0.12);
}
.card-top { padding: 28px 28px 20px; flex: 1; }
.card-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* Category chip inside card-num */
.card-num .cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.card-num .type-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
/* card-icon removed from design — kept hidden if still in markup */
.card-icon { display: none; }
.card-title { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; line-height: 1.35; }
.card-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.card-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.card-stat { display: flex; flex-direction: column; }
.card-stat .val { font-size: 1rem; font-weight: 800; color: var(--blue); }
.card-stat .key { font-size: 0.7rem; color: var(--muted); }
.card-footer {
  padding: 12px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--light-gray);
}
/* card-tags removed from design */
.card-tags { display: none; }
.tag { display: none; }
.card-arrow {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background .2s;
}
.topic-card:hover .card-arrow { background: var(--accent-gold); }

/* ═══════════════════════════════
   ECOSYSTEM TAGS ON CARDS (index)
   ═══════════════════════════════ */
.card-eco {
  padding: 10px 28px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #F0F7FF;
}
.eco-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  background: white;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  cursor: default;
  text-decoration: none;
}
.eco-tag:hover .eco-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.eco-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--navy);
  color: white;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all .2s;
  z-index: 50;
  text-align: right;
  pointer-events: none;
}
.eco-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: var(--navy);
}
/* Single-color eco-tags — all variants same blue style */
.eco-tag.initiative,
.eco-tag.system,
.eco-tag.ai { border-color: #BFDBFE; color: #1D4ED8; }

/* ═══════════════════════════════
   TOPIC PAGE LAYOUT
   ═══════════════════════════════ */
.layout {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}
.main-content {}
.sidebar {}

/* ═══════════════════════════════
   SECTIONS (topic pages)
   ═══════════════════════════════ */
.section {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 24px;
}
.section h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  margin: 20px 0 10px;
}
.section p {
  color: var(--text);
  margin-bottom: 12px;
  font-size: 0.92rem;
  line-height: 1.7;
}
.section ul, .section ol {
  padding-right: 20px;
  margin-bottom: 12px;
}
.section li {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 6px;
  line-height: 1.6;
}
.section li strong { color: var(--navy); }

/* ═══════════════════════════════
   CASE BOXES
   ═══════════════════════════════ */
.case-box {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-right: 4px solid var(--teal);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.case-box h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.case-box p, .case-box li {
  font-size: 0.85rem;
  color: var(--muted);
}
.case-results {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.case-results span {
  background: var(--teal);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}

/* ═══════════════════════════════
   STAT ROWS
   ═══════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-card .val {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .lbl { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

/* ═══════════════════════════════
   TECH TAGS
   ═══════════════════════════════ */
.tech-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tech-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
}
.tech-tag.blue { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.tech-tag.gold { background: #FFFBEB; color: #92400E; border-color: #FCD34D; }
.tech-tag.green { background: #ECFDF5; color: #15803D; border-color: #A7F3D0; }
.tech-tag.purple { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }

/* ═══════════════════════════════
   DATA TABLE
   ═══════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 12px; }
.data-table th {
  background: var(--navy);
  color: white;
  padding: 10px 14px;
  text-align: right;
  font-weight: 600;
  font-size: 0.78rem;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--light); }
.data-table td:first-child { font-weight: 600; color: var(--navy); }

/* ═══════════════════════════════
   CONTACT CARDS (sidebar)
   ═══════════════════════════════ */
.contact-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.contact-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.contact { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.contact:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.contact-name { font-weight: 700; font-size: 0.85rem; color: var(--navy); }
.contact-role { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.contact a { font-size: 0.78rem; color: var(--blue); text-decoration: none; display: block; }
.contact a:hover { text-decoration: underline; }

/* ═══════════════════════════════
   BUDGET BOX (sidebar)
   ═══════════════════════════════ */
.budget-box {
  background: var(--navy);
  color: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.budget-box h4 {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.8;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.budget-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem;
}
.budget-line:last-child { border-bottom: none; font-weight: 700; padding-top: 12px; }
.budget-line .amount { font-weight: 700; color: var(--accent); }

/* ═══════════════════════════════
   TIMELINE BOX (sidebar)
   ═══════════════════════════════ */
.timeline-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.timeline-box h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
}
.timeline-step {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.step-num {
  width: 24px;
  height: 24px;
  background: var(--blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content .step-title { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.step-content .step-desc { font-size: 0.75rem; color: var(--muted); }

/* ═══════════════════════════════
   ALERTS
   ═══════════════════════════════ */
.alert {
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  border-right: 4px solid;
}
.alert.info { background: #EFF6FF; border-color: #3B82F6; color: #1E40AF; }
.alert.warn { background: #FFFBEB; border-color: #F59E0B; color: #92400E; }
.alert.success { background: #ECFDF5; border-color: #10B981; color: #065F46; }

/* ═══════════════════════════════
   ECOSYSTEM SECTION (topic pages)
   ═══════════════════════════════ */
.eco-section {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1px solid #BFDBFE;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}
.eco-section h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  border-bottom: none;
  padding-bottom: 0;
}
.eco-section .eco-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.eco-groups { display: flex; flex-direction: column; gap: 16px; }
.eco-group {}
.eco-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.eco-badges { display: flex; gap: 8px; flex-wrap: wrap; }

/* Ecosystem badge (in topic section) */
.eco-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: default;
  white-space: nowrap;
}
.eco-badge:hover .eco-tooltip-box { opacity: 1; visibility: visible; transform: translateY(0); }
.eco-badge.challenge { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.eco-badge.initiative { background: #ECFDF5; color: #14532D; border: 1px solid #BBF7D0; }
.eco-badge.system { background: #F5F3FF; color: #4C1D95; border: 1px solid #DDD6FE; }
.eco-badge.ai-init { background: #FFF7ED; color: #7C2D12; border: 1px solid #FED7AA; }
.eco-badge.layer5 { background: #F0F9FF; color: #075985; border: 1px solid #BAE6FD; }

.eco-tooltip-box {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--navy);
  color: white;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 12px 16px;
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: all .2s;
  z-index: 100;
  text-align: right;
  pointer-events: none;
}
.eco-tooltip-box strong { display: block; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.eco-tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 18px;
  border: 6px solid transparent;
  border-top-color: var(--navy);
}

/* ═══════════════════════════════
   FOOTER
   ═══════════════════════════════ */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 40px 32px;
  margin-top: 64px;
  font-size: 0.85rem;
}
footer strong { color: white; }

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 0 20px; }
  .sidebar { order: -1; }
}
@media (max-width: 640px) {
  .hero { padding: 48px 20px 40px; }
  .hero.index-hero { padding: 48px 20px 40px; }
  .hero-stats { gap: 24px; }
  .container { padding: 0 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .hero-kpis { flex-direction: column; gap: 12px; }
  .kpi { min-width: auto; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
