/* =========================================================================
   Schreiner Stoll — Design tokens & base
   Übernommen aus schreiner-stoll-next (Jost, Rostrot #af3a1b, Taupe #8c7459)
   ========================================================================= */
:root {
  --color-primary: #af3a1b;
  --color-primary-dark: #8a2e15;
  --color-primary-light: #d4654a;
  --color-accent: #8c7459;
  --color-text: #545454;
  --color-text-heading: #333333;
  --color-bg: #f6f5f4;
  --color-bg-section-alt: #eeebe7;
  --color-bg-white: #ffffff;
  --color-border: #e6e6e6;
  --color-border-dark: #c1c1c1;

  --color-footer-bg: #2a2a2a;
  --color-footer-text: #c8c8c8;
  --color-footer-heading: #d4654a;
  --color-footer-link: #e0e0e0;

  --font-sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max-width: 1152px;   /* max-w-6xl */
  --header-height: 4rem; /* h-16 */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

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

h1, h2, h3, h4 {
  color: var(--color-text-heading);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }
a { color: var(--color-primary); text-decoration: none; transition: color .2s, opacity .2s; }
a:hover { color: var(--color-primary-dark); }

.wrap { max-width: var(--max-width); margin-inline: auto; padding-inline: 1rem; }
.wrap-narrow { max-width: 820px; margin-inline: auto; padding-inline: 1.5rem; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 2px;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:hover { background: var(--color-primary-dark); color: #fff; }
.btn:active { transform: translateY(1px); }

/* =========================================================================
   Header / Navigation
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.site-header__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 2.5rem; width: auto; }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}
.main-nav > a:not(.nav-phone):hover,
.main-nav > a[aria-current="page"] { color: var(--color-primary); }

.nav-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-primary) !important;
  font-weight: 500;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95rem !important;
}
.nav-phone:hover { opacity: 0.8; }
.nav-phone svg { width: 1rem; height: 1rem; }

.nav-phone--mobile { display: none; padding: 0.5rem; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text-heading);
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.mobile-nav {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  background: #fff;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a {
  padding: 1rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav a[aria-current="page"] { color: var(--color-primary); }

/* =========================================================================
   Hero (Startseite)
   ========================================================================= */
/* Hero with cross-fading slider, centred logo + subline + button */
.hero {
  display: block;
  position: relative;
  min-height: 62vh;
  overflow: hidden;
  background: #333;
}
a.hero { cursor: pointer; }
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease;
  transform: scale(1.03);
}
.hero__slide.is-active { opacity: 1; }

/* Leistungen (service cards: 1 / 2 / 4 pro Reihe) */
.leistungen { padding: 5rem 0; background: var(--color-bg-white); }
.leistungen h2 { text-align: center; margin-bottom: 3rem; }
.leistungen__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px)  { .leistungen__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .leistungen__grid { grid-template-columns: repeat(4, 1fr); } }
.leistung { text-align: center; padding: 1.5rem; }
.leistung svg { width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; color: var(--color-primary); display: block; }
.leistung h3 { margin-bottom: 0.6rem; }
.leistung p { font-size: 0.95rem; color: var(--color-text); margin: 0; }

/* CTA section */
.cta-section {
  padding: 4.5rem 1.5rem;
  text-align: center;
  background: var(--color-bg-section-alt);
}
.cta-section h2 { margin-bottom: 0.8rem; }
.cta-section p { margin-bottom: 2rem; font-size: 1.1rem; }

/* Button-Variante: Outline */
.btn--outline { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: #fff; }

/* Home: Referenzen-Teaser */
.ref-teaser { padding: 5rem 0; text-align: center; }
.ref-teaser__intro { max-width: 620px; margin: 0 auto 2.5rem; }
.ref-teaser__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 2.5rem; }
.ref-teaser__item { display: block; overflow: hidden; aspect-ratio: 4/3; background: #e2e2e2; }
.ref-teaser__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ref-teaser__item:hover img { transform: scale(1.05); }
@media (max-width: 768px) { .ref-teaser__grid { grid-template-columns: repeat(2, 1fr); } }

/* Home: Warum-wir-Teaser */
.warum-teaser { background: var(--color-bg-white); }
.warum-teaser__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding-block: 4.5rem; }
.warum-teaser__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.warum-teaser__text h2 { margin-bottom: 1rem; }
.warum-teaser__text p { margin-bottom: 1.8rem; font-size: 1.05rem; }
@media (max-width: 768px) { .warum-teaser__inner { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 3rem; } }

/* Über uns: Team-Foto */
.team-photo { margin: 0 0 2.5rem; }
.team-photo img { width: 100%; border-radius: 4px; display: block; }

/* Team-Foto Vorher/Nachher-Slider (harter Wipe mit vertikaler Trennlinie) */
.team-compare {
  --pos: 100%;                /* Position der Trennlinie: 100% = nur Foto A */
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  touch-action: pan-y;        /* horizontales Ziehen bleibt dem Slider */
}
.team-compare__img { border-radius: 0; }
/* Foto B wird links an der Trennlinie hart abgeschnitten (rechts davon sichtbar) */
.team-compare__img--top {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 0 0 var(--pos));
  pointer-events: none;
}
/* Vertikale Trennlinie */
.team-compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.45);
  pointer-events: none;
}
/* Griff-Knopf auf der Trennlinie */
.team-compare__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--color-text-heading);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
/* Slider liegt transparent über dem ganzen Bild und ist der eigentliche Regler */
.team-compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: ew-resize;
}
.team-compare__range:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
/* Unsichtbarer, aber breiter Greifbereich; die sichtbare Linie zeichnen wir selbst */
.team-compare__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 300px;
  background: transparent;
  cursor: ew-resize;
}
.team-compare__range::-moz-range-thumb {
  width: 44px;
  height: 300px;
  background: transparent;
  border: none;
  cursor: ew-resize;
}
.team-compare__range::-moz-range-track { background: transparent; }

/* Über uns: Werkstatt */
.werkstatt-section { padding: 4rem 0; background: var(--color-bg-section-alt); }
.werkstatt-section h2 { text-align: center; margin-bottom: 2.5rem; }
.werkstatt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.werkstatt-text p:last-child { margin-bottom: 0; }
.werkstatt-images { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.werkstatt-images img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.werkstatt-images img:first-child { grid-column: span 2; }
@media (max-width: 768px) { .werkstatt-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Über uns: Generationen */
.generationen-section { padding: 3.5rem 0; }

/* =========================================================================
   Sections
   ========================================================================= */
.intro {
  max-width: 820px;
  margin-inline: auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
}
.intro h1 { margin-bottom: 1.5rem; }

.page-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 3rem 1.5rem;
  text-align: center;
}
.page-header h1 { margin: 0; }
.page-header__intro {
  max-width: 640px;
  margin: 1rem auto 0;
  color: var(--color-text);
}

.page-content {
  max-width: 820px;
  margin-inline: auto;
  padding: 3.5rem 1.5rem;
}

/* =========================================================================
   Galerie / Referenzen  (Grid + Filter-Pills)
   ========================================================================= */
/* Sticky, minimal filter bar with underline indicator (wie Next FilterPill) */
.filter-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  background: rgba(242, 242, 242, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.filter-nav a,
.filter-nav button {
  position: relative;
  padding: 0.55rem 1rem;
  background: none;
  border: none;
  color: var(--color-accent);
  font: inherit;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s;
}
.filter-nav a.active,
.filter-nav a:hover,
.filter-nav button.active,
.filter-nav button:hover { color: var(--color-text-heading); }
.filter-nav a::after,
.filter-nav button::after {
  content: "";
  position: absolute;
  bottom: 0.3rem;
  left: 50%;
  transform: translateX(-50%);
  height: 1.5px;
  width: 0;
  background: var(--color-text-heading);
  transition: width .3s ease;
}
.filter-nav a.active::after,
.filter-nav button.active::after { width: 60%; }

/* Edge-to-edge architectural grid with feature (2x2) tiles */
.galerie {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 280px;
  /* KEIN grid-auto-flow: dense — Lücken/Weißraum sollen bewusst entstehen. */
  gap: 4px;
  padding: 6px 2px 5rem;
}
@media (min-width: 640px)  { .galerie { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 300px; } }
@media (min-width: 1024px) { .galerie { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 320px; } }
@media (min-width: 1280px) { .galerie { grid-template-columns: repeat(4, 1fr); } }

.galerie-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #e2e2e2;
}
@media (min-width: 640px) {
  .galerie-item.large { grid-column: span 2; grid-row: span 2; }
  .galerie-item.wide  { grid-column: span 2; }
}
.galerie-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.galerie-item:hover img { transform: scale(1.03); }

/* Badge: Projekt mit mehreren Bildern */
.galerie-item__count {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  border-radius: 2px;
  backdrop-filter: blur(2px);
}
.galerie-item__count svg { display: block; }

.galerie-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity .4s ease;
}
.galerie-item:hover .galerie-item__overlay { opacity: 1; }
.galerie-item__overlay div {
  padding: 1rem;
  transform: translateY(8px);
  transition: transform .4s ease;
}
.galerie-item:hover .galerie-item__overlay div { transform: translateY(0); }
.galerie-item__album {
  display: block;
  color: #fff;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.25rem;
}
.galerie-item__cap {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================================
   Kontakt / Anfahrt
   ========================================================================= */
.kontakt-content,
.anfahrt-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 3.5rem 1.5rem;
}
address { font-style: normal; }

.person { margin: 1.2rem 0; }
.person strong { display: block; color: var(--color-text-heading); }
.person span { display: block; font-size: 0.9rem; opacity: 0.75; }

.kontakt-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-field label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border-dark);
  border-radius: 2px;
  font: inherit;
  background: #fff;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(175,58,27,0.12);
}
.form-datenschutz { font-size: 0.85rem; color: var(--color-text); margin: 0; }

/* Honeypot – visuell versteckt, aber für Bots im DOM */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Formular-Rückmeldungen */
.form-message { padding: 1rem 1.2rem; border-radius: 2px; margin-bottom: 1.5rem; font-size: 0.95rem; }
.form-message p { margin: 0.2rem 0; }
.form-message--success {
  background: #edf5ed;
  border: 1px solid #b7d9b7;
  color: #2f6b34;
}
.form-message--error {
  background: #fbecea;
  border: 1px solid #e7b8b0;
  color: #a3341f;
}

.anfahrt-karte img { width: 100%; border-radius: 2px; }

/* Über uns */
.ueber-intro { padding: 3.5rem 0 1rem; }
.ueber-intro h1 { margin-bottom: 1.2rem; }
.team-section { padding: 3rem 0; text-align: center; }
.team-section h2 { margin-bottom: 2.5rem; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  max-width: 820px;
  margin-inline: auto;
}
.team-member h3 { margin-bottom: 0.3rem; }
.team-member__role { color: var(--color-primary); font-size: 0.95rem; margin-bottom: 0.6rem; }
.team-member__desc { font-size: 0.95rem; margin: 0; }
.werte-section { padding: 2.5rem 0 3.5rem; }
.werte-section h2 { text-align: center; margin-bottom: 2.5rem; }
.werte-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) { .werte-grid { grid-template-columns: repeat(3, 1fr); } }
.wert-card { text-align: center; padding: 1rem; }
.wert-card svg { width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; color: var(--color-primary); display: block; }
.wert-card h3 { margin-bottom: 0.6rem; font-size: 1.15rem; }
.wert-card p { font-size: 0.95rem; color: var(--color-text); margin: 0; }

/* Anfahrt (überarbeitet: Info-Spalte + Karte in voller Breite) */
.anfahrt-info-section { padding: 3rem 0 2rem; }
.anfahrt-block { margin-bottom: 2rem; }
.anfahrt-block h2 { font-size: 1.4rem; margin-bottom: 0.8rem; }
.erreichbar-zeiten { font-weight: 500; color: var(--color-text-heading); margin: 0 0 0.6rem; }
.anfahrt-weg { margin-bottom: 1rem; }
.anfahrt-map-wrap { padding-bottom: 4rem; }
.anfahrt-map {
  width: 100%;
  min-height: 380px;
  height: 100%;
  border-radius: 4px;
  background: #f0eded;
  z-index: 0;
}
.anfahrt-map .leaflet-container { font-family: var(--font-sans); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: auto;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
}
.site-footer__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer-col h3 {
  color: var(--color-footer-heading);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.footer-col p { margin: 0 0 0.4rem; font-size: 0.9rem; }
.footer-col strong { color: var(--color-footer-link); font-weight: 500; }
.footer-contact { margin-top: 0.9rem; }
.site-footer a { color: var(--color-footer-link); }
.site-footer a:hover { opacity: 0.8; color: var(--color-footer-link); }
.footer-nav { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.8rem;
  padding: 1.3rem 1rem;
  opacity: 0.8;
}
.site-footer__bottom p { margin: 0; }

/* =========================================================================
   Lightbox
   ========================================================================= */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}
.lightbox figure { margin: 0; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 75vh; width: auto; height: auto; object-fit: contain; }
.lightbox figcaption {
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
  padding: 1rem 1rem 0;
  max-width: 60ch;
}
.lightbox figcaption .lb-album {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.lightbox figcaption .lb-counter {
  display: block;
  margin-top: 0.35rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.lightbox__btn {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
  padding: 0;
}
.lightbox__btn:hover { color: #fff; }
.lightbox__close { top: 1.25rem; right: 1.25rem; width: 2.5rem; height: 2.5rem; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; }
.lightbox__prev { left: 0.75rem; }
.lightbox__next { right: 0.75rem; }
.lightbox__btn[hidden] { display: none; }
@media (min-width: 768px) {
  .lightbox__close { top: 1.5rem; right: 1.5rem; }
  .lightbox__prev { left: 1.5rem; }
  .lightbox__next { right: 1.5rem; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .nav-phone--mobile { display: inline-flex; color: var(--color-primary); }

  .kontakt-content,
  .anfahrt-content { grid-template-columns: 1fr; gap: 2rem; }

  .site-footer__inner { grid-template-columns: 1fr; gap: 2.5rem; }
}
