/*
-----------------------------------------
BASE
1. Reset och bas
2. Layout (page, main, container, section)
3. Brödtext (rich-text) och sektionsrubrik
Alla värden kommer från tokens.css.
-----------------------------------------
*/

/* ---- Reset och bas ------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
address {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

hr {
  margin: 0;
  border: 0;
  border-block-start: 1px solid var(--border-subtle);
}

:focus-visible {
  outline: var(--border-width-focus) solid var(--focus-ring-color);
  outline-offset: var(--border-width-focus);
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(100%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: var(--space-gutter);
  z-index: var(--z-drawer);
  padding: var(--space-8) var(--space-16);
  background: var(--surface-page);
  color: var(--text-heading);
  transform: translateY(-100%);
}

.skip-link:focus {
  transform: none;
}

/* ---- Layout ------------------------------------------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
}

.main {
  flex: 1 0 auto;
}

/* Innehållet är 1216 px brett och centrerat; ytorna (sektionernas bakgrunder) går i full bredd utanför */
.container {
  inline-size: 100%;
  max-inline-size: calc(var(--size-content) + 2 * var(--space-gutter));
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

.section {
  padding-block: var(--space-section);
}

.section--white {
  background: var(--surface-page);
}

.section--light {
  background: var(--surface-light);
}

.section--mid {
  background: var(--surface-mid);
}

/* ---- Brödtext ur en rich text editor ------------------------------------------- */

.rich-text {
  font: var(--font-body);
  color: var(--text-body);
}

.rich-text > * + * {
  margin-block-start: var(--space-16);
}

/* En rubrik mitt i texten har 40 px luft över sig, och 20 px (h2) eller 16 px (h3) till texten under */
.rich-text > * + h2,
.rich-text > * + h3 {
  margin-block-start: var(--space-40);
}

.rich-text > h2 + * {
  margin-block-start: var(--space-20);
}

.rich-text h2 {
  font: var(--font-section-heading);
  color: var(--text-accent);
  text-transform: uppercase;
}

.rich-text h3 {
  font: var(--font-card-heading);
  color: var(--text-heading);
}

.rich-text strong {
  font-weight: var(--font-weight-bold);
}

.rich-text ul,
.rich-text ol {
  padding-inline-start: var(--space-24);
}

.rich-text ul {
  list-style: disc;
}

.rich-text ol {
  list-style: decimal;
}

.rich-text a {
  color: var(--text-accent);
  text-decoration: underline;
}

/* ---- Sektionsrubrik (Exellent/sectionHeader) ----------------------------------- */

.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.section-header--center {
  align-items: center;
  text-align: center;
}

.section-header__title {
  font: var(--font-section-heading);
  color: var(--text-accent);
  text-transform: uppercase;
}

.section-header__text {
  font: var(--font-meta-strong);
  color: var(--text-body);
}
