/* HEARING.co.il · Design System v1.1 upgrade layer · 2026-10-22 · DRAFT / L2 offline
   Loaded AFTER hearing.css. Adds colour and components on top of v1. Changes nothing in v1:
   no selector in hearing.css is overridden except .answer (enriched, same markup) and .sources (boxed).
   Sections: U1 hub tones · U2 answer box · U3 reviewer box · U4 sources box · U5 hub hero
   U6 hub cards + illustrations · U7 comparison table · U8 glossary box · U9 key facts / checklist
   U10 compat-DB filter + data-required cells · U11 sample banner · U12 tone pills · U13 print/motion */

/* U1 · hub tones (all text colours >= 4.5:1 on #fff and on their tint) */
:root {
  --tone-basics: #0d5560;   --tone-basics-tint: #e3eeec;
  --tone-devices: #2f4a9e;  --tone-devices-tint: #e6eaf7;
  --tone-connect: #5b3a8e;  --tone-connect-tint: #eee8f6;
  --tone-protect: #8f4300;  --tone-protect-tint: #fbecd9;
  --tone-family: #8e2a4b;   --tone-family-tint: #f8e6ec;
  --tone-daily: #2c5a2e;    --tone-daily-tint: #e5f0e3;
  --tone-db: #0a5a84;       --tone-db-tint: #e2eff7;
  --tone-articles: #17212b; --tone-articles-tint: #ece7dc;
  --tone: var(--accent);    --tone-tint: var(--accent-tint);
  --radius: 6px;
  --shadow-1: 0 1px 2px rgba(23, 33, 43, 0.08), 0 2px 8px rgba(23, 33, 43, 0.06);
}
[data-tone="basics"]   { --tone: var(--tone-basics);   --tone-tint: var(--tone-basics-tint); }
[data-tone="devices"]  { --tone: var(--tone-devices);  --tone-tint: var(--tone-devices-tint); }
[data-tone="connect"]  { --tone: var(--tone-connect);  --tone-tint: var(--tone-connect-tint); }
[data-tone="protect"]  { --tone: var(--tone-protect);  --tone-tint: var(--tone-protect-tint); }
[data-tone="family"]   { --tone: var(--tone-family);   --tone-tint: var(--tone-family-tint); }
[data-tone="daily"]    { --tone: var(--tone-daily);    --tone-tint: var(--tone-daily-tint); }
[data-tone="db"]       { --tone: var(--tone-db);       --tone-tint: var(--tone-db-tint); }
[data-tone="articles"] { --tone: var(--tone-articles); --tone-tint: var(--tone-articles-tint); }

/* U2 · answer box (same .answer markup, richer look; new .answer-box adds the label) */
.answer, .answer-box {
  border: 1px solid var(--rule); border-inline-start: 6px solid var(--tone);
  background: var(--tone-tint); border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s-4) var(--s-5); max-width: var(--measure); margin-bottom: var(--s-5);
}
.answer > :last-child, .answer-box > :last-child { margin-bottom: 0; }
.answer-box__label {
  display: inline-block; font-size: var(--fs-0); font-weight: 800; letter-spacing: 0.02em;
  color: #fff; background: var(--tone); padding: 0.1em 0.6em; border-radius: 3px; margin-bottom: var(--s-2);
}

/* U3 · reviewer box (replaces the plain .meta-bar on upgraded pages) */
.reviewer-box {
  display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius);
  padding: var(--s-4); margin-bottom: var(--s-5); max-width: 52rem; font-size: var(--fs-0);
  box-shadow: var(--shadow-1);
}
.reviewer-box > div { margin: 0; border-inline-start: 3px solid var(--rule); padding-inline-start: var(--s-3); }
.reviewer-box dt { font-weight: 800; color: var(--ink); }
.reviewer-box dd { margin: 0; color: var(--ink-2); }
.reviewer-box .is-pending { border-inline-start-color: var(--warn); }
.reviewer-box .is-pending dd { color: var(--warn); font-weight: 700; }
.reviewer-box__note { grid-column: 1 / -1; border: 0 !important; padding: 0 !important; color: var(--ink-2); }

/* U4 · sources box */
.sources-box {
  border: 1px solid var(--rule); border-top: 4px solid var(--ink); background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius); padding: var(--s-4) var(--s-5); max-width: 52rem;
}
.sources-box h2 { font-size: var(--fs-3); margin-bottom: var(--s-2); }
.sources-box .sources { counter-reset: src; list-style: none; padding: 0; margin: 0; }
.sources-box .sources > li {
  counter-increment: src; position: relative; padding-inline-start: 2.5rem;
  padding-block: var(--s-2); border-bottom: 1px dashed var(--rule); margin: 0;
}
.sources-box .sources > li:last-child { border-bottom: 0; }
.sources-box .sources > li::before {
  content: counter(src); position: absolute; inset-inline-start: 0; top: var(--s-2);
  width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--sunken); font-family: var(--mono); font-weight: 700; font-size: var(--fs-0);
}
.sources-box__meta { font-size: var(--fs-0); color: var(--ink-2); }

/* U5 · hub hero */
.hub-hero {
  display: grid; gap: var(--s-5); align-items: center;
  background: linear-gradient(135deg, var(--tone-tint) 0%, var(--surface) 70%);
  border: 1px solid var(--rule); border-top: 6px solid var(--tone); border-radius: var(--radius);
  padding: var(--s-5); margin-bottom: var(--s-6);
}
.hub-hero h1 { margin-bottom: var(--s-3); }
.hub-hero .lead { margin-bottom: 0; }
.hub-hero__art { width: 7rem; height: 7rem; color: var(--tone); justify-self: start; }
.hub-hero__art svg { width: 100%; height: 100%; }
.hub-hero__stats { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: var(--s-4) 0 0; }
.hub-hero__stats li { margin: 0; }
@media (min-width: 48rem) {
  .hub-hero { grid-template-columns: minmax(0, 1fr) 9rem; padding: var(--s-6); }
  .hub-hero__art { width: 9rem; height: 9rem; justify-self: end; }
}

/* U6 · hub cards with illustrations (tone varies per card: never identical cards) */
.hub-cards { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); list-style: none; padding: 0; margin: 0 0 var(--s-5); }
.hub-cards > li { margin: 0; }
.hub-card {
  height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s-2);
  background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--tone);
  border-radius: var(--radius); padding: var(--s-4); box-shadow: var(--shadow-1);
}
.hub-card__art { width: 3.25rem; height: 3.25rem; color: var(--tone); background: var(--tone-tint); border-radius: 50%; display: grid; place-items: center; }
.hub-card__art svg { width: 2.25rem; height: 2.25rem; }
.hub-card h3 { font-size: var(--fs-2); margin: 0; }
.hub-card h3 a { color: var(--ink); text-decoration: none; }
.hub-card h3 a::after { content: ""; position: absolute; inset: 0; }
.hub-card { position: relative; }
.hub-card:hover { border-color: var(--tone); }
.hub-card:hover h3 a { text-decoration: underline; text-decoration-color: var(--tone); }
.hub-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.hub-card p { margin: 0; font-size: var(--fs-1); color: var(--ink-2); }
.hub-card__links { list-style: none; padding: 0; margin: 0; font-size: var(--fs-0); position: relative; z-index: 1; }
.hub-card__links li { margin: 0; }
.hub-card__links a { display: inline-flex; min-height: 2.25rem; align-items: center; }
.hub-card__kind { font-size: var(--fs-0); font-weight: 800; color: var(--tone); }

/* U7 · comparison table (description only: no winner column, no highlight, no score) */
.compare { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow-x: auto; margin-bottom: var(--s-3); }
.compare .data-table { min-width: 40rem; }
.compare .data-table thead th { background: var(--tone-tint); color: var(--ink); }
.compare .data-table tbody th { position: sticky; inset-inline-start: 0; background: var(--surface); box-shadow: inset -1px 0 0 var(--rule); }
.compare__note { font-size: var(--fs-0); color: var(--ink-2); max-width: var(--measure); }
.compare__note::before { content: "⚖ "; }

/* U8 · glossary box */
.glossary-box { border: 1px solid var(--rule); border-inline-start: 6px solid var(--tone-connect); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: var(--s-4) var(--s-5); max-width: 52rem; margin-bottom: var(--s-5); }
.glossary-box h2, .glossary-box h3 { font-size: var(--fs-2); margin: 0 0 var(--s-3); border: 0; padding: 0; }
.glossary-box dl { display: grid; gap: var(--s-3); margin: 0; }
.glossary-box dl > div { margin: 0; }
.glossary-box dt { font-weight: 800; }
.glossary-box dt a { color: var(--ink); }
.glossary-box dd { margin: 0; font-size: var(--fs-1); color: var(--ink-2); }
@media (min-width: 48rem) { .glossary-box dl { grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-6); } }

/* U9 · key facts and checklist */
.keyfacts { list-style: none; padding: 0; margin: 0 0 var(--s-5); max-width: var(--measure); display: grid; gap: var(--s-2); }
.keyfacts li { margin: 0; position: relative; padding: var(--s-2) var(--s-3); padding-inline-start: 2rem; background: var(--tone-tint); border-radius: var(--radius); }
.keyfacts li::before { content: ""; position: absolute; inset-inline-start: 0.75rem; top: 1.05em; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--tone); }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--s-5); max-width: var(--measure); }
.checklist li { position: relative; padding-inline-start: 2rem; margin: 0; padding-block: var(--s-2); border-bottom: 1px solid var(--rule); }
.checklist li::before { content: "☐"; position: absolute; inset-inline-start: 0; top: var(--s-2); font-size: 1.15em; line-height: 1.5; color: var(--tone); }

/* U10 · compatibility DB: filter panel, search, table, missing data */
.db-filter { border: 1px solid var(--rule); border-top: 4px solid var(--tone-db); background: var(--surface); border-radius: var(--radius); padding: var(--s-4); margin-bottom: var(--s-4); }
.db-filter .field { max-width: none; margin-bottom: var(--s-3); }
.db-filter .chips { margin-bottom: 0; }
.db-table td, .db-table th { white-space: nowrap; }
.db-table td.is-missing { color: var(--warn); font-family: var(--mono); font-size: var(--fs-0); font-weight: 700; background: repeating-linear-gradient(-45deg, var(--warn-tint), var(--warn-tint) 6px, #fff 6px, #fff 12px); }
.db-table td.is-na { color: var(--ink-2); }
.db-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-0); color: var(--ink-2); list-style: none; padding: 0; margin: 0 0 var(--s-4); }
.db-legend li { margin: 0; }
.entity-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); margin-bottom: var(--s-5); }
.entity { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: var(--s-4); font-size: var(--fs-1); }
.entity h3 { font-size: var(--fs-2); margin-bottom: var(--s-2); font-family: var(--mono); color: var(--tone-db); }
.entity ul { margin: 0; padding-inline-start: 1rem; font-size: var(--fs-0); }

/* U11 · sample / template banner (pages that are structure only) */
.sample-banner { border: 2px dashed var(--warn); background: var(--warn-tint); color: var(--ink); padding: var(--s-3) var(--s-4); border-radius: var(--radius); max-width: 52rem; margin-bottom: var(--s-5); font-size: var(--fs-1); }
.sample-banner strong { color: var(--warn); }

/* U12 · tone pills */
.pill { display: inline-flex; align-items: center; gap: 0.35em; font-size: var(--fs-0); font-weight: 700; line-height: 1.4; padding: 0.15em 0.7em; border-radius: 999px; background: var(--tone-tint); color: var(--ink); border: 1px solid var(--tone); }
.pill--count { font-family: var(--mono); }

/* section heading accent on upgraded pages */
.has-tone .section > h2::before, .has-tone .prose h2::before {
  content: ""; display: inline-block; width: 0.5rem; height: 0.9em; background: var(--tone);
  margin-inline-end: var(--s-2); border-radius: 2px; vertical-align: -0.05em;
}

/* U13 · print / motion */
@media (prefers-reduced-motion: no-preference) {
  .hub-card { transition: border-color 0.12s, box-shadow 0.12s; }
  .hub-card:hover { box-shadow: 0 2px 4px rgba(23, 33, 43, 0.1), 0 6px 16px rgba(23, 33, 43, 0.08); }
}
@media print {
  .hub-hero, .answer, .answer-box, .keyfacts li { background: #fff !important; }
  .hub-card { box-shadow: none; break-inside: avoid; }
  .db-filter { display: none; }
}
