/* Prodifystudio · Seitenhülle: Kopf, Mega-Menü, mobiles Menü, Brotkrumen, Footer.
   Wird von ALLEN Seiten geladen, auch von den Bestandsseiten (Branchen, Orte, Ratgeber, Rechtliches).
   Farben/Schrift sind bewusst nur innerhalb der Hülle definiert, damit alte Stylesheets
   (die teils dieselben Variablennamen nutzen) nicht beeinflusst werden. */

.hd, .mnav, .ft, .crumbs, .toast, .btn {
  --petrol: #24616b;
  --petrol-dark: #1c4f57;
  --mint: #46b384;
  --cyan: #32b7be;
  --green-text: #2c8a62;   /* Mint-Ton für Überschriften auf Weiß (große Schrift, AA) */
  --green-btn: #2a805b;    /* Button-Grün mit weißer Schrift (AA) */
  --green-btn-hover: #226b4c;
  --gray-bg: #f5f7f7;
  --line: #dfe5e6;
  --text: #3d4749;
  --muted: #6c7779;
  --white: #ffffff;

  --font: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --container: 1170px;
  --gutter: 20px;
  --hd-h: 96px;
  --ease: cubic-bezier(.25, .7, .3, 1);
}
@media (max-width: 991px) { .hd, .mnav { --hd-h: 76px; } }

/* Grundwerte innerhalb der Hülle (unabhängig vom Seiten-Stylesheet).
   :where() hält die Spezifität bei null, damit diese Grundwerte nie gezielte Regeln überstimmen. */
:where(.hd, .mnav, .ft, .crumbs) { font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
:where(.hd, .mnav, .ft, .crumbs) :where(*, *::before, *::after) { box-sizing: border-box; }
:where(.hd, .mnav, .ft) :where(p) { margin: 0; }
:where(.hd, .ft) :where(ul) { margin: 0; padding: 0; list-style: none; }
:where(.hd, .ft) :where(img) { display: block; max-width: 100%; }
:where(.hd, .mnav, .ft) :where(button) { font: inherit; }
:where(.hd, .mnav, .ft, .crumbs) :focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .6rem 1.4rem;
  background: var(--green-btn); color: var(--white); font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent; border-radius: 2px; cursor: pointer; transition: background-color .2s var(--ease);
}
.btn:hover { background: var(--green-btn-hover); }
.btn--sm { min-height: 42px; padding: .5rem 1.1rem; font-size: .95rem; }
.btn--light { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .8); }
.btn--light:hover { background: var(--white); color: var(--petrol); }

/* ---------- Kopf ---------- */
.hd { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); transition: box-shadow .25s var(--ease); }
.hd.is-scrolled { box-shadow: 0 2px 14px rgba(28, 79, 87, .1); }
.hd__bar { display: flex; align-items: center; gap: 1.5rem; height: var(--hd-h); }
.logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--petrol-dark); text-decoration: none; margin-right: auto; }
.logo__mark { width: 44px; height: 44px; }
.logo__txt { display: flex; flex-direction: column; line-height: 1; }
.logo__name { font-weight: 900; font-size: 1.5rem; letter-spacing: -.02em; color: #14232a; }
.logo__sub { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 500; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: .18rem; }
.nav { align-self: stretch; display: flex; }
.nav__list { display: flex; align-items: stretch; }
.nav__item { display: flex; }
.nav__link {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0 1rem; position: relative;
  font-size: 1.06rem; font-weight: 500; color: var(--petrol); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.nav__link::after { content: ""; position: absolute; left: 1rem; right: 1rem; top: 0; height: 3px; background: var(--mint); transform: scaleX(0); transition: transform .25s var(--ease); }
.nav__link:hover::after, .nav__item.is-open > .nav__link::after { transform: scaleX(1); }
.chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .25s var(--ease); }
.nav__item.is-open .chev { transform: rotate(180deg); }
.hd__cta { margin-left: .5rem; }

/* Mega-Menü: volle Breite, hellgrau, Spalten mit Titel + Satz + Unterpunkten (wie cytrus) */
.dd {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--gray-bg); border-top: 1px solid var(--line); box-shadow: 0 16px 30px -18px rgba(28, 79, 87, .35);
  opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.nav__item.is-open > .dd { opacity: 1; visibility: visible; transition-delay: 0s; }
.dd__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem 2.5rem; padding-block: 2rem 2.4rem; }
.dd__col { display: grid; gap: .3rem; align-content: start; }
.dd__title { font-weight: 700; font-size: 1.02rem; color: var(--petrol); text-decoration: none; }
.dd__title:hover { color: var(--green-text); }
.dd__col p { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.dd__sub { font-size: .92rem; color: var(--petrol); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(36, 97, 107, .35); }
.dd__sub:hover { text-decoration-color: var(--petrol); }

/* Burger + mobiles Menü */
.burger { display: none; width: 46px; height: 46px; border: 0; background: none; cursor: pointer; position: relative; color: var(--petrol); }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 22px; }
.burger span:nth-child(3) { top: 29px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mnav { position: fixed; left: 0; right: 0; bottom: 0; top: var(--hd-h); z-index: 49; background: var(--white); overflow-y: auto; opacity: 0; transition: opacity .25s var(--ease); }
.mnav.is-open { opacity: 1; }
.mnav__inner { display: grid; padding: .5rem var(--gutter) calc(2rem + env(safe-area-inset-bottom, 0px)); }
.mnav__group, .mnav__top { border-bottom: 1px solid var(--line); }
.mnav__group summary, .mnav__top { display: flex; justify-content: space-between; align-items: center; min-height: 56px; font-size: 1.15rem; font-weight: 600; color: var(--petrol); text-decoration: none; cursor: pointer; list-style: none; }
.mnav__group summary::-webkit-details-marker { display: none; }
.mnav__group summary::after { content: "›"; font-size: 1.4rem; transform: rotate(90deg); transition: transform .25s var(--ease); color: var(--muted); }
.mnav__group[open] summary::after { transform: rotate(-90deg); }
.mnav__group a { display: block; padding: .5rem 0 .5rem 1rem; color: var(--text); text-decoration: none; }
.mnav__group[open] { padding-bottom: .75rem; }
.mnav__cta { margin-top: 1.5rem; }
.mnav__meta { margin-top: 1.25rem; font-size: .95rem; line-height: 1.7; color: var(--text); }
.mnav__meta a { color: var(--petrol); }


/* Brotkrumen */
.crumbs { border-bottom: 1px solid var(--line); background: var(--white); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: .8rem 0; list-style: none; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: #a3adaf; }
.crumbs a { color: var(--petrol); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--text); }


/* Kopfzeile: aktiver Bereich */
.nav__item.is-current > .nav__link::after { transform: scaleX(1); }

/* ---------- Footer (wie cytrus, in Petrol) ---------- */
.ft { background: var(--petrol); color: var(--white); padding-top: 3.5rem; font-size: 1rem; }
.ft a { color: var(--white); }
.ft__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.ft__grid > div { display: grid; gap: 1.1rem; align-content: start; }
.ft__h { font-weight: 600; }
.ft__links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.ft__grid .btn { background: var(--mint); color: #0e3439; }
.ft__grid .btn:hover { background: #5cc596; }
.ft__divider { position: relative; margin-top: 2.5rem; display: flex; justify-content: center; }
.ft__divider::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; height: 1px; background: rgba(255, 255, 255, .35); }
.ft__top { position: relative; width: 44px; height: 30px; border: 0; background: var(--petrol); color: var(--white); cursor: pointer; padding: 0 7px; }
.ft__top svg { width: 30px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.ft__bottom { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .4rem 1.5rem; padding-block: 1rem calc(1.4rem + env(safe-area-inset-bottom, 0px)); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.ft__bottom a { text-decoration: none; }
.ft__bottom a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Hinweis für Seiten aus Phase 2 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: #1d2a2c; color: var(--white); padding: .7rem 1rem; font-size: .9rem; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); transition: opacity .25s var(--ease), transform .25s var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


/* Links im Footer und im mobilen Menü unterstreichen (Bestandsseiten setzen global text-decoration: none) */
.ft__grid a:not(.btn), .ft__links a, .mnav__meta a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

@media (max-width: 1100px) {
  .nav__link { padding: 0 .7rem; font-size: 1rem; }
  .nav__link::after { left: .7rem; right: .7rem; }
}
@media (max-width: 991px) {
  .nav, .hd__cta { display: none; }
  .burger { display: block; }
  .logo__mark { width: 38px; height: 38px; }
  .logo__name { font-size: 1.3rem; }
  .ft__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ft__grid { grid-template-columns: 1fr; }
  .ft__bottom { justify-content: flex-start; }
}

/* ---------- Lade-Animation der Hülle ----------
   site-shell.js setzt html.is-loaded, sobald die Schrift da ist. Ohne JS, bei „Bewegung reduzieren“
   oder im Prüfmodus (?static=1) ist alles sofort sichtbar. */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.static):not(.is-loaded) .hd .logo,
  html.js:not(.static):not(.is-loaded) .hd .nav__item,
  html.js:not(.static):not(.is-loaded) .hd .hd__cta,
  html.js:not(.static):not(.is-loaded) .hd .burger { opacity: 0; translate: 0 -12px; }
  html.js:not(.static):not(.is-loaded) .crumbs ol { opacity: 0; translate: 0 -6px; }
  /* Übergänge nur während des Auftritts (bis html.is-settled), danach gelten wieder die eigenen Hover-Übergänge */
  html.js.is-loaded:not(.is-settled) .hd .logo,
  html.js.is-loaded:not(.is-settled) .hd .nav__item,
  html.js.is-loaded:not(.is-settled) .hd .hd__cta,
  html.js.is-loaded:not(.is-settled) .hd .burger,
  html.js.is-loaded:not(.is-settled) .crumbs ol { transition: opacity .7s cubic-bezier(.2, .7, .2, 1), translate .8s cubic-bezier(.2, .7, .2, 1); }
  html.js.is-loaded:not(.is-settled) .hd .nav__item:nth-child(1) { transition-delay: .08s; }
  html.js.is-loaded:not(.is-settled) .hd .nav__item:nth-child(2) { transition-delay: .14s; }
  html.js.is-loaded:not(.is-settled) .hd .nav__item:nth-child(3) { transition-delay: .20s; }
  html.js.is-loaded:not(.is-settled) .hd .nav__item:nth-child(4) { transition-delay: .26s; }
  html.js.is-loaded:not(.is-settled) .hd .nav__item:nth-child(5) { transition-delay: .32s; }
  html.js.is-loaded:not(.is-settled) .hd .hd__cta { transition-delay: .40s; }
  html.js.is-loaded:not(.is-settled) .hd .burger { transition-delay: .15s; }
  html.js.is-loaded:not(.is-settled) .crumbs ol { transition-delay: .30s; }
}
