/* ========================================
   MAIN.CSS — Reset, Variables, Typography
   Langrenn Guide
   ======================================== */

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

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

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --color-midnight: #1a2744;
  --color-fjord: #2c4a7c;
  --color-fjord-light: #3d6bab;
  --color-frost: #e8edf4;
  --color-snow: #f8f9fb;
  --color-white: #ffffff;
  --color-amber: #d4a03c;
  --color-amber-hover: #b8872e;
  --color-amber-light: #f0ddb0;
  --color-forest: #2d5f3e;
  --color-forest-light: #e2ede6;
  --color-brown: #7c5c3c;
  --color-brown-light: #f0e6d9;
  --color-text: #2a2a2a;
  --color-text-muted: #6b7280;
  --color-border: #d1d5db;
  --color-border-light: #e5e7eb;

  /* Category colors */
  --cat-norge: var(--color-fjord);
  --cat-norge-bg: #eaf0f9;
  --cat-europa: var(--color-forest);
  --cat-europa-bg: var(--color-forest-light);
  --cat-nybegynner: var(--color-amber);
  --cat-nybegynner-bg: var(--color-amber-light);
  --cat-utstyr: var(--color-brown);
  --cat-utstyr-bg: var(--color-brown-light);
  --cat-annet: var(--color-text-muted);
  --cat-annet-bg: #f0f0f0;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Tahoma, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-article: 740px;
  --header-height: 72px;
  --border-radius: 6px;
  --border-radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 39, 68, 0.08);
  --shadow-md: 0 4px 12px rgba(26, 39, 68, 0.1);
  --shadow-lg: 0 8px 30px rgba(26, 39, 68, 0.12);
  --shadow-hover: 0 12px 40px rgba(26, 39, 68, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

/* --- Typography --- */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-snow);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(44, 74, 124, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(45, 95, 62, 0.02) 0%, transparent 50%);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-midnight);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
}

p {
  line-height: 1.75;
  margin-bottom: 1.25em;
}

strong {
  font-weight: 600;
}

/* --- Links --- */
.article-content a,
.text-link {
  color: var(--color-fjord);
  text-decoration: underline;
  text-decoration-color: rgba(44, 74, 124, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast);
}

.article-content a:hover,
.text-link:hover {
  text-decoration-color: var(--color-fjord);
}

/* --- Utility Classes --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

.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;
}

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

.section {
  padding: var(--space-xl) 0;
}

.section--frost {
  background-color: var(--color-frost);
}

.section-title {
  margin-bottom: var(--space-lg);
}

.section-title small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.see-all {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-amber);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  transition: color var(--transition-fast);
}

.see-all:hover {
  color: var(--color-amber-hover);
}

.see-all::after {
  content: '\2192';
  transition: transform var(--transition-fast);
}

.see-all:hover::after {
  transform: translateX(4px);
}

/* --- Selection --- */
::selection {
  background-color: var(--color-amber-light);
  color: var(--color-midnight);
}
