/* GREMATEC — was theme.json nicht ausdrücken kann.
   Tokens kommen als CSS-Variablen aus theme.json, hier wird nur komponiert. */

:root {
  --gt-teal-900: var(--wp--preset--color--teal-900);
  --gt-teal-700: var(--wp--preset--color--teal-700);
  --gt-green-500: var(--wp--preset--color--green-500);
  --gt-green-700: var(--wp--preset--color--green-700);
  --gt-border: var(--wp--preset--color--border);
  --gt-muted: var(--wp--preset--color--muted);
  --gt-radius-card: 8px;
  --gt-radius-control: 6px;
  --gt-radius-tile: 12px;
}

/* ---------- Grundlagen ---------- */

/* front-page/page/page-breit setzen <main> bewusst auf padding:0 (contentSize:100%),
   damit einzelne Sections wie der Hero edge-to-edge Hintergründe zeigen können.
   Core behandelt "main" dadurch aber als bereits gepolsterten Vorfahren und
   nullt das Root-Padding (theme.json settings.layout padding) bei JEDEM
   verschachtelten .has-global-padding weg, auch bei den Sections selbst,
   die den Root-Abstand links/rechts eigentlich brauchen. Hier direkt wieder
   herstellen, per Spezifität statt !important. */
.wp-block-post-content.has-global-padding > .has-global-padding {
  padding-left: var(--wp--style--root--padding-left);
  padding-right: var(--wp--style--root--padding-right);
}

body { text-wrap: pretty; }
p { max-width: 68ch; }
.gt-full p, .wp-block-cover p { max-width: none; }

:where(a:focus-visible),
:where(button:focus-visible),
:where(input:focus-visible),
:where(select:focus-visible),
:where(textarea:focus-visible) {
  outline: 3px solid var(--gt-green-500);
  outline-offset: 2px;
}
/* Auf dunklen Flächen ist Grün auf Deep Teal zu schwach — dort weiß. */
.has-teal-700-background-color :where(a:focus-visible, button:focus-visible),
.has-teal-900-background-color :where(a:focus-visible, button:focus-visible) {
  outline-color: #fff;
}

.gt-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--gt-teal-700); color: #fff; padding: 14px 20px;
  border-radius: 0 0 var(--gt-radius-control) 0; text-decoration: none;
}
.gt-skip-link:focus { left: 0; }

/* ---------- Eyebrow / Akzenttrenner ---------- */

.gt-eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gt-muted); margin: 0 0 16px;
}
.has-teal-700-background-color .gt-eyebrow,
.has-teal-900-background-color .gt-eyebrow { color: var(--wp--preset--color--teal-300); }

.gt-rule { width: 40px; height: 3px; background: var(--gt-green-500); margin: 0 0 18px; }

/* ---------- Karten ---------- */

.gt-card {
  background: #fff; border: 1px solid var(--gt-border);
  border-radius: var(--gt-radius-card); padding: 36px;
  transition: box-shadow 200ms ease-out;
}
.gt-card:hover { box-shadow: var(--wp--preset--shadow--hover); }
.gt-card--accent { border: 1.5px solid var(--gt-green-500); position: relative; }

.gt-badge {
  position: absolute; top: 0; right: 36px; transform: translateY(-50%);
  background: var(--gt-green-700); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 4px;
}

/* Icon-Kachel: weißes Linien-Icon auf Deep Teal, Radius 12. */
.gt-tile {
  width: 56px; height: 56px; border-radius: var(--gt-radius-tile);
  background: var(--gt-teal-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; flex: none;
}
.gt-tile svg { width: 26px; height: 26px; }

/* ---------- Platzhalter für offene Fakten ---------- */

.gt-placeholder {
  display: inline-block; max-width: 100%; overflow-wrap: break-word;
  color: var(--gt-green-700);
  background: var(--wp--preset--color--green-100);
  border: 1px dashed #A9C795; border-radius: 4px;
  padding: 7px 11px; font-weight: 500;
}

/* ---------- Kennzahlen ---------- */

.gt-facts { border-block: 1px solid var(--gt-border); display: grid; gap: 0; }
@media (min-width: 782px) { .gt-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 781px) { .gt-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gt-fact { padding: 36px 32px; border-left: 1px solid var(--gt-border); }
.gt-fact:first-child { border-left: 0; padding-left: 0; }
.gt-fact__value {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--kennzahl);
  font-weight: 700; line-height: 1; color: var(--gt-teal-700); margin: 0 0 12px;
}
.gt-fact__label { font-size: 15px; line-height: 1.5; color: var(--gt-muted); margin: 0; }

/* ---------- Ablaufschritte ---------- */

.gt-steps { position: relative; display: grid; gap: 24px; }
@media (min-width: 782px) {
  .gt-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gt-steps::before {
    content: ""; position: absolute; left: 28px; right: 28px; top: 27px;
    height: 1px; background: var(--gt-border);
  }
}
.gt-step { position: relative; }
.gt-step__num {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gt-teal-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; margin-bottom: 24px;
}
.gt-step:last-child .gt-step__num { background: var(--gt-green-700); }

/* ---------- Tabellen ---------- */

.gt-table { border: 1px solid var(--gt-border); border-radius: var(--gt-radius-card); overflow: hidden; }
.gt-table table { border-collapse: collapse; width: 100%; border: 0; }
.gt-table th {
  background: var(--gt-teal-700); color: #fff; text-align: left;
  font-weight: 500; padding: 17px 24px; border: 0;
}
.gt-table td { padding: 17px 24px; border: 0; }
.gt-table tbody tr:nth-child(even) { background: var(--wp--preset--color--teal-100); }
@media (max-width: 781px) {
  .gt-table { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .gt-table table { width: max-content; min-width: 100%; }
}

/* ---------- Formular ---------- */

.gt-form__grid { display: grid; gap: 24px; }
@media (min-width: 600px) { .gt-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.gt-field { display: block; margin: 24px 0 0; max-width: none; }
.gt-field label { display: block; font-size: 14px; font-weight: 500; color: var(--gt-teal-700); margin-bottom: 9px; }
.gt-field input[type="text"],
.gt-field input[type="email"],
.gt-field input[type="tel"],
.gt-field select,
.gt-field textarea {
  box-sizing: border-box;
  width: 100%; border: 1px solid var(--gt-border); border-radius: var(--gt-radius-control);
  padding: 0 16px; font: inherit; color: var(--wp--preset--color--ink);
  background: #fff; min-height: 48px;
}
.gt-field textarea { padding: 15px 16px; min-height: 150px; line-height: 1.6; }
.gt-field input[aria-invalid="true"],
.gt-field textarea[aria-invalid="true"] { border: 1.5px solid var(--wp--preset--color--error); }

.gt-field input[type="file"] {
  box-sizing: border-box;
  width: 100%; border: 1.5px dashed var(--gt-border); border-radius: var(--gt-radius-control);
  background: var(--wp--preset--color--surface); padding: 20px 16px; font: inherit;
}

.gt-field--check { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; }
.gt-field--check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--gt-teal-700); }
.gt-field--check label { font-size: 15px; font-weight: 400; color: var(--gt-muted); line-height: 1.55; margin: 0; }
.gt-field--check .gt-error { grid-column: 2; }

.gt-hint { display: block; font-size: 14px; color: var(--gt-muted); margin-top: 9px; }
.gt-error { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--wp--preset--color--error); margin-top: 9px; }
.gt-form__actions { margin-top: 32px; }

/* Honeypot: für Menschen und Screenreader unsichtbar, für Bots ausfüllbar. */
.gt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.gt-alert {
  display: flex; gap: 16px; align-items: flex-start;
  border-radius: var(--gt-radius-control); padding: 22px; margin-bottom: 24px;
}
.gt-alert p { margin: 6px 0 0; }
.gt-alert svg { flex: none; margin-top: 2px; }
.gt-alert--success { background: var(--wp--preset--color--green-100); border: 1px solid var(--gt-green-500); color: var(--gt-green-700); }
.gt-alert--success strong { color: var(--gt-teal-700); }
.gt-alert--success p { color: var(--gt-muted); }
.gt-alert--error { background: #fff; border: 1.5px solid var(--wp--preset--color--error); color: var(--wp--preset--color--error); }

/* ---------- Bildplatzhalter (bis die echten Fotos da sind) ---------- */

.gt-imgph {
  background: var(--wp--preset--color--teal-100);
  border: 1px dashed #A9C0C3; border-radius: var(--gt-radius-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 32px; color: #4E6A6E;
  aspect-ratio: 4 / 3;
}
.gt-imgph strong {
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gt-teal-700);
}
.gt-imgph span { font-size: 14px; color: var(--gt-muted); max-width: 26em; }

/* ---------- Kopfbereich ---------- */

.gt-header { border-bottom: 1px solid var(--gt-border); background: #fff; }
.gt-header .wp-block-navigation { font-weight: 500; }
.gt-header .wp-block-navigation a { text-decoration: none; color: var(--gt-muted); }
.gt-header .wp-block-navigation .current-menu-item > a {
  color: var(--gt-teal-700); box-shadow: inset 0 -3px 0 var(--gt-green-500);
  padding-bottom: 6px;
}
/* Dropdown ist Deep Teal (overlayBackgroundColor). Die Textfarbe des aktiven
   Punkts oben ist ebenfalls Deep Teal und würde darin verschwinden - hier
   auf Weiß zurückgesetzt. */
.gt-header .wp-block-navigation__submenu-container .current-menu-item > a {
  color: #fff; box-shadow: inset 0 -3px 0 var(--gt-green-500);
}
/* .wp-block-navigation__responsive-container steckt strukturell IMMER um die
   Navigation, auch am Desktop (dort mit neutralisiertem Hintergrund) - erst
   ab 781px wird daraus wirklich das Deep-Teal-Overlay-Menü. Die Weiß-Regel
   nur dafür gilt ausschließlich mobil, sonst wird "Startseite" auf dem
   weißen Header unlesbar. */
@media (max-width: 781px) {
  .gt-header .wp-block-navigation__responsive-container .current-menu-item > a {
    color: #fff; box-shadow: inset 0 -3px 0 var(--gt-green-500);
  }
}

/* ---------- Fußbereich ---------- */

.gt-footer { border-top: 3px solid var(--gt-green-500); }
.gt-footer a { color: var(--wp--preset--color--mist-200); text-decoration: none; }
.gt-footer a:hover { color: #fff; text-decoration: underline; }
.gt-footer .wp-block-navigation { display: block; }
.gt-footer .wp-block-navigation li { display: block; }
.gt-footer .wp-block-navigation a { display: block; padding: 11px 0; }
/* Footer zeigt dieselbe Navigation wie der Header, aber flach statt als
   Dropdown: Toggle-Pfeil aus, Untermenü immer offen statt per Klick/Hover. */
.gt-footer .wp-block-navigation-submenu__toggle { display: none; }
.gt-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container {
  position: static; opacity: 1; visibility: visible; height: auto; width: auto;
  overflow: visible; padding-left: 16px;
  background: transparent; border: 0; color: inherit;
}
.gt-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container a {
  color: var(--wp--preset--color--mist-200);
}
.gt-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container a:hover { color: #fff; }
.gt-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__label::before {
  content: "› ";
}

/* ---------- Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Belegpunkt-Liste mit grünem Haken ---------- */

.gt-checklist { list-style: none; padding: 0; margin: var(--wp--preset--spacing--50) 0 0; }
.gt-checklist li {
  position: relative; padding-left: 36px; margin-bottom: 18px; line-height: 1.5;
}
.gt-checklist li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2369A53B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
}

/* ---------- Ablaufschritte: Typo ---------- */

.gt-step h3 {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--h5);
  font-weight: 600; line-height: 1.3; color: var(--gt-teal-700); margin: 0 0 10px;
}
.gt-step p { color: var(--gt-muted); margin: 0; padding-right: 24px; }

/* ---------- Mobil ---------- */

@media (max-width: 781px) {
  .gt-card { padding: 28px; }
  .gt-fact { padding: 26px 20px; }
  .gt-fact:nth-child(odd) { border-left: 0; padding-left: 0; }
  .gt-header .wp-block-navigation__responsive-container-open,
  .gt-header .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; }
}

/* ---------- Tags in den Vergleichskarten ---------- */

.gt-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 7px 11px; border-radius: 4px; margin: 18px 0 14px;
}
.gt-tag--warn { color: var(--wp--preset--color--error); background: #fff; border: 1px solid var(--wp--preset--color--error); }
.gt-tag--ok { color: #fff; background: var(--gt-green-700); }

/* Bildplatzhalter randlos oben in einer Karte */
.gt-card > .gt-imgph:first-child {
  border: 0; border-radius: var(--gt-radius-card) var(--gt-radius-card) 0 0;
  margin: -36px -36px 0; width: auto;
}
@media (max-width: 781px) { .gt-card > .gt-imgph:first-child { margin: -28px -28px 0; width: auto; } }

/* ---------- Spezifikationstabelle ---------- */

.gt-table--spec table { background: #fff; }
.gt-table--spec th {
  background: transparent; color: var(--gt-teal-700);
  font-weight: 500; width: 34%; border-bottom: 1px solid var(--gt-border);
}
.gt-table--spec td { border-bottom: 1px solid var(--gt-border); }
.gt-table--spec tbody tr:last-child th,
.gt-table--spec tbody tr:last-child td { border-bottom: 0; }
.gt-table--spec tbody tr:nth-child(even) { background: var(--wp--preset--color--surface); }

/* ---------- Inhaltsverzeichnis Rechtstexte ---------- */

.gt-toc { position: sticky; top: 24px; align-self: start; }
.gt-toc__list { list-style: none; padding: 0; margin: 0; }
.gt-toc__list li { border-left: 2px solid var(--gt-border); padding: 10px 0 10px 18px; margin: 0; }
.gt-toc__list a { color: var(--gt-muted); text-decoration: none; }
.gt-toc__list a:hover { color: var(--gt-teal-700); }
@media (max-width: 781px) { .gt-toc { position: static; } }

/* ---------- Cookie-Einwilligung ---------- */

.gt-consent[hidden] { display: none; }
.gt-consent {
  position: fixed; inset: auto 0 0 0; z-index: 10000;
  display: flex; justify-content: center;
  padding: 16px;
  pointer-events: none;
}
.gt-consent__backdrop { display: none; }
.gt-consent__panel {
  pointer-events: auto;
  position: relative;
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; color: var(--wp--preset--color--ink);
  border-top: 4px solid var(--gt-green-500);
  border-radius: var(--gt-radius-card);
  box-shadow: 0 18px 48px rgba(11, 48, 54, 0.28);
  padding: 28px 28px 20px;
  font-size: 15px; line-height: 1.55;
}
.gt-consent__title {
  font-size: 20px; line-height: 1.3; margin: 0 0 12px;
  color: var(--gt-teal-900);
}
.gt-consent__text p { margin: 0 0 10px; max-width: none; }
.gt-consent__actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 18px 0 14px;
}
/* Beide Buttons bewusst gleich gestaltet: Ablehnen darf nicht schwerer
   erreichbar oder unauffälliger sein als Akzeptieren. */
.gt-consent__btn.wp-element-button { width: 100%; justify-content: center; text-align: center; }
.gt-consent__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 13px; }
.gt-consent__links a { color: var(--gt-muted); }
.gt-consent__links a:hover { color: var(--gt-teal-700); }

/* Gesperrt, bis entschieden ist: Seite ausgegraut, nicht bedienbar, nicht scrollbar. */
.gt-consent--modal { inset: 0; align-items: center; }
.gt-consent--modal .gt-consent__backdrop {
  display: block; position: absolute; inset: 0;
  background: rgba(11, 48, 54, 0.55);
  -webkit-backdrop-filter: grayscale(1) blur(3px);
  backdrop-filter: grayscale(1) blur(3px);
  pointer-events: auto;
}
body.gt-consent-locked { overflow: hidden; }

@media (max-width: 560px) {
  .gt-consent { padding: 10px; }
  .gt-consent__panel { padding: 22px 18px 16px; }
  .gt-consent__actions { grid-template-columns: 1fr; }
}

/* Platzhalter für blockierte externe Inhalte (iframes, Embeds). */
.gt-extern-blocked {
  border: 1px dashed var(--gt-teal-700); border-radius: var(--gt-radius-card);
  background: var(--wp--preset--color--surface);
  padding: 24px; text-align: center;
}
.gt-extern-blocked p { margin: 0 auto 12px; }

/* Tabellen in Rechtstexten */
.gt-legal-table table { font-size: 15px; }
.gt-legal-table th { text-align: left; }
