/* =============================
   WaveSaga Rentenkompass – style.css
   Scandinavian Clean: light colors, simple typography, functional beauty
   Mobile-first, Flexbox-only layouts
   ============================= */

/* 1) CSS RESET & NORMALIZE */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0 0 16px; padding-left: 20px; }
p { margin: 0 0 16px; }

/* 2) THEME TOKENS (with fallbacks) */
:root {
  --primary: #0B3A53; /* deep nordic blue */
  --secondary: #2E7DA3; /* fjord blue */
  --accent: #F5F3EE; /* warm sand/off-white */
  --ink: #24333C; /* readable body text */
  --muted: #6B7B86; /* subdued text */
  --border: #E6E3DD; /* light border */
  --white: #FFFFFF;
  --sand: #FAF9F6; /* soft background alt */
  --shadow: 0 2px 10px rgba(11,58,83,0.06);
}

/* 3) BASE TYPOGRAPHY */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif; /* brand body */
  color: var(--ink);
  background: var(--accent);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; color: var(--primary); margin: 0 0 14px; line-height: 1.25; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; color: var(--ink); }
small { font-size: 14px; color: var(--muted); }
strong { color: var(--primary); font-weight: 700; }

/* Links */
a { color: var(--primary); }
a:hover { color: var(--secondary); text-decoration: underline; }

/* Focus states for accessibility */
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 6px; }

/* 4) LAYOUT PRIMITIVES (Flexbox-only) */
.container {
  display: flex; /* flex container */
  flex-direction: column;
  max-width: 1100px;
  padding: 0 16px;
  margin: 0 auto;
}
.content-wrapper {
  display: flex; /* flex container */
  flex-direction: column; /* mobile-first */
  align-items: flex-start;
  gap: 20px; /* consistent spacing */
  width: 100%;
}

/* Sections */
section { margin-bottom: 48px; padding: 32px 0; }
.section { margin-bottom: 60px; padding: 40px 20px; } /* mandatory pattern */

/* Card & grid helpers (mandatory patterns) */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; position: relative; 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; border-radius: 12px; border: 1px solid var(--border); background: var(--white); box-shadow: var(--shadow); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* 5) HEADER */
header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
header .content-wrapper { padding: 12px 0; }
.brand { display: flex; align-items: center; }
.brand img { height: 36px; width: auto; }

.main-nav { display: none; flex-wrap: wrap; gap: 14px; }
.main-nav a { color: var(--ink); padding: 8px 10px; border-radius: 8px; transition: background-color 180ms ease, color 180ms ease; }
.main-nav a:hover { background: var(--accent); color: var(--primary); text-decoration: none; }

.header-cta { display: none; align-items: center; gap: 10px; }

/* Mobile menu button */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--white); color: var(--primary); cursor: pointer; transition: background-color 180ms ease, transform 180ms ease; }
.mobile-menu-toggle:hover { background: var(--accent); transform: translateY(-1px); }

/* Mobile Menu (off-canvas) */
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; width: 82%; max-width: 360px; background: var(--white); border-left: 1px solid var(--border); box-shadow: -6px 0 18px rgba(11,58,83,0.08); transform: translateX(100%); transition: transform 260ms ease; display: flex; flex-direction: column; gap: 10px; padding: 16px; z-index: 9999; }
.mobile-menu.open, body.menu-open .mobile-menu { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; background: var(--accent); border: 1px solid var(--border); color: var(--primary); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background-color 180ms ease; }
.mobile-menu-close:hover { background: #EFEDE7; }
.mobile-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mobile-nav a { padding: 14px 12px; border-radius: 10px; color: var(--ink); border: 1px solid var(--border); background: var(--sand); }
.mobile-nav a:hover { background: var(--accent); color: var(--primary); text-decoration: none; }

/* 6) HERO */
.hero { background: var(--accent); border-bottom: 1px solid var(--border); }
.hero .content-wrapper { padding: 16px 0; }
.hero h1 { letter-spacing: 0.2px; }
.hero p { color: var(--ink); max-width: 75ch; }

/* Utility groups */
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }
.language-switcher, .trust-badges, .phone-snippet {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); background: var(--white); color: var(--muted); border-radius: 999px; font-size: 14px; }
.trust-badges { border-radius: 12px; }
.phone-snippet { color: var(--primary); font-weight: 700; }

/* Lists */
ul li, ol li { margin-bottom: 8px; }

/* 7) BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 120ms ease, box-shadow 180ms ease; text-decoration: none; }
.btn.primary { background: var(--primary); color: var(--white); box-shadow: var(--shadow); }
.btn.primary:hover { background: #0a3146; transform: translateY(-1px); }
.btn.secondary { background: var(--white); color: var(--secondary); border-color: var(--secondary); }
.btn.secondary:hover { background: #EEF6FA; }
.btn:active { transform: translateY(0); box-shadow: none; }

/* 8) CONTENT ELEMENTS */
.text-image-section .text { flex: 1 1 320px; }
.text-image-section .image { flex: 1 1 320px; border-radius: 12px; overflow: hidden; }

/* Testimonials – ensure dark text on light bg for readability */
.testimonial-card p { margin: 0; color: var(--ink); }
.testimonial-card p strong { color: var(--primary); }

/* 9) FOOTER */
footer { background: var(--primary); color: var(--white); margin-top: 40px; }
footer .content-wrapper { padding: 28px 0; }
.footer-brand { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 700; letter-spacing: 0.3px; }
.footer-nav, .legal-nav { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.footer-nav a, .legal-nav a { color: #E7EEF2; padding: 6px 8px; border-radius: 8px; }
.footer-nav a:hover, .legal-nav a:hover { background: rgba(255,255,255,0.08); color: #FFFFFF; text-decoration: none; }
.footer-contact { color: #D7E2E8; }
.social { display: flex; gap: 10px; flex-wrap: wrap; }
.social a { color: #E7EEF2; }

/* 10) COOKIE CONSENT (banner + modal) */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; display: none; /* toggled with .show */
  align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--white); border-top: 1px solid var(--border); box-shadow: 0 -8px 20px rgba(11,58,83,0.08); z-index: 9998; }
.cookie-banner.show { display: flex; }
.cookie-banner .cookie-text { display: flex; flex: 1; align-items: center; gap: 12px; color: var(--ink); }
.cookie-banner .cookie-actions { display: flex; align-items: center; gap: 10px; }
.cookie-banner .btn { padding: 10px 14px; border-radius: 10px; }
.cookie-accept { background: var(--primary); color: var(--white); }
.cookie-accept:hover { background: #0a3146; }
.cookie-reject { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.cookie-settings { background: var(--white); color: var(--secondary); border: 1px solid var(--secondary); }
.cookie-settings:hover { background: #EEF6FA; }

/* Cookie Preferences Modal */
.cookie-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none; z-index: 9997; }
.cookie-modal-backdrop.show { display: block; }
.cookie-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 92%; max-width: 560px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(11,58,83,0.18); padding: 20px; display: none; flex-direction: column; gap: 16px; z-index: 9999; }
.cookie-modal.show { display: flex; }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 12px; color: var(--ink); }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* 11) UTILITIES */
.hr { height: 1px; background: var(--border); width: 100%; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--border); background: var(--white); border-radius: 999px; font-size: 12px; color: var(--muted); }

/* 12) RESPONSIVE QUERIES */
@media (max-width: 768px) {
  /* Mobile-first adjustments already set */
  .text-image-section { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 769px) {
  /* Header layout on tablet/desktop */
  header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; }
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* Hero spacing */
  .hero .content-wrapper { padding: 24px 0; }

  /* Footer groups */
  footer .content-wrapper { flex-direction: row; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; }
}

@media (min-width: 992px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
  section { margin-bottom: 60px; padding: 40px 0; }

  /* Create broader content feel */
  .content-wrapper { gap: 24px; }
}

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

/* 13) PAGE-SPECIFIC POLISH */
/* Index trust badges cluster */
.trust-badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* Lists inside sections readable width */
main .content-wrapper > ul, main .content-wrapper > ol, main .content-wrapper > p { max-width: 80ch; }

/* CTA blocks spacing */
.content-wrapper .cta-group { margin-top: 4px; }

/* 14) AESTHETIC DETAILS (Scandinavian clean) */
/* Subtle panel style for non-card sections */
section:not(.hero) .container .content-wrapper > h2 { padding-bottom: 4px; border-bottom: 1px solid var(--border); }

/* Hover lifts for cards/testimonials */
.card:hover, .testimonial-card:hover { box-shadow: 0 6px 24px rgba(11,58,83,0.10); transform: translateY(-1px); transition: box-shadow 200ms ease, transform 200ms ease; }

/* 15) NAV LINK CURRENT STATE (optional if handled server-side) */
.main-nav a.active, .mobile-nav a.active { color: var(--secondary); border-color: var(--secondary); background: #EEF6FA; }

/* 16) MANDATED FLEX GAPS & SAFETY SPACING */
/* Ensure minimum spacing between adjacent content blocks */
.content-wrapper > * { margin: 0; }
.content-wrapper { gap: 20px; }

/* 17) PRINT TWEAKS */
@media print {
  header, footer, .mobile-menu, .cookie-banner, .cookie-modal, .mobile-menu-toggle { display: none !important; }
  body { background: #FFFFFF; }
}
