/* Felkészülés vészhelyzetekre – kézikönyv stíluslap */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1f2a2e;
  --muted: #5b676b;
  --border: #dcd7cb;
  --primary: #1f5f5b;
  --primary-ink: #ffffff;
  --primary-soft: #e1eeec;
  --accent: #b5651d;
  --accent-soft: #fbeedd;
  --verify-bg: #fff1c7;
  --verify-ink: #6b4a00;
  --danger: #a33a2c;
  --danger-soft: #f8e4e0;
  --ok: #2e7d4f;
  --shadow: 0 1px 3px rgba(0,0,0,.03);
  --radius: 16px;
  --sidebar-w: 300px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141a1c;
    --surface: #1b2326;
    --surface-2: #222c30;
    --text: #e6ecec;
    --muted: #a3b0b2;
    --border: #2f3b3f;
    --primary: #6cc3b9;
    --primary-ink: #0d1f1d;
    --primary-soft: #1d3432;
    --accent: #e7a467;
    --accent-soft: #3a2a1a;
    --verify-bg: #4a3a0e;
    --verify-ink: #ffe39a;
    --danger: #f08a7b;
    --danger-soft: #3b2220;
    --ok: #7fd3a1;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141a1c;
  --surface: #1b2326;
  --surface-2: #222c30;
  --text: #e6ecec;
  --muted: #a3b0b2;
  --border: #2f3b3f;
  --primary: #6cc3b9;
  --primary-ink: #0d1f1d;
  --primary-soft: #1d3432;
  --accent: #e7a467;
  --accent-soft: #3a2a1a;
  --verify-bg: #4a3a0e;
  --verify-ink: #ffe39a;
  --danger: #f08a7b;
  --danger-soft: #3b2220;
  --ok: #7fd3a1;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
}

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--primary); color: var(--primary-ink);
  padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.brand-mark {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: var(--primary-ink);
  font-size: 13px; font-weight: 800; letter-spacing: -.02em;
}
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.btn-label { display: inline; }

.progress-bar {
  position: absolute; left: 0; bottom: -1px; height: 3px;
  background: var(--primary); width: 0; transition: width .1s linear;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1280px; margin: 0 auto;
}

.sidebar {
  position: sticky; top: 60px; align-self: start;
  height: calc(100vh - 60px); overflow-y: auto;
  padding: 24px 12px 40px 16px;
  border-right: 1px solid var(--border);
}
.sidebar h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0 0 10px 10px;
}
.toc { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14.5px; line-height: 1.4;
}
.toc a:hover { background: var(--surface-2); }
.toc a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toc .num {
  flex: none; width: 22px; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px;
}
.toc a.active .num { color: var(--primary); }

main { padding: 0 32px 80px; min-width: 0; }
.content { max-width: 820px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 28px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 46px); line-height: 1.12;
  margin: 0 0 12px; letter-spacing: -.01em; text-wrap: balance;
}
.hero .subtitle { font-size: 19px; color: var(--muted); margin: 0 0 16px; text-wrap: pretty; }
.meta { font-size: 14px; color: var(--muted); }

.hero-art {
  display: block; width: 100%; height: auto;
  margin: 20px 0 4px;
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow);
}

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 28px 0 24px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.stat .big {
  display: block; font-family: var(--font-serif);
  font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--primary);
}
.stat .lbl { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.35; }

.need-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0;
}
.need {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.need:hover { border-color: var(--primary); transform: translateY(-1px); }
.need .ico { font-size: 26px; line-height: 1; }
.need strong { display: block; margin-top: 8px; font-size: 16px; }
.need span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.need em { display: block; font-style: normal; font-size: 12.5px; color: var(--primary); margin-top: 8px; font-weight: 600; }

/* ---------- Sections ---------- */
section.chapter {
  padding-top: 40px; margin-top: 24px;
  border-top: 1px solid var(--border);
}
section.chapter > h2 {
  display: flex; gap: 14px; align-items: baseline;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; margin: 0 0 16px;
  text-wrap: balance;
}
.ch-num {
  flex: none; display: inline-grid; place-items: center;
  min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: 10px; background: var(--primary); color: var(--primary-ink);
  font-family: var(--font); font-size: 18px; font-weight: 700;
  transform: translateY(-4px);
}
h3 { font-size: 19px; margin: 32px 0 10px; line-height: 1.3; }
h4 { font-size: 16.5px; margin: 22px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 1.4em; margin: 0 0 16px; }
li { margin: 4px 0; }
li::marker { color: var(--primary); }
strong { font-weight: 650; }

.lead { font-size: 18.5px; color: var(--text); }

.verify {
  background: var(--verify-bg); color: var(--verify-ink);
  padding: 1px 6px; border-radius: 5px; font-size: .88em; font-weight: 600;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Callouts */
.callout {
  display: flex; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 16px 18px; margin: 20px 0;
  box-shadow: var(--shadow);
}
.callout > .ico { flex: none; font-size: 22px; line-height: 1.3; }
.callout > div > :last-child { margin-bottom: 0; }
.callout .title { display: block; font-weight: 700; margin-bottom: 4px; }
.callout.warn { border-left-color: var(--danger); background: var(--danger-soft); }
.callout.tip { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.info { border-left-color: var(--primary); background: var(--primary-soft); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin: 18px 0;
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card h3:first-child, .card h4:first-child { margin-top: 0; }
.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; margin: 18px 0; }
.two-col .card { margin: 0; }

/* Steps */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding: 10px 0 10px 48px; margin: 0;
  border-bottom: 1px dashed var(--border);
}
ol.steps > li:last-child { border-bottom: 0; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 9px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 15px;
}

/* Tables */
.table-wrap {
  overflow-x: auto; margin: 18px 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
thead th {
  background: var(--surface-2); font-size: 13.5px; font-weight: 700;
  position: sticky; top: 0;
}
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 650; background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.wide { min-width: 720px; }
table.xwide { min-width: 900px; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 20px 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline li { position: relative; padding: 0 0 18px 32px; margin: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--primary);
}
.timeline li.recent::before { background: var(--primary); }
.timeline time { display: block; font-weight: 700; font-size: 14px; color: var(--primary); }
.timeline p { margin: 2px 0 0; }

/* Details (country profiles etc.) */
details.fold {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 12px 0; box-shadow: var(--shadow);
}
details.fold > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; font-weight: 700; font-size: 17px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: ""; margin-left: auto; flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
}
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > summary .tag {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); padding: 2px 8px; border-radius: 999px;
}
details.fold > .fold-body { padding: 0 20px 14px; }

/* Petíció szövege (beágyazott rich text) */
#petition-what-text { font-size: 16px; line-height: 1.6; }
#petition-what-text .trix-content > div { margin-bottom: .8em; }
#petition-what-text ol, #petition-what-text ul { margin-bottom: .8em; }
#petition-what-text li { margin: 4px 0; }
#petition-what-text > div > div:last-child { margin-bottom: 0; }
.flag { font-size: 20px; }

/* Checklists */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { margin: 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist label {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 4px; cursor: pointer;
}
.checklist input[type="checkbox"] {
  flex: none; width: 20px; height: 20px; margin-top: 3px;
  accent-color: var(--primary); cursor: pointer;
}
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border); }

.list-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.list-head h3, .list-head h4 { margin: 0; }
.meter {
  flex: 1; min-width: 120px; height: 8px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.meter > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.meter-label { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-btn {
  border: 0; background: none; color: var(--primary); font: inherit; font-size: 14px;
  cursor: pointer; padding: 4px 6px; border-radius: 6px; text-decoration: underline;
}

/* Quiz */
.quiz .checklist label { justify-content: space-between; }
.quiz .pts {
  flex: none; margin-left: auto; font-size: 13px; font-weight: 700;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.quiz .checklist input:checked + span { text-decoration: none; color: var(--text); }
.score {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 16px;
  background: var(--surface-2); border-radius: 10px;
}
.score .val { font-family: var(--font-serif); font-size: 34px; font-weight: 700; line-height: 1; }
.score .verdict { font-weight: 700; }
.score .verdict.l1 { color: var(--danger); }
.score .verdict.l2 { color: var(--accent); }
.score .verdict.l3 { color: var(--primary); }
.score .verdict.l4 { color: var(--ok); }
.scale { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Commandments */
ol.commandments { counter-reset: c; list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
ol.commandments li {
  counter-increment: c; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px 12px 52px; position: relative; font-size: 15.5px; line-height: 1.45;
}
ol.commandments li::before {
  content: counter(c); position: absolute; left: 14px; top: 11px;
  font-family: var(--font-serif); font-weight: 700; font-size: 22px; color: var(--accent);
}

/* Phone numbers */
.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.phone {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.phone a { display: block; font-size: 30px; font-weight: 800; color: var(--danger); text-decoration: none; font-variant-numeric: tabular-nums; }
.phone span { font-size: 14px; color: var(--muted); }
.phone.main { border-color: var(--danger); }
.fill-line { display: inline-block; min-width: 180px; border-bottom: 1px dotted var(--muted); }

/* Sources */
.sources ul { font-size: 15px; }
.sources h3 { font-size: 16px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border); margin-top: 48px; padding: 28px 0;
  font-size: 14px; color: var(--muted);
}

.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; font-size: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

.scrim { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0; z-index: 45;
    width: min(320px, 86vw); height: auto;
    background: var(--bg); border-right: 1px solid var(--border);
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 60px 0 0 0; z-index: 44;
    background: rgba(0,0,0,.35);
  }
  main { padding: 0 16px 80px; }
}
@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .stat-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .need-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: minmax(0,1fr); }
  ol.commandments { grid-template-columns: 1fr; }
  .phones { grid-template-columns: 1fr 1fr; }
  .btn-label { display: none; }
  .hero { padding-top: 32px; }
  th, td { padding: 9px 11px; }
}
@media (max-width: 420px) {
  .need-grid { grid-template-columns: 1fr; }
  .topbar .brand .brand-text { font-size: 15px; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --muted: #444; --border: #bbb; --shadow: none; }
  body { font-size: 11pt; line-height: 1.45; background: #fff; }
  .topbar, .sidebar, .to-top, .scrim, .no-print, .text-btn { display: none !important; }
  .layout { display: block; }
  main { padding: 0; }
  .content { max-width: none; }
  section.chapter { break-before: page; border-top: 0; padding-top: 0; }
  section.chapter.no-break { break-before: auto; }
  .card, .callout, .table-wrap, details.fold, .stat, .need, .phone { break-inside: avoid; box-shadow: none; }
  .table-wrap { overflow: visible; }
  table.wide, table.xwide { min-width: 0; font-size: 9pt; }
  a { color: #000; text-decoration: none; }
  details.fold > summary::after { display: none; }
  .need:hover { transform: none; }
}

.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .stat-grid.three { grid-template-columns: 1fr; } .stat .big { font-size: 26px; } }
