/* ===========================================================================
   Politur — liegt ÜBER dem Original-CSS und überschreibt nur.
   Kein Markup-Umbau, keine neuen Inhalte, Marke bleibt unverändert.
   Grundlage: gemessene Mängel (Kontrastwerte, Breakpoints, Abstände).
   =========================================================================== */

:root {
  --mm-font: 'Golos Text', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mm-gold: #d0ab75;
  --mm-gold-deep: #8a6624;   /* dunkler Goldton für Text auf Weiß */
  --mm-dark: #1b191a;
  --mm-light: #f2f2f2;
  --mm-sec: clamp(72px, 9vw, 118px);
  --mm-r-btn: 6px;
  --mm-r-card: 12px;
  --mm-ease: cubic-bezier(.2, .7, .2, 1);
}

/* --- 1. Vertikaler Rhythmus -------------------------------------------
   Original: 141/51/61/81/101/111px oben, 40/70/100/120 unten — keine Skala. */
.con-kit-section > .con-kit-frame,
.con-kit-section .con-kit-organism-section__frame {
  padding-top: var(--mm-sec) !important;
  padding-bottom: var(--mm-sec) !important;
}

/* --- 2. Lesbarkeit: Zeilenlänge ---------------------------------------
   Original bis 1032px breite Fließtextspalten (~115 Zeichen). */
.con-kit-quark-paragraph { max-width: 68ch; }
[data-kit-align-horizontal="center"] .con-kit-quark-paragraph { margin-inline: auto; }

/* --- 3. Kontrast ------------------------------------------------------
   Gemessen: Sekundärtext 3,13:1 auf Weiß (AA-Fail).                     */
.con-kit-quark-paragraph[style*="rgba(27, 25, 26, 0.48)"],
.con-kit-quark-paragraph[style*="rgba(27,25,26,0.48)"] {
  color: rgba(27, 25, 26, .74) !important;
}
.con-kit-quark-paragraph[style*="rgba(255, 255, 255, 0.51)"],
.con-kit-quark-paragraph[style*="rgba(255,255,255,0.51)"] {
  color: rgba(255, 255, 255, .82) !important;
}

/* --- 4. Buttons -------------------------------------------------------
   Gemessen: Weiß auf Gold = 2,15:1 — der wichtigste Text der Seite war der
   am schlechtesten lesbare. Dunkle Schrift auf Gold ergibt ~8,4:1.
   Zusätzlich raus: der permanente 3px-Geisterring des Baukastens.        */
.con-kit-component-button {
  border-radius: var(--mm-r-btn) !important;
  transition: transform .18s var(--mm-ease), box-shadow .18s var(--mm-ease),
              background-color .18s var(--mm-ease), color .18s var(--mm-ease) !important;
}
.con-kit-component-button:hover { transform: translateY(-1px); }
.con-kit-component-button:active { transform: translateY(0); }

/* Primär (goldene Fläche) */
.con-kit-component-button[style*="rgb(208, 171, 117)"],
.con-kit-component-button[style*="#D0AB75"],
.con-kit-component-button[style*="#d0ab75"] {
  color: var(--mm-dark) !important;
  box-shadow: 0 1px 2px rgba(27, 25, 26, .10), 0 6px 18px -8px rgba(208, 171, 117, .55) !important;
}
.con-kit-component-button[style*="rgb(208, 171, 117)"] *,
.con-kit-component-button[style*="#D0AB75"] *,
.con-kit-component-button[style*="#d0ab75"] * { color: inherit !important; fill: currentColor !important; }
.con-kit-component-button[style*="rgb(208, 171, 117)"]:hover {
  background-color: #c39c62 !important;
  box-shadow: 0 2px 4px rgba(27, 25, 26, .12), 0 12px 26px -10px rgba(208, 171, 117, .7) !important;
}

/* --- 5. Sichtbare Fokus-Zustände (Tastaturbedienung) ------------------ */
:where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--mm-gold) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

/* --- 6. Karten: gleiche Höhe, weiche Elevation, echtes Hover ---------- */
.con-kit-component-grid-list { align-items: stretch !important; }
.con-kit-component-grid-list-item { display: flex !important; }
.con-kit-molecule-grid-item {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  border-radius: var(--mm-r-card);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(27, 25, 26, .05), 0 10px 28px -14px rgba(27, 25, 26, .22);
  transition: transform .28s var(--mm-ease), box-shadow .28s var(--mm-ease);
}
.con-kit-molecule-grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 6px rgba(27, 25, 26, .07), 0 22px 44px -18px rgba(27, 25, 26, .3);
}
.con-kit-molecule-grid-item img { transition: transform .6s var(--mm-ease); }
.con-kit-molecule-grid-item:hover img { transform: scale(1.035); }

/* --- 7. Mobiler Breakpoint fürs Leistungs-Grid ------------------------
   Original bleibt bei 390px dreispaltig -> 93px breite Karten.           */
@media (max-width: 900px) {
  .con-kit-component-grid-list--columns-3,
  .con-kit-component-grid-list--columns-4 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px !important;
  }
  .con-kit-component-grid-list--columns-3 > *,
  .con-kit-component-grid-list--columns-4 > * { width: 100% !important; max-width: none !important; }
}
@media (max-width: 620px) {
  .con-kit-component-grid-list--columns-3,
  .con-kit-component-grid-list--columns-4 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }
}

/* --- 8. Mobile Navigation --------------------------------------------
   Der Baukasten liefert geräteabhängiges SSR; im gespiegelten
   Desktop-Snapshot fehlt das Burger-Markup vollständig. repair.js ergänzt
   den Button, hier kommt das Verhalten dazu.                             */
.mm-burger { display: none; }

@media (max-width: 1000px) {
  /* Der Header-Layer des Baukastens ist ein Flex-Container mit fixer
     Innenbreite; ein einfaches margin-left:auto schiebt den Burger aus dem
     Viewport. Deshalb absolut im Header verankern. */
  .con-kit-layer-header-v2 { position: relative !important; }
  .mm-burger {
    display: flex;
    position: absolute;
    right: max(14px, env(safe-area-inset-right));
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 60;
  }
  html.mm-nav-open .mm-burger span { background: #fff; }
  /* Original-Menü aus dem Fluss nehmen; es lebt im Overlay weiter */
  .con-kit-atom-menu-v2 { position: fixed !important; }
  /* CTA-Button im Header auf Mobil ausblenden — er kollidiert mit dem Burger
     und steht im Hero ohnehin prominent */
  .con-kit-layer-header-v2 .con-kit-component-button { display: none !important; }
  .mm-burger span {
    display: block; height: 2px; width: 100%;
    background: #fff; border-radius: 2px;
    transition: transform .3s var(--mm-ease), opacity .2s ease;
  }
  html.mm-nav-open .mm-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  html.mm-nav-open .mm-burger span:nth-child(2) { opacity: 0; }
  html.mm-nav-open .mm-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .mm-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 88px 24px 32px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    background: rgba(27, 25, 26, .98);
    backdrop-filter: blur(12px);
    transform: translateY(-102%);
    transition: transform .38s var(--mm-ease);
    z-index: 50;
    max-height: 100svh;
    overflow-y: auto;
  }
  html.mm-nav-open .mm-nav { transform: translateY(0); }
  /* Der eigentliche Flex-Container ist die innere <ul>, nicht die <nav>. */
  .mm-nav > *,
  .mm-nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  .mm-nav li { width: 100% !important; }
  .mm-nav button,
  .mm-nav a {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 15px 2px !important;
    font-size: 1.08rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
  html.mm-nav-open { overflow: hidden; }
}

/* --- 9. Bilder auf eine gemeinsame Gradation ziehen -------------------- */
.con-kit-molecule-grid-item img,
.con-kit-component-image img { filter: saturate(.92) contrast(1.03); }

/* --- 10. Dezente Scroll-Reveals --------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html.mm-reveal .con-kit-section { opacity: 0; transform: translateY(16px); }
  html.mm-reveal .con-kit-section.is-in {
    opacity: 1; transform: none;
    transition: opacity .7s var(--mm-ease), transform .7s var(--mm-ease);
  }
}

/* ===========================================================================
   Modal (von repair.js erzeugt) — Kontaktformular
   =========================================================================== */

.mm-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; }
.mm-modal[hidden] { display: none; }
.mm-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(12, 11, 12, .62);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.mm-modal.is-open .mm-modal__backdrop { opacity: 1; }

.mm-modal__panel {
  position: relative;
  width: min(38rem, calc(100vw - 2rem));
  max-height: calc(100svh - 2.5rem);
  overflow-y: auto;
  background: #fff;
  color: var(--mm-dark);
  border-radius: 16px;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  box-shadow: 0 32px 80px -20px rgba(12, 11, 12, .5);
  transform: translateY(14px) scale(.985);
  opacity: 0;
  transition: transform .3s var(--mm-ease), opacity .3s ease;
}
.mm-modal.is-open .mm-modal__panel { transform: none; opacity: 1; }

.mm-modal__x {
  position: absolute; top: .7rem; right: .8rem;
  width: 40px; height: 40px;
  font-size: 1.6rem; line-height: 1;
  background: transparent; border: 0; cursor: pointer;
  color: #6b6b6b; border-radius: 8px;
}
.mm-modal__x:hover { background: #f2f2f2; color: var(--mm-dark); }

.mm-modal__kicker {
  margin: 0 0 .4rem; font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--mm-gold-deep);
}
.mm-modal__title { margin: 0 0 .5rem; font-size: clamp(1.35rem, 3.4vw, 1.8rem); line-height: 1.25; }
.mm-modal__lead { margin: 0 0 1.5rem; color: #5a5a5a; font-size: .95rem; line-height: 1.6; }

.mm-form__row { display: grid; gap: 1rem; }
@media (min-width: 34rem) { .mm-form__row { grid-template-columns: 1fr 1fr; } }
.mm-field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.mm-field > span { font-size: .82rem; font-weight: 600; color: #3a3a3a; }
.mm-field b { color: var(--mm-gold-deep); margin-left: .15rem; }
.mm-field input, .mm-field textarea {
  font: inherit; font-size: .95rem;
  padding: .72rem .85rem; min-height: 46px;
  border: 1px solid #d8d8d8; border-radius: 8px;
  background: #fcfcfc; color: var(--mm-dark);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.mm-field textarea { min-height: 108px; resize: vertical; }
.mm-field input:focus, .mm-field textarea:focus {
  outline: none; background: #fff;
  border-color: var(--mm-gold);
  box-shadow: 0 0 0 3px rgba(208, 171, 117, .25);
}

.mm-form__note { margin: .2rem 0 1.2rem; font-size: .78rem; color: #7a7a7a; line-height: 1.5; }
.mm-form__actions { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; }
.mm-btn {
  font: inherit; font-size: .92rem; font-weight: 600;
  padding: .8rem 1.5rem; min-height: 46px;
  border-radius: var(--mm-r-btn); cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.mm-btn:active { transform: translateY(1px); }
.mm-btn--ghost { background: transparent; color: #5a5a5a; border: 1px solid #d8d8d8; }
.mm-btn--ghost:hover { background: #f4f4f4; color: var(--mm-dark); }
.mm-btn--solid { background: var(--mm-gold); color: var(--mm-dark); border: 1px solid var(--mm-gold); }
.mm-btn--solid:hover { background: #c39c62; border-color: #c39c62; }

.mm-form__done { margin: 1rem 0 0; font-size: .9rem; padding: .8rem 1rem; border-radius: 8px; }
.mm-form__done.is-ok { background: #f1f6ef; color: #2f5d33; border: 1px solid #cfe3cd; }
.mm-form__done.is-err { background: #fdf2f2; color: #8a2b2b; border: 1px solid #f0d5d5; }

@media (prefers-reduced-motion: reduce) {
  .mm-modal__panel, .mm-modal__backdrop, .mm-nav,
  .con-kit-component-button, .con-kit-molecule-grid-item { transition: none !important; }
}

/* Eigene Komponenten auf die Seitenschrift ziehen — der Baukasten setzt die
   Familie nur auf einzelnen Elementen, ein `font: inherit` landet sonst bei Times. */
.mm-modal, .mm-modal *, .mm-burger, .mm-nav, #ck-banner, #ck-banner * {
  font-family: var(--mm-font) !important;
}

/* Echte Überschriften nachgerüstet (der Baukasten lieferte nur divs).
   Browser-Defaults neutralisieren, damit die Optik unverändert bleibt. */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
