/* =============================================================
   RentenNavigator International – style.css
   Design: scandinavian_clean (light, natural, simple, functional)
   Brand: Primary #123A66, Secondary #2E7D6E, Accent #F4F7FA
   Fonts: Georgia (display), Verdana (body)
   Layout: STRICTLY FLEXBOX ONLY
   ============================================================= */

/* ========== CSS Reset & Base Normalize ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 20px; }
button { background: none; border: none; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #2E7D6E; outline-offset: 2px; }

/* ========== Theme Variables (with fallbacks) ========== */
:root {
  --brand-primary: #123A66;
  --brand-secondary: #2E7D6E;
  --brand-accent: #F4F7FA;
  --ink: #1B2A3A; /* main text */
  --ink-soft: #415568;
  --line: #E6EBF0; /* subtle lines/borders */
  --paper: #FFFFFF;
  --paper-tint: #FAFBFC; /* very light background */
  --radius-s: 8px;
  --radius-m: 12px;
  --shadow-s: 0 2px 6px rgba(18, 58, 102, 0.06);
  --shadow-m: 0 6px 18px rgba(18, 58, 102, 0.08);
  --gap-s: 12px; --gap-m: 20px; --gap-l: 30px; --gap-xl: 40px;
  --transition: 220ms ease;
}

/* ========== Typography ========== */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: var(--ink);
  background-color: var(--paper-tint);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; color: var(--brand-primary); line-height: 1.25; }
h1 { font-size: 32px; margin-bottom: 16px; }
h2 { font-size: 24px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 10px; }

p { margin-bottom: 12px; color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 700; }

/* Links with subtle Scandinavian underline on hover */
a { color: var(--brand-primary); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

/* Lists spacing */
ul, ol { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
li { color: var(--ink-soft); }

/* ========== Containers & Layout (FLEX ONLY) ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* Flex for all layout wrappers */
  flex-direction: column; /* default: column for mobile */
  gap: 0; /* controlled by child components */
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}

/* Mandatory spacing class (even if not present everywhere) */
.section { margin-bottom: 60px; padding: 40px 20px; }

/* Generic section spacing to ensure breathing room */
main > section { margin-bottom: 60px; }

/* Content grids – FLEX ONLY, never grid */
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-s); padding: 20px; margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Text-Image Sections */
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.text-image-section > div { flex: 1 1 260px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px; box-shadow: var(--shadow-s); transition: box-shadow var(--transition), transform var(--transition); }
.text-image-section > div:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); }

/* Testimonials – ensure high contrast (dark text on light) */
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--brand-accent); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-s); margin-bottom: 20px; }
.testimonial-card p { color: var(--ink); }

/* ========== Header & Navigation ========== */
header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 0 0 rgba(0,0,0,0); }
header .container { flex-direction: row; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.logo img { width: 160px; height: auto; }

.main-nav { display: none; align-items: center; gap: 18px; }
.main-nav a { color: var(--ink); padding: 10px 8px; border-radius: 6px; transition: background var(--transition), color var(--transition); }
.main-nav a:hover { background: var(--brand-accent); color: var(--brand-primary); }

/* CTA in header */
header .btn.primary { display: none; }

/* Mobile burger */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-accent); color: var(--brand-primary); transition: background var(--transition), transform var(--transition); }
.mobile-menu-toggle:hover { background: #EAF1F7; transform: translateY(-1px); }

/* Mobile Menu Overlay */
.mobile-menu { position: fixed; inset: 0; background: rgba(18,58,102,0.05); display: flex; flex-direction: row; align-items: stretch; justify-content: flex-end; transform: translateX(100%); transition: transform 300ms ease; z-index: 100; }
.mobile-menu.open, .mobile-menu.active { transform: translateX(0); }
.mobile-menu .mobile-nav { display: flex; flex-direction: column; gap: 8px; background: var(--paper); width: 82%; max-width: 360px; padding: 20px; border-left: 1px solid var(--line); box-shadow: var(--shadow-m); }
.mobile-menu-close { align-self: flex-start; margin: 8px; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-accent); color: var(--brand-primary); }
.mobile-nav a { padding: 12px 10px; border-radius: 8px; color: var(--ink); transition: background var(--transition), color var(--transition); }
.mobile-nav a:hover { background: var(--brand-accent); color: var(--brand-primary); }

/* ========== Hero ========== */
.hero { background: var(--brand-accent); border-bottom: 1px solid var(--line); }
.hero .container { padding-top: 36px; padding-bottom: 36px; }
.hero .content-wrapper { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-m); }
.hero p { font-size: 16px; }

/* ========== Buttons ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; padding: 12px 18px; font-weight: 700; letter-spacing: 0.2px; transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition); border: 1px solid transparent; }
.btn.primary { background: var(--brand-primary); color: #fff; }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(18,58,102,0.18); transform: translateY(-1px); }
.btn.secondary { background: #E9F3F1; color: var(--brand-secondary); border-color: #D7E8E4; }
.btn.secondary:hover { background: #DFF0EC; box-shadow: 0 6px 16px rgba(46,125,110,0.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* ========== Footer ========== */
footer { background: var(--paper); border-top: 1px solid var(--line); }
footer .container { padding-top: 30px; padding-bottom: 30px; }
footer .content-wrapper { display: flex; flex-direction: column; gap: 20px; }
.footer-nav, .legal-nav, .social-links { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.footer-nav a, .legal-nav a { color: var(--ink-soft); padding: 6px 0; }
.footer-nav a:hover, .legal-nav a:hover { color: var(--brand-primary); text-decoration: underline; }

/* ========== Forms (baseline) ========== */
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-secondary); box-shadow: 0 0 0 3px rgba(46,125,110,0.15); }

/* ========== Cookie Consent ========== */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(18,58,102,0.06); padding: 14px 16px; display: flex; align-items: center; justify-content: center; z-index: 90; transform: translateY(110%); transition: transform 300ms ease; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .inner { max-width: 1200px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn { padding: 10px 14px; border-radius: 999px; }
.cookie-accept { background: var(--brand-primary); color: #fff; }
.cookie-reject { background: #EFEFEF; color: var(--ink); border-color: #E0E0E0; }
.cookie-settings { background: #E9F3F1; color: var(--brand-secondary); border-color: #D7E8E4; }

/* Cookie Modal */
.cookie-modal-overlay { position: fixed; inset: 0; background: rgba(27,42,58,0.35); display: none; align-items: center; justify-content: center; z-index: 120; }
.cookie-modal-overlay.open { display: flex; }
.cookie-modal { background: var(--paper); width: 96%; max-width: 720px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-m); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.cookie-modal .rows { display: flex; flex-direction: column; gap: 12px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--brand-accent); }
.cookie-row .label { display: flex; flex-direction: column; gap: 4px; }

/* Toggle Switch (pure CSS) */
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #CFD8E3; transition: background var(--transition); display: inline-flex; align-items: center; padding: 3px; }
.switch:before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transform: translateX(0); transition: transform var(--transition); }
.switch.on { background: var(--brand-secondary); }
.switch.on:before { transform: translateX(20px); }

.cookie-modal .actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ========== Utility & Micro-interactions ========== */
.shadow-s { box-shadow: var(--shadow-s); }
.shadow-m { box-shadow: var(--shadow-m); }
.rounded { border-radius: var(--radius-m); }
.muted { color: var(--ink-soft); }
.center { display: flex; align-items: center; justify-content: center; }

/* ========== Page-specific refinements ========== */
/* Steps (ordered lists) visual rhythm */
ol { counter-reset: step; }
ol > li { position: relative; padding-left: 36px; }
ol > li::before { content: counter(step); counter-increment: step; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: #EAF1F7; color: var(--brand-primary); font-weight: 700; left: -8px; top: 0; }

/* Countries/Lists in content blocks */
.content-wrapper > ul, .content-wrapper > ol { margin-top: 4px; }

/* Ensure adequate spacing between stacked elements */
.content-wrapper > * + * { margin-top: 4px; }

/* Links inside paragraphs */
.content-wrapper p a { color: var(--brand-secondary); }
.content-wrapper p a:hover { color: #1e5f53; }

/* ========== Responsive (Mobile-first) ========== */
@media (min-width: 480px) {
  h1 { font-size: 36px; }
}

@media (min-width: 768px) {
  /* Header nav visible on tablet+ */
  .main-nav { display: flex; }
  header .btn.primary { display: inline-flex; }
  .mobile-menu-toggle { display: none; }

  /* Container spacing in hero */
  .hero .container { padding-top: 48px; padding-bottom: 48px; }

  /* Typographic scale */
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }

  /* Footer layout becomes multi-column using flex */
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 24px 40px; }
  footer .content-wrapper > * { flex: 1 1 260px; }
}

@media (min-width: 1024px) {
  .text-image-section { align-items: stretch; }
  .text-image-section > div { padding: 18px; }
}

/* ========== Spacing & Alignment Rules (Mandatory) ========== */
/* Reinforce global spacing: */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.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; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Ensure minimum 20px margin between cards/sections */
main > section + section { margin-top: 0; }
.card + .card, .testimonial-card + .testimonial-card { margin-top: 20px; }

/* ========== Accessibility Helpers ========== */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; width: auto; height: auto; padding: 8px 10px; background: var(--brand-accent); border-radius: 8px; }

/* ========== Tables (if any appear in legal pages) ========== */
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: 10px; text-align: left; }
th { background: var(--brand-accent); color: var(--brand-primary); }

/* ========== Print styles (basic) ========== */
@media print {
  header, footer, .mobile-menu, .cookie-banner, .cookie-modal-overlay { display: none !important; }
  body { background: #fff; }
  a { text-decoration: underline; color: #000; }
}
