/* =============================================================
   style.css — Byg Agent · Design System · Base & Layout
   Agent 3/4: Tilpas kun via CSS custom properties øverst.
   ============================================================= */

/* -------------------------------------------------------------
   1. DESIGN TOKENS (custom properties)
   ------------------------------------------------------------- */
:root {
  /* Farver — match Streamlit-appens "Stormy Morning" tema */
  --color-dark:        #1D2D3A;   /* sidebar, footer, overskrifter */
  --color-medium:      #384959;   /* brødtekst, sekundære overskrifter */
  --color-primary:     #6A89A7;   /* accent, links, ikoner */
  --color-light-accent:#BDDDFC;   /* hover-states, highlights */
  --color-card-bg:     #EBF3FB;   /* kortbaggrunde */
  --color-bg:          #F2F6FA;   /* sidens baggrund */
  --color-border:      #B8D0E8;   /* borders, adskillere */
  --color-white:       #FFFFFF;
  --color-text-muted:  #5a7080;   /* sekundær tekst, captions */

  /* Typografi */
  --font-base:   'Inter', system-ui, -apple-system, sans-serif;
  --text-xs:     0.75rem;   /* 12px */
  --text-sm:     0.875rem;  /* 14px */
  --text-base:   1rem;      /* 16px */
  --text-lg:     1.125rem;  /* 18px */
  --text-xl:     1.25rem;   /* 20px */
  --text-2xl:    1.5rem;    /* 24px */
  --text-3xl:    1.875rem;  /* 30px */
  --text-4xl:    2.25rem;   /* 36px */
  --text-5xl:    3rem;      /* 48px */

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --line-height-tight:  1.25;
  --line-height-snug:   1.4;
  --line-height-normal: 1.6;
  --line-height-relaxed:1.75;

  /* Spacing (8px grid) */
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Layout */
  --container-max:    1140px;
  --container-wide:   1280px;
  --container-narrow:  720px;
  --gutter:            var(--space-6);  /* vandret padding på container */

  /* Borders & radii */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Skygger */
  --shadow-xs: 0 1px 2px rgba(29, 45, 58, 0.06);
  --shadow-sm: 0 2px 6px rgba(29, 45, 58, 0.08);
  --shadow-md: 0 4px 16px rgba(29, 45, 58, 0.10);
  --shadow-lg: 0 8px 32px rgba(29, 45, 58, 0.12);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Z-indekser */
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
}


/* -------------------------------------------------------------
   2. RESET & BOX MODEL
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-medium);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-dark);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-dark);
  line-height: var(--line-height-tight);
}

h1 { font-size: var(--text-4xl); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-3xl); font-weight: var(--weight-semibold); }
h3 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
h4 { font-size: var(--text-xl);  font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-lg);  font-weight: var(--weight-medium); }
h6 { font-size: var(--text-base);font-weight: var(--weight-medium); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }


/* -------------------------------------------------------------
   3. LAYOUT — CONTAINER & GRID
   ------------------------------------------------------------- */

/* Centreret indholdsbeholder */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Generelt side-layout (main indhold mellem nav og footer) */
.page-main {
  min-height: calc(100dvh - 64px); /* trækker nav-højde fra */
}

/* Sektion-wrapper — giver ensartet vertikal luft */
.section {
  padding-block: var(--space-20);
}

.section--sm {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: var(--space-24);
}

/* Sektion-header (bruges i de fleste sektioner) */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header__eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-header__title {
  margin-bottom: var(--space-4);
}

.section-header__lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 640px;
  margin-inline: auto;
}

/* Fleksibelt grid — bruges til cards, features osv. */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Stack-hjælper */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Inline-flex hjælper */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}


/* -------------------------------------------------------------
   4. TYPOGRAFI — UTILITY CLASSES
   ------------------------------------------------------------- */
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-lg      { font-size: var(--text-lg); }
.text-xl      { font-size: var(--text-xl); }
.text-2xl     { font-size: var(--text-2xl); }
.text-3xl     { font-size: var(--text-3xl); }

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

.text-dark    { color: var(--color-dark); }
.text-medium  { color: var(--color-medium); }
.text-primary { color: var(--color-primary); }
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: var(--color-white); }

.font-normal   { font-weight: var(--weight-normal); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.leading-tight   { line-height: var(--line-height-tight); }
.leading-normal  { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }


/* -------------------------------------------------------------
   5. KNAPPER
   ------------------------------------------------------------- */

/* Basis-knap — arves af alle varianter */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

/* Primær knap — mørk bg, hvid tekst */
.btn--primary {
  background-color: var(--color-medium);  /* #384959 */
  color: var(--color-white);
  border-color: var(--color-medium);
}

.btn--primary:hover {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

/* Sekundær knap — lys bg, mørk tekst, accent border */
.btn--secondary {
  background-color: var(--color-card-bg);  /* #EBF3FB */
  color: var(--color-dark);
  border-color: var(--color-primary);      /* #6A89A7 */
}

.btn--secondary:hover {
  background-color: var(--color-light-accent);
  border-color: var(--color-dark);
  color: var(--color-dark);
  box-shadow: var(--shadow-sm);
}

/* Outline (ghost) variant */
.btn--outline {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn--outline:hover {
  background-color: var(--color-white);
  color: var(--color-dark);
}

/* Størrelser */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}


/* -------------------------------------------------------------
   6. HJÆLPE-KLASSER (spacing, display, visibilitet)
   ------------------------------------------------------------- */
.hidden           { display: none !important; }
.sr-only          { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.mt-auto          { margin-top: auto; }
.mb-0             { margin-bottom: 0; }
.mb-4             { margin-bottom: var(--space-4); }
.mb-8             { margin-bottom: var(--space-8); }

.py-section       { padding-block: var(--space-20); }

.bg-white         { background-color: var(--color-white); }
.bg-card          { background-color: var(--color-card-bg); }
.bg-dark          { background-color: var(--color-dark); }
.bg-light         { background-color: var(--color-bg); }

.rounded          { border-radius: var(--radius-md); }
.rounded-lg       { border-radius: var(--radius-lg); }
.shadow           { box-shadow: var(--shadow-sm); }
.shadow-md        { box-shadow: var(--shadow-md); }

.border           { border: 1px solid var(--color-border); }
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-8);
}


/* -------------------------------------------------------------
   7. RESPONSIVT BREAKPOINT — MOBILE-FIRST
   Breakpoints:
     sm:  480px  (store mobiler)
     md:  768px  (tablets, primær breakpoint)
     lg:  1024px (bærbare)
     xl:  1280px (desktop)
   ------------------------------------------------------------- */

/* Mobilstandard: 1-kolonne grids */
.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

/* sm — 480px+ */
@media (min-width: 480px) {
  h1 { font-size: var(--text-4xl); }
}

/* md — 768px+ */
@media (min-width: 768px) {
  :root {
    --gutter: var(--space-8);
  }

  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }

  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }

  .section { padding-block: var(--space-24); }
}

/* lg — 1024px+ */
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}


/* -------------------------------------------------------------
   8. FOKUS & TILGÆNGELIGHED
   ------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Fjern outline for musen, behold for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* Respekter prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
