/* Gemensam stil för vardnadstvister.com och vårdnadstvister.com.
   Inga externa typsnitt – systemtypsnitt laddar direkt. */

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --ink: #111a28;
  --ink-2: #3b4656;
  --muted: #5f6977;
  --line: #e4ddd0;
  --navy: #071320;
  --navy-2: #0f2238;
  --gold: #c9a96a;
  --gold-ink: #7a5a1c;
  --accent: #7a5a1c;
  --accent-soft: #f3ead8;
  --focus: #1f5fbf;
  --warn-bg: #fff4e5; --warn-line: #e7b765;
  --info-bg: #eef3f9; --info-line: #9db6d6;
  --danger-bg: #fdecec; --danger-line: #d98b8b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(7,19,32,.06), 0 4px 18px rgba(7,19,32,.05);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.site-b { --accent: #2f6655; --accent-soft: #e5efe9; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1522; --surface: #111f31; --surface-2: #0e1a2a; --ink: #eef1f5; --ink-2: #c9d1dc;
    --muted: #9aa6b5; --line: #22344b; --gold-ink: #d9bd83; --accent: #d9bd83; --accent-soft: #1d2a3a;
    --warn-bg: #2b2213; --warn-line: #8a6a2a; --info-bg: #122236; --info-line: #3e5f86;
    --danger-bg: #2d1717; --danger-line: #8a4242; --focus: #7fb0ff;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
  :root:not([data-theme="light"]) .site-b { --accent: #8fcbb6; --accent-soft: #152a26; }
}
:root[data-theme="dark"] {
  --bg: #0b1522; --surface: #111f31; --surface-2: #0e1a2a; --ink: #eef1f5; --ink-2: #c9d1dc;
  --muted: #9aa6b5; --line: #22344b; --gold-ink: #d9bd83; --accent: #d9bd83; --accent-soft: #1d2a3a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 var(--sans); overflow-x: hidden;
  padding-bottom: 76px;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); margin: .2em 0 .4em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .25em 0; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 720px; padding-block: 48px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0; }
.fine { font-size: .85rem; color: var(--muted); }

/* ---------- Sidhuvud ---------- */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand__mark { width: 38px; height: 38px; flex: none; border: 1.5px solid var(--gold); border-radius: 9px; display: grid; place-items: center; color: var(--gold); font: 700 1.2rem var(--serif); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font: 700 1.15rem var(--serif); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__tag { font-size: .72rem; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }
.top .top__cta { display: none; }
@media (min-width: 900px) { .top .top__cta { display: inline-flex; } }
.mainnav { border-top: 1px solid rgba(255,255,255,.08); }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav ul::-webkit-scrollbar { display: none; }
.mainnav a { display: block; padding: 10px 12px; color: #d8dee7; text-decoration: none; font-size: .92rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }

/* ---------- Knappar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border-radius: 999px; font-weight: 700; text-decoration: none; padding: 12px 22px; line-height: 1.2; border: 2px solid transparent; transition: transform .12s ease, box-shadow .12s ease; text-align: center; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(7,19,32,.18); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.btn--sm { padding: 8px 16px; font-size: .92rem; }
.btn--lg { padding: 15px 28px; font-size: 1.05rem; }

/* ---------- Brödsmulor ---------- */
.crumbs { width: min(1160px, 100% - 32px); margin: 18px auto 0; font-size: .88rem; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1100px 380px at 85% -10%, rgba(201,169,106,.25), transparent 60%), var(--navy); color: #eef1f5; padding: 56px 0 64px; }
.hero h1 { color: #fff; max-width: 24ch; }
.hero .lead { color: #c8d1dd; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 28px 0 0; padding: 0; list-style: none; font-size: .92rem; color: #c8d1dd; }
.hero__trust li::before { content: "✓"; color: var(--gold); font-weight: 700; margin-right: 8px; }

.search { margin-top: 26px; max-width: 640px; position: relative; }
.search label { display: block; font-size: .9rem; color: #c8d1dd; margin-bottom: 6px; }
.search input { width: 100%; font: inherit; padding: 14px 18px 14px 46px; border-radius: 999px; border: 2px solid transparent; background: #fff; color: #111a28; }
.search input:focus { outline: none; border-color: var(--gold); }
.search svg { position: absolute; left: 16px; bottom: 15px; width: 20px; height: 20px; color: #5f6977; }
.search__count { font-size: .88rem; color: var(--muted); margin: 10px 0 0; min-height: 1.4em; }

/* ---------- Forumtavlor ---------- */
.section { padding: 48px 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.section__head h2 { margin: .1em 0 0; }
.boards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.boardcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); display: flex; gap: 14px; transition: border-color .15s; }
.boardcard:hover { border-color: var(--accent); }
.boardcard__icon { font-size: 1.5rem; line-height: 1; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--accent-soft); border-radius: 12px; }
.boardcard h3 { margin: 0 0 4px; font-size: 1.08rem; }
.boardcard p { margin: 0; font-size: .92rem; color: var(--muted); }
.boardcard .count { font-size: .8rem; font-weight: 700; color: var(--accent); margin-top: 6px; display: block; }

.board { padding: 24px 0 48px; }
.board__head { margin-bottom: 20px; }

.threads { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.thread { display: flex; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); margin: 0; }
.thread:first-child { border-top: 0; }
.thread:hover { background: var(--surface-2); }
.thread[hidden] { display: none; }
.thread__icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--accent-soft); border-radius: 50%; font-size: 1.1rem; }
.thread__main { min-width: 0; }
.thread__title { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.thread__title:hover { color: var(--accent); text-decoration: underline; }
.thread__sum { margin: 4px 0 6px; color: var(--ink-2); font-size: .95rem; }
.thread__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); align-items: center; }
.chip { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .78rem; padding: 2px 10px; border-radius: 999px; }
.chip a { color: inherit; text-decoration: none; }
.chip--lg { font-size: .85rem; padding: 4px 12px; margin: 0; }

/* ---------- Trådsida ---------- */
.threadpage { padding: 12px 0 56px; }
.threadpage__head { max-width: 820px; padding: 10px 0 8px; }
.threadpage__meta { color: var(--muted); font-size: .9rem; }
.threadpage__grid { display: grid; gap: 28px; }
@media (min-width: 980px) { .threadpage__grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.threadpage__side { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 980px) { .threadpage__side { position: sticky; top: 130px; align-self: start; } }

.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.post__who { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.post__who div { display: flex; flex-direction: column; line-height: 1.3; }
.post__who span { font-size: .82rem; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 1.05rem var(--serif); flex: none; }
.avatar--q { background: var(--accent-soft); color: var(--accent); }
.avatar--a { background: var(--navy); color: var(--gold); }
.post__body { padding: 18px 22px 8px; }
@media (min-width: 700px) { .post__body { padding: 22px 30px 10px; } }
.post--q .post__body p { font-size: 1.08rem; font-style: italic; color: var(--ink-2); }
.post__body h2 { scroll-margin-top: 120px; }

.short { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 0 0 18px; }
.short__label { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--accent); margin: 0 0 4px; }
.short p:last-child { margin: 0; }

.toc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 0 0 8px; font-size: .95rem; }
.toc p { font-weight: 700; margin: 0 0 4px; }
.toc ol { margin: 0; }

.law { margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.law figcaption { background: var(--navy); color: var(--gold); font-size: .82rem; font-weight: 700; letter-spacing: .04em; padding: 8px 16px; }
.law blockquote { margin: 0; padding: 14px 18px; background: var(--surface-2); font-family: var(--serif); font-size: 1.02rem; }
.law blockquote p { margin: 0; }

.note { border-radius: 12px; padding: 14px 18px; margin: 18px 0; border: 1px solid var(--info-line); background: var(--info-bg); }
.note p { margin: 0; }
.note--warn { border-color: var(--warn-line); background: var(--warn-bg); }
.note--danger { border-color: var(--danger-line); background: var(--danger-bg); }

.check, .mistakes { border: 1px solid var(--line); border-radius: 12px; padding: 6px 18px 10px; margin: 18px 0; background: var(--surface-2); }
.check h3, .mistakes h3 { margin-top: .8em; }
.check ul, .mistakes ul { list-style: none; padding: 0; }
.check li { padding-left: 30px; position: relative; }
.check li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 4px; }
.mistakes li { padding-left: 28px; position: relative; }
.mistakes li::before { content: "✕"; position: absolute; left: 4px; color: #b24a4a; font-weight: 700; }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 18px 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 52px; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 700; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: 2px; width: 2px; background: var(--line); }
.steps strong { display: block; font-size: 1.05rem; }
.steps span { display: block; color: var(--ink-2); }

.sources { border-top: 1px solid var(--line); margin-top: 26px; }
.sources h2 { font-size: 1.2rem; }
.sources li { font-size: .92rem; }

.cta-box { background: var(--navy); color: #dfe5ee; border-radius: var(--radius); padding: 26px 24px; margin: 30px 0; position: relative; overflow: hidden; }
.cta-box::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 1px solid rgba(201,169,106,.35); }
.cta-box h2 { color: #fff; margin-top: 0; }
.cta-box .fine { color: #9fb0c4; margin: 14px 0 0; }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.side-card__h { font-weight: 700; font-family: var(--serif); font-size: 1.08rem; margin-bottom: 6px; }
.side-card--cta { background: var(--navy); color: #d6dde8; border-color: var(--navy); }
.side-card--cta .side-card__h { color: #fff; }
.side-card--cta .btn { width: 100%; }
.side-list { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.side-list li { border-top: 1px solid var(--line); padding: 8px 0; margin: 0; }
.side-list li:first-child { border-top: 0; }

/* ---------- Startsidans extra sektioner ---------- */
.how { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: h; }
.how li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; counter-increment: h; margin: 0; }
.how li::before { content: counter(h); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.how { padding: 0; }
.split { display: grid; gap: 22px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.panel h3 { margin-top: 0; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

.glossary dt { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; margin-top: 18px; scroll-margin-top: 120px; }
.glossary dd { margin: 4px 0 0; color: var(--ink-2); }
.az { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.az a { display: inline-block; min-width: 34px; text-align: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: var(--surface); }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline > li { position: relative; padding: 0 0 26px 40px; margin: 0; }
.timeline > li::before { content: ""; position: absolute; left: 8px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid var(--navy); }
.timeline > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.timeline h3 { margin: 0 0 4px; }
.timeline .when { font-size: .85rem; color: var(--accent); font-weight: 700; }

/* ---------- Sidfot ---------- */
.foot { background: var(--navy); color: #b9c4d2; margin-top: 40px; font-size: .92rem; }
.foot a { color: #e3cfa1; }
.foot__grid { display: grid; gap: 28px; padding: 40px 0 20px; }
@media (min-width: 800px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
.foot__name { font: 700 1.15rem var(--serif); color: #fff; }
.foot__h { color: #fff; font-weight: 700; margin: 0 0 6px; }
.foot ul { list-style: none; padding: 0; margin: 0 0 16px; }
.foot__base { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0 20px; font-size: .82rem; }
.foot__base p { margin: 0; }

/* ---------- Mobilens fasta knapprad ---------- */
.mobilebar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(7,19,32,.96); z-index: 30; }
.mobilebar .btn { width: 100%; }
@media (min-width: 900px) { .mobilebar { display: none; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .top, .mobilebar, .foot, .threadpage__side, .cta-box { display: none; } body { background: #fff; } }
.kicker--gold { color: var(--gold); }
.section--tight { padding-top: 0; }
.gap { height: 28px; }
