/* ============================================
   Kabal Design AS — grunnstil.css
   Reset, selvhostede fonter, grunnstil, typografi.
   Mobil først.
   ============================================ */

/* ---------- Selvhostede fonter ---------- */
@font-face {
  font-family: "Baskervville";
  src: url("../fonter/baskervville-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Baskervville";
  src: url("../fonter/baskervville-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonter/manrope-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonter/manrope-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonter/manrope-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-padding-top: var(--header-h);
  overflow-x: clip;
}

body {
  font-family: var(--font-brodtekst);
  font-size: var(--str-brodtekst);
  line-height: var(--linje-brodtekst);
  color: var(--tekst);
  background: var(--bg-side);
  -webkit-font-smoothing: antialiased;
}

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

ul,
ol {
  list-style: none;
}

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

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

/* ---------- Overskrifter: tagg nullstilles, klasse styrer ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* ---------- Typografi-klasser ---------- */
.tittel-side {
  font-family: var(--font-overskrift);
  font-size: var(--str-h1);
  line-height: var(--linje-overskrift);
  color: var(--tekst-overskrift);
}

.tittel-seksjon {
  font-family: var(--font-overskrift);
  font-size: var(--str-h2);
  line-height: var(--linje-overskrift);
  color: var(--tekst-overskrift);
}

.tittel-under {
  font-family: var(--font-brodtekst);
  font-size: var(--str-h3);
  font-weight: 600;
  line-height: 1.3;
  color: var(--tekst-overskrift);
}

.sitat {
  font-family: var(--font-overskrift);
  font-style: italic;
  font-size: var(--str-sitat);
  line-height: 1.35;
}

.kicker {
  font-size: var(--str-kicker);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ingress {
  font-size: 1.05rem;
  line-height: 1.55;
}

.liten {
  font-size: var(--str-liten);
}

/* Tekstfarger på mørke kapitler */
.paa-mork .tittel-side,
.paa-mork .tittel-seksjon,
.paa-mork .tittel-under,
.paa-mork .sitat,
.paa-mork .kicker,
.paa-mork p,
.paa-mork a {
  color: var(--tekst-paa-mork);
}

/* ---------- Store skjermer: tak, marg og skala ---------- */
html {
  background: var(--papir-marg);
}

body {
  max-width: var(--side-maks);
  margin-inline: auto;
}

@media (min-width: 1800px) {
  body {
    border-inline: 1px solid var(--papir-dyp);
    box-shadow: 0 0 48px rgba(43, 42, 38, 0.18);
  }
}

/* Flytende skala: rot-fonten vokser med både bredde og høyde.
   1440x900 = 16px (grunnlinje), stor/høy skjerm opp mot 24px.
   Alt i rem (tekst, luft, bildehøyder) følger med. */
@media (min-width: 1024px) {
  html {
    font-size: clamp(16px, 0.42vw + 1.78vh - 5.3px, 30px);
  }
}

@media (min-width: 1600px) {
  :root {
    --bredde-side: min(85vw, 1520px);
  }
}

/* Store eller høye skjermer: overskriftene skal lede, ikke bare følge */
@media (min-width: 1600px), (min-height: 1200px) {
  :root {
    --str-h1: 2.5rem;
    --str-h2: 1.9rem;
    --str-sitat: 1.6rem;
  }
}
