/*
 * Glaswerk Forchheim – globale Styles (aus dem Design übernommen).
 * Die Akzentfarbe wird als CSS-Variable gesetzt und im Markup über
 * var(--accent) verwendet. Ändern = hier die drei Werte anpassen.
 */
:root {
    --accent: #1857cc;
    --accent-dark: #103f96;
    --accent-tint: #eaf1fd;
}

* { box-sizing: border-box; }

/*
 * Standard-Inhaltselemente (FSC-Frames wie Text, Text+Medien, Plugins) auf
 * Container-Breite zentrieren. Die ContentBlocks (Hero/Bewertungen/Kontakt-CTA)
 * sind eigene <section>-Elemente und regeln ihre Breite selbst -> hier NICHT
 * betroffen (Full-Bleed bleibt Full-Bleed).
 */
main > .frame {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(40px, 6vw, 72px) clamp(16px, 4vw, 32px);
}
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Public Sans', system-ui, sans-serif;
    color: #0e1116;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* Alle Überschriften in der Display-Schrift (auch Standard-Textelemente/FSC).
   ContentBlocks setzen ihre Headlines per Inline-Style – die bleiben unberührt. */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Bricolage Grotesque', 'Public Sans', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0e1116;
    text-wrap: balance;
}

/* ---------------------------------------------------------------------------
   Typo-Skala fuer redaktionelle Ueberschriften (RTE, Standard-Inhaltselemente,
   Leistungstexte).

   Warum das noetig ist: bisher war fuer h1-h6 KEINE font-size gesetzt, es galten
   also die Browser-Defaults – und die sind hier zwei Mal irrefuehrend:
   1. Ein <h1> innerhalb von <section>/<article> wird vom Browser automatisch auf
      h2-Groesse (1.5em) heruntergesetzt. Genau deshalb waren h1 und h2 optisch
      gleich gross.
   2. Die Default-Groessen sind em-basiert, haengen also an der Schriftgroesse des
      Containers (z. B. 20px im Leistungs-Intro) und rutschen dort mit hoch.
   Feste clamp()-Werte setzen beides ausser Kraft: die Stufen sind absolut,
   skalieren mit der Viewport-Breite und behalten ihren Abstand zueinander.

   ContentBlocks (Hero, Kontakt-CTA, Kontakt-Direkt) und die Leistungs-Templates
   setzen ihre Headline-Groessen per Inline-Style – Inline gewinnt, die bleiben
   also unveraendert.
--------------------------------------------------------------------------- */
h1 { font-size: clamp(34px, 5vw,   52px); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; line-height: 1.12; }
h3 { font-size: clamp(21px, 2.4vw, 26px); line-height: 1.25; }
h4 { font-size: clamp(18px, 1.9vw, 20px); line-height: 1.35; letter-spacing: -0.01em; }
h5 { font-size: 17px; line-height: 1.4; letter-spacing: 0; }
h6 {
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5a6472;
}

/* Vertikaler Rhythmus: Abstand nach oben groesser als nach unten, damit eine
   Ueberschrift sichtbar zum folgenden Absatz gehoert. em = relativ zur eigenen
   Groesse, die Abstaende skalieren also mit der Stufe mit. */
h1, h2, h3, h4, h5, h6 { margin: 1.5em 0 0.5em; }
h1 { margin-top: 0; }
h1:first-child, h2:first-child, h3:first-child,
h4:first-child, h5:first-child, h6:first-child { margin-top: 0; }
p { text-wrap: pretty; }

/* ---------------------------------------------------------------------------
   Redaktioneller Fliesstext (RTE-Ausgabe, z. B. Leistungsbeschreibungen).
   Der erste Absatz laeuft als Lead groesser, alles danach in Lesegroesse –
   sonst stehen mehrseitige Beschreibungen komplett auf Intro-Groesse.
--------------------------------------------------------------------------- */
.gw-richtext {
    font-size: 17px;
    line-height: 1.65;
    color: #4a5261;
    max-width: 660px;
}
.gw-richtext > p:first-child {
    font-size: clamp(17px, 2.2vw, 20px);
    line-height: 1.6;
    color: #3a4251;
}
/* Abstaende zentral ueber das "Owl"-Pattern: jedes Element ausser dem ersten
   bekommt Luft nach oben, niemand nach unten -> kein Margin-Collapsing-Raten. */
.gw-richtext > * { margin-top: 0; margin-bottom: 0; }
.gw-richtext > * + * { margin-top: 1em; }
/* Zwischenueberschriften brauchen mehr Luft nach oben als ein Absatz, damit sie
   sichtbar zum FOLGENDEN Text gehoeren und nicht zum vorhergehenden. */
.gw-richtext > h2 + *, .gw-richtext > h3 + *, .gw-richtext > h4 + * { margin-top: 0.5em; }
.gw-richtext > * + h2 { margin-top: 1.35em; }
.gw-richtext > * + h3, .gw-richtext > * + h4 { margin-top: 1.6em; }
.gw-richtext h2, .gw-richtext h3, .gw-richtext h4 { color: #0e1116; }
.gw-richtext ul, .gw-richtext ol { padding-left: 1.25em; }
.gw-richtext li + li { margin-top: 0.4em; }
.gw-richtext a { text-decoration: underline; text-underline-offset: 2px; }
a { color: var(--accent, #1857cc); text-decoration: none; }
a:hover { color: var(--accent-dark, #103f96); }
::selection { background: var(--accent, #1857cc); color: #fff; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(72,187,120,0.5); } 70% { box-shadow: 0 0 0 7px rgba(72,187,120,0); } 100% { box-shadow: 0 0 0 0 rgba(72,187,120,0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Leistungs-Kacheln */
.gw-svc { transition: box-shadow .22s ease, border-color .22s ease, background .22s ease; }
.gw-svc:hover { border-color: var(--accent, #1857cc); background: var(--accent-tint, #eaf1fd); box-shadow: 0 16px 38px rgba(24,86,199,0.16); }
.gw-svc:hover .gw-svc-title { color: var(--accent, #1857cc) !important; }
.gw-svc:hover .gw-svc-overlay { opacity: 1 !important; }
.gw-svc:hover .gw-svc-arrow { opacity: 1 !important; transform: translateY(0) !important; }
.gw-svc-img { transition: transform .5s ease; height: 100%; }
.gw-svc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gw-svc:hover .gw-svc-img { transform: scale(1.07) !important; }

/* Responsives Verhalten der Navigation */
.gw-burger { display: none; }
@media (max-width: 720px) {
    .gw-desktop-nav { display: none !important; }
    .gw-burger { display: inline-flex !important; }
    .gw-header-phone .gw-phone-label { display: none; }
}

/* Mobile Navigation (per JS umgeschaltet) */
.gw-mobile-nav.is-open {
    display: block !important; animation: slideDown 0.18s ease both;
    overflow-y: auto; overscroll-behavior: contain;
}
/* Offenes Menü: Seite abdunkeln und nicht scrollen lassen. Das Overlay liegt
   unter dem Header (z-index 50), der bleibt also sichtbar und bedienbar.
   Nur <html> sperren: overflow auf <body> macht body zum Scroll-Container,
   dann klebt der Sticky-Header nicht mehr am Fenster. */
html.gw-nav-locked { overflow: hidden; }
.gw-nav-overlay {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(14,17,22,0.45); animation: fadeIn 0.18s ease both;
}
.gw-nav-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Hauptmenü: Hover/Fokus (Basisstyles stehen inline, daher !important) */
.gw-navlink:hover, .gw-flyout__toggle[aria-expanded="true"] { color: var(--accent, #1857cc) !important; }
.gw-navlink:focus-visible, .gw-flyout__item:focus-visible, .gw-flyout__all:focus-visible,
.gw-acc__toggle:focus-visible, .gw-acc__item:focus-visible { outline: 2px solid var(--accent, #1857cc); outline-offset: 2px; border-radius: 6px; }
.gw-chevron { transition: transform .18s ease; }
[aria-expanded="true"] > .gw-chevron, [aria-expanded="true"] .gw-acc__icon .gw-chevron { transform: rotate(180deg); }

/* Flyout "Leistungen" (Desktop). Zentriert unter dem Menüpunkt; ragt es aus
   dem Fenster, schiebt glaswerk.js es per --gw-shift zurück. */
.gw-flyout__panel {
    position: absolute; top: calc(100% + 22px); left: 50%; z-index: 60;
    translate: calc(-50% - var(--gw-shift, 0px)) 0;
    width: min(580px, calc(100vw - 32px));
    background: #fff; border: 1px solid #e4e9f1; border-radius: 12px;
    box-shadow: 0 22px 48px rgba(24,86,199,0.14), 0 2px 6px rgba(14,17,22,0.05);
    font-family: 'Public Sans', sans-serif; text-align: left;
}
.gw-flyout__panel:not([hidden]) { animation: slideDown 0.18s ease both; }
/* Unsichtbare Brücke, damit der Hover beim Weg vom Button ins Panel hält */
.gw-flyout__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 24px; }
.gw-flyout__body { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.gw-flyout__list { list-style: none; margin: 0; padding: 10px; border-right: 1px solid #eef1f6; }
.gw-flyout__item {
    display: block; padding: 9px 12px; border-radius: 7px;
    font-size: 15px; font-weight: 500; line-height: 1.35; color: #0e1116; text-decoration: none;
}
.gw-flyout__item:hover, .gw-flyout__item.is-preview { background: var(--accent-tint, #eaf1fd); color: var(--accent-dark, #103f96); }
.gw-flyout__item[aria-current="page"] { font-weight: 600; color: var(--accent, #1857cc); }
.gw-flyout__previews { padding: 16px; }
.gw-flyout__preview img, .gw-flyout__noimg {
    display: block; width: 100%; height: auto; aspect-ratio: 52 / 30; object-fit: cover;
    border-radius: 8px; background: #e4e9f1;
}
.gw-flyout__teaser { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: #5a6472; }
.gw-flyout__all {
    display: flex; align-items: center; gap: 8px; padding: 14px 22px;
    border-top: 1px solid #eef1f6; font-size: 15px; font-weight: 600; color: var(--accent, #1857cc);
}
.gw-flyout__all:hover { background: var(--accent-tint, #eaf1fd); border-radius: 0 0 12px 12px; }

/* Akkordeon "Leistungen" (Mobil) */
.gw-acc__icon {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: 7px; background: var(--accent-tint, #eaf1fd); color: var(--accent, #1857cc);
}
.gw-acc__panel:not([hidden]) { display: flex; flex-direction: column; padding: 4px 0 8px; border-bottom: 1px solid #eef1f6; animation: slideDown 0.16s ease both; }
.gw-acc__item {
    padding: 11px 4px 11px 18px; font-size: 16px; font-weight: 500; color: #3a4251; text-decoration: none;
}
.gw-acc__item:hover { color: var(--accent, #1857cc); }
.gw-acc__item--all { font-weight: 600; color: var(--accent, #1857cc); }
.gw-acc__item[aria-current="page"], .gw-acc__item.is-current {
    background: var(--accent-tint, #eaf1fd); color: var(--accent-dark, #103f96); border-radius: 7px; font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .gw-mobile-nav.is-open, .gw-flyout__panel:not([hidden]), .gw-acc__panel:not([hidden]) { animation: none; }
    .gw-chevron { transition: none; }
}

/*
 * Hover-Zustände: überschreiben die Inline-Basisstyles der Buttons/Links
 * (Inline-Styles haben höhere Priorität, daher !important).
 */
.gw-btn-primary:hover { background: var(--accent-dark, #103f96) !important; color: #fff !important; }
.gw-link-accent:hover { color: var(--accent-dark, #103f96) !important; }
.gw-ghost-light:hover { background: rgba(255,255,255,0.22) !important; }
.gw-iconbtn:hover { border-color: var(--accent, #1857cc) !important; color: var(--accent, #1857cc) !important; }
.gw-footlink:hover { color: var(--accent, #1857cc) !important; }
.gw-contact-primary:hover { background: var(--accent-dark, #103f96) !important; }
.gw-contact-secondary:hover { border-color: var(--accent, #1857cc) !important; }
.gw-back:hover { color: var(--accent, #1857cc) !important; }

/* Kontakt-Karten ("Direkt bei uns melden") */
.gw-kd-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.gw-kd-phone:hover { background: var(--accent-dark, #103f96) !important; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(16,63,150,0.24); }
.gw-kd-mail:hover { border-color: var(--accent, #1857cc) !important; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(24,86,199,0.12); }
.gw-kd-mail:hover { color: #0e1116 !important; }

/* ---------------------------------------------------------------------------
   Lightbox (generisch, gesteuert ueber [data-gw-lightbox])
   Markup-Vertrag: <button data-gw-lightbox="<gruppe>" data-full="<bild-url>"
                           data-caption="<optional>">…thumbnail…</button>
   Logik: Resources/Public/JavaScript/glaswerk.js
--------------------------------------------------------------------------- */
.gw-lb-trigger {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    width: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}
.gw-lb-trigger:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(14,17,22,0.18); }
.gw-lb-trigger:focus-visible { outline: 3px solid var(--accent, #1857cc); outline-offset: 3px; }

.gw-lb {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 14, 0.92);
    /* Geschlossen: unsichtbar UND klickdurchlaessig – sonst liegt das Overlay
       weiterhin ueber der Seite und schluckt alle Klicks. */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.gw-lb.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.gw-lb__figure {
    margin: 0;
    max-width: min(1400px, 92vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.gw-lb__img {
    max-width: min(1400px, 92vw);
    max-height: 78vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: contain;
    background: #14181f;
}
.gw-lb__caption {
    color: #d3dae5;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 15px;
    text-align: center;
    margin: 0;
}
.gw-lb__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    transition: background .18s ease;
}
.gw-lb__btn:hover { background: rgba(255,255,255,0.26); }
.gw-lb__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.gw-lb__btn--close { top: 18px; right: 18px; }
.gw-lb__btn--prev { left: 18px; top: 50%; transform: translateY(-50%); }
.gw-lb__btn--next { right: 18px; top: 50%; transform: translateY(-50%); }
.gw-lb__counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #97a2b3;
    font-family: 'Public Sans', system-ui, sans-serif;
    font-size: 14px;
    letter-spacing: 0.02em;
}
@media (max-width: 640px) {
    .gw-lb__btn--prev { left: 8px; }
    .gw-lb__btn--next { right: 8px; }
    .gw-lb__btn--close { top: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .gw-lb, .gw-lb-trigger { transition: none; }
}
body.gw-lb-open { overflow: hidden; }
