/* ==========================================================================
   Base Styles — Typografie, links, body defaults
   ========================================================================== */

/* --- Font-face declaraties --- */

/* Space Grotesk — headings (static woff2: Regular, Medium, Bold) */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/SpaceGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/SpaceGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/SpaceGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Inter — body text (variable woff2) */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono — code blocks (static woff2: Regular, Bold) */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Body --- */
body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: color var(--transition-base), background-color var(--transition-base);
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-secondary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--color-text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1,
  :root:not([data-theme="light"]) h2,
  :root:not([data-theme="light"]) h3,
  :root:not([data-theme="light"]) h4,
  :root:not([data-theme="light"]) h5,
  :root:not([data-theme="light"]) h6 {
    color: var(--color-text);
  }
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

/* Responsive heading sizes */
@media (max-width: 767px) {
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }
}

/* --- Paragrafen --- */
p {
  margin-block-end: var(--space-md);
  max-width: 70ch;
}

/* --- Links --- */
a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

/* --- Code --- */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-bg-alt);
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background-color: var(--color-bg-alt);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-block-end: var(--space-lg);
}

pre code {
  background: none;
  padding: 0;
}

/* --- Lijsten --- */
ul, ol {
  padding-inline-start: var(--space-xl);
  margin-block-end: var(--space-md);
}

li {
  margin-block-end: var(--space-xs);
}

/* --- Afbeeldingen --- */
img {
  height: auto;
  border-radius: var(--radius-md);
}

/* --- Horizontale lijn --- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-2xl);
}

/* --- Selectie --- */
::selection {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* --- Skip link (WCAG) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  z-index: 1000;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* --- Screenreader only --- */
.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;
}
