/* KurvenWerk – Scandinavian Clean UI
   Complete mobile-first, flexbox-only CSS for all pages
   Brand: primary #0B2850, secondary #157A6E, accent #F4F7FB
   Fonts: Oswald (display), Inter (body) */

/* -------------------------------------
   0) Font import (optional web-safe fallbacks included)
-------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Oswald:wght@400;500;600&display=swap');

/* -------------------------------------
   1) Reset / Normalize
-------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

ul, ol { margin: 0; padding-left: 1.25rem; }
p { margin: 0; }

:root {
  --primary: #0B2850;   /* Deep Nordic Navy */
  --secondary: #157A6E; /* Pine Green */
  --accent: #F4F7FB;    /* Frost Light */
  --ink: #1D2A34;       /* Neutral dark text */
  --muted: #6B7B86;     /* Muted text */
  --surface: #FFFFFF;   /* Clean white */
  --line: #E6ECF2;      /* Subtle border */
  --focus: #2E8CC9;     /* Focus outline */

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;

  --shadow-1: 0 1px 2px rgba(13, 30, 50, 0.06), 0 2px 8px rgba(13, 30, 50, 0.05);
  --shadow-2: 0 6px 18px rgba(13, 30, 50, 0.08);

  --font-display: 'Oswald', 'Franklin Gothic Medium', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* -------------------------------------
   2) Base
-------------------------------------- */
html { scroll-behavior: smooth; }
body {
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4 { margin: 0; color: var(--primary); font-family: var(--font-display); letter-spacing: 0.2px; }
h1 { font-size: 36px; line-height: 1.15; }
h2 { font-size: 28px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }
h4 { font-size: 18px; line-height: 1.35; }

@media (min-width: 768px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
  h4 { font-size: 18px; }
}

p, li { color: var(--ink); font-weight: 400; }
strong { font-weight: 600; }

a { color: var(--secondary); text-decoration: underline; text-underline-offset: 2px; transition: color .2s ease, background-color .2s ease, box-shadow .2s ease; }
a:hover { color: #0f5f57; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* -------------------------------------
   3) Global layout (Flexbox-only)
-------------------------------------- */
.container {
  width: 100%;
  display: flex;              /* Flex-only layout */
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
}

.content-wrapper {
  display: flex;              /* Flex-only */
  flex-direction: column;     /* Column on mobile */
  gap: 20px;
  width: 100%;
  max-width: 1100px;
}

/* Apply spacing to all sections for Scandinavian airy feel */
section { background: transparent; }
section + section { margin-top: 20px; }

/* Mandatory spacing and alignment patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Ensure no overlap between content blocks */
.text-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

/* -------------------------------------
   4) Header & Navigation
-------------------------------------- */
header { position: sticky; top: 0; z-index: 1000; background: var(--surface); border-bottom: 1px solid var(--line); backdrop-filter: saturate(160%) blur(2px); }
header .container { padding-top: 10px; padding-bottom: 10px; }

header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { width: 150px; height: auto; }

.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; transition: background-color .2s ease, color .2s ease; }
.main-nav a:hover { background: var(--accent); color: var(--primary); }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  color: var(--primary);
  transition: background-color .2s ease, transform .2s ease;
}
.mobile-menu-toggle:hover { background: var(--accent); transform: translateY(-1px); }

/* Off-canvas mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(11, 40, 80, 0.12);
  display: flex;             /* Flex container */
  align-items: stretch; justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.mobile-menu > nav, .mobile-menu .mobile-nav { display: flex; }
.mobile-menu .mobile-nav {
  height: 100%; width: 86%; max-width: 360px; min-width: 300px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px; padding-top: 60px;  /* space for close button */
  transform: translateX(100%);
  transition: transform .35s ease;
}
.mobile-menu .mobile-menu-close {
  position: fixed; right: 16px; top: 14px; z-index: 2200;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.mobile-menu .mobile-nav a {
  display: flex; align-items: center; min-height: 44px;
  color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 10px;
}
.mobile-menu .mobile-nav a:hover { background: var(--accent); color: var(--primary); }

/* Open states: support multiple potential class names */
.mobile-menu.active, .mobile-menu.open, .mobile-menu.is-open, .mobile-menu[aria-hidden="false"], .mobile-menu[data-open="true"] {
  pointer-events: auto; opacity: 1;
}
.mobile-menu.active .mobile-nav, .mobile-menu.open .mobile-nav, .mobile-menu.is-open .mobile-nav, .mobile-menu[aria-hidden="false"] .mobile-nav, .mobile-menu[data-open="true"] .mobile-nav {
  transform: translateX(0);
}

/* Desktop switch */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  .mobile-menu { display: none; }
}

/* -------------------------------------
   5) Hero
-------------------------------------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero .container { padding-top: 32px; padding-bottom: 32px; }
.hero .content-wrapper { gap: 16px; }
.hero p { color: var(--muted); }

/* CTA links styled as buttons in content areas (but not in nav) */
.content-wrapper > .text-section a,
.content-wrapper > p > a,
.hero a,
section .content-wrapper a[href^="tel"],
section .content-wrapper a[href^="mailto"] {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 10px 16px; margin-right: 10px; margin-bottom: 10px;
  background: var(--primary); color: #fff; text-decoration: none; border-radius: 10px;
  box-shadow: var(--shadow-1);
}
.content-wrapper > .text-section a:hover,
.content-wrapper > p > a:hover,
.hero a:hover { background: #0a2346; }

/* Secondary/ghost style when multiple CTAs appear side by side */
.content-wrapper > .text-section a + a,
.hero a + a { background: var(--surface); color: var(--primary); border: 1px solid var(--line); }
.content-wrapper > .text-section a + a:hover,
.hero a + a:hover { background: var(--accent); }

/* -------------------------------------
   6) Lists and content rhythm
-------------------------------------- */
.content-wrapper ul, .content-wrapper ol { display: flex; flex-direction: column; gap: 8px; }
.content-wrapper li { padding-left: 2px; }

/* -------------------------------------
   7) Cards & Testimonials (clean, readable)
-------------------------------------- */
.testimonial-card p { margin: 0; color: var(--ink); }
.testimonial-card p strong { color: var(--primary); }

/* Contrast-ensured testimonial background */
section h2 + .text-section + .testimonial-card,
section .testimonial-card { background: #FFFFFF; border: 1px solid var(--line); }

/* Hover micro-interaction */
.card:hover, .testimonial-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); transition: transform .2s ease, box-shadow .2s ease; }

/* -------------------------------------
   8) Footer
-------------------------------------- */
footer { background: var(--surface); border-top: 1px solid var(--line); }
footer .container { padding-top: 28px; padding-bottom: 28px; }
footer .content-wrapper { gap: 22px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-nav a { color: var(--ink); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
.footer-nav a:hover { background: var(--accent); color: var(--primary); }

/* -------------------------------------
   9) Forms / Inputs (generic styling for potential forms)
-------------------------------------- */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }

/* -------------------------------------
   10) Responsive text-image sections
-------------------------------------- */
.text-image-section { align-items: center; }
.text-image-section > * { flex: 1 1 280px; }
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

/* -------------------------------------
   11) Utility spacing (8/16/24/32 rhythm)
-------------------------------------- */
.u-stack-8 > * + * { margin-top: 8px; }
.u-stack-16 > * + * { margin-top: 16px; }
.u-stack-24 > * + * { margin-top: 24px; }
.u-stack-32 > * + * { margin-top: 32px; }

/* -------------------------------------
   12) Page-specific gentle accents
-------------------------------------- */
/* Light accent panels for non-hero sections to create Scandinavian layers */
main section .container .content-wrapper { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; box-shadow: var(--shadow-1); }
/* Keep hero minimal and flat */
.hero .content-wrapper { border: none; box-shadow: none; background: transparent; padding: 0; }

/* Ensure a minimum 20px between content blocks */
.content-wrapper > * + * { margin-top: 4px; }

/* -------------------------------------
   13) Tables (if added later) – Flex faux-rows (still flex-only)
-------------------------------------- */
.table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.table-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.table-row:first-child { border-top: 0; background: var(--accent); font-weight: 600; }
.table-cell { display: flex; flex: 1 1 160px; }

/* -------------------------------------
   14) Mobile menu and header adjustments for tiny screens
-------------------------------------- */
@media (max-width: 360px) {
  .logo img { width: 132px; }
}

/* -------------------------------------
   15) Cookie Consent Banner & Modal
-------------------------------------- */
/* Banner (fixed bottom) */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 3000;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-2);
  padding: 16px;
  transform: translateY(16px); opacity: 0; pointer-events: none;
  transition: transform .3s ease, opacity .3s ease;
}
.cookie-banner.show, .cookie-banner.active, .cookie-banner.is-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner .cookie-text { display: flex; flex-direction: column; gap: 8px; }
.cookie-banner .cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .cookie-buttons .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border-radius: 10px; text-decoration: none; border: 1px solid var(--line); }
.cookie-banner .btn-accept { background: var(--primary); color: #fff; border-color: transparent; }
.cookie-banner .btn-accept:hover { background: #0a2346; }
.cookie-banner .btn-reject { background: var(--surface); color: var(--primary); }
.cookie-banner .btn-reject:hover { background: var(--accent); }
.cookie-banner .btn-settings { background: var(--surface); color: var(--ink); }
.cookie-banner .btn-settings:hover { background: var(--accent); }

/* Modal overlay */
.cookie-backdrop { position: fixed; inset: 0; background: rgba(11,40,80,0.28); z-index: 3500; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.cookie-backdrop.open { opacity: 1; pointer-events: auto; }

.cookie-modal {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 3600;
  display: flex; flex-direction: column; width: 100%; max-width: 560px; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-2);
  transform: translateX(100%); transition: transform .35s ease;
}
.cookie-modal.open { transform: translateX(0); }
.cookie-modal .cookie-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.cookie-modal .cookie-modal-body { display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow: auto; }
.cookie-modal .cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.cookie-modal .cookie-category .desc { display: flex; flex-direction: column; gap: 4px; }
.cookie-modal .cookie-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 10px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .switch { width: 48px; height: 28px; border-radius: 999px; background: #dfe7ee; border: 1px solid var(--line); display: inline-flex; align-items: center; padding: 2px; transition: background-color .2s ease; }
.toggle .knob { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); transform: translateX(0); transition: transform .2s ease; }
.toggle input:checked + .switch { background: #cfe7e3; border-color: #b5d9d4; }
.toggle input:checked + .switch .knob { transform: translateX(20px); }

/* Essential cookies lock state */
.cookie-category[data-essential="true"] { background: #fafcff; }
.cookie-category[data-essential="true"] .toggle { opacity: 0.6; }

/* -------------------------------------
   16) Accessibility helpers
-------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* -------------------------------------
   17) Desktop enhancements
-------------------------------------- */
@media (min-width: 768px) {
  .container { padding: 0 24px; }
  .hero .container { padding-top: 48px; padding-bottom: 48px; }
  main section .container .content-wrapper { padding: 28px; }
}

@media (min-width: 1024px) {
  .content-grid { justify-content: space-between; }
}

/* -------------------------------------
   18) Images and icons in lists */
.content-wrapper li img { width: 18px; height: 18px; margin-right: 6px; vertical-align: middle; }

/* -------------------------------------
   19) Prevent overlapping and ensure spacing */
.content-wrapper > .testimonial-card + .testimonial-card { margin-top: 10px; }
.content-wrapper > .text-section + .testimonial-card { margin-top: 10px; }

/* -------------------------------------
   20) Scandinavian touches */
/* Quiet borders and generous white space are already applied. Add subtle separators */
.separator { height: 1px; width: 100%; background: var(--line); }

/* -------------------------------------
   21) Print basics */
@media print {
  header, .mobile-menu-toggle, .mobile-menu, .cookie-banner, .cookie-modal, .cookie-backdrop { display: none !important; }
  body { background: #fff; }
  main section .container .content-wrapper { box-shadow: none; border: none; }
}
