/*
 * Arkivboten.
 *
 * Bruker temaets egne variabler (--ink, --muted, --surface, --border,
 * --accent-strong, --font-ui, --font-display), så boten arver lys/mørk modus
 * og typografi uten at noe må vedlikeholdes to steder. Reservefargene under
 * gjelder bare hvis pluginen skulle havne i et annet tema.
 */

.hd-ab {
  --hd-ab-ink: var(--ink, #161210);
  --hd-ab-muted: var(--muted, #797468);
  --hd-ab-flate: var(--surface-2, #f6f4f1);
  --hd-ab-kant: var(--border, #e3ded7);
  --hd-ab-aksent: var(--accent-strong, #ec5a13);
  font-family: var(--font-ui, system-ui, sans-serif);
  color: var(--hd-ab-ink);
  max-width: 46rem;
}

/* Samtalen */
.hd-ab__runde { padding: 28px 0; border-bottom: 1px solid var(--hd-ab-kant); }
.hd-ab__runde:last-child { border-bottom: 0; }

.hd-ab__sporsmal {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.hd-ab__funnet,
.hd-ab__status {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hd-ab-muted);
  margin: 0 0 12px;
}
.hd-ab__status--feil { color: var(--hd-ab-aksent); text-transform: none; letter-spacing: 0; font-weight: 500; }

.hd-ab__tekst { font-size: 16.5px; line-height: 1.6; }
.hd-ab__tekst p { margin: 0 0 14px; }
.hd-ab__tekst p:last-child { margin-bottom: 0; }

/* Kildehenvisningen i teksten */
.hd-ab__ref {
  display: inline-block;
  min-width: 17px;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 4px;
  background: var(--hd-ab-flate);
  border: 1px solid var(--hd-ab-kant);
  color: var(--hd-ab-muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  text-decoration: none;
  vertical-align: 2px;
}
.hd-ab__ref:hover { color: var(--hd-ab-aksent); border-color: currentColor; }

/* Forbeholdet under hvert svar. Skal være lesbart, men ikke konkurrere med
   svaret – det er en fotnote, ikke en advarsel. */
.hd-ab__forbehold {
  font-size: 13px;
  line-height: 1.5;
  color: var(--hd-ab-muted);
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--hd-ab-kant);
  max-width: 60ch;
}

/* Kildelista */
.hd-ab__kildeboks { margin-top: 22px; }
.hd-ab__kilder-tittel {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--hd-ab-muted); margin: 0 0 10px;
}
.hd-ab__kilder { margin: 0; padding-left: 1.4em; }
.hd-ab__kilder li { margin-bottom: 12px; font-size: 14.5px; line-height: 1.45; }
.hd-ab__kilder a { color: var(--hd-ab-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--hd-ab-kant); }
.hd-ab__kilder a:hover { color: var(--hd-ab-aksent); }
.hd-ab__kilde-meta,
.hd-ab__kilde-utdrag { display: block; color: var(--hd-ab-muted); }
.hd-ab__kilde-meta { font-size: 12.5px; margin-top: 2px; }
.hd-ab__kilde-utdrag { font-size: 13.5px; margin-top: 4px; }
.hd-ab__kilder li:target { background: var(--hd-ab-flate); border-radius: 6px; padding: 6px 8px; margin-left: -8px; }

/* Tidslinja i listemodus */
.hd-ab__tidslinje { list-style: none; margin: 18px 0 0; padding: 0; }
.hd-ab__tidslinje > li {
  padding: 12px 0 12px 16px;
  border-left: 2px solid var(--hd-ab-kant);
}
.hd-ab__tidslinje-utgave { font-weight: 600; color: var(--hd-ab-ink); text-decoration: none; }
.hd-ab__tidslinje-utgave:hover { color: var(--hd-ab-aksent); }
.hd-ab__tidslinje-dato { display: block; font-size: 12.5px; color: var(--hd-ab-muted); margin-top: 1px; }
.hd-ab__tidslinje ul { margin: 8px 0 0; padding-left: 1.1em; }
.hd-ab__tidslinje ul li { font-size: 14.5px; line-height: 1.45; margin-bottom: 4px; color: var(--hd-ab-ink); }

/* Skrivefeltet */
.hd-ab__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--hd-ab-kant);
  border-radius: 22px;
  padding: 6px 6px 6px 18px;
  transition: border-color 0.15s ease;
}
.hd-ab__form:focus-within { border-color: var(--accent, var(--hd-ab-aksent)); }
.hd-ab__felt {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--hd-ab-ink);
  padding: 9px 0;
  outline: none;
  max-height: 160px;
}
.hd-ab__felt::placeholder { color: var(--hd-ab-muted); }
.hd-ab__send {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--hd-ab-aksent);
  color: var(--accent-ink, #fff);
  cursor: pointer;
}
.hd-ab__send svg { width: 17px; height: 17px; }

.hd-ab__fot { font-size: 12.5px; color: var(--hd-ab-muted); margin: 12px 0 0; line-height: 1.5; }

/* Sperren for utloggede og gratisbrukere */
.hd-ab-sperre {
  border: 1px solid var(--border, #e3ded7);
  border-radius: 14px;
  padding: clamp(24px, 4vw, 40px);
  max-width: 40rem;
}
.hd-ab-sperre h2 {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 10px;
}
.hd-ab-sperre p { color: var(--muted, #797468); line-height: 1.6; margin: 0 0 16px; }
