/* ===========================================
   WEBSITE FACTORY - BASE CSS
   Version: 1.1
   =========================================== */

/* ===========================================
   0. SELF-HOSTED FONTS (FOUNDATION FIRST)
   ===========================================
   Download fonts from fonts.google.com (TTF format)
   Place in /assets/fonts/ folder
   Uncomment and customize the @font-face rules below
   =========================================== */

/*
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-500.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-600.ttf') format('truetype');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/playfair-display-600.ttf') format('truetype');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/playfair-display-700.ttf') format('truetype');
}
*/

/* ===========================================
   1. RESET & BASE
   =========================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-dark);
  background-color: var(--color-bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Focus-visible for keyboard accessibility (E1) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===========================================
   2. CSS VARIABLER
   =========================================== */

:root {
  /* === FÄRGER (ANPASSA PER PROJEKT) === */
  --color-primary: #1a1a2e;        /* Huvudfärg (mörk) */
  --color-secondary: #f4b41a;      /* Accentfärg (gul/orange) */
  --color-accent: #4ade80;         /* CTA/success (grön) */

  /* Text */
  --color-text-dark: #1a1a2e;
  --color-text-light: #ffffff;
  --color-text-muted: #6b7280;

  /* Bakgrunder */
  --color-bg-white: #ffffff;
  --color-bg-light: #f9fafb;
  --color-bg-dark: #1a1a2e;

  /* Övrigt */
  --color-border: #e5e7eb;
  --color-error: #ef4444;
  --color-success: #22c55e;

  /* === TYPOGRAFI === */
  /* Option 1: System fonts (default - no external files needed) */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-heading: var(--font-primary);

  /* Option 2: Self-hosted fonts (uncomment after adding @font-face above)
  --font-primary: 'Inter', sans-serif;
  --font-heading: 'Playfair Display', serif;
  */

  /* Font-storlekar */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* === SPACING === */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */

  /* === LAYOUT === */
  --container-max: 1200px;
  --container-padding: 1.5rem;
  --section-padding: 5rem;

  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);

  /* === BORDERS === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* === TRANSITIONS === */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* ===========================================
   3. TYPOGRAFI
   =========================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-dark);
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 4vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 3vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--color-text-muted); }

/* ===========================================
   4. LAYOUT
   =========================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}

.section {
  padding: var(--section-padding) 0;
}

.section--light {
  background-color: var(--color-bg-light);
}

.section--white {
  background-color: var(--color-bg-white);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
}

.section--primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section__title {
  margin-bottom: var(--space-4);
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* AEO: Lead paragraph, first sentence that AI systems parse as summary */
.section__lead {
  font-size: var(--text-xl);
  line-height: 1.5;
  max-width: 700px;
}

/* Grid system */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* Split layout (text + image) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split--reverse {
    direction: ltr;
  }
}

/* ===========================================
   5. KOMPONENTER
   =========================================== */

/* --- KNAPPAR --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--color-secondary);
  color: var(--color-text-dark);
}

.btn--primary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.btn--white {
  background-color: var(--color-bg-white);
  color: var(--color-primary);
}

.btn--white:hover {
  background-color: var(--color-secondary);
  transform: translateY(-2px);
}

.btn--large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  min-height: 48px;
}

/* --- KORT --- */
.card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card__icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.card__text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.card__link {
  font-weight: 600;
  color: var(--color-secondary);
  transition: color var(--transition-fast);
}

.card__link:hover {
  color: var(--color-primary);
}

/* --- HEADER --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  padding: var(--space-4) 0;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 50px;
  width: auto;
}

.nav__list {
  display: flex;
  gap: var(--space-8);
}

.nav__link {
  font-weight: 500;
  position: relative;
  padding: var(--space-2) 0;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  transition: width var(--transition-normal);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* --- MOBILE MENU BUTTON (Hamburger) --- */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-btn span {
  width: 100%;
  height: 3px;
  background: var(--color-text-dark);
  border-radius: 2px;
  transition: all var(--transition-normal);
  transform-origin: center;
}

/* Hamburger to X animation */
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Legacy support for .nav__toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
}

.nav__toggle-bar {
  width: 25px;
  height: 2px;
  background: var(--color-text-dark);
  transition: all var(--transition-normal);
}

/* --- MOBILE NAVIGATION (Fullscreen overlay) --- */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-nav.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav a {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text-dark);
  transition: color var(--transition-fast);
}

.mobile-nav a:hover {
  color: var(--color-secondary);
}

/* Desktop: hide mobile nav, show desktop nav */
.desktop-nav { display: flex; }
.mobile-nav { display: none; }
.mobile-menu-btn { display: none; }

@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .desktop-nav { display: none; }
  .mobile-nav { display: flex; }
  .mobile-menu-btn { display: flex; }
  .nav__toggle { display: flex; }

  /* Legacy: .nav dropdown */
  .nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-bg-white);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    gap: var(--space-4);
  }
}

/* --- HERO --- */
.hero {
  padding-top: calc(70px + var(--section-padding));
  padding-bottom: var(--section-padding);
  background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-bg-white) 100%);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero__badge {
  display: inline-block;
  background: var(--color-secondary);
  color: var(--color-text-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.hero__title {
  margin-bottom: var(--space-4);
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

.hero__buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero__image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__buttons {
    justify-content: center;
  }

  .hero__image {
    order: -1;
  }
}

/* --- USP BAR --- */
.usp-bar {
  background: var(--color-primary);
  color: var(--color-text-light);
  padding: var(--space-6) 0;
}

.usp-bar__grid {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.usp-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.usp-bar__icon {
  color: var(--color-accent);
  font-weight: bold;
}

/* --- STATISTIK --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  text-align: center;
}

.stat__number {
  display: block;
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--color-secondary);
}

.stat__label {
  font-size: var(--text-lg);
  opacity: 0.9;
}

.stat__context {
  display: block;
  font-size: var(--text-sm);
  opacity: 0.7;
  margin-top: var(--space-1);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- TESTIMONIALS --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.testimonial {
  background: var(--color-bg-white);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.testimonial__text {
  font-size: var(--text-lg);
  font-style: italic;
  margin-bottom: var(--space-6);
}

.testimonial__author strong {
  display: block;
}

.testimonial__author span {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

@media (max-width: 768px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}

/* --- FAQ --- */
.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__question {
  padding: var(--space-5) 0;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq__question::after {
  content: '+';
  font-size: var(--text-xl);
  transition: transform var(--transition-normal);
}

.faq__item[open] .faq__question::after {
  transform: rotate(45deg);
}

.faq__answer {
  padding-bottom: var(--space-5);
  color: var(--color-text-muted);
}

/* --- CTA SECTION --- */
.section--cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d2d4a 100%);
  color: var(--color-text-light);
}

.cta__title {
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
}

.cta__text {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-8);
}

/* --- FEATURE LIST --- */
.feature-list {
  margin: var(--space-6) 0;
}

.feature-list__item {
  padding-left: var(--space-8);
  position: relative;
  margin-bottom: var(--space-3);
}

.feature-list__item::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* EEAT: Expert badge */
.expert-badge {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-light);
  border-left: 3px solid var(--color-secondary);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* EEAT: Footer last-updated */
.footer__updated {
  text-align: center;
  font-size: var(--text-sm);
  opacity: 0.6;
  margin-bottom: var(--space-4);
}

/* --- FOOTER --- */
.footer {
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.footer__logo {
  margin-bottom: var(--space-4);
}

.footer__text {
  opacity: 0.8;
  font-size: var(--text-sm);
}

.footer__heading {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.footer__links li {
  margin-bottom: var(--space-2);
}

.footer__links a {
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer__links a:hover {
  opacity: 1;
}

.footer__contact {
  font-style: normal;
  opacity: 0.8;
  font-size: var(--text-sm);
}

.footer__contact p {
  margin-bottom: var(--space-1);
}

.footer__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer__social a {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.footer__social a:hover {
  background: var(--color-secondary);
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  opacity: 0.7;
}

.footer__legal {
  display: flex;
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
  }
}

/* ===========================================
   6. UTILITIES
   =========================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Skip-to-content link (E3) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-text-light);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* ===========================================
   7. FORMULÄR
   =========================================== */

.form__group {
  margin-bottom: var(--space-4);
}

.form__label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.form__textarea {
  min-height: 150px;
  resize: vertical;
}

/* ===========================================
   8. ANIMATIONS
   =========================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Prefers-reduced-motion: disable animations (E2) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
