/* מדריך תקני הזכוכית – styles */
:root {
  --bg: #f6f9fb;
  --surface: #ffffff;
  --surface-2: #eef4f7;
  --text: #0f1f2b;
  --text-2: #3d5260;
  --muted: #5b6f7c;
  --line: #d6e1e8;
  --accent: #0e7490;
  --accent-strong: #0b5c72;
  --accent-soft: #e0f2f7;
  --ok: #166534;
  --ok-soft: #dcfce7;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(15, 31, 43, .06), 0 4px 16px rgba(15, 31, 43, .05);
  --radius: 14px;
  --font: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1820;
    --surface: #12232e;
    --surface-2: #172c39;
    --text: #e8f1f5;
    --text-2: #bccbd4;
    --muted: #94a8b4;
    --line: #26404f;
    --accent: #5fd0ea;
    --accent-strong: #8fe0f2;
    --accent-soft: #123947;
    --ok: #86efac;
    --ok-soft: #133524;
    --warn: #fcd34d;
    --warn-soft: #3a2c0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.3; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 800; margin: .2em 0 .4em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 700; margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 32px, 1080px); margin-inline: auto; }
.article { max-width: 820px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand .logo { width: 34px; height: 34px; color: var(--accent); flex-shrink: 0; }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.brand small { display: block; font-size: .8rem; color: var(--muted); line-height: 1.2; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
@media (max-width: 760px) {
  .site-header { position: static; }
  .header-inner { flex-direction: column; align-items: stretch; gap: 6px; }
  .header-inner > * { min-width: 0; max-width: 100%; }
  .nav { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
}

/* hero */
.hero { background: linear-gradient(160deg, var(--accent-soft), var(--bg) 70%); padding: clamp(40px, 8vw, 80px) 0 clamp(32px, 6vw, 56px); border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .95rem; margin-bottom: .3em; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin-top: 0; }
.hero h1 span { display: block; font-size: .5em; font-weight: 500; color: var(--text-2); margin-top: .35em; }
.hero .lead { max-width: 640px; }
.hero-search { display: flex; gap: 8px; max-width: 620px; margin-top: 20px; }
.hero-search input { flex: 1; min-width: 0; }
.hero-search button, .btn {
  font: inherit; font-weight: 700; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer; text-decoration: none; display: inline-block;
}
@media (prefers-color-scheme: dark) { .hero-search button, .btn { color: #06222b; } }
.hero-search button:hover, .btn:hover { background: var(--accent-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .hero-search button:hover, .btn:hover { color: #06222b; } }

input[type="search"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; width: 100%;
}
input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* page heads */
.page-head { margin: 8px 0 24px; }
.lead { font-size: 1.15rem; color: var(--text-2); }
.updated { font-size: .9rem; color: var(--muted); margin: 0; }
.crumbs ol { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "‹"; margin-inline-end: 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* prose */
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.note { background: var(--accent-soft); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 1.5em 0; }
.note p:last-child { margin-bottom: 0; }
.home-note { margin-top: 40px; }

/* cards */
.cards { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-2, .cards-4, .related .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards-4 { grid-template-columns: repeat(4, 1fr); } .related .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.card strong { font-size: 1.05rem; line-height: 1.4; }
.card small { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.cat-card span { color: var(--accent); font-weight: 700; font-size: .95rem; }
.series-num { font-weight: 800; font-size: 1.4rem; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 1.5em; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: .88rem; color: var(--text-2); font-weight: 700; }
tbody tr:last-child > * { border-bottom: 0; }
.std-table td.num { white-space: nowrap; }
.num-link { font-weight: 700; }
.std-table .status { min-width: 130px; }
.meta-line { display: block; font-size: .88rem; color: var(--muted); }
.guide-link { font-size: .88rem; font-weight: 700; white-space: nowrap; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; line-height: 1.6; }
.badge-ok { background: var(--ok-soft); color: var(--ok); margin-inline-start: 8px; vertical-align: middle; }
.badge-official { background: var(--warn-soft); color: var(--warn); margin-bottom: 4px; }
.compare th[scope="row"] { background: var(--surface-2); width: 22%; font-size: .92rem; }
@media (max-width: 600px) {
  .std-table thead { display: none; }
  .std-table, .std-table tbody, .std-table tr, .std-table td { display: block; width: 100%; }
  .std-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .std-table tbody tr:last-child { border-bottom: 0; }
  .std-table td { border: 0; padding: 2px 0; }
  .std-table td.num { white-space: normal; }
  .std-table .status { min-width: 0; }
  .compare { font-size: .92rem; }
  .compare th, .compare td { padding: 10px; }
}

/* filters */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 24px; }
.filters .field { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .92rem; }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: 4px; float: right; width: 100%; }
.chips label span, .check span { display: inline-block; }
.chips input { position: absolute; opacity: 0; }
.chips label span { padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: .92rem; cursor: pointer; background: var(--surface); }
.chips input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.chips input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .95rem; cursor: pointer; padding-bottom: 6px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.result-count { flex-basis: 100%; margin: 0; font-size: .9rem; color: var(--muted); }
.result-count:empty { display: none; }
.cat h2 { display: flex; align-items: center; gap: 10px; }
.count { font-size: .85rem; background: var(--surface-2); color: var(--text-2); padding: 2px 10px; border-radius: 999px; }
.linkish { font: inherit; background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 0; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

/* faq, sources, related */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style-position: inside; }
.faq details p { padding: 0 18px 14px; margin: 0; color: var(--text-2); }
.sources ul { padding-inline-start: 1.2em; font-size: .95rem; }
.sources li { margin-bottom: 6px; }
.related { margin-bottom: 40px; }

/* diagram */
.diagram { margin: 1.5em 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.diagram svg { display: block; width: 100%; max-width: 460px; margin: 0 auto; height: auto; }
.diagram figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; text-align: center; }
.d-wall { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.d-zone1 { fill: var(--accent); opacity: .45; }
.d-zone2 { fill: var(--accent); opacity: .2; }
.d-door { fill: none; stroke: var(--text); stroke-width: 2.5; }
.d-floor { stroke: var(--text); stroke-width: 3; }
.d-lbl { fill: var(--text); font: 700 13px var(--font); }
.d-sm { fill: var(--text); font: 600 9.5px var(--font); }

/* footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 56px; padding: 32px 0 24px; font-size: .95rem; color: var(--text-2); }
.foot-cols { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .foot-cols { grid-template-columns: 2fr 1fr 1fr; } }
.foot-brand, .foot-h { font-weight: 800; color: var(--text); margin-bottom: .4em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; }
.foot-meta { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; font-size: .88rem; color: var(--muted); margin-bottom: 0; }
.notfound { padding: 40px 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: .95rem; z-index: 50; }
.credits { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 12px; margin: 2em 0; }
.credits h2 { margin-top: .8em; }
.credits ul { padding-inline-start: 1.2em; font-size: .95rem; }
.credits li { margin-bottom: 6px; }
