/* ==========================================================================
   Blog post — editorial article modules (key_stat, pull_quote, compare,
   checklist, share_card, inline_cta, figure, heading).

   These modules use their own block-scoped class names (.keystat, .pullquote,
   .compare ...) instead of a shared .section class. That's deliberate: when
   blocks can be reordered freely in a StreamField, colliding margins between
   modules is the failure mode that shows up first and is hardest to track
   down afterwards.

   Colors: every token below is one of the site's existing --color-* custom
   properties (theme/static_src/src/styles.css), so these modules follow the
   dark/light toggle automatically. Domain accent colors (Drive/Impact/
   Insight/Connection) are NOT defined here — they're resolved server-side
   from dashboard.content.domain_colors via the `domain_hex` filter and passed
   in per-block as an inline custom property (--bar-color, --card-color,
   --checklist-accent), so this file can't drift from the dashboard/PDF
   palette.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Block-til-block-afstand

   Ensartet lodret rytme mellem alle topniveau-blokke i artiklens body,
   uanset hvilken blok-type der kommer før/efter. Wagtails include_block-
   wrapper (.block-<type>) er det ene sted, der styrer denne afstand — de
   enkelte moduler herunder (.keystat, .pullquote, .compare ...) sætter selv
   ingen ydre margin, så en tekstblok efterfulgt af fx en nøgletals-boks
   altid får samme luft som to tekstblokke efter hinanden.
   -------------------------------------------------------------------------- */

.article-body > [class^="block-"] {
  margin-top: 2.5rem;
}

.article-body > [class^="block-"]:first-child {
  margin-top: 0;
}

.not-prose .article-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--color-txt-primary);
  margin: 0;
  scroll-margin-top: 6rem;
}

.article-heading__eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-royal-blue);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Nøgletals-boks
   -------------------------------------------------------------------------- */

.keystat {
  background: var(--color-navy-mid);
  border: 1px solid var(--color-navy-border);
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0;
  color: var(--color-txt-primary);
}

.keystat__top {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-navy-border);
}

.keystat__figure {
  flex: 0 0 auto;
  font-size: clamp(2rem, 8vw, 5rem);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.04em;
  white-space: nowrap;
  margin: 0;
}

.keystat__unit {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.125rem;
  color: var(--color-txt-secondary);
  margin: 0;
}

.keystat__bars {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.85rem;
}

.keystat__row {
  display: grid;
  gap: 0.4rem;
}

.keystat__label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-txt-secondary);
}

.keystat__track {
  height: 0.6rem;
  border-radius: 999px;
  background: var(--color-navy-border);
  overflow: hidden;
}

.keystat__fill {
  height: 100%;
  border-radius: 999px;
  width: var(--target);
  background: var(--bar-color, var(--color-royal-blue));
}

/* Animation kun når JS har markeret boksen — ellers står søjlerne straks i
   fuld bredde, så de også virker uden JS. */
.keystat[data-animate] .keystat__fill {
  width: 0;
  transition: width 1.1s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.keystat[data-animate].is-visible .keystat__fill {
  width: var(--target);
}

.keystat__source {
  margin: 1.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-txt-muted);
}

/* --------------------------------------------------------------------------
   Fremhævet citat
   -------------------------------------------------------------------------- */

.pullquote {
  margin: 0;
  padding: 2rem 0;
  border-top: 1px solid var(--color-navy-border);
  border-bottom: 1px solid var(--color-navy-border);
}

.pullquote p {
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--color-txt-primary);
  margin: 0;
  max-width: 22ch;
}

.pullquote__mark {
  color: var(--color-royal-blue);
}

/* --------------------------------------------------------------------------
   Sammenligning
   -------------------------------------------------------------------------- */

.compare {
  display: grid;
  gap: 1rem;
  margin: 0;
}

@media (min-width: 700px) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.compare__card {
  background: var(--color-navy-light);
  border: 1px solid var(--color-navy-border);
  border-radius: 1rem;
  padding: 1.75rem;
  color: var(--color-txt-primary);
}

.compare__card--accent {
  background: var(--color-navy-mid);
  border-color: transparent;
}

.compare__card h3 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-txt-muted);
  margin: 0 0 1.1rem;
}

.compare__card--accent h3 {
  color: var(--color-royal-blue);
}

.compare__card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.compare__card li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.7rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.compare__card li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-top: 0.45rem;
  background: var(--color-navy-border);
}

.compare__card--accent li::before {
  background: var(--color-royal-blue);
}

/* --------------------------------------------------------------------------
   Tjekliste
   -------------------------------------------------------------------------- */

.checklist {
  background: var(--color-navy-light);
  border: 1px solid var(--color-navy-border);
  border-left: 3px solid var(--checklist-accent, var(--color-royal-blue));
  border-radius: 0 1rem 1rem 0;
  padding: 1.75rem 1.75rem 1.5rem;
  margin: 0;
  color: var(--color-txt-primary);
}

.checklist h3 {
  margin: 0 0 1.1rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.checklist li p {
  margin: 0;
}

.checklist ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: checkitem;
  display: grid;
  gap: 0.9rem;
}

.checklist li {
  counter-increment: checkitem;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-txt-secondary);
}

.checklist li::before {
  content: counter(checkitem);
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--checklist-accent, var(--color-royal-blue));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Delbart citatkort
   -------------------------------------------------------------------------- */

.sharewrap {
  margin: 0;
}

.sharecard {
  aspect-ratio: 1 / 1;
  max-width: 26rem;
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 1.25rem;
  color: #fff;
  background: var(--card-color, var(--color-royal-blue));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sharecard blockquote {
  margin: 0;
  font-size: clamp(1.375rem, 3.6vw, 1.875rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.sharecard figcaption {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
}

.sharebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-txt-secondary);
}

.sharebtn {
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-navy-border);
  border-radius: 999px;
  background: var(--color-navy-light);
  color: var(--color-txt-primary);
}

.sharebtn:hover {
  border-color: var(--color-txt-muted);
}

.sharebtn:focus-visible {
  outline: 2px solid var(--color-royal-blue);
  outline-offset: 2px;
}

.sharebar__status {
  font-size: 0.8125rem;
  color: var(--color-txt-secondary);
}

/* --------------------------------------------------------------------------
   Handlingsfelt
   -------------------------------------------------------------------------- */

.inline-cta {
  background: var(--color-navy-light);
  border: 1px solid var(--color-navy-border);
  border-left: 3px solid var(--color-royal-blue);
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0;
  display: grid;
  gap: 1.25rem;
  color: var(--color-txt-primary);
}

@media (min-width: 760px) {
  .inline-cta {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
  }
}

.inline-cta h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.inline-cta p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-txt-secondary);
  max-width: 40ch;
}

.inline-cta__link {
  display: inline-block;
  white-space: nowrap;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--color-royal-blue);
  color: var(--color-navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: transform 150ms;
}

.inline-cta__link:hover {
  transform: translateY(-1px);
}

.inline-cta__link:focus-visible {
  outline: 2px solid var(--color-royal-blue);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Billede
   -------------------------------------------------------------------------- */

.figure {
  margin: 0;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
}

.figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-txt-muted);
}

/* --------------------------------------------------------------------------
   Relaterede artikler
   -------------------------------------------------------------------------- */

.related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-navy-border);
}

.related h2 {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-txt-primary);
}

.related__grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .related__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.related__card {
  display: block;
  padding: 1.5rem;
  background: var(--color-navy-light);
  border: 1px solid var(--color-navy-border);
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
}

.related__card:hover {
  border-color: var(--color-txt-muted);
}

.related__kicker {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--kicker-color, var(--color-royal-blue));
}

.related__card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--color-txt-primary);
}

.related__meta {
  font-size: 0.8125rem;
  color: var(--color-txt-muted);
}

/* --------------------------------------------------------------------------
   Tag (kategori)
   -------------------------------------------------------------------------- */

.article-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  background: var(--tag-color, var(--color-royal-blue));
}

/* --------------------------------------------------------------------------
   Læseprogress
   -------------------------------------------------------------------------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--color-royal-blue);
  z-index: 60;
}

/* --------------------------------------------------------------------------
   Indholdsfortegnelse
   -------------------------------------------------------------------------- */

.article-toc h2 {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-txt-muted);
  font-weight: 600;
  margin: 0 0 0.9rem;
}

.article-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--color-navy-border);
}

.article-toc a {
  display: block;
  padding: 0.4rem 0 0.4rem 1rem;
  margin-left: -1px;
  color: var(--color-txt-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.article-toc a:hover {
  color: var(--color-txt-primary);
}

.article-toc a.is-active {
  color: var(--color-txt-primary);
  border-left-color: var(--color-royal-blue);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Tilgængelighed
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .keystat[data-animate] .keystat__fill,
  .keystat[data-animate].is-visible .keystat__fill {
    width: var(--target);
    transition: none;
  }

  .reading-progress {
    display: none;
  }
}
