/* Block bedri/process: .forloeb*, .fl-*, the step index.
   Carved from design/style.css (concept approved 23 Oct 2026) in source order; see build/carve/LEDGER.md. */

/* =====================================================
   21 Oct: "Sådan foregår et kandidatforløb", the client's Framer section. One list of four paper cards.
   The stacking only applies once motion.js has set it up (.forloeb.is-live), so without JS, with reduced motion
   or if anything fails, the cards are a plain list and nothing piles up
   ===================================================== */
.forloeb { padding: clamp(5rem, 10vw, 8rem) 0; background: var(--bg); }
.fl-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); grid-template-areas: "eye ." "title lede" "title cta";
  column-gap: clamp(2rem, 6vw, 6rem); align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.fl-head .eyebrow { grid-area: eye; }
.fl-head .h-lg { grid-area: title; max-width: 15ch; }
.fl-lede { grid-area: lede; margin-bottom: 1.25rem; color: var(--muted); }
.fl-head .btn { grid-area: cta; justify-self: start; }
@media (max-width: 800px) {
  .fl-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eye" "title" "lede" "cta"; }
  .fl-head .h-lg { margin-bottom: 1rem; }
}

.fl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1rem, 2vw, 1.5rem); container-type: inline-size; }
/* 30 Oct (Jannik): each card is an index card. The numeral and the title sit side by side on a tab on top, the body
   under it holds the photo beside the text and the time, the text set larger (a lead) so it carries its half of the
   card. The tab is drawn like a browser tab (Jannik, 30 Oct, second round): quiet, a shade off the card with a hairline
   under it, small type. One colour for every tab at all times (third round: no change while the cards move); the
   hairline stays under every tab, so tab and body read as two parts of the card in the stack and in the list alike.
   Body kept low: a wide photo, so the card is short */
.fl-card {
  --card-bg: #EEF2F8; --card-ink: #0A1020; --card-muted: #4A5368; --card-num: #3D6BFF; --card-chip: rgba(61, 107, 255, .1);
  --card-tab: #DDE3EC; --card-tab-line: rgba(10, 16, 32, .12);
  position: relative; display: flex; flex-direction: column; overflow: clip;
  border-radius: 10px; background: var(--card-bg); color: var(--card-ink);
}
.fl-tab {
  display: flex; align-items: center; gap: .65rem; padding: .62rem clamp(.9rem, 2vw, 1.2rem);
  border-bottom: 1px solid var(--card-tab-line); background: var(--card-tab); color: var(--card-ink);
}
.fl-num { flex: none; font-size: .8rem; font-weight: 600; line-height: 1; letter-spacing: .02em; color: var(--card-muted); font-variant-numeric: lining-nums tabular-nums; }
/* the title sized by the card's width (the list is the container), within a small range */
.fl-title { margin: 0; font-family: var(--font-text); font-weight: 600; font-size: clamp(.92rem, 2.5cqi, 1.02rem); line-height: 1.3; letter-spacing: 0; text-wrap: balance; }
.fl-body { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: .25rem; padding: .55rem; }
.fl-photo { position: relative; overflow: hidden; aspect-ratio: 2 / 1; border-radius: 7px; background: #C9D1DF; }
/* --focus keeps the faces in frame: the card crops each photo differently at each size */
.fl-photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.fl-copy { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; padding: .7rem .6rem .75rem; }
.fl-time { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: .35rem .7rem; border-radius: 999px; background: var(--card-chip); color: var(--card-num); font-size: .8rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.fl-clock { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fl-text { margin: 0; max-width: 40ch; font-size: clamp(.98rem, 3cqi, 1.08rem); line-height: 1.5; color: var(--card-ink); text-wrap: pretty; }
/* a card wide enough: the photo and the text side by side, the text (a lead) and the time centred together in the
   column, left-aligned (Jannik, 30 Oct) */
@container (min-width: 34rem) {
  .fl-body { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0; }
  .fl-photo { aspect-ratio: 2 / 1; }
  .fl-copy { justify-content: center; gap: 1rem; padding: clamp(.8rem, 1.6vw, 1.1rem) clamp(1rem, 2vw, 1.4rem) clamp(.7rem, 1.4vw, 1rem); }
  .fl-text { font-size: clamp(1.02rem, .5rem + 1.35cqi, 1.3rem); line-height: 1.45; }
}

/* --- Kartotek (chosen 21 Oct out of three stacking variants, then made straight and native): the steps land straight on
   each other as you scroll. Plain CSS sticky, so the cards move exactly with the scroll and nothing is eased, held or
   snapped. The heading and an index of the steps stay beside the stack; motion.js marks the current step and dims the
   covered cards a little.
   30 Oct (Jannik): each card stops one tab height lower than the one before, so the tabs of the covered cards stay in
   view above the card on top, like the tabs in a card file. --fl-tab is the tallest tab, measured by view.js (a title
   can wrap on a narrow card) and given to every tab as its height; the fallback is the one-line tab. The card's height
   is what the viewport leaves below the stacked tabs, at most --deck-max (kept low, Jannik 30 Oct); the covered cards
   dim in the body only, never the tab --- */
.forloeb.is-live {
  --fl-top: calc(76px + clamp(1.5rem, 4vh, 2.75rem)); --fl-tab: 2.5rem; --fl-under: 3; --deck-max: 360px;
  --deck-h: clamp(280px, calc(100svh - var(--fl-top) - var(--fl-under) * var(--fl-tab) - 1.5rem), var(--deck-max));
}
.forloeb.is-live .fl-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.forloeb.is-live .fl-head { position: sticky; top: var(--fl-top); display: block; margin: 0; }
.forloeb.is-live .fl-head .h-lg { margin-bottom: 1rem; max-width: 14ch; }
.forloeb.is-live .fl-lede { max-width: 34ch; }
.forloeb.is-live .fl-steps { display: block; padding-bottom: 8vh; }
.forloeb.is-live .fl-card {
  position: sticky; top: calc(var(--fl-top) + var(--i) * var(--fl-tab)); height: var(--deck-h); scroll-margin-top: var(--fl-top);
  box-shadow: 0 -8px 20px -14px rgba(0, 0, 0, .5);
}
.forloeb.is-live .fl-card + .fl-card { margin-top: 14vh; }
.forloeb.is-live .fl-tab { flex: none; box-sizing: border-box; min-height: var(--fl-tab); }
.forloeb.is-live .fl-body::after { content: ""; position: absolute; inset: 0; background: #0A1020; opacity: min(.45, calc(var(--depth, 0) * .15)); pointer-events: none; }
.forloeb.is-live .fl-body { grid-template-rows: minmax(0, 1fr) auto; }
.forloeb.is-live .fl-photo { aspect-ratio: auto; min-height: 0; }
@container (min-width: 34rem) {
  .forloeb.is-live .fl-body { grid-template-rows: minmax(0, 1fr); }
}
/* a phone: the text goes under the photo, so the card gets a little more height */
@media (max-width: 600px) { .forloeb.is-live { --deck-max: 400px; } }
/* too short for a stack (a phone on its side): the cards stay a list with their tabs, the index still works. One
   column needs more height: the index bar sits above the stack and a title can wrap to two lines */
@media (max-height: 519px), (max-width: 900px) and (max-height: 599px) {
  .forloeb.is-live .fl-card { position: relative; top: auto; height: auto; box-shadow: none; }
  .forloeb.is-live .fl-card + .fl-card { margin-top: clamp(1rem, 2vw, 1.5rem); }
  .forloeb.is-live .fl-tab { min-height: 0; }
  .forloeb.is-live .fl-body::after { content: none; }
  .forloeb.is-live .fl-photo { aspect-ratio: 2 / 1; }
  @container (min-width: 34rem) { .forloeb.is-live .fl-photo { aspect-ratio: 2 / 1; } }
}
/* the index: number, title and time per step, a line that fills as the cards land; a click scrolls to that step */
.fl-index { position: relative; list-style: none; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0 0 0 1.4rem; }
.fl-index::before, .fl-index::after { content: ""; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 2px; border-radius: 2px; background: var(--line); }
.fl-index::after { background: var(--accent-lit); transform-origin: 50% 0; transform: scaleY(var(--fill, 0)); }
.fl-index button {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; align-items: baseline; gap: .75rem; width: 100%; padding: .7rem 0;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--muted); font: 500 1rem/1.35 var(--font-text); text-align: left; cursor: pointer; transition: color .3s;
}
.fl-index li:last-child button { border-bottom: 0; }
.fl-index button:hover, .fl-index button[aria-current="step"] { color: var(--ink); }
.fl-index .fi-n { font-family: var(--font-display); font-size: 1.15rem; color: var(--accent-lit); font-variant-numeric: lining-nums tabular-nums; }
.fl-index .fi-t { font-size: .82rem; white-space: nowrap; opacity: .8; }
@media (max-width: 900px) {
  /* one column: the heading scrolls away, the index shrinks to four progress segments that stay above the stack */
  .forloeb.is-live { --fl-top: calc(76px + 1.5rem + 22px); --deck-h: clamp(280px, calc(100svh - var(--fl-top) - var(--fl-under) * var(--fl-tab) - 1rem), var(--deck-max)); }
  .forloeb.is-live .fl-wrap { display: block; }
  .forloeb.is-live .fl-head { position: static; margin-bottom: 2.5rem; }
  .fl-index { position: sticky; top: calc(76px + .75rem); z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 .75rem; padding: 0; }
  .fl-index::before, .fl-index::after { content: none; }
  /* 44px to tap, but laid out as the 22px strip it was: the negative margins give the extra 11px above and below back,
     and the bars move down by as much, so neither the bars nor the stack under them move (Jannik, 6 Nov) */
  .fl-index button { display: block; height: 44px; margin-block: -11px; padding: 0; border: 0; position: relative; }
  .fl-index button::before { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 4px; border-radius: 4px; background: var(--line); }
  .fl-index button::after { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 4px; border-radius: 4px; background: var(--accent-lit); transform-origin: 0 50%; transform: scaleX(var(--seg, 0)); }
  .fl-index .fi-n, .fl-index .fi-l, .fl-index .fi-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* --- Subpages (Jannik, 29 Oct, For sælgere): no paper card, the steps on the section's own navy with a thin line and
   the dark colours. Opaque, not transparent, so the stacked deck (.is-live) still covers the steps under it. The
   frontpage keeps the approved paper cards. --- */
body:not(.home) .fl-card {
  --card-bg: var(--bg); --card-ink: var(--ink); --card-muted: var(--muted); --card-num: var(--accent-lit); --card-chip: rgba(142, 197, 255, .12);
  --card-tab: var(--surface); --card-tab-line: rgba(238, 242, 248, .1); /* a dark tab on the dark card, as a dark browser theme */
  border: 1px solid var(--line);
}
body:not(.home) .fl-photo { background: var(--surface); } /* while a photo loads */
