/* Global Dialogue on AI Governance — Digital Registry (static build).
   Framework-free. Brand color is driven by --primary (set from data.json meta by app.js). */

:root { --primary: #0077B6; --primary-dark: #023E8A; }

* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0; padding: 0; background: #f8f9fa; color: #222;
}

/* Header / banner */
.banner-header {
  width: 100%; overflow: hidden; line-height: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
/* show the official banner in full (it already contains the title) — never crop it */
.banner-header img { width: 100%; height: auto; display: block; }
.banner-fallback { color: #fff; font-weight: 700; font-size: clamp(20px, 4vw, 32px); text-align: center; padding: 20px; }
.subtitle-bar {
  background: var(--primary-dark); color: #fff; text-align: center;
  padding: 8px 12px; font-size: clamp(13px, 2.4vw, 16px); font-weight: 300; letter-spacing: .3px;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { max-width: 1500px; margin: 0 auto; padding: 15px 12px 40px; }

/* Intro + search */
.intro-section { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.intro-title { color: var(--primary); font-size: clamp(18px, 3.2vw, 23px); font-weight: 700; margin: 0 0 8px; }
.intro-text { color: #555; margin: 0 0 18px; font-size: clamp(14px, 2.4vw, 16px); }
.search-row { display: flex; flex-wrap: wrap; gap: 14px; }
.search-row .field { display: flex; flex-direction: column; gap: 5px; }
.search-row .field.grow { flex: 1 1 280px; }
.search-row label { font-weight: 600; font-size: 14px; color: #333; }
select, input[type="text"] {
  border: 1px solid #ccc; border-radius: 6px; padding: 10px 12px; font-size: 15px;
  font-family: inherit; background: #fff; transition: border-color .2s, box-shadow .2s;
}
select:focus, input[type="text"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,119,182,.15); }

/* Filters (collapsible) */
.filters { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); margin-bottom: 15px; border-bottom: 3px solid var(--primary); }
.filters-header {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #f1f4f7; border: none; border-radius: 8px 8px 0 0; padding: 12px 16px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: clamp(15px, 2.6vw, 17px); color: #333;
}
.filters-header:hover { background: #e7ecf1; }
.filters-header .chevron { transition: transform .25s ease; color: var(--primary); font-size: 13px; }
.filters[aria-collapsed="true"] .chevron { transform: rotate(-90deg); }
.filters[aria-collapsed="true"] .filters-body { display: none; }
.filters-body { padding: 16px; }
.facet-block { margin-bottom: 14px; }
.facet-block:last-of-type { margin-bottom: 6px; }
.facet-legend { font-weight: 600; font-size: 13px; color: #444; margin-bottom: 7px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 18px;
  border: 1.5px solid #cfd6dd; background: #fff; color: #333; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s ease; font-family: inherit;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { color: #fff; border-color: transparent; }
.chip:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn { border: none; border-radius: 6px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-clear { background: #e3342f; color: #fff; }
.btn-clear:hover { background: #cc1f1a; }
.btn-csv { background: var(--primary); color: #fff; display: inline-flex; align-items: center; gap: 7px; }
.btn-csv:hover { background: var(--primary-dark); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--primary); margin-bottom: 18px; }
.tab-btn { background: transparent; border: none; padding: 12px 18px; font: inherit; font-weight: 600; font-size: clamp(14px, 2.5vw, 16px); color: #666; cursor: pointer; border-radius: 6px 6px 0 0; }
.tab-btn:hover:not(.active) { background: #eef2f6; color: var(--primary); }
.tab-btn.active { background: var(--primary); color: #fff; }

.count { color: #666; font-size: 14px; margin: 0 2px 14px; }
.empty-state { text-align: center; padding: 50px 20px; color: #666; }

/* Cards */
.cards { display: grid; gap: 18px; grid-template-columns: 1fr; }
.card {
  background: #fff; border: 1px solid #e7ebef; border-left: 4px solid var(--primary); border-radius: 12px;
  padding: 18px; box-shadow: 0 3px 8px rgba(0,0,0,.09); cursor: pointer; position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,119,182,.25); border-color: var(--primary); }
.card:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.card-title { color: var(--primary); font-weight: 700; font-size: 16px; line-height: 1.3; margin-bottom: 10px; }
.card-lead { font-size: 13.5px; color: #555; margin-bottom: 9px; }
.card-lead strong { color: #333; }
.card-desc { font-size: 13px; color: #666; line-height: 1.45; margin-bottom: 12px; }
.tag-label { font-weight: 600; font-size: 12px; color: #333; margin-bottom: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 500; display: inline-block; border: 1px solid;
}
.tag-muted { color: #999; font-style: italic; font-size: 12px; }
.more-info {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 7px 15px;
  background: var(--primary); color: #fff; border-radius: 20px; font-size: 13px; font-weight: 600;
  text-decoration: none; box-shadow: 0 2px 4px rgba(0,119,182,.2);
}
.more-info:hover { background: var(--primary-dark); }

/* Detail */
.detail { max-width: 1000px; margin: 0 auto; }
.back-btn { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; margin-bottom: 18px; }
.back-btn:hover { background: var(--primary-dark); }
.detail-card { background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.detail-card h1 { color: var(--primary); font-size: clamp(22px, 4vw, 28px); line-height: 1.3; border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin: 0 0 22px; }
.detail-section { margin-bottom: 24px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h3 { color: var(--primary); font-size: 17px; margin: 0 0 9px; border-bottom: 2px solid var(--primary); padding-bottom: 5px; }
.detail-section .body { line-height: 1.6; color: #333; font-size: 15.5px; }
.detail-section .body p { margin: 5px 0 10px; }
.detail-section ul { margin: 5px 0; padding-left: 20px; }
.detail-section li { margin: 3px 0; }

/* Charts */
.chart-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); margin-bottom: 20px; overflow: hidden; }
.chart-title { background: #f1f4f7; padding: 14px 20px; border-bottom: 1px solid #e7ebef; font-weight: 700; font-size: clamp(15px, 2.8vw, 19px); color: #333; margin: 0; }
.chart-body { padding: 18px; }
.chart { width: 100%; min-height: 320px; }
.chart-note { font-size: 12px; color: #666; font-style: italic; margin-top: 8px; padding: 0 4px; }

/* Footer */
.footer { text-align: center; color: #8a929a; font-size: 12px; padding: 24px 12px 8px; }
.sample-note { display: inline-block; background: #fff4e5; color: #8a5a00; border: 1px solid #ffd8a8; border-radius: 6px; padding: 6px 12px; margin-bottom: 8px; font-size: 12.5px; }

/* Responsive */
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .cards { grid-template-columns: repeat(4, 1fr); } }
