/* familjepris.se. Design B ("Mening"): one column, big type, one accent. Tokens first, then base, layout, components. */

/* Familjen Grotesk (SIL OFL 1.1, see fonts/OFL.txt): variable font, one file per subset covers weights 400-700. Self-hosted, no third-party request. */
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/FamiljenGrotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/FamiljenGrotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0F1F38;
  --muted: #4D5B70;      /* 7.3:1 on white */
  --line: #DCE1E8;
  --surface: #F1F3F7;
  --chip-border: #C9D1DC;
  --accent: #C2410C;     /* 5.2:1 on white, white text on it passes too */
  --ground: #FFFFFF;
  --font: 'Familjen Grotesk', 'Helvetica Neue', Helvetica, sans-serif;
  --gutter: 16px;
  --column: 640px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
}

a { color: var(--ink); }
a:hover { color: #000; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---- page column ---- */
.page {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter) 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
main { display: flex; flex-direction: column; gap: 40px; }
#svar, #val { scroll-margin-top: 16px; }

.test-banner {
  margin: 0;   /* outside .page, so it spans the whole viewport like the sticky bar */
  padding: 10px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  text-align: center;
}

/* ---- header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 36px;
  border: 1.5px dashed #8C97A8;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.logo-small { width: 108px; height: 30px; border-radius: 8px; font-size: 12px; }

.segmented {
  display: flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
  border-radius: 999px;
}
.segmented a {
  display: flex;
  align-items: center;
  height: 44px;               /* touch target; the pill looks 38 px thanks to the padding of the track */
  padding: 0 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
}
.segmented a[aria-current="page"] {
  background: var(--ground);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 31, 56, 0.12);
}

/* ---- footer ---- */
.site-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 16px; }
.site-footer nav a { display: flex; align-items: center; min-height: 44px; }
.site-footer p { font-size: 14px; color: var(--muted); }

/* ---- result page ---- */
.intro { display: flex; flex-direction: column; gap: 14px; }
h1 { font-size: 36px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; text-wrap: pretty; }

.answer { display: flex; flex-direction: column; gap: 18px; }
.answer h2 { font-size: 15px; font-weight: 500; color: var(--muted); }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.price-big { font-size: 80px; line-height: 0.9; font-weight: 700; letter-spacing: -0.045em; }
.price-unit { font-size: 18px; color: var(--muted); }
.summary { font-size: 20px; line-height: 1.45; text-wrap: pretty; }
.reasons { display: flex; flex-direction: column; gap: 8px; font-size: 18px; }

/* the rows of a result: persons (mobile) or products (streaming); .people is the same list of persons where there is no answer to show */
.rows, .people { display: flex; flex-direction: column; }
.rows li, .people li { border-top: 1px solid var(--line); }
.rows li:last-child, .people li:last-child { border-bottom: 1px solid var(--line); }
.rows a, .people a {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-height: 44px;
  padding: 14px 0;
  color: inherit;
  text-decoration: none;
}
.rows a:hover .row-name, .people a:hover .row-name { text-decoration: underline; text-underline-offset: 3px; }
.row-text { display: flex; flex-direction: column; gap: 2px; }
.row-name { font-weight: 600; }
.row-detail { font-size: 15px; color: var(--muted); }
.row-price { font-weight: 600; white-space: nowrap; }
.row-needs { font-size: 14px; color: var(--muted); }
/* price and the "Ändra" pill on the right; the pill is a span, the whole row is the link (touch target = the row) */
.row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.row-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.row-edit svg { flex: none; }
.rows a:hover .row-edit, .people a:hover .row-edit { border-color: var(--ink); }
.people-title { font-size: 15px; font-weight: 500; color: var(--muted); }
.who .people-title { margin-bottom: 10px; }
.who .actions { margin-top: 16px; }
h1[tabindex="-1"]:focus { outline: none; }   /* FocusOnNavigate moves focus here after an enhanced navigation; it is not a control */

/* heading (or the line under it) with underlined counts that open the picker (links, no JavaScript) */
h1 .pick, .counts-line .pick {
  display: inline-block;
  padding: 0;
  border-bottom: 3px solid var(--accent);
  color: inherit;
  line-height: 1.1;
  text-decoration: none;
}
h1 .pick.open, .counts-line .pick.open { background: var(--accent); border-bottom-color: var(--accent); color: #fff; padding: 0 6px; margin: 0 -6px; border-radius: 6px 6px 0 0; }
/* long names must wrap inside flex rows instead of pushing the page wider than the phone */
.row-text, .alt-text, .summary, .reasons li, .note, .about p { min-width: 0; overflow-wrap: anywhere; }
h1 { overflow-wrap: anywhere; }
h1 .pick, .counts-line .pick { position: relative; }
h1 .pick::after, .counts-line .pick::after { content: ""; position: absolute; inset: -5px -2px; }   /* touch target >= 44 px without changing the look */
.counts-line { font-size: 22px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.spec-intro { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.hint { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; color: var(--muted); }
.hint svg { flex: none; margin-top: 3px; }
.picker { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; background: var(--surface); border-radius: 16px; }
.picker-title { font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { display: flex; }
.pill[aria-current="true"], .pill[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.note { font-size: 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--accent); text-underline-offset: 4px; }
.more.plain { font-weight: 400; color: var(--ink); font-size: 16px; }
/* secondary button next to the main action: calm outline, not orange */
.edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 22px;
  background: var(--ground);
  border: 1.5px solid var(--chip-border);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
}
.edit-button:hover { border-color: var(--ink); }
.edit-button svg { flex: none; }
.hints a { color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.prio { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border-radius: 16px; }
.prio h2 { font-size: 20px; font-weight: 600; }

.near, .all, .about, .who { display: flex; flex-direction: column; }
.near h2, .all h2, .about h2, .who h2 { margin-bottom: 10px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.alts { list-style: none; margin: 0; padding: 0; }
.alts li { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.alts li:last-child { border-bottom: 1px solid var(--line); }
.alt-price { flex: 0 0 96px; font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.alt-text { font-size: 16px; line-height: 1.45; }
.all .footnote { margin-bottom: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; font-size: 16px; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; }
.about { gap: 10px; }
.about h2 { margin-bottom: 0; }
.about p { font-size: 17px; line-height: 1.5; text-wrap: pretty; }

.warnings { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.card-link svg { flex: none; }

.others { display: flex; flex-direction: column; gap: 12px; }
.others h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 8px; }
.family-grid a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  min-height: 44px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}
.family-name { font-weight: 600; }
.family-price { font-size: 15px; color: var(--muted); }
.footnote { font-size: 14px; color: var(--muted); }

/* ---- notices (404, bad link, busy) ---- */
.notice { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border-radius: 16px; }
.notice h1 { font-size: 28px; }
.notice p { font-size: 18px; }

/* ---- pills and buttons (used by later steps) ---- */
.pill {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  background: var(--ground);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.button.secondary { background: var(--ground); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- edit person (design B-person) ---- */
.back { display: flex; align-items: center; gap: 6px; height: 44px; padding-right: 8px; font-size: 16px; text-decoration: none; }
.person { display: flex; flex-direction: column; gap: 10px; }
.person-title { font-size: 15px; line-height: 1.4; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.sentence { font-size: 27px; line-height: 1.5; font-weight: 500; letter-spacing: -0.01em; text-wrap: pretty; }
.choice {
  padding: 0;
  border-bottom: 3px solid var(--accent);
  color: inherit;
  line-height: 1.2;
  text-decoration: none;
}
.choice { position: relative; }
.choice::after { content: ""; position: absolute; inset: -9px -2px; }   /* touch target >= 44 px without changing the look (as h1 .pick) */
.choice.open { padding: 0 8px; background: var(--accent); border-radius: 8px; color: #fff; line-height: 1.3; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border-radius: 16px; }
.panel h2 { font-size: 17px; font-weight: 600; }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.name-row { display: flex; gap: 8px; }
.name-row .button { height: 44px; padding: 0 20px; cursor: pointer; }
.text-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  background: var(--ground);
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.sentence, .structure-list a, .total, .total-price, .total-note { min-width: 0; overflow-wrap: anywhere; }
/* who the person page is about: one chip per person, the current one filled, then "+ Vuxen" / "+ Barn" */
.switcher { margin-bottom: 6px; }
.switcher ul { display: flex; flex-wrap: wrap; gap: 8px; }
.switcher .pill { height: auto; min-height: 44px; max-width: 100%; padding-top: 8px; padding-bottom: 8px; line-height: 1.2; overflow-wrap: anywhere; }
.switcher .pill.add { border-style: dashed; font-size: 15px; }
.structure { display: flex; flex-direction: column; gap: 6px; }
.structure-list { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.structure-list a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; }
.structure-list a.danger { color: #B42318; }
.page.has-bar { padding-bottom: 120px; }
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ground); border-top: 1px solid var(--line); }
.sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--column);
  margin: 0 auto;
  padding: 14px var(--gutter) 22px;
}
.total { display: flex; flex-direction: column; }
.total-label { font-size: 14px; color: var(--muted); }
.total-price { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.total-note { font-size: 16px; font-weight: 500; }

@media (min-width: 640px) {
  h1 { font-size: 44px; }
  .person-title { font-size: 15px; }
  .sentence { font-size: 30px; }
  .price-big { font-size: 96px; }
}

@media (max-width: 380px) {
  h1 { font-size: 32px; }
  .sentence { font-size: 24px; }
  .price-big { font-size: 68px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---- streaming result ---- */
.rows .row-static { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-height: 44px; padding: 14px 0; }
.row-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--accent); }
.rows a:hover .row-link { text-decoration: underline; text-underline-offset: 3px; }
.cheaper { font-size: 17px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.prio-form { display: flex; flex-direction: column; gap: 14px; }
.prio-sub { font-size: 15px; font-weight: 600; margin-bottom: -6px; }

/* ---- info pages (Så räknar vi, Om datan, Kontakt) ---- */
.info { display: flex; flex-direction: column; gap: 14px; }
.info h2 { margin-top: 14px; font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.info p, .info li { font-size: 17px; line-height: 1.55; text-wrap: pretty; overflow-wrap: anywhere; }
.info ul { display: flex; flex-direction: column; gap: 10px; padding-left: 20px; list-style: disc; }
.info code { padding: 1px 5px; background: var(--surface); border-radius: 4px; font-size: 15px; overflow-wrap: anywhere; }
.info-note { padding: 14px 16px; background: var(--surface); border-radius: 12px; }
.placeholder { padding: 1px 6px; border: 1px dashed var(--muted); border-radius: 4px; font-weight: 600; }

/* ---- answer-first line, questions with tables, more comparisons ---- */
.answer-line { font-size: 19px; line-height: 1.45; text-wrap: pretty; overflow-wrap: anywhere; }
.checked { font-size: 14px; color: var(--muted); }
.questions, .more-compare { display: flex; flex-direction: column; gap: 8px; }
.questions { gap: 26px; }
.questions h2, .more-compare h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.question { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.question h3 { font-size: 19px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.question p { font-size: 17px; line-height: 1.5; text-wrap: pretty; overflow-wrap: anywhere; }
.qtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.qtable caption { padding-bottom: 6px; font-size: 14px; color: var(--muted); text-align: left; }
.qtable th, .qtable td { padding: 9px 10px 9px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: break-word; }   /* break-word, not anywhere: a column keeps room for its longest word ("Operatör") instead of shrinking and splitting it */
.qtable thead th { border-top: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.qtable tbody th { font-weight: 600; }
.qtable tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
.qtable .num { padding-right: 0; text-align: right; white-space: nowrap; }
.qtable td.num { font-weight: 600; }
.qtable a { display: inline-block; padding: 8px 0; }
.grid-caption { font-size: 15px; color: var(--muted); }
.more-compare h3 { margin-top: 10px; font-size: 15px; font-weight: 500; color: var(--muted); }
.link-list { display: flex; flex-wrap: wrap; gap: 0 20px; }
.link-list a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; }
