/* =========================
   RheinZaun Basel - Vibrant Energetic UI
   Global mobile-first, flexbox-only layout
   Fonts: Trebuchet MS (display), Arial (body)
   ========================= */

/* -------- RESET & BASE -------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: #10261C; background: #FFFFFF; line-height: 1.6; }
img, svg { max-width: 100%; height: auto; display: block; }
button, a { cursor: pointer; }
button { font-family: inherit; }
input, button, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #00B8FF; outline-offset: 2px; }

/* -------- THEME VARIABLES -------- */
:root {
  /* Brand */
  --brand-primary: #1F3B2D; /* deep green */
  --brand-secondary: #4A5D6A; /* slate */
  --brand-accent: #F4F6F8; /* light */

  /* Vibrant accents */
  --neon-mint: #00E887;
  --neon-pink: #FF3D6E;
  --neon-blue: #00B8FF;
  --warning: #FFB703;

  /* Text */
  --text-dark: #10261C;
  --text-muted: #546570;
  --white: #FFFFFF;

  /* Surfaces */
  --surface: #FFFFFF;
  --surface-alt: #F9FBFC;

  /* Shadows & radii */
  --shadow-1: 0 6px 18px rgba(0,0,0,0.08);
  --shadow-2: 0 10px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* -------- TYPOGRAPHY -------- */
h1, h2, h3, h4 { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; color: var(--brand-primary); margin: 0 0 16px; line-height: 1.2; letter-spacing: 0.2px; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 16px; font-size: 16px; color: var(--text-dark); }
small { color: var(--text-muted); font-size: 14px; }
strong { font-weight: 700; }

/* Links */
a { color: var(--neon-blue); text-decoration: none; position: relative; }
a:hover { color: var(--neon-pink); }
a:focus-visible { box-shadow: 0 0 0 3px rgba(0,184,255,0.3); border-radius: 4px; }

/* Lists */
ul, ol { margin: 0 0 16px 20px; padding: 0; }
ul li, ol li { margin: 6px 0; }
ul li { list-style: disc; }
ol { list-style: decimal; }

/* Tables (for Cookie page) */
.text-section table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; white-space: nowrap; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-1); }
.text-section table th, .text-section table td { padding: 12px 14px; border-bottom: 1px solid #E6EDF2; text-align: left; font-size: 14px; }
.text-section table thead th { background: var(--brand-accent); color: var(--brand-primary); font-weight: 700; }

/* -------- LAYOUT HELPERS -------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.content-wrapper { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }

/* Mandatory spacing & 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-radius: var(--radius-md); box-shadow: var(--shadow-1); padding: 20px; }
.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: var(--radius-md); background: var(--brand-accent); color: var(--text-dark); box-shadow: var(--shadow-1); border-left: 6px solid var(--neon-mint); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Spacing for real sections */
main section { margin-bottom: 60px; padding: 40px 0; }
.text-section { background: var(--surface); border: 1px solid #E6EDF2; border-left: 4px solid var(--neon-blue); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-1); }
.text-section p:last-child { margin-bottom: 0; }

/* Breadcrumbs */
nav[aria-label="Brotkrumen"] { font-size: 14px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; }
nav[aria-label="Brotkrumen"] a { color: var(--brand-secondary); }

/* -------- HEADER & NAV -------- */
header { position: sticky; top: 0; z-index: 1000; background: var(--white); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.logo { display: flex; align-items: center; }
.logo img { height: 38px; width: auto; }

.main-nav { display: none; align-items: center; gap: 18px; }
.main-nav a { color: var(--brand-primary); font-weight: 700; padding: 8px 10px; border-radius: 8px; }
.main-nav a[aria-current="page"] { color: var(--neon-pink); }
.main-nav a:hover { background: var(--brand-accent); color: var(--brand-primary); }

.header-actions { display: none; align-items: center; gap: 12px; }
.phone { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-primary); font-weight: 700; }
.phone img { width: 18px; height: 18px; }

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

/* Mobile menu overlay */
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; width: 86vw; max-width: 380px; background: var(--white); box-shadow: -8px 0 30px rgba(0,0,0,0.15); transform: translateX(100%); transition: transform .35s ease; z-index: 1100; display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.mobile-menu.open, .mobile-menu.active, .mobile-menu.is-open { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; width: 40px; height: 40px; border: 2px solid var(--brand-primary); border-radius: 10px; background: var(--white); color: var(--brand-primary); font-size: 18px; }
.mobile-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.mobile-nav a { padding: 14px 12px; border-radius: 10px; background: var(--surface-alt); color: var(--brand-primary); font-weight: 700; border: 1px solid #E6EDF2; }
.mobile-nav a[aria-current="page"] { border-color: var(--neon-mint); box-shadow: 0 0 0 2px rgba(0,232,135,0.15) inset; }

/* Optional body lock when menu open */
body.menu-open { overflow: hidden; }

/* -------- HERO -------- */
.hero { position: relative; background: var(--brand-primary); color: var(--white); overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; background: var(--neon-mint); opacity: .18; border-radius: 24px; transform: rotate(12deg); z-index: 0; }
.hero .container { position: relative; z-index: 1; }
.hero .content-wrapper { align-items: flex-start; }
.hero h1, .hero p { color: var(--white); }
.hero .cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

/* Trust badges in hero */
.trust-badges ul { display: flex; flex-wrap: wrap; gap: 10px; margin-left: 0; }
.trust-badges li { list-style: none; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: var(--white); padding: 8px 12px; border-radius: 999px; font-size: 14px; }

/* -------- BUTTONS -------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px; border-radius: 12px; border: 2px solid var(--neon-blue); color: var(--brand-primary); background: transparent; font-weight: 800; letter-spacing: 0.3px; transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; text-align: center; }
.button:hover { background: var(--neon-blue); color: var(--white); box-shadow: 0 8px 18px rgba(0,184,255,0.25); transform: translateY(-1px); }
.button:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(0,184,255,0.2); }
.button.primary { background: var(--neon-mint); border-color: var(--neon-mint); color: var(--brand-primary); }
.button.primary:hover { background: #00d67c; border-color: #00d67c; box-shadow: 0 8px 18px rgba(0,232,135,0.28); }

/* -------- CONTENT PRESENTATION -------- */
/* Ensure section internals align with vibrant look but no overlaps */
.content-wrapper > h2, .content-wrapper > nav[aria-label="Brotkrumen"], .content-wrapper > .cta-group { flex: 1 1 100%; }
/* Two-up layout for text blocks on larger screens is handled in media queries */

/* Ordered and unordered lists inside .text-section spaced well */
.text-section ul, .text-section ol { margin: 10px 0 0 18px; }
.text-section li::marker { color: var(--neon-pink); }

/* Testimonial emphasis - readable dark text on light background */
.testimonial-card p { margin: 0; }

/* -------- FOOTER -------- */
footer { background: var(--brand-primary); color: var(--white); padding: 40px 0; margin-top: 40px; }
footer .content-wrapper { flex-direction: column; gap: 20px; }
footer h3 { color: var(--white); margin-bottom: 8px; }
footer a { color: #E6FFF4; }
footer a:hover { color: var(--neon-mint); }
footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
footer .text-section { background: transparent; border: none; border-left: 0; box-shadow: none; padding: 0; color: var(--white); }

/* -------- COOKIE CONSENT -------- */
/* Banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; background: var(--white); border-top: 4px solid var(--neon-mint); box-shadow: 0 -8px 24px rgba(0,0,0,0.12); transform: translateY(100%); transition: transform .35s ease; }
.cookie-banner.show, .cookie-banner.visible, .cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner .container { padding: 16px; }
.cookie-banner .content { display: flex; flex-direction: column; gap: 12px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .button { padding: 10px 14px; }
.cookie-banner .btn-accept { background: var(--neon-mint); border-color: var(--neon-mint); color: var(--brand-primary); }
.cookie-banner .btn-reject { background: var(--white); border-color: var(--brand-secondary); color: var(--brand-secondary); }
.cookie-banner .btn-settings { background: var(--white); border-color: var(--neon-blue); color: var(--brand-primary); }

/* Modal */
.cookie-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1300; }
.cookie-modal.open, .cookie-modal.active, .cookie-modal.is-open { display: flex; }
.cookie-modal-content { background: var(--surface); width: 100%; max-width: 720px; border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #E6EDF2; border-left: 4px solid var(--neon-blue); border-radius: var(--radius-md); background: var(--surface-alt); }
/* Toggle switch */
.cookie-toggle { position: relative; width: 48px; height: 28px; background: #B8C5CE; border-radius: 999px; transition: background .2s ease; }
.cookie-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: var(--white); border-radius: 50%; box-shadow: var(--shadow-1); transition: transform .2s ease; }
.cookie-toggle.on { background: var(--neon-mint); }
.cookie-toggle.on::after { transform: translateX(20px); }

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

/* -------- RESPONSIVE -------- */
@media (min-width: 480px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
}

@media (min-width: 768px) {
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }

  /* Header */
  .main-nav { display: flex; }
  .header-actions { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* Content layout: allow two-up for text sections */
  .content-wrapper { flex-direction: row; flex-wrap: wrap; }
  .content-wrapper > h1, .content-wrapper > h2, .content-wrapper > nav[aria-label="Brotkrumen"], .content-wrapper > .cta-group { flex-basis: 100%; }
  .content-wrapper .text-section { flex: 1 1 calc(50% - 20px); min-width: 320px; }

  /* Footer layout */
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  footer .text-section { flex: 1 1 260px; }

  /* Text-image section alignment */
  .text-image-section { flex-direction: row; }
}

@media (min-width: 1024px) {
  .container { padding: 0 24px; }
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
}

/* -------- PAGE-SPECIFIC POLISH -------- */
/* Highlight current nav item in any nav */
nav[aria-label="Hauptnavigation"] a[aria-current="page"],
footer nav a[aria-current="page"] { color: var(--neon-pink); }

/* Hero punchy edge */
.hero { padding: 48px 0; border-bottom: 6px solid var(--neon-pink); }

/* CTA groups spacing */
.cta-group .button { min-width: 180px; }

/* Phone and mail rows inside content */
.text-section img[alt="Telefon"],
.text-section img[alt="E-Mail"] { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 8px; }

/* Ordered step lists more visible */
ol li { padding-left: 2px; }
ol li + li { margin-top: 6px; }

/* Tables stripe */
.text-section table tbody tr:nth-child(even) td { background: #FCFEFF; }

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

/* ------- ACCESSIBILITY CONTRAST FOR TESTIMONIALS ------- */
/* Ensure dark text on light background for testimonial cards */
section .testimonial-card, .testimonial-card * { color: var(--text-dark); }

/* -------- PREVENT OVERLAP & CONSISTENT GAPS -------- */
section > .container > .content-wrapper > * { margin: 0; }
section > .container > .content-wrapper { gap: 20px; }

/* Ensure min spacing between sequential .text-section blocks */
.text-section + .text-section { margin-top: 20px; }

/* -------- PRINT (basic) -------- */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { color: #000; text-decoration: underline; }
}
