/* ==========================================================================
   InduTech HK — Basis- und Seitenstile
   Farb-Tokens kommen aus navbar.css (global geladen).
   ========================================================================== */

:root {
    --page-bg:      #0f181e;
    --page-bg-alt:  #131f27;
    --text:         #c3d0d7;
    --text-dim:     #8b9ea8;
    --heading:      #eef4f7;
    --hairline:     rgba(181, 196, 204, .12);
    --hairline-2:   rgba(181, 196, 204, 0.2);
    --wrap:         min(100% - 2.5rem, 1240px);
    --radius:       14px;
}

body {
    background: var(--page-bg);
    color: var(--text);
    font-size: clamp(1rem, .95rem + .2vw, 1.075rem);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.wrap {
    width: var(--wrap);
    margin-inline: auto;
}

h1, h2, h3 {
    color: var(--heading);
    line-height: 1.15;
    letter-spacing: -.015em;
    margin: 0 0 .75rem;
    font-weight: 600;
    text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--accent); }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Wiederverwendbare Bausteine
   -------------------------------------------------------------------------- */

.eyebrow {
    margin: 0 0 1.25rem;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
}

/* Buttons ---------------------------------------------------------------- */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 52px;
    padding: .8rem 1.7rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    transition: background-color .25s var(--ease),
                border-color .25s var(--ease),
                color .25s var(--ease),
                box-shadow .25s var(--ease),
                transform .25s var(--ease-out);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent);
    color: #0b191f;
    box-shadow: 0 8px 24px -12px rgba(79, 182, 201, .8);
}
.btn-primary:hover {
    background: #6ac9da;
    box-shadow: 0 14px 30px -12px rgba(79, 182, 201, .95);
}

.btn-ghost {
    border-color: var(--hairline-2);
    color: var(--heading);
}
.btn-ghost:hover {
    border-color: var(--accent);
    background: rgba(79, 182, 201, .09);
}

/* Pfeil-Link ------------------------------------------------------------- */

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 182, 201, .4);
    padding-bottom: 2px;
    transition: border-color .25s var(--ease), gap .25s var(--ease-out);
}

.link-arrow::after {
    content: "\2192";
    transition: transform .25s var(--ease-out);
}

.link-arrow:hover { border-color: var(--accent); gap: .75rem; }
.link-arrow:hover::after { transform: translateX(2px); }

/* --------------------------------------------------------------------------
   Seitenkopf — global in _layout.twig, auf jeder Seite identisch
   -------------------------------------------------------------------------- */

.page-head {
    position: relative;
    overflow: hidden;
    padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(3rem, 7vw, 5.5rem);
    border-bottom: 1px solid var(--hairline);
    background:
        radial-gradient(70ch 38ch at 12% -15%, rgba(79, 182, 201, .15), transparent 70%),
        linear-gradient(180deg, #16232b, var(--page-bg));
}

/* Angedeutete Maschinen-Rasterlinien, passend zu den Balken im Logo */
.page-head::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        var(--hairline) 0 1px,
        transparent 1px 96px
    );
    opacity: .5;
    mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
    pointer-events: none;
}

.page-head > .wrap { position: relative; }

.page-head h1 {
    max-width: 22ch;
    margin: 0 0 1.5rem;
    font-size: clamp(2.2rem, 6.2vw, 4.1rem);
    font-weight: 700;
    letter-spacing: -.03em;
}

/* Zahnrad-Motiv aus Craft (Navigation-Global, Feld "siteIcon"), dezent
   im Hintergrund.

   NOTLOESUNG fuer das aktuelle Asset: IndutechHKIcon.png hat keinen
   Alphakanal — der Grund ist deckendes Weiss (253) mit eingebackenem
   hellgrauen Karomuster (242), die Marke selbst liegt bei ~190.
   invert + grayscale dreht das um, brightness/contrast druecken Weiss
   und Karo auf 0, screen laesst nur die Marke stehen.
   -> Sobald das Icon transparent vorliegt (PNG mit Alpha oder SVG):
      filter/mix-blend-mode loeschen und opacity: .06 setzen. */
.hero-mark {
    position: absolute;
    top: 50%;
    right: -5rem;
    width: min(46vw, 560px);
    height: auto;
    transform: translateY(-50%);
    pointer-events: none;
    -webkit-user-select: none;   /* Safari braucht das Praefix bis 16.4 */
    user-select: none;
    filter: invert(1) grayscale(1) brightness(4) contrast(2);
    mix-blend-mode: screen;
    opacity: .07;
}

.lead {
    max-width: 54ch;
    margin: 0 0 2.25rem;
    font-size: clamp(1.05rem, 1rem + .45vw, 1.3rem);
}

/* Auf Unterseiten ist der Lead das letzte Element im Kopf */
.page-head .lead:last-child { margin-bottom: 0; }

.page-head .actions { margin-bottom: clamp(2.5rem, 6vw, 3.5rem); }
.page-head .actions:last-child { margin-bottom: 0; }

/* Öffnungszeiten-Hinweis im Kopf ---------------------------------------- */

.hero-note {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem 1.1rem;
    margin: 0 0 clamp(2rem, 5vw, 2.75rem);
    padding-left: 1.1rem;
    border-left: 3px solid var(--accent);
    font-size: 1.02rem;
}
.hero-note strong { color: var(--heading); }
.hero-note span { color: var(--text-dim); }
.hero-note:last-child { margin-bottom: 0; }

/* Belege aus dem Kleinanzeigen-Profil ----------------------------------- */

.trust {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trust li {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .85rem;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: rgba(181, 196, 204, .04);
    font-size: .84rem;
    color: var(--text-dim);
}

.trust strong { color: var(--heading); font-weight: 600; }
.trust li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
    padding: clamp(3.25rem, 8vw, 6rem) 0;
    border-bottom: 1px solid var(--hairline);
}

.section-alt { background: var(--page-bg-alt); }

.section h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.35rem);
    margin-bottom: 1rem;
}

/* Kleiner Akzentstrich über jeder Überschrift */
.section h2::before {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-bottom: 1.1rem;
    border-radius: 3px;
    background: var(--accent);
}

.section-lead {
    max-width: 62ch;
    margin: 0 0 2.5rem;
    color: var(--text-dim);
    font-size: 1.08rem;
}

/* Fliesstext aus dem Redactor — Impressum, Datenschutz und aehnliche
   reine Textseiten (_partials/text-page.twig). */
.prose { max-width: 68ch; }
.prose p + p { margin-top: 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

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

/* Kleiner als die Section-Ueberschriften: in einem langen Rechtstext
   gliedern die Zwischentitel nur, sie sollen nicht dominieren. */
.prose h2 {
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    margin: 2.75rem 0 .75rem;
}

/* Ohne den Akzentstrich von .section h2 — bei einem Dutzend
   Zwischentiteln wird der sonst zum Flimmern. */
.prose h2::before { content: none; }

.prose h3 {
    font-size: 1.08rem;
    margin: 1.9rem 0 .5rem;
}

.prose h4, .prose h5, .prose h6 {
    color: var(--heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 .4rem;
}

.prose ul, .prose ol {
    margin: 1.1rem 0;
    padding-left: 1.3rem;
}

.prose li + li { margin-top: .4rem; }
.prose li::marker { color: var(--text-dim); }

.prose a {
    text-decoration: none;
    border-bottom: 1px solid var(--hairline-2);
}

.prose a:hover { border-color: var(--accent); }

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

.prose .actions,
.prose + .actions { margin-top: 2.5rem; }

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

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 1.6rem 1.5rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(181, 196, 204, .055), transparent 60%);
    transition: border-color .3s var(--ease), transform .3s var(--ease-out);
}

/* Akzentkante, die beim Hover einläuft */
.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .35s var(--ease-out);
}

.card:hover {
    border-color: rgba(79, 182, 201, .35);
    transform: translateY(-3px);
}
.card:hover::before { transform: scaleY(1); }

.card-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--hairline);
    background: rgba(79, 182, 201, .08);
    color: var(--accent);
}
.card-icon svg { width: 22px; height: 22px; }

.card h3 { font-size: 1.12rem; margin-bottom: .5rem; }

.card p {
    margin: 0;
    font-size: .97rem;
    color: var(--text-dim);
}

.card ul {
    margin: .75rem 0 0;
    padding: 0;
    list-style: none;
    font-size: .93rem;
    color: var(--text-dim);
}
.card ul li {
    padding-left: 1rem;
    position: relative;
}
.card ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .68em;
    width: 5px;
    height: 1px;
    background: var(--steel-dim);
}

.cards + .section-cta { margin-top: 2.5rem; }
.section-cta { margin: 0; }

/* --------------------------------------------------------------------------
   Ablauf in drei Schritten
   -------------------------------------------------------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hairline-2);
}

.steps li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    margin-bottom: .6rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .14em;
    color: var(--accent);
}

.steps h3 { font-size: 1.06rem; margin-bottom: .4rem; }
.steps p { margin: 0; font-size: .97rem; color: var(--text-dim); }

/* --------------------------------------------------------------------------
   Info-Raster (Öffnungszeiten / Adresse / Telefon)
   -------------------------------------------------------------------------- */

.info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2.25rem;
}

.info-block {
    padding: 1.75rem 1.6rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: rgba(181, 196, 204, .04);
}

.info-block h3 {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.info-block .big {
    margin: 0 0 .9rem;
    font-size: 1.28rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--heading);
}

.info-block .big a {
    color: var(--heading);
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 182, 201, .35);
    transition: border-color .25s var(--ease), color .25s var(--ease);
}
.info-block .big a:hover { color: var(--accent); border-color: var(--accent); }

.info-block .muted {
    font-size: .93rem;
    color: var(--text-dim);
}
.info-block p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Bildergalerie — Element-Typ "Galerie" aus dem Matrix-Feld "Elemente"
   -------------------------------------------------------------------------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Bei einem einzelnen Bild wirkt ein schmales Raster verloren — dann
   lieber eine ruhige, breite Flaeche. Bei zweien zwei gleiche Haelften. */
.gallery-single { grid-template-columns: minmax(0, 900px); }
.gallery-duo    { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.gallery-item { margin: 0; }

.gallery-trigger {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: rgba(181, 196, 204, .04);
    cursor: zoom-in;
    transition: border-color .3s var(--ease), transform .3s var(--ease-out);
}

.gallery-trigger img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .5s var(--ease-out), filter .3s var(--ease);
}

.gallery-single .gallery-trigger img { aspect-ratio: 16 / 9; }

/* Sanfter Verlauf nach unten, damit die Kacheln zum dunklen Untergrund
   passen und nicht als helle Rechtecke herausstechen. */
.gallery-trigger::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(15, 24, 30, .55));
    opacity: .8;
    pointer-events: none;
    transition: opacity .3s var(--ease);
}

.gallery-trigger:hover {
    border-color: rgba(79, 182, 201, .4);
    transform: translateY(-3px);
}
.gallery-trigger:hover img { transform: scale(1.04); }
.gallery-trigger:hover::after { opacity: .35; }

.gallery-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Lightbox ---------------------------------------------------------------
   <dialog> ist nativ modal: Fokusfalle, Esc und Backdrop kommen vom
   Browser, das JS in web/js/gallery.js liefert nur Bildwechsel. */

.lightbox {
    width: min(100vw - 2rem, 1400px);
    max-width: none;
    max-height: calc(100vh - 2rem);   /* Fallback fuer Browser ohne dvh */
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    overflow: visible;
}

.lightbox::backdrop {
    background: rgba(8, 14, 18, .88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox-figure {
    display: grid;
    place-items: center;
    margin: 0;
}

.lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 2rem);   /* Fallback fuer Browser ohne dvh */
    max-height: calc(100dvh - 2rem);
    width: auto;
    height: auto;
    border-radius: var(--radius);
    background: var(--page-bg-alt);
}

.lightbox-caption {
    margin-top: .85rem;
    font-size: .92rem;
    color: var(--text-dim);
    text-align: center;
    text-wrap: pretty;
}
.lightbox-caption:empty { display: none; }

/* Bedienknoepfe: gleiche Sprache wie .btn-ghost, nur rund. */
.lightbox-btn {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;        /* Buttons erben die Schrift in keinem Browser */
    position: absolute;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--hairline-2);
    border-radius: 50%;
    background: rgba(15, 24, 30, .82);
    color: var(--heading);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .25s var(--ease), border-color .25s var(--ease);
}

.lightbox-btn:hover {
    border-color: var(--accent);
    background: rgba(79, 182, 201, .18);
}
.lightbox-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.lightbox-close { top: .65rem; right: .65rem; }
.lightbox-prev  { top: 50%; left: .65rem;  transform: translateY(-50%); }
.lightbox-next  { top: 50%; right: .65rem; transform: translateY(-50%); }

/* Bei nur einem Bild sind Vor/Zurueck sinnlos — JS setzt [hidden]. */
.lightbox-btn[hidden] { display: none; }

.lightbox-count {
    position: absolute;
    left: 50%;
    bottom: -2.1rem;
    transform: translateX(-50%);
    font-size: .8rem;
    letter-spacing: .12em;
    color: var(--text-dim);
}

@media (max-width: 600px) {
    .lightbox-count { display: none; }
    .lightbox-btn { width: 42px; height: 42px; }
}

/* --------------------------------------------------------------------------
   CTA-Band
   -------------------------------------------------------------------------- */

.cta {
    position: relative;
    overflow: hidden;
    padding: clamp(2.5rem, 6vw, 4rem) 0;
    border-bottom: 1px solid var(--hairline);
    background:
        radial-gradient(50ch 26ch at 85% 120%, rgba(79, 182, 201, .16), transparent 70%),
        var(--page-bg-alt);
}

.cta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
}

.cta h2 {
    margin: 0 0 .4rem;
    font-size: clamp(1.4rem, 3vw, 1.95rem);
}
.cta h2::before { content: none; }

.cta p {
    margin: 0;
    max-width: 52ch;
    color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Formular-Einbettung (JotForm)
   -------------------------------------------------------------------------- */

/* JotForm rendert innerhalb des iframes oben und unten einen festen Leerraum,
   unten zusaetzlich die "Jetzt eigenes Formular erstellen"-Leiste. An beides
   kommt CSS von aussen nicht heran, also wird der Rahmen stattdessen
   beschnitten. Die Werte sind zum Nachjustieren gedacht; sauberer ist es,
   die Abstaende zusaetzlich im JotForm-Designer unter
   Styles -> Inject Custom CSS auf 0 zu setzen. */
.form-embed {
    --form-crop-top:    0px;
    --form-crop-bottom: 60px;

    position: relative;
    overflow: hidden;
    line-height: 0;              /* sonst steht Inline-Whitespace unter dem iframe */
    border-radius: var(--radius);
}

.form-embed__frame {
    display: block;
    width: 100%;
    min-height: 620px;           /* bis JotForm die echte Hoehe meldet */
    border: 0;
    margin-top:    calc(var(--form-crop-top) * -1);
    margin-bottom: calc(var(--form-crop-bottom) * -1);
    transition: opacity .35s var(--ease);
}

/* Ladeanzeige, solange das iframe laedt. Die Klasse .is-loading setzt das
   Script neben der Einbettung — ohne JS bleibt hier alles unsichtbar. */
.form-embed__loader {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .9rem;
    background: var(--page-bg-alt);
    color: var(--text-dim);
    font-size: .95rem;
    line-height: 1.5;
}

.form-embed.is-loading .form-embed__loader { display: flex; }
.form-embed.is-loading .form-embed__frame  { opacity: 0; }

.form-embed__spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--hairline-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: form-embed-spin .8s linear infinite;
}

@keyframes form-embed-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .form-embed__spinner { animation: none; }
    .form-embed__frame   { transition: none; }
}

/* --------------------------------------------------------------------------
   Kleine Viewports
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    :root { --wrap: min(100% - 1.75rem, 1240px); }

    .btn { width: 100%; }
    .actions { gap: .7rem; }
    .card, .info-block { padding: 1.35rem 1.25rem; }
    .hero-mark { display: none; }
}

/* Sprungmarken unter dem Sticky-Header */
html {
    -webkit-text-size-adjust: 100%;   /* iOS vergroessert Text sonst im Querformat */
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h-sm) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .card, .link-arrow, .link-arrow::after { transition: none; }
    .gallery-trigger, .gallery-trigger img { transition: none; }
    .gallery-trigger:hover { transform: none; }
    .gallery-trigger:hover img { transform: none; }
}
