/* ============================================
   VildtfogedBakkens Mountainbikespor
   Dark/earthy MTB aesthetic, mobile-first
   Typography: Barlow Condensed + Barlow
   ============================================ */

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

:root {
  --c-bg: #1a1a1a;
  --c-bg-alt: #242420;
  --c-bg-accent: #2a3028;
  --c-surface: #2e2e2a;
  --c-surface-light: #3a3a34;
  --c-text: #e8e4dc;
  --c-text-muted: #b5b0a6;
  --c-heading: #f0ece4;
  --c-primary: #8ab648;
  --c-primary-dark: #6e9438;
  --c-accent: #c4a24e;
  --c-danger: #c85a4a;
  --c-link: #8ab648;
  --c-border: #3a3a34;
  --font-body: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Barlow Condensed', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-w: 1100px;
  --nav-h: 60px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

p + p {
  margin-top: 0.75em;
}

a {
  color: var(--c-link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--c-accent);
}

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

/* --- Skip Link (a11y) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: var(--c-primary);
  color: #1a1a1a;
  font-weight: 600;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.5rem;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26, 26, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  transition: background 0.3s, box-shadow 0.3s;
}

.nav--scrolled {
  background: rgba(26, 26, 26, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem var(--space-sm);
  min-height: var(--nav-h);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav__logo:hover {
  color: var(--c-primary);
}

.nav__logo-icon {
  color: var(--c-primary);
  flex-shrink: 0;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Language Toggle --- */
.lang-toggle {
  display: flex;
  align-items: center;
  position: relative;
  width: 64px;
  height: 32px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  cursor: pointer;
  padding: 2px;
  transition: border-color 0.2s;
}

.lang-toggle:hover {
  border-color: var(--c-primary);
}

/* Sliding indicator */
.lang-toggle__slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 26px;
  background: var(--c-primary);
  border-radius: 13px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.lang-toggle[data-active="en"] .lang-toggle__slider {
  transform: translateX(32px);
}

.lang-toggle__opt {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.lang-toggle__opt--active {
  color: #1a1a1a;
}

/* Screen reader announcement for language change */
.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;
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__links {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(26, 26, 26, 0.98);
  border-bottom: 1px solid var(--c-border);
  padding: var(--space-xs) var(--space-sm);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.nav__links.active {
  max-height: 400px;
  padding: var(--space-sm);
}

.nav__links li {
  padding: 0;
}

.nav__links a {
  display: block;
  padding: 0.75rem 0.5rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--c-text-muted);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav__links a:hover {
  color: var(--c-primary);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #1a1a1a;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(26, 26, 26, 0.35) 0%, rgba(26, 26, 26, 0.55) 40%, rgba(26, 26, 26, 0.8) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) var(--space-sm);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 900;
  color: var(--c-heading);
  line-height: 1.0;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--c-text-muted);
  margin-bottom: var(--space-md);
  font-weight: 400;
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  min-height: 48px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--c-primary);
  color: #1a1a1a;
  border-color: var(--c-primary);
}

.btn--primary:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-text-muted);
}

.btn--outline:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.btn--block {
  display: flex;
  width: 100%;
  text-align: center;
}

/* --- Sections --- */
.section {
  padding: var(--space-xl) 0;
  scroll-margin-top: var(--nav-h);
}

.section--dark {
  background: var(--c-bg-alt);
}

.section--accent {
  background: var(--c-bg-accent);
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--c-heading);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.section__intro {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  margin-bottom: var(--space-md);
  max-width: 650px;
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

/* --- Cards --- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--c-surface-light);
}

.card h3 {
  font-family: var(--font-heading);
  color: var(--c-heading);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xs);
}

.card__icon {
  color: var(--c-primary);
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.card__icon svg {
  display: block;
}

.card--img {
  padding: 0;
  overflow: hidden;
}

.card__photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card__body {
  padding: var(--space-md);
}

.card--img h3 {
  font-family: var(--font-heading);
}

.card--highlight {
  border-color: var(--c-primary);
  border-width: 2px;
}

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

.card--center .card__icon {
  display: flex;
  justify-content: center;
}

.card--cta {
  background: var(--c-surface);
  border-color: var(--c-primary);
  border-width: 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card--cta:hover {
  transform: translateY(-2px);
  border-color: var(--c-primary);
}

.card--cta .btn {
  margin-top: var(--space-sm);
}

/* --- Fact list --- */
.fact-list {
  list-style: none;
}

.fact-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.95rem;
}

.fact-list li:last-child {
  border-bottom: none;
}

/* --- Rules list --- */
.rules-list {
  list-style: none;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--c-border);
}

.rules-list li:last-child {
  border-bottom: none;
}

.rules-list__icon {
  flex-shrink: 0;
  width: 1.5rem;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.15rem;
}

.rules-list__icon svg {
  display: block;
}

/* --- Check list --- */
.check-list {
  list-style: none;
  margin-top: var(--space-sm);
}

.check-list li {
  padding: 0.4rem 0;
  padding-left: 1.75rem;
  position: relative;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 16px;
  height: 16px;
  background: var(--c-primary);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* --- Trail info --- */
.trail-info {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--c-surface);
  border-radius: var(--radius);
  border-left: 4px solid var(--c-primary);
}

.trail-info h3 {
  font-family: var(--font-heading);
  color: var(--c-heading);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  font-weight: 700;
}

.trail-info p {
  margin-bottom: 0.5rem;
}

/* --- Donate box --- */
.donate-box {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.donate-box__mobilepay {
  background: linear-gradient(135deg, #5a31f4, #7b52ff);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
}

.donate-box__label {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.25rem;
}

.donate-box__number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.08em;
}

.donate-box__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.donate-box__copy:hover {
  background: rgba(255, 255, 255, 0.25);
}

.donate-box__copy-text {
  pointer-events: none;
}

/* --- Social links --- */
.social-links {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 0.5rem;
  justify-content: center;
}

/* --- Footer --- */
.footer {
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  padding: var(--space-md) 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--c-text-muted);
}

.footer__sub {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  opacity: 0.6;
}

/* --- Steps list --- */
.steps-list {
  list-style: none;
  counter-reset: step;
  margin-top: var(--space-sm);
}

.steps-list li {
  counter-increment: step;
  padding: 0.6rem 0 0.6rem 2.5rem;
  position: relative;
  border-bottom: 1px solid var(--c-border);
}

.steps-list li:last-child {
  border-bottom: none;
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--c-primary);
  color: #1a1a1a;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- App Badges --- */
.app-badges {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  min-height: 44px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, background 0.2s;
}

.app-badge:hover {
  border-color: var(--c-primary);
  background: var(--c-surface-light);
  color: var(--c-primary);
}

/* --- Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.gallery__item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s, filter 0.3s;
}

.gallery__item:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  transition: opacity 0.15s ease;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox__prev {
  left: 1rem;
}

.lightbox__next {
  right: 1rem;
}

/* ============================================
   Responsive — Tablet+
   ============================================ */
@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__links {
    display: flex;
    position: static;
    background: none;
    border: none;
    padding: 0;
    gap: 1.5rem;
    max-height: none;
    overflow: visible;
  }

  .nav__links li {
    padding: 0;
  }

  .nav__links a {
    padding: 0.5rem 0;
    min-height: auto;
    font-size: 0.85rem;
  }

  .grid--2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .card__photo {
    height: 220px;
  }

  .container {
    padding: 0 var(--space-md);
  }
}

/* ============================================
   Responsive — Desktop
   ============================================ */
@media (min-width: 1024px) {
  .section {
    padding: var(--space-xl) 0;
  }

  .hero__content {
    padding: 0 var(--space-md);
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
