/*
 * base.css
 * Reset + typografi-defaults for Digirehab-temaet.
 * Bygger på design-tokens.css — må ikke hardcode værdier.
 */

/* ============================================================
   RESET
============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-family);
}

input,
textarea,
select {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
}

/* ============================================================
   TYPOGRAFI
============================================================ */

.display,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.display {
  font-size: var(--font-size-display);
  line-height: var(--line-height-display);
  letter-spacing: var(--letter-spacing-display);
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  letter-spacing: var(--letter-spacing-h1);
}

h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-h2);
  letter-spacing: var(--letter-spacing-h2);
}

h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-h3);
  letter-spacing: var(--letter-spacing-h3);
}

h4 {
  font-size: var(--font-size-h4);
  line-height: var(--line-height-h4);
  letter-spacing: var(--letter-spacing-h4);
}

p {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
}

.text-secondary {
  font-size: var(--font-size-secondary);
  line-height: var(--line-height-secondary);
  color: var(--color-text-secondary);
}

.caption,
.label {
  font-family: var(--font-family);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-caption);
  letter-spacing: var(--letter-spacing-caption);
  text-transform: uppercase;
}

/* ============================================================
   TABLET (max 1024px)
============================================================ */

@media (max-width: 1024px) {
  .display {
    font-size: 52px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 32px;
  }

  h3 {
    font-size: 22px;
  }
}

/* ============================================================
   LAYOUT UTILITIES
============================================================ */

.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--padding-page-desktop);
  padding-right: var(--padding-page-desktop);
}

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

@media (max-width: 1024px) {
  .container {
    padding-left: var(--padding-page-tablet);
    padding-right: var(--padding-page-tablet);
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: var(--padding-page-mobile);
    padding-right: var(--padding-page-mobile);
  }
}

/* ============================================================
   FOCUS
============================================================ */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--color-focus-ring);
}

/* ============================================================
   IMAGE PLACEHOLDER
============================================================ */

.img-placeholder {
    background: var(--color-bg-inactive) url('../images/logo-digirehab.svg') center / 35% no-repeat;
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

/* ============================================================
   SCROLL REVEAL — sektioner og indhold fader ind ved scroll
   Fjern blot .reveal og .reveal-child klasserne for at deaktivere
============================================================ */

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sektioner der venter på at blive synlige */
.reveal {
  opacity: 0;
}

/* Når IntersectionObserver tilføjer klassen */
.reveal.is-visible {
  animation: revealUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Staggerede indholdselementer inden i en sektion */
.reveal-child {
  opacity: 0;
}

.reveal.is-visible .reveal-child:nth-child(1) { animation: revealUp 0.5s 0.05s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal.is-visible .reveal-child:nth-child(2) { animation: revealUp 0.5s 0.13s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal.is-visible .reveal-child:nth-child(3) { animation: revealUp 0.5s 0.21s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal.is-visible .reveal-child:nth-child(4) { animation: revealUp 0.5s 0.29s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal.is-visible .reveal-child:nth-child(5) { animation: revealUp 0.5s 0.37s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* Respekter prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-child {
    opacity: 1 !important;
    animation: none !important;
  }
}
