/* kim.simplineers.se — samma typografiska familj som gdpr.simplineers.se.
   Allt självhostat: inga externa anrop. */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/fraunces-latin-full-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/newsreader-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/newsreader-latin-wght-italic.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  --bg: #f1ebdf;
  --card: #f8f4e9;
  --ink: #29251d;
  --muted: #6f6757;
  --line: #d9cfb9;
  --accent: #a34a24;
  --accent-soft: #eadfcb;
  --ok: #3d6b3f;
  --err: #9c3a2b;
  --serif: 'Newsreader', Georgia, serif;
  --display: 'Fraunces', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1e28;
    --card: #222633;
    --ink: #e8e3d5;
    --muted: #9a95a5;
    --line: #363b4b;
    --accent: #e08a5a;
    --accent-soft: #2c3040;
    --ok: #8fbf8f;
    --err: #e08578;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-weight: 420;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 4.5rem 1.4rem 3rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
em { font-style: italic; }
code {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.dim { color: var(--muted); }

/* ---------- hero ---------- */
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.6rem;
}
.kicker a { color: inherit; }
h1 {
  font-family: var(--display);
  font-weight: 590;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 1.2rem;
}
.lead { font-size: 1.28rem; line-height: 1.55; margin: 0 0 1.6rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.chips li {
  font-family: var(--mono);
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- sektioner ---------- */
section { margin-top: 4.5rem; border-top: 1px solid var(--line); padding-top: 2.6rem; }
h2 {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.7rem;
  line-height: 1.15;
  margin: 0 0 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
h2 .num { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; color: var(--accent); }
section > p { margin: 0 0 1.4rem; }

.recipe {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 1.4rem 0 0;
  flex-wrap: wrap;
}
.recipe span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.recipe code { font-size: 0.74rem; }

/* ---------- statspanel ---------- */
.panel { min-height: 12rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 0;
}
.stats > div { background: var(--card); padding: 0.9rem 1rem 1rem; }
.stats dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stats dd { margin: 0; font-family: var(--mono); font-weight: 500; font-size: 1.25rem; }
.stats-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin: 0.8rem 0 0; }

/* ---------- gästbok ---------- */
form { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.4rem; }
.row { display: flex; gap: 0.6rem; }
.row input { flex: 1; }
input[type="text"], input[type="search"], textarea {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  width: 100%;
}
input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
textarea { resize: vertical; }
button {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  background: var(--accent);
  color: var(--bg);
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1.3rem;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

#gb-feedback { font-family: var(--mono); font-size: 0.76rem; min-height: 1.3rem; margin: 0 0 0.8rem; }
#gb-feedback.ok { color: var(--ok); }
#gb-feedback.err { color: var(--err); }

#gb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
#gb-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}
#gb-list li.htmx-added { animation: pop 0.35s ease-out; }
#gb-list li.htmx-swapping { opacity: 0; transition: opacity 0.2s; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.entry-head { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.2rem; }
.entry-head strong { font-weight: 620; }
.entry-head time { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); }
.entry-head .del {
  margin-left: auto;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  padding: 0 0.3rem;
  line-height: 1;
}
.entry-head .del:hover { color: var(--err); filter: none; }
#gb-list li p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- sök ---------- */
#search-results { min-height: 5rem; margin-top: 1rem; }
.hint { margin: 0.4rem 0; }
table.results, table.compare { width: 100%; border-collapse: collapse; }
table.results td, table.results th, table.compare td, table.compare th {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
table.results th, table.compare th {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
table.results .r { text-align: right; font-variant-numeric: tabular-nums; }
table.results td.r { font-family: var(--mono); font-size: 0.85rem; }

/* ---------- jämförelse & punkter ---------- */
table.compare { margin: 0 0 1.6rem; }
table.compare td:first-child { color: var(--muted); }
table.compare td:last-child { font-weight: 540; }
.how { padding-left: 1.2rem; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }

/* ---------- BankID ---------- */
.bid-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}
.bid-btn {
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.8rem 1.6rem;
}
.bid-btn[disabled] { opacity: 0.6; cursor: progress; }
.bid-qr {
  width: 240px;
  height: 240px;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;           /* QR ska alltid vara mörk på vitt, även i mörkt läge */
  padding: 8px;
  image-rendering: pixelated; /* skarpa moduler */
}
.bid-hint { font-size: 1.05rem; margin: 0; max-width: 22rem; }
.bid-err { color: var(--err); }
.bid-ok { font-size: 1.2rem; margin: 0; }
.bid-ok strong { font-weight: 640; }
.bid-note { font-size: 0.82rem; margin: 0; max-width: 26rem; }
.bid-done { border-color: var(--ok); }
.bid-cancel {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  padding: 0.4rem 1rem;
}
.bid-cancel:hover { filter: none; border-color: var(--muted); }
.bid-consent {
  margin-top: 1.6rem;
  border-left: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.1rem;
}
.bid-consent h3 {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}
.bid-consent p { margin: 0; font-size: 0.98rem; }

/* ---------- htmx-laddindikator ---------- */
.htmx-request .stats, .htmx-request.stats { opacity: 0.7; }
.bid-btn.htmx-request { opacity: 0.6; cursor: progress; }

/* ---------- footer ---------- */
footer { margin-top: 4.5rem; border-top: 1px solid var(--line); padding-top: 1.6rem; }
footer p { margin: 0 0 0.4rem; }
footer .dim { font-size: 0.85rem; }

@media (max-width: 480px) {
  .wrap { padding-top: 3rem; }
  .row { flex-direction: column; }
}
