/* Pusterom – deltakerportal. Samme uttrykk som konseptsiden: varmt papir, mose og leire. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #f5f0e8;
  --paper-2: #ece4d6;
  --card: #fbf8f2;
  --sage: #dfe5d6;
  --ink: #1d2721;
  --ink-soft: #4b5750;
  --moss: #3a5543;
  --moss-deep: #243629;
  --clay: #b4623a;
  --clay-ink: #924a28;
  --clay-light: #e3a477;
  --line: rgb(29 39 33 / 0.13);
  --line-strong: rgb(29 39 33 / 0.28);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--moss); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, .h3 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 360;
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-wrap: balance;
}
h2 { font-size: 1.625rem; }
.h3, h3 { font-size: 1.375rem; font-weight: 400; }

.wrap { width: 100%; max-width: 720px; margin-inline: auto; padding-inline: 16px; }
.wide { max-width: 980px; }
.skip-link { position: absolute; left: 12px; top: -80px; padding: 10px 16px; background: var(--moss-deep); color: var(--paper); border-radius: 999px; z-index: 10; }
.skip-link:focus { top: 12px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9063rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; }

/* Topp og meny */
.top { position: sticky; top: 0; z-index: 5; background: rgb(245 240 232 / 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--moss-deep); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; }
.brand-name { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.375rem; font-weight: 420; }
.link-button { background: none; border: 0; padding: 8px 0; color: var(--moss); font: 600 0.9375rem var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.tabs a {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}
.tabs a[aria-current="page"] { background: var(--moss); color: var(--paper); }

main { padding-block: 28px 56px; display: grid; gap: 20px; }
.foot { padding-block: 24px 40px; color: var(--ink-soft); font-size: 0.875rem; border-top: 1px solid var(--line); }

/* Hero */
.hero { padding-block: 24px 8px; }
.hero.compact { padding-top: 8px; }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--clay-ink); margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.25rem); font-weight: 320; letter-spacing: -0.025em; }
.lead { margin-top: 14px; font-size: 1.1563rem; color: var(--ink-soft); max-width: 44ch; }
.status { min-height: 1.6em; margin-top: 14px; color: var(--ink-soft); }

/* Kort */
.card { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card > * + * { margin-top: 12px; }
.card.soft { background: var(--sage); border-color: transparent; }
.card.dark { background: var(--moss-deep); color: var(--paper); border-color: transparent; }
.card.dark .small { color: rgb(245 240 232 / 0.7); }
.card-label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--clay-ink); }
.next-time { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.75rem; font-weight: 350; line-height: 1.2; }
.next-time::first-letter { text-transform: uppercase; }
.next.is-open { border-color: var(--moss); box-shadow: 0 18px 40px -26px rgb(36 54 41 / 0.6); }

.flash { padding: 14px 18px; border-radius: 14px; background: var(--sage); color: var(--moss-deep); font-weight: 500; }
.flash-info { background: #f3e2d3; color: #6e3a1e; }
.errors { padding: 16px 20px; border-radius: 14px; background: #f3e2d3; color: #6e3a1e; }
.errors ul { list-style: disc; padding-left: 1.2em; margin-top: 6px; }

/* Knapper */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.card .actions { margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--ink); font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--moss); color: var(--paper); }
.btn-primary:hover { background: var(--moss-deep); }
.btn-quiet { border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--paper-2); }
.btn-large { min-height: 56px; padding-inline: 28px; font-size: 1.0625rem; }
.btn-door { width: 100%; min-height: 64px; font-size: 1.1875rem; }

/* Fliser */
.tiles { display: grid; gap: 12px; }
.tile { display: grid; gap: 2px; padding: 18px 20px; border-radius: var(--radius); background: var(--paper-2); color: var(--ink); text-decoration: none; }
.tile:hover { background: #e5dccb; }
.tile-title { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.25rem; }
.tile-text { color: var(--ink-soft); font-size: 0.9375rem; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

/* Skjema */
.stack { display: grid; gap: 16px; }
fieldset.card { margin: 0; min-width: 0; }
legend { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.25rem; padding: 0 6px; margin-left: -6px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 0.9375rem; }
.field em { font-weight: 400; color: var(--ink-soft); }
.field small { color: var(--ink-soft); font-size: 0.875rem; }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); font: 1rem var(--sans);
}
input:focus, select:focus { outline: 3px solid rgb(180 98 58 / 0.35); border-color: var(--clay); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--moss); flex: none; }
.question { padding-top: 12px; border-top: 1px solid var(--line); }
.question p { font-weight: 500; }
.choices { display: flex; gap: 20px; margin-top: 6px; }
.choices label { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; }
.choices input { width: 20px; height: 20px; accent-color: var(--moss); }

/* Booking */
.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-2); gap: 4px; justify-self: start; }
.segmented a { padding: 8px 18px; border-radius: 999px; color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.dates a {
  flex: none; display: grid; justify-items: center; min-width: 58px; padding: 8px 6px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); text-decoration: none; font-size: 0.8125rem; line-height: 1.3;
}
.dates a strong { font-size: 1.125rem; color: var(--ink); }
.dates a[aria-current="date"] { background: var(--moss); border-color: var(--moss); color: rgb(245 240 232 / 0.8); }
.dates a[aria-current="date"] strong { color: var(--paper); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { min-height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font: 600 1rem var(--sans); color: var(--ink); cursor: pointer; }
.slot:hover { border-color: var(--moss); background: var(--sage); }
.list { display: grid; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.pill-now { padding: 4px 12px; border-radius: 999px; background: var(--sage); font-weight: 600; font-size: 0.875rem; }

/* Utvikling */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stats li { padding-top: 12px; border-top: 2px solid var(--moss); }
.stat-num { display: block; font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.875rem; font-weight: 350; line-height: 1.1; }
.stat-label { display: block; margin-top: 4px; font-size: 0.8438rem; color: var(--ink-soft); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: var(--line); }
.chart-grid line:first-child { stroke: var(--line-strong); }
.chart-y text, .bar-x, .chart-xtitle { font: 500 12px var(--sans); fill: var(--ink-soft); }
.chart-y text { text-anchor: end; }
.bar-x { text-anchor: middle; }
.chart-xtitle { text-anchor: end; }
.bar path { fill: var(--moss); transition: fill 0.2s ease; }
.bar.is-latest path { fill: var(--moss-deep); }
.bar:hover path { fill: var(--clay); }
.bar-hit { fill: transparent; }
.trend { fill: none; stroke: var(--clay); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bar-label { font: 600 13px var(--sans); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; }
.chart-table summary, .raw summary { cursor: pointer; color: var(--moss); font-weight: 600; }
.chart-table table { margin-top: 10px; border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.chart-table th, .chart-table td { padding: 6px 8px 6px 0; text-align: left; border-bottom: 1px solid var(--line); }
.remember div { padding: 12px 0; border-top: 1px solid rgb(245 240 232 / 0.14); }
.remember dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(245 240 232 / 0.6); }
.remember dd { margin-top: 2px; font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.1875rem; }

/* Mine data og admin */
.facts-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts-list div:first-child { border-top: 0; }
.facts-list dt { color: var(--ink-soft); }
.facts-list dd { text-align: right; font-weight: 500; }
.raw pre { margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--paper-2); overflow-x: auto; font-size: 0.8125rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 10px 10px 10px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 600; }
.row-actions { display: grid; gap: 2px; justify-items: start; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--sage); font-size: 0.75rem; font-weight: 600; }
.tag-warm { background: #f3e2d3; color: #6e3a1e; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
