/* ===============================
   Stark Riddle Rentenbrücke
   Vintage Retro UI — Mobile First, Flexbox Only
   =============================== */

/* ===== Reset & Normalize ===== */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0 0 16px; padding-left: 20px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #C3902E; outline-offset: 2px; }

/* ===== CSS Variables (Brand + Vintage Retro) ===== */
:root {
  /* Brand core */
  --brand-primary: #12395B; /* deep ink blue */
  --brand-secondary: #2E7D6E; /* muted evergreen teal */
  --brand-accent: #F3F6FA; /* light blue-gray */

  /* Vintage palette */
  --v-ink: #102A43; /* dark ink */
  --v-cream: #F8F1E7; /* warm paper */
  --v-paper: #F5EBDD; /* deeper paper */
  --v-mustard: #C3902E; /* mustard gold */
  --v-brick: #B5563A; /* brick red */
  --v-forest: #1E5A4A; /* forest green */
  --v-brown: #7A5C45; /* brown accent */

  --text: #1e293b;
  --text-soft: #3a4756;
  --muted: #6b7280;
  --border: #d8cdbd; /* warm border */
  --bg: var(--v-cream);
  --bg-contrast: #ffffff;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-1: 0 1px 0 rgba(16, 42, 67, 0.08), 0 6px 16px rgba(16, 42, 67, 0.08);
  --shadow-2: 0 2px 0 rgba(16, 42, 67, 0.12), 0 10px 24px rgba(16, 42, 67, 0.12);
  --focus: var(--v-mustard);
}

/* ===== Base Typography ===== */
body {
  font-family: Verdana, Geneva, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; color: var(--brand-primary); margin: 0 0 12px; }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: 0.2px; }
h2 { font-size: 24px; line-height: 1.3; letter-spacing: 0.2px; }
h3 { font-size: 18px; line-height: 1.4; font-variant: small-caps; letter-spacing: 0.6px; color: var(--v-forest); }

p { margin: 0 0 14px;   }
strong { color: var(--text); }
.subheadline { color: var(--text-soft); font-size: 16px; }
.tagline { font-style: italic; color: var(--v-brown); }
.note { color: var(--v-brown); font-size: 14px; }
.disclaimer { color: var(--muted); font-size: 14px; }
.person { font-weight: bold; color: var(--v-ink); }

/* ===== Layout Containers (Flexbox Only) ===== */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* Flex container */
  flex-direction: column; /* mobile-first */
  gap: 20px; /* ensure spacing */
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.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 lists do not collide with flex gaps */
.text-section { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--bg-contrast); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow-1); }

/* ===== Header & Navigation ===== */
header {
  background: var(--brand-primary);
  color: #fff;
  border-bottom: 4px solid var(--v-mustard); /* retro accent strip */
}
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; filter: contrast(1.05) saturate(0.95); }

.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a { color: #F5EBDD; padding: 8px 10px; border-radius: var(--radius-s); font-size: 14px; letter-spacing: 0.4px; }
.main-nav a[aria-current="page"], .main-nav a:hover { background: rgba(195, 144, 46, 0.18); color: #fff; transition: background 0.2s ease; }

/* Mobile menu button */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 2px solid #fff; background: transparent; color: #fff; border-radius: 50%; cursor: pointer; }
.mobile-menu-toggle:hover { background: rgba(255,255,255,0.12); }

/* Mobile slide-in menu */
.mobile-menu {
  position: fixed; inset: 0 0 0 auto; /* right side drawer */
  width: 85%; max-width: 360px;
  background: var(--v-paper);
  color: var(--v-ink);
  box-shadow: var(--shadow-2);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
}
.mobile-menu.is-active { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; width: 40px; height: 40px; border: 2px solid var(--v-ink); background: transparent; color: var(--v-ink); border-radius: 50%; cursor: pointer; }
.mobile-nav { display: flex; flex-direction: column; gap: 10px; }
.mobile-nav a { padding: 12px 10px; border-radius: var(--radius-s); border: 1px solid var(--border); background: #fff; color: var(--v-ink); }
.mobile-nav a[aria-current="page"], .mobile-nav a:hover { background: var(--v-cream); border-color: var(--v-mustard); }

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .cookie-btn, .btn-accept, .btn-reject, .btn-settings {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 18px; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer; text-align: center;
  box-shadow: 0 2px 0 rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.06);
  transition: background 0.2s ease, color 0.2s ease, transform 0.05s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--brand-secondary); color: #fff; border-color: #0f4f44; }
.btn-primary:hover { background: #266b5f; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: var(--v-mustard); color: #1b1b1b; border-color: #a57922; }
.btn-secondary:hover { background: #b88229; }

/* Link-style buttons within dark header */
header .btn-primary { background: var(--v-mustard); color: #1b1b1b; border-color: #a57922; }
header .btn-primary:hover { background: #b88229; }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ===== Hero Section (Vintage Card) ===== */
.hero { background: var(--v-paper); border-bottom: 1px solid var(--border); }
.hero .container { padding-top: 30px; padding-bottom: 30px; }
.hero .content-wrapper { background: #fff; border: 2px solid var(--border); border-radius: var(--radius-l);
  padding: 22px; box-shadow: var(--shadow-1); position: relative; }
.hero .content-wrapper::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--v-mustard); border-top-left-radius: var(--radius-l); border-top-right-radius: var(--radius-l); }

/* ===== Lists & Badges ===== */
.key-badges, .usp { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.key-badges li, .usp li {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  background: var(--brand-accent); color: var(--brand-primary); border: 1px solid var(--border); font-size: 14px; }
.key-badges li::before, .usp li::before { content: "◆"; color: var(--v-mustard); margin-right: 8px; font-size: 12px; }

/* ===== Generic Sections ===== */
main section { padding: 24px 0; border-top: 1px dashed var(--border); }
main section:first-of-type { border-top: none; }

/* ===== Cards & Testimonials ===== */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 16px; }

.testimonial-card {
  background: #fff; color: var(--text);
  border: 1px solid var(--border);
  border-left: 6px solid var(--v-mustard); border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  flex-direction: column; /* mobile */
}
.testimonial-card p { margin: 0; }

/* Ensure testimonials are readable (dark text on light bg) */
.testimonial-card, .testimonial-card p, .testimonial-card .person { color: #13293d; }

/* ===== Contact Details with Icons ===== */
.contact-details { display: flex; flex-direction: column; gap: 8px; }
.contact-details p { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.contact-details img { width: 18px; height: 18px; opacity: 0.9; }

/* ===== Footer ===== */
footer { background: #0f2e49; color: #e7ecf2; border-top: 6px solid var(--v-mustard); }
footer a { color: #e7ecf2; }
footer a:hover { text-decoration: underline; }
footer .container { padding-top: 26px; padding-bottom: 26px; }
footer .content-wrapper { flex-direction: column; gap: 20px; }
footer .text-section { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); box-shadow: none; }
footer nav { display: flex; flex-direction: column; gap: 8px; }

/* ===== Links & Interactions ===== */
a:hover { color: var(--brand-secondary); }

/* ===== Tables (if any appear in content) ===== */
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 10px; text-align: left; }
th { background: var(--v-paper); }

/* ===== Mobile Navigation Visibility Rules ===== */
@media (min-width: 769px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  header .container { gap: 20px; }
}

/* ===== Responsive Layout Enhancements ===== */
@media (min-width: 640px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  .hero .content-wrapper { padding: 28px; }
}

@media (min-width: 900px) {
  .container { gap: 28px; }
  .content-wrapper { gap: 20px; }
  .text-image-section { flex-direction: row; }
  .testimonial-card { flex-direction: row; }
  /* Footer columns */
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; gap: 24px; }
  footer .text-section { flex: 1 1 280px; }
}

/* ===== Accessibility: Focus Styles ===== */
.btn-primary:focus-visible, .btn-secondary:focus-visible, .mobile-menu-toggle:focus-visible, .mobile-menu-close:focus-visible { box-shadow: 0 0 0 3px rgba(195,144,46,0.4); }

/* ===== Forms (if added later) ===== */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--border); background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { border-color: var(--v-mustard); outline: none; box-shadow: 0 0 0 3px rgba(195,144,46,0.2); }
label { font-weight: bold; margin-bottom: 6px; display: inline-flex; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.form-row > * { flex: 1 1 220px; }

/* ===== Micro-interactions ===== */
.card:hover, .text-section:hover, .testimonial-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); transition: box-shadow 0.2s ease, transform 0.2s ease; }

/* ===== Decorative Separators for Vintage Feel ===== */
hr { border: none; border-top: 1px dashed var(--border); margin: 20px 0; }

/* ===== Page-specific small tweaks ===== */
.hero .usp { margin-top: 4px; }

/* ===== Spacing safety to avoid overlaps ===== */
main > section + section { margin-top: 10px; }

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
  background: #fff; color: var(--text);
  border-top: 4px solid var(--v-mustard);
  box-shadow: 0 -10px 20px rgba(0,0,0,0.08);
  display: none; /* hidden by default, show with .is-active */
}
.cookie-banner.is-active { display: flex; }
.cookie-banner .inner { width: 100%; max-width: 1120px; margin: 0 auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-btn, .btn-accept, .btn-reject, .btn-settings { font-size: 14px; }
.btn-accept { background: var(--brand-secondary); color: #fff; border-color: #0f4f44; }
.btn-reject { background: #fff; color: var(--v-ink); border-color: var(--v-ink); }
.btn-settings { background: var(--v-mustard); color: #1b1b1b; border-color: #a57922; }

/* Cookie Modal (Preferences) */
.cookie-modal-overlay { position: fixed; inset: 0; background: rgba(16, 42, 67, 0.5); display: none; z-index: 9999; align-items: center; justify-content: center; }
.cookie-modal-overlay.is-active { display: flex; }
.cookie-modal { background: #fff; width: 92%; max-width: 640px; border-radius: var(--radius-l); border: 1px solid var(--border); box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.cookie-modal .header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .body { display: flex; flex-direction: column; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-s); }
.cookie-modal .footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Toggle Switch (for cookies) */
.toggle { position: relative; width: 44px; height: 26px; display: inline-flex; align-items: center; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 44px; height: 26px; background: #d7d3cc; border-radius: 999px; border: 1px solid var(--border); transition: background 0.2s ease; }
.toggle .thumb { width: 20px; height: 20px; margin-left: -40px; border-radius: 50%; background: #fff; border: 1px solid var(--border); transform: translateX(3px); transition: transform 0.2s ease; }
.toggle input:checked + .track { background: var(--brand-secondary); }
.toggle input:checked + .track + .thumb { transform: translateX(21px); }

/* ===== Utility Helpers ===== */
.hidden { display: none !important; }
.center { display: flex; align-items: center; justify-content: center; }
.wrap { display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== Ensure Required Flex Containers for Provided Classes ===== */
.card-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.card-grid .card { flex: 1 1 280px; }

/* ===== Desktop Layout Enhancements ===== */
@media (min-width: 1024px) {
  .hero .container { padding-top: 40px; padding-bottom: 40px; }
  .hero .content-wrapper { padding: 36px 40px; }
  .content-grid { justify-content: space-between; }
}

/* ===== Fine-tune Lists inside text-section for retro look ===== */
.text-section ul { list-style: none; padding-left: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.text-section ul li { position: relative; padding-left: 20px; }
.text-section ul li::before { content: "▸"; position: absolute; left: 0; color: var(--v-brick); top: 0; }
.text-section ol { margin-left: 18px; }

/* ===== Prevent Overlaps & Provide Breathing Room ===== */
main { display: flex; flex-direction: column; gap: 20px; }

/* ===== Header stickiness optional (not fixed to avoid overlap) ===== */

/* ===== Print tweaks (optional) ===== */
@media print {
  .mobile-menu, .cookie-banner, .cookie-modal-overlay { display: none !important; }
  header, footer { color: #000; background: #fff; border: none; }
}
