/* ── Maringer GmbH & Co. KG — Theme CSS ─────────────── */
/* Sandwerk, Schotterwerk, Bauschuttrecycling              */
/* CI: Teal — dunkel oklch(42%) für Text/Buttons, hell oklch(75%) dekorativ */

/* ══════════════════════════════════════════════════════
   0. Self-hosted Fonts (DSGVO-konform)
   ══════════════════════════════════════════════════════ */

@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Work Sans';
  src: url('/assets/fonts/work-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ══════════════════════════════════════════════════════
   0b. Prevent horizontal scrollbar from off-screen mobile nav
   ══════════════════════════════════════════════════════ */

html {
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════
   1. Theme Custom Properties
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] {
  --color-primary: oklch(46% 0.14 175);
  --color-primary-rgb: 0, 129, 99;
  --color-primary-light: oklch(75% 0.12 175);
  --color-primary-dark: oklch(38% 0.14 175);

  --color-secondary: oklch(42% 0.01 0);
  --color-secondary-rgb: 80, 80, 80;
  --color-secondary-light: oklch(55% 0.01 0);
  --color-secondary-dark: oklch(35% 0.01 0);

  --color-accent: oklch(46% 0.14 175);

  --color-bg: #ffffff;
  --color-bg-alt: #f5f7f6;
  --color-bg-card: #ffffff;
  --color-surface: #eef2f0;

  --color-text: #404040;
  --color-text-muted: #5a5a5a;
  --color-text-subtle: #6e6e6e;

  --color-border: rgba(0, 0, 0, 0.08);

  --gradient-primary: linear-gradient(135deg, oklch(40% 0.14 175), oklch(46% 0.14 175));
  --gradient-hero: linear-gradient(160deg, oklch(36% 0.14 175) 0%, oklch(46% 0.14 175) 50%, oklch(36% 0.14 175) 100%);
  --gradient-mesh: radial-gradient(ellipse at 30% 50%, rgba(66, 205, 185, 0.06) 0%, transparent 50%),
                   radial-gradient(ellipse at 70% 20%, rgba(66, 205, 185, 0.04) 0%, transparent 50%);

  --shadow-glow-sm: 0 0 20px rgba(66, 205, 185, 0.08);
  --shadow-glow-md: 0 0 40px rgba(66, 205, 185, 0.10);
  --shadow-glow-lg: 0 0 60px rgba(66, 205, 185, 0.12);

  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(0, 0, 0, 0.06);

  --card-bg: var(--color-bg-card);
  --card-border: rgba(0, 0, 0, 0.06);
  --card-border-hover: rgba(66, 205, 185, 0.25);
  --card-shine: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, transparent 50%);

  /* Formsprache: industriell, stabil */
  --btn-radius: var(--radius-sm);
  --card-shadow: var(--shadow-lg);
  --img-radius: var(--radius-sm);

  color-scheme: light;

  /* Fonts: DM Sans + Work Sans */
  --font-heading: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* ══════════════════════════════════════════════════════
   2. Navigation
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .nav {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: padding 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

[data-theme="maringer"] .nav.is-scrolled {
  padding-block: var(--space-2);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

/* Nav-Logo: Bild */
[data-theme="maringer"] .nav__logo-img {
  max-width: 180px;
  height: auto;
}

/* Nav-Button: kleiner Text braucht 4.5:1, dunkler als primary */
[data-theme="maringer"] .nav .btn--primary {
  background: oklch(48% 0.14 175);
}

/* ══════════════════════════════════════════════════════
   3. Hero — Split-Layout (links Teal, rechts Bild)
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .hero--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80vh;
  align-items: stretch;
}

[data-theme="maringer"] .hero--split .hero__grid-content {
  background: var(--gradient-hero);
  color: #fff;
  display: flex;
  align-items: center;
  padding: var(--space-12) var(--space-9);
  position: relative;
  z-index: 2;
}

[data-theme="maringer"] .hero--split .hero__grid-visual {
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

[data-theme="maringer"] .hero--split .hero__grid-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-theme="maringer"] .hero--split .hero__title {
  color: #fff;
  text-shadow: none;
}

[data-theme="maringer"] .hero--split .hero__subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 400;
}

/* Hero-Buttons auf Teal-Hintergrund */
[data-theme="maringer"] .hero--split .btn--primary {
  background: #fff;
  color: oklch(45% 0.12 175);
  font-weight: 600;
}

[data-theme="maringer"] .hero--split .btn--primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="maringer"] .hero--split .btn--outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="maringer"] .hero--split .btn--outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Badge im Hero */
[data-theme="maringer"] .hero--split .badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

@media (max-width: 768px) {
  [data-theme="maringer"] .hero--split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  [data-theme="maringer"] .hero--split .hero__grid-content {
    padding: var(--space-8) var(--container-padding);
    order: 1;
  }

  [data-theme="maringer"] .hero--split .hero__grid-visual {
    order: 2;
    min-height: 40vh;
  }

  /* Hero-Titel auf Mobile verkleinern */
  [data-theme="maringer"] .hero--split .hero__title {
    font-size: var(--text-4xl);
  }

  /* Hero-Buttons umbrechen */
  [data-theme="maringer"] .hero__actions {
    flex-wrap: wrap;
  }

  /* Nav-Logo auf Mobile kleiner */
  [data-theme="maringer"] .nav__logo-img {
    max-width: 140px;
  }
}

/* ── Kleine Screens (375px) ─────────────────────────── */
@media (max-width: 480px) {
  [data-theme="maringer"] .hero--split .hero__title {
    font-size: var(--text-3xl);
  }

  [data-theme="maringer"] .hero--split .hero__grid-content {
    padding: var(--space-7) var(--container-padding);
  }

  /* Hero-Buttons volle Breite */
  [data-theme="maringer"] .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  [data-theme="maringer"] .hero__actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════
   3b. Service Cards mit Bild
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .service-card {
  overflow: hidden;
  text-align: left;
}

[data-theme="maringer"] .service-card .card__title {
  font-size: var(--text-lg);
  hyphens: auto;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
}

[data-theme="maringer"] .service-card__image {
  aspect-ratio: 4/3;
  overflow: hidden;
}

[data-theme="maringer"] .service-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

[data-theme="maringer"] .service-card:hover .service-card__image img {
  transform: scale(1.05);
}

[data-theme="maringer"] .service-card__body {
  padding: var(--space-5) var(--space-5) var(--space-6);
}

/* ══════════════════════════════════════════════════════
   4. Cards
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .card {
  transition: transform 0.4s var(--ease-smooth, ease),
              box-shadow 0.5s ease,
              border-color 0.3s ease;
}

[data-theme="maringer"] .card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border-hover);
}

/* Card-Icon: Teal-Tönung */
[data-theme="maringer"] .card__icon {
  color: oklch(55% 0.12 175);
}

[data-theme="maringer"] .card__icon--round {
  background: oklch(92% 0.04 175);
}

/* Kontakt-Block: Icon-Fix */
[data-theme="maringer"] #kontakt .card__icon {
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════
   5. Buttons
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .btn--outline {
  border-color: rgba(66, 205, 185, 0.4);
  color: oklch(55% 0.12 175);
}

[data-theme="maringer"] .btn--outline:hover {
  background: rgba(66, 205, 185, 0.08);
  border-color: oklch(55% 0.12 175);
}

/* White-Button auf dunklem Hintergrund */
[data-theme="maringer"] .btn--white {
  background: #fff;
  color: oklch(45% 0.12 175);
  font-weight: 600;
}

[data-theme="maringer"] .btn--white:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ══════════════════════════════════════════════════════
   6. Sections
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .section--bg-alt {
  background: var(--color-bg-alt);
}

[data-theme="maringer"] .section--bg-primary {
  background: var(--gradient-primary);
  color: #fff;
}

[data-theme="maringer"] .section--bg-primary .section-header__label {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="maringer"] .section--bg-primary .btn--primary {
  background: #fff;
  color: oklch(45% 0.12 175);
}

/* Service-Bereichstitel */
[data-theme="maringer"] .services-group__title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: oklch(55% 0.12 175);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid oklch(75% 0.12 175);
  display: inline-block;
}

/* ══════════════════════════════════════════════════════
   7. Footer
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .footer--primary {
  background: oklch(25% 0.01 0);
}

[data-theme="maringer"] .footer__title {
  color: oklch(75% 0.12 175);
}

[data-theme="maringer"] .footer__group-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

[data-theme="maringer"] .footer__bottom {
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="maringer"] .footer__bottom a {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="maringer"] .footer__link {
  padding-block: 0.15em;
}

[data-theme="maringer"] .footer__group-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

[data-theme="maringer"] .footer__group-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
  font-size: var(--text-sm);
}

[data-theme="maringer"] .footer__group-links a:hover {
  color: oklch(75% 0.12 175);
}

/* ══════════════════════════════════════════════════════
   8. Scroll Progress
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .scroll-progress {
  background: oklch(75% 0.12 175);
}

/* ══════════════════════════════════════════════════════
   9. Zahlen-Counter
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .counter {
  color: oklch(55% 0.12 175);
  font-family: var(--font-heading);
}

/* ══════════════════════════════════════════════════════
   10. Image Divider
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .image-divider {
  height: 40vh;
  background: var(--gradient-primary);
}

/* ══════════════════════════════════════════════════════
   11. CTA-Band
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .cta-band {
  background: var(--gradient-primary);
  color: #fff;
  padding: var(--space-10) 0;
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   12. Kontakt-Öffnungszeiten Tabelle
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

[data-theme="maringer"] .hours-table td {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

[data-theme="maringer"] .hours-table td:first-child {
  font-weight: 600;
  color: var(--color-text);
  width: 6rem;
}

[data-theme="maringer"] .hours-table td:last-child {
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════
   13. About — Gilch Gruppe Badge
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] .about-group {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="maringer"] .about-group__title {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-3);
}

/* ══════════════════════════════════════════════════════
   14. Focus-Visible (WCAG)
   ══════════════════════════════════════════════════════ */

[data-theme="maringer"] :focus-visible {
  outline: 2px solid oklch(45% 0.15 175);
  outline-offset: 2px;
}

/* ── Prose Styles (Legal Pages) ─────────────────────── */

.prose {
  font-size: var(--text-base, 1rem);
  line-height: 1.75;
  color: var(--color-text);
}

.prose h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 700;
  color: var(--color-primary, currentColor);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl, 1.25rem);
  font-weight: 600;
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  font-weight: 600;
  color: var(--color-text);
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose ul, .prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose li::marker {
  color: var(--color-primary);
}


/* ── Legal Pages: Kompaktere Überschrift ────────────── */

/* Seiten ohne Hero (Impressum, Datenschutz) */
body:not(:has(.hero)) .section-header__title {
  font-size: var(--text-3xl);
  text-wrap: balance;
}

/* Prose H2 nicht zu groß, mit Silbentrennung */
.prose h2 {
  text-wrap: balance;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* ══════════════════════════════════════════════════════
   15. Mobile-Friendly Overrides
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Minimum font-size: Engine clamp() geht unter 12px auf kleinen Viewports */
  [data-theme="maringer"] .label,
  [data-theme="maringer"] .badge,
  [data-theme="maringer"] .text-xs,
  [data-theme="maringer"] .card__text,
  [data-theme="maringer"] .text-sm,
  [data-theme="maringer"] .btn--sm,
  [data-theme="maringer"] .footer__bottom,
  [data-theme="maringer"] .footer__bottom a,
  [data-theme="maringer"] .footer__group-links a,
  [data-theme="maringer"] .hours-table {
    font-size: max(0.8125rem, 13px) !important;
  }

  /* Tap-Targets: mindestens 44px Höhe */
  [data-theme="maringer"] .footer__link,
  [data-theme="maringer"] .footer__group-links a,
  [data-theme="maringer"] .footer__bottom a,
  [data-theme="maringer"] .footer__grid a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Nav phone button + logo: mindestens 44px */
  [data-theme="maringer"] .nav .btn--sm {
    min-height: 44px;
    padding-inline: 1rem;
  }

  [data-theme="maringer"] .nav__logo {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Kontakt-Section Links + Nav-Links im Burger */
  [data-theme="maringer"] #kontakt a,
  [data-theme="maringer"] .nav__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ══════════════════════════════════════════════════════
   16. Reduced Motion (WCAG 2.3.3)
   ══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-progress { display: none; }
}
