/* Vilkår og personvern (/vilkar/, /personvern/, med en/). Lastes etter v2.css.
   Innholdet er uendret fra de live sidene og laget av mockups/lag_restsider.py. Klassene (.terms-*)
   er de samme som live, så denne fila gir dem v2-utseende: én lesespalte som eksamensguidene,
   serif i overskriftene og tabeller med hårlinjer. Folk skriver ut vilkårene, så utskriften står nederst. */

@layer seksjon {
  /* TIL v2.css: koblingen fra de gamle variabelnavnene står også i eksamen.css og qr.css */
  .avtale-side {
    --text: var(--ink);
    --subtext: var(--ink-2);
    --border: var(--line);
    --muted: var(--tint);
    --avtale-spalte: 720px;
  }

  .avtale-side main > .avtale { padding: 20px 0 72px;}
  .avtale-wrap { max-width: calc(var(--avtale-spalte) + 48px);}
  .avtale-tilbake { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-size: 16px;}

  .terms-hero { padding: 20px 0 28px; border-bottom: 1px solid var(--line);}
  .avtale-merke { color: var(--ink-2); font-size: 16px; font-weight: 500;}
  /* «Personvernerklæring» er ett langt ord. På 320 px får det plass først ved ca. 30 px. */
  .terms-hero h1 { margin: 10px 0 14px; font-size: clamp(28px, 9.5vw, 40px); line-height: 1.06; overflow-wrap: break-word;}
  .terms-meta { max-width: 36em; color: var(--ink-2); font-size: 17px; line-height: 1.5;}

  .terms-divider { display: none;}
  .terms-section { padding-top: 44px; scroll-margin-top: 16px;}
  .terms-section h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-size: 27px; line-height: 1.15;}
  .terms-section h2 .num { flex: none; min-width: 1.7em; color: var(--link); font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums;}
  .terms-section p { margin: 0 0 14px; line-height: 1.6;}
  .terms-section p:last-child { margin-bottom: 0;}
  .terms-section strong { color: var(--heading); font-weight: 600;}
  .terms-section ul { margin: 0 0 14px; padding: 0; list-style: none;}
  .terms-section li { position: relative; margin: 0 0 10px; padding-left: 22px; line-height: 1.55;}
  .terms-section li::before { content: "–"; position: absolute; left: 0; color: var(--ink-2);}

  .terms-table { width: 100%; margin: 18px 0 0; border-collapse: collapse; font-size: 16px; line-height: 1.45;}
  .terms-table th { padding: 0 14px 8px 0; border-bottom: 1px solid var(--field-line); color: var(--ink-2); font-size: 14px; font-weight: 600; text-align: left; vertical-align: bottom;}
  .terms-table td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; hyphens: auto;}
  .terms-table th:last-child, .terms-table td:last-child { padding-right: 0;}
  /* Satsene står til høyre, som på priskortene. Personvern har tre kolonner med tekst og står til venstre. */
  .terms-table:not(:has(th:nth-child(3))) :is(th, td):last-child { text-align: right;}
  .terms-table + .terms-table { margin-top: 28px;}

  .terms-highlight { margin-top: 18px; padding: 18px 20px; border-radius: 18px; background: var(--boks); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere;}
  .terms-highlight + p { margin-top: 14px;}
  .terms-table + p, .terms-highlight + p, .terms-table + .terms-highlight { margin-top: 14px;}

  @media (max-width: 559px) {
    /* Personverntabellen med tre kolonner blir en liste: formålet som overskrift, resten under */
    .terms-table:has(th:nth-child(3)) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);}
    .terms-table:has(th:nth-child(3)) tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line);}
    .terms-table:has(th:nth-child(3)) td { display: block; padding: 0; border: 0;}
    .terms-table:has(th:nth-child(3)) td:first-child { color: var(--heading); font-weight: 600;}
    .terms-table:has(th:nth-child(3)) td + td { margin-top: 4px;}
    .terms-table:has(th:nth-child(3)) td:last-child { color: var(--ink-2); font-size: 15px;}
  }

  @media (min-width: 900px) {
    .avtale-side main > .avtale { padding: 28px 0 112px;}
    .avtale-wrap { max-width: calc(var(--avtale-spalte) + 80px);}
    .terms-hero { padding: 28px 0 36px;}
    .terms-hero h1 { font-size: 60px; line-height: 1.02;}
    .terms-meta { font-size: 19px;}
    /* Toppen står fast på PC og er 62 px etter scroll. #angrerett fra Cal.com skal ikke havne under den. */
    .terms-section { padding-top: 56px; scroll-margin-top: 76px;}
    .terms-section h2 { font-size: 32px;}
    .terms-section h2 .num { font-size: 16px;}
    .terms-table { font-size: 17px;}
  }

  /* ---------- Utskrift ---------- */
  @media print {
    :root, [data-theme="dark"] {
      color-scheme: light;
      --bg: #fff; --tint: #fff; --surface: #fff; --boks: #f3f1ed;
      --ink: #000; --heading: #000; --ink-2: #3d3832;
      --line: #bbb; --field-line: #777; --link: #000; --pen: #000;
    }
    @page { margin: 18mm 16mm 18mm; }
    body { padding: 0; background: #fff; font-size: 11pt;}
    .skisse-bar, .valg-rad, .topbar, .nav-dim, .burger-menu, .mobile-bar, .bunn, .avtale-tilbake { display: none !important;}
    .avtale-side main > .avtale { padding: 0;}
    .avtale-wrap { max-width: none; padding: 0;}
    .terms-hero { padding: 0 0 14pt;}
    .terms-hero h1 { margin: 4pt 0 6pt; font-size: 24pt;}
    .avtale-merke, .terms-meta { font-size: 10pt;}
    .terms-section { padding-top: 16pt;}
    .terms-section h2 { margin-bottom: 6pt; font-size: 14pt; break-after: avoid;}
    .terms-section h2 .num { font-size: 10pt;}
    .terms-section p, .terms-section li { orphans: 3; widows: 3;}
    .terms-table { font-size: 10pt; break-inside: avoid;}
    .terms-table tr { break-inside: avoid;}
    .terms-highlight { border: 1px solid #bbb; background: none; font-size: 10pt; break-inside: avoid;}
    .terms-section a { color: #000; text-decoration: underline;}
    /* Lenker til nettsider skrives ut med adressen etter */
    .terms-section a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; overflow-wrap: anywhere;}
  }
}
