/* ============================================================================
 * WHS Updates — Design System (Stage 1)
 * ============================================================================
 * Pure CSS + semantic HTML. No framework, no JS library.
 *
 * Colour semantics
 *   Confirmed     = green     #1B7A43
 *   Proposed      = amber     #B26A00
 *   Recalled      = red       #B3261E
 *   Superseded    = grey      #6B7280
 *   Brand navy    = #003B5C
 *   Accent azure  = #005EB8
 *   Background    = #F4F8FC
 *   Surface       = #FFFFFF
 *
 * Typography
 *   Display (headings): serif (Georgia / 'Times New Roman')
 *   Body: sans-serif (system stack), 16px, line-height 1.6
 *   Meta/data: small muted sans-serif
 *
 * Accessibility
 *   Skip link, :focus-visible, screen-reader-only, WCAG AA contrast,
 *   semantic landmarks, keyboard navigation.
 * ========================================================================= */

:root {
  --navy: #003B5C;
  --azure: #005EB8;
  --green: #1B7A43;
  --amber: #B26A00;
  --red: #B3261E;
  --grey: #6B7280;
  --bg: #F4F8FC;
  --surface: #FFFFFF;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #D9E2EC;
  --max-width: 1100px;
}

/* ---------- Reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -40px; left: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 0.5rem 1rem;
}
.skip-link:focus { top: 0; }

/* ---------- Layout ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* ---------- Header / brand ---------- */
.site-header {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 0;
}
.site-header .logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem; font-weight: 700; color: #fff;
}
.site-header .logo span { color: var(--azure); }
.site-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.site-nav a {
  color: #fff; text-decoration: none; padding: 0.4rem 0.7rem;
  border-radius: 4px; font-size: 0.9rem;
}
.site-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ---------- Search bar ---------- */
.search-bar {
  display: flex; gap: 0.5rem; max-width: 640px; margin: 1.5rem auto;
  padding: 0 1rem;
}
.search-bar input {
  flex: 1; padding: 0.75rem 1rem; border: 2px solid var(--border);
  border-radius: 8px; font-size: 1rem; background: var(--surface);
}
.search-bar input:focus {
  outline: 3px solid var(--azure); border-color: var(--azure);
}
.search-bar button {
  padding: 0.75rem 1.25rem; background: var(--azure); color: #fff;
  border: none; border-radius: 8px; font-size: 1rem; cursor: pointer;
}
.search-bar button:hover { background: #004a8c; }

/* ---------- Filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  margin: 1.5rem 0; padding: 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.filter-label { font-weight: 700; color: var(--navy); margin-right: 0.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 0.6rem 1rem; border: none;
  border-radius: 8px; font-size: 0.95rem; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #002B45; }
.btn-ghost {
  background: transparent; color: var(--navy); border: 1px solid var(--navy);
}
.btn-ghost:hover { background: rgba(0,59,92,0.08); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 5px solid var(--navy); border-radius: 10px;
  padding: 1.25rem; margin: 1rem 0; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.card h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; margin-bottom: 0.4rem; }
.card .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.6rem; }
.card p { margin-bottom: 0.6rem; }
/* Long source URLs and codes break cleanly on narrow screens. */
.meta,
.card .meta,
span.meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Status badges ---------- */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.badge-confirmed  { background: #D4EDDA; color: #12502F; border: 1px solid #BBF7D0; }
.badge-proposed   { background: #FEF3C7; color: #854D0E; border: 1px solid #FCD34D; }
.badge-recalled   { background: #FADBD8; color: #7F1D1D; border: 1px solid #F5B7B1; }
.badge-superseded { background: #E5E7EB; color: #4B5563; border: 1px solid #D1D5DB; }
.badge-enacted    { background: #E0F2FE; color: #075273; border: 1px solid #7DD3FC; }

/* ---------- Research snapshot panel ---------- */
.snapshot {
  background: #F0F7FB; border: 1px solid var(--border);
  border-left: 5px solid var(--azure); border-radius: 6px;
  padding: 1rem; margin-top: 1rem;
}
.snapshot h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; color: var(--navy); margin-bottom: 0.4rem; }
.snapshot .pair { display: flex; gap: 0.5rem; margin-bottom: 0.35rem; }
.snapshot .pair .k { font-weight: 700; color: var(--muted); min-width: 9rem; }

/* ---------- Ticker ---------- */
.ticker-wrapper { background: var(--navy); color: #fff; padding: 0.5rem 0; border-bottom: 3px solid var(--azure); overflow: hidden; }
.ticker { display: flex; animation: ticker 60s linear infinite; white-space: nowrap; }
.ticker-item { padding: 0 1.5rem; font-size: 0.9rem; }
.ticker-item span { color: var(--azure); margin-right: 8px; font-weight: 700; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface); border-radius: 10px; padding: 1.25rem;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-top: 4px solid var(--navy);
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Section titles ---------- */
.section-title {
  font-size: 1.4rem; font-weight: 600; margin-bottom: 1rem; color: var(--navy);
  border-left: 4px solid var(--azure); padding-left: 12px;
}

/* ---------- Subscribe ---------- */
.subscribe {
  background: linear-gradient(135deg, var(--navy), var(--azure));
  border-radius: 12px; padding: 2rem; text-align: center; color: #fff;
  border: 2px solid var(--azure); margin-bottom: 2rem;
}
.subscribe h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.subscribe p { opacity: 0.9; margin-bottom: 1.5rem; }
.subscribe-form { display: flex; gap: 8px; max-width: 500px; margin: 0 auto; }
.subscribe-form input {
  flex: 1; padding: 12px 16px; border-radius: 8px; border: none; font-size: 1rem;
}
.subscribe-form button {
  background: var(--azure); color: #fff; border: none; padding: 12px 24px;
  border-radius: 8px; font-size: 1rem; cursor: pointer; font-weight: 600;
}
.subscribe-form button:hover { background: #004a8c; }

/* ---------- Safety stripe ---------- */
.safety-stripe { height: 8px; background: repeating-linear-gradient(45deg, var(--azure), var(--azure) 10px, var(--navy) 10px, var(--navy) 20px); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy); color: #EAF3FB; text-align: center;
  padding: 1.5rem; font-size: 0.85rem;
}
.site-footer a { color: var(--azure); text-decoration: none; }

/* ---------- Live indicator ---------- */
.live-dot {
  display: inline-block; width: 8px; height: 8px; background: var(--azure);
  border-radius: 50%; margin-right: 6px; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .filters { flex-direction: column; align-items: flex-start; }
  .filters .btn-filter { width: 100%; }
  .search-bar { flex-direction: column; }
}
