/* ==========================================================================
   Brochmedia 2027 – base
   Nulstilling, typografi, overskrifter, margin-regler og layout-hjælpere.
   Kræver tokens.css først.
   ========================================================================== */

/* ---------- Nulstilling ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--space-4)); }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }

body {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

/* ---------- Overskrifter ---------- */
h1, h2, h3, h4, h5, h6, .display {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);   /* altid 700 */
  color: var(--text);
  text-wrap: balance;            /* undgå enkeltord på sidste linje */
}
.display { font-size: var(--fs-display); line-height: var(--lh-tight);   letter-spacing: var(--ls-tight); }
h1, .h1  { font-size: var(--fs-h1);      line-height: var(--lh-heading); letter-spacing: var(--ls-tight); }
h2, .h2  { font-size: var(--fs-h2);      line-height: var(--lh-heading); letter-spacing: var(--ls-heading); }
h3, .h3  { font-size: var(--fs-h3);      line-height: var(--lh-snug);    letter-spacing: var(--ls-heading); }
h4, .h4  { font-size: var(--fs-h4);      line-height: var(--lh-snug); }
h5, .h5  { font-size: var(--fs-h5);      line-height: var(--lh-snug); }
h6, .h6, .eyebrow {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h6);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Todelt overskrift: <h2>Hjemmesider <span class="muted">der virker</span></h2> */
h1 .muted, h2 .muted, .display .muted { color: var(--heading-soft); }

/* ---------- Brødtekst ---------- */
p, li { text-wrap: pretty; }
.lead  { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-muted); }
.small { font-size: var(--fs-small); }
.caption { font-size: var(--fs-caption); color: var(--text-muted); }
strong, b { font-weight: var(--fw-bold); }
a { color: inherit; text-underline-offset: 0.2em; }

/* ---------- Fokus (tastatur) ----------
   Synlig ring på alt, der kan fokuseres, men kun ved tastatur (ikke ved klik). */
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.btn:focus-visible, .svc:focus-visible, .work-card:focus-visible { outline-offset: 4px; }

/* ---------- Margin-regler ----------
   Grundregel: elementer har INGEN margin som udgangspunkt.
   Afstand sættes af forælderen:
   - .stack  -> sektionshoveder, kort, korte tekstblokke (fast, tæt rytme)
   - .prose  -> lange tekster (guides, cases, juridisk) med H2/H3 inde i teksten
*/

/* Stack: lodret rytme i en blok */
.stack > * + * { margin-top: var(--space-4); }                    /* 16 standard */
.stack > .eyebrow + * { margin-top: var(--space-3); }             /* 12 label -> overskrift */
.stack > :is(h1, .h1, .display) + * { margin-top: var(--space-5); } /* 24 efter H1 */
.stack > :is(h2, .h2) + * { margin-top: var(--space-4); }         /* 16 efter H2 */
.stack > :is(h3, h4, h5) + * { margin-top: var(--space-3); }      /* 12 efter H3-H5 */
.stack > * + .actions { margin-top: var(--space-6); }             /* 32 tekst -> knapper */

/* Prose: lang tekst */
.prose { max-width: var(--container-text); }
.prose > * + * { margin-top: 1.1em; }                              /* afsnit -> afsnit */
.prose > * + h2 { margin-top: var(--space-8); }                    /* 64 før H2 */
.prose > * + h3 { margin-top: var(--space-7); }                    /* 48 før H3 */
.prose > * + h4 { margin-top: var(--space-6); }                    /* 32 før H4 */
.prose > :is(h2, h3, h4) + * { margin-top: var(--space-4); }       /* 16 efter overskrift */
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--space-2); }
.prose > :is(img, figure, video, .media) { margin-block: var(--space-7); }

/* Sektionshoved -> sektionens indhold */
.section-head { max-width: 760px; margin-bottom: clamp(2rem, 1rem + 3vw, 4rem); } /* 32 (mobil) -> 64 */
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- Layout ---------- */
.container      { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter));      margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { width: 100%; max-width: calc(var(--container-wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container-text { width: 100%; max-width: calc(var(--container-text) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.section    { padding-block: var(--section-y);    background: var(--bg); color: var(--text); }
.section-sm { padding-block: var(--section-y-sm); background: var(--bg); color: var(--text); }
.section.alt, .section-sm.alt { background: var(--bg-alt); }

.grid { display: grid; gap: var(--grid-gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* ---------- Komponent-padding (kun mål, ingen udseende endnu) ---------- */
.card     { padding: clamp(1.5rem, 1rem + 1.5vw, 2rem); border-radius: var(--radius-md); background: var(--bg-alt); } /* 24 -> 32 */
.card-lg  { padding: clamp(2rem, 1rem + 3vw, 3rem);     border-radius: var(--radius-lg); background: var(--bg-alt); } /* 32 -> 48 */

.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-5);   /* 48 høj, 24 sider */
  border-radius: var(--radius-btn);
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 1rem; line-height: 1;
  text-decoration: none; cursor: pointer; border: 0; white-space: nowrap;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* Accent: Ink-knap med gradient-ramme (gradienten bærer aldrig tekst) */
.btn-accent {
  color: var(--c-white);
  border: 2px solid transparent;
  background: linear-gradient(var(--c-ink), var(--c-ink)) padding-box, var(--gradient-x) border-box;
}
.btn-sm { min-height: 40px; padding: 0 var(--space-4); font-size: var(--fs-small); border-radius: calc(var(--radius-btn) * 0.85); }
.btn-lg { min-height: 56px; padding: 0 var(--space-6); font-size: 1.0625rem; border-radius: calc(var(--radius-btn) * 1.15); }

/* ---------- Hjørne-form (squircle) ----------
   Alle afrundede elementer får squircle-hjørner, hvor browseren kan.
   Billeder og video får automatisk --radius-lg (logoer undtaget). */
img:not([src*="logo"]):not([src*="bomaerke"]), video, picture, .media {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@supports (corner-shape: squircle) {
  *, *::before, *::after { corner-shape: squircle; }
}

/* ---------- Logo ---------- */
.logo { display: block; height: 32px; width: auto; }   /* header desktop */
@media (max-width: 640px) { .logo { height: 26px; } }  /* header mobil */
.logo-footer { height: 40px; }

/* Kort på grå sektion bliver hvide, så de altid skiller sig ud */
.section.alt .card, .section.alt .card-lg, .section-sm.alt .card, .section-sm.alt .card-lg { background: var(--card-on-alt); }
.dark .card, .dark .card-lg { background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- Ikoner (Flaticon UIcons Regular Rounded, kun streger) ----------
   Sprite: assets/icons/sprite.svg (indsættes inline øverst i <body>)
   Brug: <svg class="icon"><use href="#i-robot"/></svg>
   Farve følger teksten. Standard = 1.25em, ellers .icon-20/24/32/48. */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; vertical-align: -0.2em; }
.icon-20 { width: 20px; height: 20px; }
.icon-24 { width: 24px; height: 24px; }
.icon-32 { width: 32px; height: 32px; }
.icon-48 { width: 48px; height: 48px; }
.btn .icon { width: 20px; height: 20px; vertical-align: 0; }
.icon-box { width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.icon-box .icon { width: 28px; height: 28px; }

/* ---------- Produktbilleder (Apple-stil) ----------
   Store enheder (MacBook/iPhone) med kundens side på skærmen. Gennemsigtig baggrund,
   så de virker i begge temaer. Ingen radius på selve produktbilledet. */
img.product { border-radius: 0; overflow: visible; width: 100%; height: auto; }

/* Scene: overskrift centreret over et stort produkt, der "vokser" op fra bunden */
.product-stage { text-align: center; overflow: hidden; padding-bottom: 0; }
.product-stage .section-head { margin-inline: auto; text-align: center; }
.product-stage .product { max-width: 1200px; margin: 0 auto -6%; }   /* skæres let af nederst */

/* Panel: produkt på en flade med store hjørner (cases, ydelser) */
.product-panel {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--bg-alt);
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem) clamp(1.5rem, 1rem + 2.5vw, 3rem) 0;
  display: flex; flex-direction: column;
}
.section.alt .product-panel { background: var(--card-on-alt); }
.product-panel .product { margin-top: auto; padding-top: var(--space-6); }
.product-panel .product.phone { width: 52%; margin-inline: auto; margin-bottom: -18%; }

/* Rolig "zoom ind" når produktet scroller ind (kun browsere med scroll-animationer) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .product-rise { animation: product-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    @keyframes product-rise { from { transform: translateY(8%) scale(.92); opacity: .4; } to { transform: none; opacity: 1; } }
  }
}

/* ==========================================================================
   Formularer (inputs: --radius-sm, 52 px høje, semantiske tokens)
   ========================================================================== */
.field { display: grid; gap: var(--space-2); min-width: 0; border: 0; padding: 0; margin: 0; }
.field > label, .field > legend { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-small); padding: 0; }
.field .opt { font-family: var(--font-body); font-weight: 400; color: var(--text-muted); }
.field > legend { margin-bottom: var(--space-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.input { width: 100%; min-height: 52px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: var(--fs-body); transition: border-color .2s ease, box-shadow .2s ease; }
textarea.input { min-height: 140px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--line); }
.input:focus-visible { outline: none; }
.input:user-invalid { border-color: #EF5255; }
/* Valg-chips: skjult afkrydsningsfelt, hele chippen er klikbar */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-sm); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-small); transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.chip:hover span { box-shadow: inset 0 0 0 1px var(--text); }
.chip input:checked + span { background: var(--btn-bg); color: var(--btn-text); box-shadow: none; }
.chip input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
