/* ================================================
   UK SE Education AI Readiness — Shared Styles
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=Open+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --cream: #FAF7F2;
  --warm-white: #FFFDF9;
  --text-dark: #2C1810;
  --text-mid: #5C4A3E;
  --text-light: #8C7B6F;
  --accent: #C4501C;
  --accent-light: #E8714A;
  --accent-bg: rgba(196,80,28,0.06);
  --border: rgba(92,74,62,0.12);
  --border-strong: rgba(92,74,62,0.25);
  --green: #2D7D46;
  --green-bg: rgba(45,125,70,0.1);
  --amber: #9E6B14;
  --amber-bg: rgba(158,107,20,0.1);
  --red: #B5392A;
  --red-bg: rgba(181,57,42,0.08);
  --grey-bg: rgba(92,74,62,0.05);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Open Sans', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--cream); color: var(--text-dark); line-height: 1.7; font-size: 15px; }
.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- SITE HEADER ---- */
.site-header { background: var(--warm-white); border-bottom: 3px solid var(--accent); padding: 20px 0 16px; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-brand { font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--text-dark); }
.site-brand a { color: var(--text-dark); }
.site-brand a:hover { text-decoration: none; color: var(--accent); }

/* ---- SITE NAV ---- */
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  font-size: 12px; font-weight: 600; color: var(--text-light);
  padding: 6px 12px; border-radius: 4px; transition: all 0.2s;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text-dark); background: var(--accent-bg); }
.site-nav a.active { color: var(--accent); background: var(--accent-bg); }

/* ---- PAGE CONTENT ---- */
.page-content { padding: 40px 0 80px; }

/* ---- TYPOGRAPHY ---- */
h1 { font-family: var(--serif); font-size: 32px; font-weight: 500; color: var(--text-dark); line-height: 1.25; margin-bottom: 16px; }
h2 { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--text-dark); margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-family: var(--serif); font-size: 17px; font-weight: 500; color: var(--text-dark); margin: 28px 0 8px; }
p { margin-bottom: 14px; color: var(--text-mid); }
.lead { font-size: 17px; line-height: 1.8; color: var(--text-mid); margin-bottom: 24px; }
.accent-text { color: var(--accent); }
.small-caps { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-light); }

/* ---- BADGES ---- */
.draft-badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  letter-spacing: 0.5px; vertical-align: middle; margin-left: 8px; position: relative; top: -3px;
}

/* ---- CARDS ---- */
.card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px 28px; margin-bottom: 16px;
}
.card h3 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }

/* ---- NAV CARDS (homepage) ---- */
.nav-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: 8px; padding: 28px 28px 24px; transition: all 0.2s;
  text-decoration: none; display: block;
}
.nav-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(44,24,16,0.06); text-decoration: none; }
.nav-card .card-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.nav-card h3 { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--text-dark); margin: 0 0 8px; }
.nav-card p { font-size: 13px; color: var(--text-mid); margin: 0; line-height: 1.6; }
.nav-card .arrow { color: var(--accent); font-size: 13px; font-weight: 600; margin-top: 12px; display: inline-block; }

/* ---- INSIGHT BOXES ---- */
.insight-box {
  background: var(--warm-white); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  padding: 20px 24px; margin: 24px 0;
}
.insight-box h3 { font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--text-dark); margin: 0 0 8px; }
.insight-box p { font-size: 14px; color: var(--text-mid); margin: 0; }

/* ---- PULL QUOTE ---- */
.pull-quote {
  font-family: var(--serif); font-size: 20px; font-weight: 400; font-style: italic;
  color: var(--accent); padding: 20px 0 20px 24px;
  border-left: 3px solid var(--accent); margin: 32px 0;
  line-height: 1.5;
}

/* ---- METRIC CARDS ---- */
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.metric-card { background: var(--warm-white); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; }
.metric-card .label { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.metric-card .value { font-family: var(--serif); font-size: 28px; font-weight: 500; color: var(--text-dark); margin: 4px 0 2px; }
.metric-card .note { font-size: 11px; color: var(--text-light); }
.metric-card .note .red { color: var(--red); font-weight: 600; }

/* ---- HEATMAP TABLE ---- */
.heatmap-wrap { overflow-x: auto; margin-bottom: 20px; }
.heatmap { width: 100%; border-collapse: collapse; font-size: 12px; }
.heatmap th { text-align: left; font-weight: 600; font-size: 11px; color: var(--text-light); padding: 8px 6px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.heatmap th.dim-col { cursor: pointer; }
.heatmap th.dim-col:hover { color: var(--accent); }
.heatmap td { padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.heatmap .inst-name { font-weight: 600; min-width: 110px; cursor: pointer; color: var(--text-dark); font-size: 12px; }
.heatmap .inst-name:hover { color: var(--accent); text-decoration: underline; }
.heatmap .tier-row td { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 6px 4px; border-bottom: none; font-weight: 700; }
.cell { display: inline-block; width: 100%; text-align: center; padding: 3px 0; border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }
.cell-strong { background: var(--green-bg); color: var(--green); }
.cell-partial { background: var(--amber-bg); color: var(--amber); }
.cell-limited { background: var(--red-bg); color: var(--red); }
.cell-none { background: var(--grey-bg); color: var(--text-light); }

/* ---- LEGEND ---- */
.legend { display: flex; gap: 18px; font-size: 11px; color: var(--text-light); margin: 10px 0; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ---- PROFILE ---- */
.profile-header { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 16px; border-bottom: 2px solid var(--accent); margin-bottom: 20px; }
.profile-header h2 { font-family: var(--serif); font-size: 22px; font-weight: 500; margin: 0; border: none; padding: 0; }
.profile-meta { text-align: right; font-size: 12px; color: var(--text-light); }
.tier-badge { display: inline-block; background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px; }
.context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.context-card { background: var(--warm-white); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; }
.context-card .label { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.context-card .val { font-size: 14px; font-weight: 600; margin-top: 2px; color: var(--text-dark); }
.context-card .sub { font-size: 11px; color: var(--text-light); }

/* ---- DIMENSION CARDS ---- */
.dim-card { background: var(--warm-white); border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; margin-bottom: 12px; }
.dim-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dim-card-header h3 { font-family: var(--serif); font-size: 15px; font-weight: 500; margin: 0; }
.score-pill { font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 12px; }
.pill-strong { background: var(--green-bg); color: var(--green); }
.pill-partial { background: var(--amber-bg); color: var(--amber); }
.pill-limited { background: var(--red-bg); color: var(--red); }
.pill-none { background: var(--grey-bg); color: var(--text-light); }
.evidence-text { font-size: 13px; color: var(--text-mid); line-height: 1.7; margin-bottom: 8px; }
.indicators { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ind { font-size: 10px; padding: 3px 8px; border-radius: 3px; font-weight: 600; }
.ind-yes { background: var(--green-bg); color: var(--green); }
.ind-no { background: var(--red-bg); color: var(--red); }
.ind-partial { background: var(--amber-bg); color: var(--amber); }
.ind-unknown { background: var(--grey-bg); color: var(--text-light); }

/* ---- DIMENSION TABS ---- */
.dim-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.dim-tab { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--sans); }
.dim-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.dim-tab:hover { color: var(--text-dark); }

/* ---- NAV TABS (dashboard) ---- */
.nav-tabs { background: var(--warm-white); border-bottom: 1px solid var(--border); padding: 0; position: sticky; top: 0; z-index: 100; }
.nav-tabs .container { display: flex; gap: 0; }
.nav-tab { padding: 12px 18px; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--sans); }
.nav-tab:hover { color: var(--text-dark); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- STAT CARDS ---- */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--warm-white); border: 1px solid var(--border); border-radius: 6px; padding: 12px; text-align: center; }
.stat-card .num { font-family: var(--serif); font-size: 30px; font-weight: 500; }
.stat-card .num.red { color: var(--red); }
.stat-card .lbl { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* ---- BAR CHARTS ---- */
.tier-section { margin-bottom: 16px; }
.tier-heading { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.inst-row { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.inst-row:last-child { border-bottom: none; }
.inst-row .name { font-size: 13px; font-weight: 600; min-width: 130px; cursor: pointer; }
.inst-row .name:hover { color: var(--accent); }
.bar-track { flex: 1; height: 16px; background: var(--grey-bg); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.bar-strong { background: rgba(45,125,70,0.4); }
.bar-partial { background: rgba(158,107,20,0.35); }
.bar-limited { background: rgba(181,57,42,0.3); }
.bar-none { background: var(--grey-bg); }
.inst-row .score-label { font-size: 11px; min-width: 65px; text-align: right; color: var(--text-light); }

/* ---- SUB-INDICATORS ---- */
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.sub-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-mid); }
.sub-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-yes { background: var(--green); }
.dot-partial { background: var(--amber); }
.dot-no { background: var(--red); }
.dot-unknown { background: var(--text-light); }

/* ---- MISC ---- */
.back-btn { font-size: 12px; color: var(--accent); cursor: pointer; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 4px; background: none; border: none; font-family: var(--sans); font-weight: 600; }
.back-btn:hover { text-decoration: underline; }
.sources { margin-top: 8px; }
.source-link { font-size: 10px; color: var(--accent); word-break: break-all; }
.view { display: none; padding: 28px 0 60px; }
.view.active { display: block; }
.section-title { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--text-dark); margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ---- FOOTER ---- */
.site-footer { background: var(--warm-white); border-top: 1px solid var(--border); padding: 24px 0; text-align: center; font-size: 11px; color: var(--text-light); }

/* ---- RESPONSIVE ---- */
@media (max-width: 720px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .context-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .sub-grid { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .profile-meta { text-align: left; }
  .card-grid { grid-template-columns: 1fr; }
  .site-header .container { flex-direction: column; gap: 10px; }
  .site-nav { flex-wrap: wrap; }
  h1 { font-size: 26px; }
}
