/* kvalitetsagent.css — page-specific styles. Builds on pernille-pages.css tokens. */

/* ─────── Body ─────── */
body {
  background: var(--surface-primary);
  /* leave room at the bottom for sticky chat bar */
  padding-bottom: 130px;
}

img { max-width: 100%; height: auto; display: block; }

/* ─────── Top nav ─────── */
.top-nav {
  background: var(--brand-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.top-nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.top-nav__brand:hover { color: var(--brand-50); }
.top-nav__logo { height: 28px; }
.top-nav__wordmark {
  font-size: 22px;
  letter-spacing: 0.025em;
}
.top-nav__caption {
  font-size: 13px;
  color: var(--brand-50);
  opacity: 0.85;
}
@media (max-width: 700px) {
  .top-nav__caption { display: none; }
}

/* ─────── Section frame ─────── */
section { padding: clamp(48px, 7vw, 96px) 0; }
.section__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}
.section__inner--narrow { max-width: 780px; }
.section--alt { background: var(--surface-secondary); }
.section--brand {
  background: var(--brand-900);
  color: #fff;
}
.section--brand .section__title { color: #fff; }
.section--brand a { color: var(--brand-50); }
.section--method { background: var(--surface-secondary); }

.section__header { margin-bottom: clamp(28px, 4vw, 48px); }
.section__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 12px;
}
.section__eyebrow--inv { color: var(--brand-50); }
.section__title {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  color: var(--gray-900);
  margin-bottom: 14px;
  letter-spacing: 0.012em;
}
.section__lead {
  font-size: 17px;
  color: var(--gray-700);
  max-width: 65ch;
  line-height: 1.55;
}
.section--brand .section__lead { color: var(--brand-50); }
.section__close {
  margin-top: 24px;
  font-size: 16px;
  color: var(--gray-700);
  font-style: italic;
}

/* ─────── Hero ─────── */
.hero {
  background: linear-gradient(180deg, var(--brand-50) 0%, var(--surface-primary) 100%);
  padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 7vw, 80px);
  text-align: left;
}
.hero__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}
.hero__headline {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.95;
  color: var(--brand-900);
  letter-spacing: 0.005em;
  max-width: 22ch;
  margin-bottom: 24px;
}
.hero__subline {
  font-size: clamp(17px, 2vw, 22px);
  color: var(--gray-700);
  max-width: 65ch;
  line-height: 1.55;
  margin-bottom: 40px;
}
.hero__caption {
  margin-top: 32px;
  font-size: 13px;
  color: var(--gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─────── KPI tiles ─────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: 1fr; gap: 14px; }
}
.kpi-tile {
  background: #fff;
  border: 1px solid var(--brand-50);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.kpi-tile__value {
  font-family: 'ItemsTextCondensed', sans-serif;
  font-size: clamp(48px, 7vw, 72px);
  line-height: 1;
  color: var(--brand-900);
  letter-spacing: 0.012em;
  margin-bottom: 8px;
}
.kpi-tile__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.kpi-tile__subtitle {
  font-size: 13px;
  color: var(--gray-500);
}

/* ─────── Vocab list ─────── */
.vocab-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}
.vocab-list li {
  background: #fff;
  border: 1px solid var(--gray-300);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--brand-900);
}

/* ─────── Insight grid ─────── */
/* auto-fit with 340px min: 3-card sections fit 3-up at ≥1100px container width,
   2-card sections fit 2-up at ≥740px. Both flow to 1-up below 700px.
   340 is the smallest where chart legend + caption stays legible. */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
}
@media (max-width: 700px) {
  .insight-grid { grid-template-columns: 1fr; }
}

.insight-card {
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}
.insight-card__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--brand-900);
  color: #fff;
  font-family: 'NeueHaasUnica', sans-serif;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  flex-shrink: 0;
}
.insight-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.insight-card__title {
  font-family: 'ItemsTextCondensed', sans-serif;
  font-size: 22px;
  letter-spacing: 0.025em;
  color: var(--gray-900);
  line-height: 1.15;
}
.insight-card__value {
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-900);
}
.insight-card__chart {
  width: 100%;
  height: 220px;
  position: relative;
}
.insight-card__caption {
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray-700);
}
.insight-card__regulation {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--brand-600);
  font-weight: 500;
}
.insight-card__quote {
  background: var(--brand-50);
  border-left: 3px solid var(--brand-600);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--brand-900);
  border-radius: 4px;
  font-style: italic;
}
.insight-card__quote::before {
  content: "Det dette tallet faktisk betyr — ";
  font-style: normal;
  font-weight: 500;
  color: var(--brand-600);
  letter-spacing: 0.01em;
}

/* ─────── Source pills ─────── */
.source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--gray-300);
  margin-top: 4px;
}
.source-pills__label {
  width: 100%;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-top: 12px;
}
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-50);
  color: var(--brand-900);
  border: 1px solid transparent;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  text-decoration: none;
  font-weight: 500;
  transition: background 120ms ease;
}
.source-pill:hover {
  background: #fff;
  border-color: var(--brand-600);
}
.source-pill__icon {
  font-size: 13px;
  line-height: 1;
  color: var(--brand-600);
}
.source-pill__icon--reg {
  font-family: 'ItemsTextCondensed', sans-serif;
  font-weight: 400;
}
.source-pill__arrow {
  font-size: 10px;
  opacity: 0.6;
}

/* ─────── Pillars ─────── */
.pillar-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
  margin: 32px 0;
}
@media (max-width: 720px) { .pillar-list { grid-template-columns: 1fr; } }
.pillar-list li {
  position: relative;
  padding-left: 28px;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
}
.pillar-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand-50);
  font-weight: 500;
}

/* ─────── Phase 2 buttons ─────── */
.phase2-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 32px;
}
@media (max-width: 720px) { .phase2-row { grid-template-columns: 1fr; } }
.phase2-button {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 18px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 150ms ease, border-color 150ms ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phase2-button:hover, .phase2-button:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand-50);
  outline: none;
}
.phase2-button__arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand-900);
  border-radius: 999px;
  font-weight: 500;
}

/* ─────── Methodology footer ─────── */
.method__body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 32px;
}
.bibliography {
  margin: 24px 0;
  padding: 0;
  font-size: 14px;
}
.bibliography summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--brand-600);
  padding: 8px 0;
}
.bibliography summary:hover { color: var(--brand-900); }
.bibliography__list {
  margin-top: 12px;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bibliography__list li {
  color: var(--gray-700);
  line-height: 1.55;
}
.bibliography__list a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bibliography__list a:hover { color: var(--brand-900); }
.method__sanity {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-300);
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─────── Sticky chat bar ─────── */
.chat-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 2px solid var(--brand-900);
  box-shadow: 0 -8px 24px rgba(28, 14, 64, 0.14);
  z-index: 40;
  padding: 12px 0;
}
.chat-bar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bar__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.chat-chip {
  background: var(--brand-50);
  color: var(--brand-900);
  border: 1px solid transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 120ms ease;
  flex-shrink: 0;
}
.chat-chip:hover, .chat-chip:focus {
  background: #fff;
  border-color: var(--brand-600);
  outline: none;
}
.chat-bar__form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-secondary);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
}
.chat-bar__icon { font-size: 18px; flex-shrink: 0; }
.chat-bar__input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  padding: 8px 0;
  color: var(--gray-900);
  min-width: 0;
}
.chat-bar__input:focus { outline: none; }
.chat-bar__input::placeholder { color: var(--gray-500); }
.chat-bar__send {
  background: var(--brand-900);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 120ms ease;
  flex-shrink: 0;
}
.chat-bar__send:hover { background: var(--brand-600); }

/* ─────── Modal ─────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[aria-hidden="false"] { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 14, 64, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.modal__panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(28, 14, 64, 0.35);
  z-index: 1;
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--gray-500);
  cursor: pointer;
  line-height: 1;
}
.modal__close:hover { color: var(--brand-900); }
.modal__title {
  font-size: 28px;
  letter-spacing: 0.012em;
  color: var(--brand-900);
  margin-bottom: 18px;
}
.modal__body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--gray-700);
  margin-bottom: 28px;
  white-space: pre-line;
}
.modal__body strong { color: var(--brand-900); }
.modal__cta {
  background: var(--brand-900);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}
.modal__cta:hover { background: var(--brand-600); }

/* ─────── Mobile tweaks ─────── */
@media (max-width: 540px) {
  body { padding-bottom: 160px; }
  .hero__headline { font-size: clamp(36px, 9vw, 48px); }
  .insight-card { padding: 22px; }
  .insight-card__chart { height: 180px; }
}
