/* LST Krause: Tokens, Basis, Rahmen. Ein Akzent (Marken-Gruen), ein Radius, kein Framework. */

/* Geist (SIL OFL 1.1, Lizenz in ../fonts/OFL.txt), selbst gehostet */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-bg: #f6f7f6;
  --c-surface: #fcfdfc;
  --c-ink: #141816;
  --c-muted: #4d5650;
  --c-line: #d9dedb;
  --c-accent: #207d17;
  --c-accent-ink: #f6f7f6;

  --f-base: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --fs-0: 1rem;
  --fs-1: 1.125rem;
  --fs-2: 1.5rem;
  --fs-3: 2rem;
  --fs-4: clamp(2.25rem, 4.5vw, 3.5rem);

  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: 1rem;
  --s-4: 1.5rem;
  --s-5: 3rem;
  --s-6: clamp(4rem, 8vw, 7rem);

  --radius: 2px;
  --header-h: 4rem;
  --container: 80rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0f1210;
    --c-surface: #171b18;
    --c-ink: #e9ede9;
    --c-muted: #a3ada5;
    --c-line: #2a302b;
    --c-accent: #58b84a;
    --c-accent-ink: #0f1210;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font: 400 var(--fs-0)/1.6 var(--f-base);
  -webkit-font-smoothing: antialiased;
}

img, picture, video { display: block; max-width: 100%; height: auto; }

a { color: var(--c-accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 var(--s-3); text-wrap: balance; }
h1 { font-size: var(--fs-4); font-weight: 650; }
h2 { font-size: var(--fs-3); font-weight: 650; }
h3 { font-size: var(--fs-2); font-weight: 600; }
p, ul, ol { margin: 0 0 var(--s-3); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.skip-link {
  position: absolute; left: var(--s-3); top: -4rem; z-index: 100;
  background: var(--c-accent); color: var(--c-accent-ink);
  padding: var(--s-2) var(--s-3); border-radius: var(--radius); text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--header-h); }
.brand { display: inline-flex; line-height: 0; border-radius: var(--radius); }
.brand img { border-radius: var(--radius); }

.menu { display: flex; flex-wrap: wrap; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.menu a {
  display: block; padding: var(--s-2) var(--s-3);
  color: var(--c-ink); text-decoration: none; font-weight: 500; border-radius: var(--radius);
  box-shadow: inset 0 -2px 0 transparent;
  transition: color .15s, box-shadow .15s;
}
.menu a:hover { color: var(--c-accent); }
.menu a[aria-current="page"], .menu .is-active > a { box-shadow: inset 0 -2px 0 var(--c-accent); }

.nav-toggle {
  display: none;
  font: inherit; font-weight: 500; color: var(--c-ink);
  background: transparent; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: var(--s-2) var(--s-3); cursor: pointer;
}
.nav-toggle:active { transform: translateY(1px); }

@media (max-width: 63.99rem) {
  .site-header__bar { flex-wrap: wrap; }
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; flex-basis: 100%; padding-bottom: var(--s-3); }
  .js .site-nav.is-open { display: block; }
  .js .menu { flex-direction: column; }
  .site-nav { flex-basis: 100%; padding-bottom: var(--s-3); }
}

/* Inhalt */
.site-main { min-height: 50vh; }

.prose { padding-block: var(--s-5) var(--s-6); }
.prose > * { max-width: 65ch; }
.prose h1 { margin-bottom: var(--s-4); }
.prose h2 { font-size: var(--fs-2); margin-top: var(--s-5); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: var(--s-1); }
.prose-narrow > * { max-width: 65ch; }
.prose-narrow ul { padding-left: 1.25rem; }

.section { padding-block: var(--s-6); }
.section--tight { padding-top: 0; }
.section h2 { margin-bottom: var(--s-4); }

/* Startseite: Hero */
.hero { padding-block: var(--s-5) var(--s-6); }
.hero__grid { display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 48rem) { .hero__grid { grid-template-columns: 5fr 6fr; } }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
.hero__lead p { font-size: var(--fs-1); color: var(--c-muted); max-width: 40ch; margin: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-4) 0 0; }
.hero__media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }

/* Kunden-Logos: feste helle Kachel, damit weisse JPG-Logos auch im Dunkelmodus sauber stehen */
.logo-strip { padding-bottom: var(--s-5); }
.logos { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
@media (min-width: 48rem) { .logos { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 75rem) { .logos { grid-template-columns: repeat(8, 1fr); } }
.logos li { display: grid; place-items: center; height: 5rem; padding: var(--s-2); background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); }
.logos img { width: auto; height: auto; max-width: 100%; max-height: 3.5rem; object-fit: contain; filter: grayscale(1); opacity: .85; transition: filter .2s, opacity .2s; }
.logos li:hover img { filter: none; opacity: 1; }

/* Leistungen: Bento mit 7 Zellen (3 Fotos, 4 Texte) */
.bento { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.cell { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-4); }
.cell p { margin: 0; font-size: var(--fs-1); }
.cell--photo { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.cell--photo picture { display: block; position: relative; flex: 1; min-height: 14rem; }
.cell--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cell--photo:hover img { transform: scale(1.03); }
.cell--photo p { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--c-line); }
@media (min-width: 48rem) {
  .bento:not(.bento--plain) { grid-template-columns: repeat(12, 1fr); }
  .b1 { grid-column: span 6; grid-row: span 2; }
  .b2, .b3 { grid-column: span 3; }
  .b4 { grid-column: span 6; }
  .b5, .b6, .b7 { grid-column: span 4; }
  .b1 picture { min-height: 22rem; }
}

/* Verfahren: Foto ueber die volle Breite, Text darunter */
.process__img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.process picture { display: block; }
.process__text { padding-block: var(--s-5) var(--s-6); max-width: 65ch; }

/* Werkstoffe */
.groups { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) { .groups { grid-template-columns: 1fr 1fr; } }
.group h3 { font-size: var(--fs-1); font-weight: 600; color: var(--c-muted); margin-bottom: var(--s-2); }
.group ul { list-style: none; margin: 0; padding: 0; font-size: var(--fs-2); }
.group li { padding: var(--s-1) 0; }

/* Einsatzbereiche: horizontale Kacheln mit Snap */
.tiles { display: flex; gap: var(--s-3); list-style: none; margin: 0; padding: 0 0 var(--s-3); overflow-x: auto; scroll-snap-type: x proximity; }
.tile { flex: 0 0 min(16rem, 75vw); scroll-snap-align: start; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.tile img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.tile__label { padding: var(--s-3); font-weight: 600; }
.tile--text { justify-content: flex-end; min-height: 12rem; border-top: 4px solid var(--c-accent); }
.tile--text .tile__label { font-size: var(--fs-2); line-height: 1.2; }

/* Referenzen */
.refs { padding-block: var(--s-5) var(--s-6); }
.refs__head { margin-bottom: var(--s-5); }
.refs__head p { font-size: var(--fs-1); color: var(--c-muted); }
.refs__block { margin-bottom: var(--s-6); }
.refs__block h2 { margin-bottom: var(--s-4); }
@media (min-width: 75rem) { .logos--all { grid-template-columns: repeat(6, 1fr); } }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 75rem) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery a { display: block; line-height: 0; overflow: hidden; border-radius: var(--radius); }
.gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }

.refs__figure { margin: 0; max-width: 40rem; }
.refs__video { width: 100%; height: auto; aspect-ratio: 4 / 3; background: #101010; border-radius: var(--radius); }
.refs__figure figcaption { margin-top: var(--s-2); color: var(--c-muted); }

.lightbox { width: 100%; max-width: min(60rem, 94vw); padding: var(--s-3); border: 0; border-radius: var(--radius); background: var(--c-surface); color: var(--c-ink); }
.lightbox::backdrop { background: rgb(15 18 16 / .88); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; background: var(--c-bg); }
.lightbox figcaption { margin-top: var(--s-2); color: var(--c-muted); }
.lightbox__bar { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between; margin-top: var(--s-3); }

/* Formulare (Layout joomla/form/renderfield) */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.field { margin-bottom: var(--s-4); }
.field__label label { display: block; font-weight: 600; margin-bottom: var(--s-1); }
.field .star { color: var(--c-accent); margin-left: .15em; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; min-height: 3rem; padding: .75rem; font: inherit; color: var(--c-ink);
  background: var(--c-surface); border: 1px solid var(--c-muted); border-radius: var(--radius);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 1px; }
.field input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin-right: var(--s-2); accent-color: var(--c-accent); vertical-align: middle; }
.field .invalid, .field [aria-invalid="true"] { border-color: #b3261e; }
@media (prefers-color-scheme: dark) { .field .invalid, .field [aria-invalid="true"] { border-color: #ff9087; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field__help { display: block; margin-top: var(--s-1); color: var(--c-muted); }

/* Kontakt */
.contact { padding-block: var(--s-5) var(--s-6); }
.contact__head { margin-bottom: var(--s-5); }
.contact__head p { font-size: var(--fs-1); color: var(--c-muted); }
.contact__grid { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) { .contact__grid { grid-template-columns: 3fr 2fr; gap: var(--s-6); } }
.contact__privacy { color: var(--c-muted); }
.contact__aside h2 { font-size: var(--fs-2); }
.contact__aside address { font-style: normal; margin-bottom: var(--s-3); }
.contact__photo { width: 100%; height: auto; margin-top: var(--s-4); border-radius: var(--radius); }

/* CTA-Band (alle Seiten ausser Kontakt) */
.cta { background: var(--c-accent); color: var(--c-accent-ink); padding-block: var(--s-6); }
.cta__grid { display: grid; gap: var(--s-4); align-items: center; }
@media (min-width: 48rem) { .cta__grid { grid-template-columns: 1fr auto; } }
.cta h2 { margin-bottom: var(--s-2); }
.cta p { margin: 0; font-size: var(--fs-1); }
.cta .btn { background: var(--c-accent-ink); color: var(--c-accent); border-color: var(--c-accent-ink); }
.cta .btn:hover { background: transparent; color: var(--c-accent-ink); }
.cta :focus-visible { outline-color: var(--c-accent-ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: .75rem 1.25rem; min-height: 3rem; white-space: nowrap;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid var(--c-accent); border-radius: var(--radius);
  background: var(--c-accent); color: var(--c-accent-ink);
  transition: transform .15s, background-color .15s, color .15s;
}
.btn:hover { background: transparent; color: var(--c-accent); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--c-accent); }
.btn--ghost:hover { background: var(--c-accent); color: var(--c-accent-ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Footer */
.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-line); padding-block: var(--s-5); }
.footer-grid { display: grid; gap: var(--s-4); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }
.footer-title { font-weight: 650; margin-bottom: var(--s-2); }
.site-footer address { font-style: normal; }
.site-footer p { color: var(--c-muted); }
.site-footer a { color: var(--c-ink); }
.site-footer a:hover { color: var(--c-accent); }
.footer-nav .menu { flex-direction: column; gap: 0; }
.footer-nav .menu a { padding: var(--s-1) 0; font-weight: 400; box-shadow: none; }
.footer-copy { margin-top: var(--s-3); }

/* Fehlerseite (404, 403) */
.error__box { text-align: left; padding-block: var(--s-6); }
.error__code { font: 650 var(--fs-4)/1 var(--f-mono); color: var(--c-accent); margin-bottom: var(--s-3); }

/* Bewegung und Kontrast */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-contrast: more) {
  :root { --c-line: currentColor; --c-muted: var(--c-ink); }
}
