/* ==========================================================================
   Andrema Sattlerhandwerk – Stylesheet
   Mobile first · ohne Framework · Breakpoints: 576 / 768 / 992 / 1200 px
   ========================================================================== */

/* ---------- Schriften (selbst gehostet; Satisfy: Apache-Lizenz 2.0, siehe fonts/satisfy-LICENSE.txt) ---------- */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/open-sans-v17-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Satisfy";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/satisfy-v22-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/open-sans-v17-latin-700.woff2") format("woff2");
}

/* ---------- Design-Tokens ---------- */
:root {
  --braun: #592d2c;
  --braun-hell: #7a4543;
  --text: #212121;
  --beige: #f0e9da;
  --grau: #636363;
  --hellgrau: #f2f2f2;
  --weiss: #fafafa;
  --dunkel: #2e180b;

  --font-text: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-akzent: "Satisfy", "Segoe Script", "Brush Script MT", cursive;

  --container: 1140px;
  --gutter: 1rem;
  --header-h: 125px;
  --fokus: var(--braun);

  color-scheme: light;
}
@media (min-width: 1200px) {
  :root { --header-h: 130px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--weiss);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.3;
  color: var(--braun);
}
h1, h2 {
  font-family: var(--font-akzent);
  font-weight: 400;
  letter-spacing: .01em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
@media (min-width: 768px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.6rem; }
  h3 { font-size: 1.4rem; }
}

p, ul, ol { margin: 0 0 1rem; }

a {
  color: var(--braun);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color .2s;
}
a:hover { color: var(--grau); }

address { font-style: normal; }

/* Sprungziele nicht unter Menü-Button bzw. festem Header verstecken */
[id] { scroll-margin-top: 5rem; }

:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }
main:focus { outline: none; }

::selection { background: var(--braun); color: var(--weiss); }

/* ---------- Hilfsklassen ---------- */
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--braun);
  color: var(--weiss);
  font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--weiss); outline-color: var(--text); }

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.icon-link svg { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: .75rem 1.5rem;
  border: 2px solid var(--braun);
  background: var(--braun);
  color: var(--weiss);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.button:hover,
.button:focus-visible { background: var(--weiss); color: var(--braun); }
.button--voll { width: 100%; }
.button[aria-disabled="true"] { opacity: .7; cursor: progress; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.link-button:hover { color: var(--grau); }

/* ---------- Header & Navigation ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  background: rgb(250 250 250 / .95);
}
@media (min-width: 992px) {
  .site-header { position: fixed; }
}
.site-header__inner {
  position: relative;
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.logo {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 250px;
  padding: 30px 30px 35px;
  background: var(--weiss);
  transform: translateX(-50%);
}
.logo::after {
  content: "";
  position: absolute;
  inset: auto 0 10px;
  border-bottom: 2px dashed var(--braun);
}
.logo img { width: 100%; }
@media (min-width: 576px) {
  .logo { width: 300px; padding: 35px; }
}

/* Mobile: Menü-Button + Vollbild-Navigation */
.nav-toggle {
  position: fixed;
  top: 1.25rem;
  right: .75rem;
  z-index: 60;
  display: grid;
  align-content: center;
  gap: 8px;
  width: 52px;
  height: 52px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: rgb(250 250 250 / .9);
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  height: 4px;
  background: var(--braun);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(12px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-12px) rotate(-45deg); }

.main-nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
  text-transform: uppercase;
}
.main-nav a {
  display: inline-block;
  padding: .5rem .25rem;
  border-bottom: 1px dashed transparent;
  color: var(--grau);
  text-decoration: none;
}
.main-nav a:hover,
.main-nav a[aria-current] { color: var(--braun); border-bottom-color: var(--braun); }

@media (max-width: 991.98px) {
  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: none;
    overflow-y: auto;
    padding: calc(var(--header-h) + 5rem) var(--gutter) 2rem;
    background: var(--weiss);
    border-bottom: 3px solid var(--braun);
  }
  .main-nav.is-open { display: block; }
  .main-nav__list { display: grid; gap: .5rem; text-align: center; font-size: 1.25rem; }
  html.nav-offen { overflow: hidden; }
}

@media (min-width: 992px) {
  .nav-toggle { display: none; }
  .main-nav__list {
    display: grid;
    grid-template-columns: 1fr 1fr 320px 1fr 1fr;
    align-items: center;
    height: var(--header-h);
    font-size: 1.1rem;
  }
  .main-nav__list li:nth-child(1) { justify-self: start; }
  .main-nav__list li:nth-child(2) { justify-self: center; }
  .main-nav__list li:nth-child(3) { grid-column: 4; justify-self: center; }
  .main-nav__list li:nth-child(4) { justify-self: end; }
  [id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
}
@media (min-width: 1200px) {
  .main-nav__list { font-size: 1.25rem; }
}

/* ---------- Hero ---------- */
.hero__img {
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  object-fit: cover;
}

/* ---------- Intro ---------- */
.intro {
  position: relative;
  margin-top: -160px;
  padding: 0;
}
.intro__text {
  padding: 2rem 1.25rem;
  background: var(--weiss);
}
@media (min-width: 576px) {
  .intro__text { padding: 3rem; }
}
.intro__signatur { margin-top: 2rem; }
.claim {
  margin: 0;
  padding: 3rem 1rem;
  background: var(--beige);
  color: var(--braun);
  font-family: var(--font-akzent);
  font-size: 2.75rem;
  line-height: 1.2;
  text-align: center;
}
@media (min-width: 768px) {
  .claim { font-size: 3.5rem; }
}

/* ---------- Leistungen (Bild/Text-Reihen) ---------- */
.leistungen { padding: 0; }
.leistung {
  position: relative;
  display: flex;
  min-height: 320px;
  overflow: hidden;
  background: var(--dunkel);
}
.leistung picture {
  position: absolute;
  inset: 0;
}
.leistung__bild {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.leistung__text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 2rem;
  background: rgb(46 24 11 / .78);
  color: var(--weiss);
}
.leistung__text h3 {
  margin-bottom: 1rem;
  color: var(--weiss);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.leistung__text p { margin: 0; }
@media (min-width: 768px) {
  .leistung { min-height: 380px; }
  .leistung--rechts { justify-content: flex-end; }
  .leistung__text { width: 50%; padding: 2.5rem; }
}

/* Dekorative Naht */
.naht {
  position: absolute;
  top: -140px;
  left: 0;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.naht path {
  fill: none;
  stroke: #fff;
  stroke-width: 1;
  stroke-dasharray: 8;
}
.js .naht { width: 0; transition: width 1.5s ease-out; }
.js .naht.is-sichtbar { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .js .naht { width: 100%; transition: none; }
}

/* Senkrechte Nähte links/rechts der Leistungsübersicht (nur auf breiten Bildschirmen) */
.naht-vertikal {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: none;
  width: 160px;
  height: 100%;
  pointer-events: none;
}
.naht-vertikal path {
  fill: none;
  stroke: #fff;
  stroke-width: 1;
  stroke-dasharray: 8;
  vector-effect: non-scaling-stroke;
}
.naht-vertikal--links { left: max(1rem, calc((100% - var(--container)) / 4 - 80px)); }
.naht-vertikal--rechts { right: max(1rem, calc((100% - var(--container)) / 4 - 80px)); transform: scaleX(-1); }
@media (min-width: 1400px) {
  .naht-vertikal { display: block; }
}
.js .naht-vertikal { clip-path: inset(0 0 100% 0); transition: clip-path 2s ease-out; }
.js .naht-vertikal.is-sichtbar { clip-path: inset(0); }
@media (prefers-reduced-motion: reduce) {
  .js .naht-vertikal { clip-path: none; transition: none; }
}

/* ---------- Galerie ---------- */
.galerie {
  padding: 3rem 0;
  background: var(--beige);
}
.galerie__intro {
  max-width: 820px;
  margin-bottom: 2rem;
  text-align: center;
}
.galerie__intro p { margin: 0; }
.galerie__viewport { position: relative; }
.galerie__liste {
  display: flex;
  margin: 0;
  padding: 0 0 .75rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--braun) transparent;
}
.galerie__item {
  flex: 0 0 240px;
  scroll-snap-align: start;
}
@media (min-width: 858px) {
  .galerie__item { flex-basis: 28vw; }
}
@media (min-width: 1430px) {
  .galerie__item { flex-basis: 400px; }
}
.galerie__link {
  position: relative;
  display: block;
  overflow: hidden;
}
.galerie__link:focus-visible { outline: 4px solid var(--braun); outline-offset: -4px; }
.galerie__link:focus-visible::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 3px solid #fff;
}
.galerie__link img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform .4s;
}
.galerie__link:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .galerie__link img { transition: none; }
  .galerie__link:hover img { transform: none; }
}

.galerie__nav {
  position: absolute;
  top: calc(50% - .375rem);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--weiss);
  border-radius: 50%;
  background: var(--braun);
  color: var(--weiss);
  cursor: pointer;
  transform: translateY(-50%);
}
.galerie__nav svg { width: 28px; height: 28px; }
.galerie__nav--prev { left: .5rem; }
.galerie__nav--next { right: .5rem; }
.galerie__nav:hover { background: var(--weiss); color: var(--braun); border-color: var(--braun); }
.galerie__nav:focus-visible { outline-color: var(--weiss); box-shadow: 0 0 0 6px var(--braun); }
.galerie__nav:disabled { opacity: .4; cursor: default; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0;
  padding: 4rem 1rem 1rem;
  border: 0;
  background: rgb(20 10 5 / .96);
  color: var(--weiss);
}
.lightbox::backdrop { background: rgb(0 0 0 / .6); }
.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
}
.lightbox__figur {
  display: grid;
  gap: .75rem;
  justify-items: center;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0;
}
.lightbox__figur picture { min-height: 0; }
.lightbox__figur img {
  width: auto;
  max-width: min(1200px, calc(100vw - 2rem));
  max-height: calc(100dvh - 11rem);
  object-fit: contain;
}
.lightbox__text { max-width: 60ch; text-align: center; }
.lightbox__zaehler { margin: .25rem 0 0; font-size: .9rem; }
.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--weiss);
  border-radius: 50%;
  background: var(--braun);
  color: var(--weiss);
  cursor: pointer;
}
.lightbox__btn svg { width: 28px; height: 28px; }
.lightbox__btn:hover { background: var(--weiss); color: var(--braun); }
.lightbox__btn:focus-visible { outline-color: var(--weiss); }
.lightbox__btn--close { top: .75rem; right: .75rem; }
.lightbox__btn--prev { top: 50%; left: .75rem; transform: translateY(-50%); }
.lightbox__btn--next { top: 50%; right: .75rem; transform: translateY(-50%); }
.lightbox__btn:disabled { opacity: .35; cursor: default; }

/* ---------- Leistungsübersicht ---------- */
.uebersicht {
  position: relative;
  padding: 3rem 0 4rem;
  overflow: hidden;
  background: var(--dunkel);
  color: var(--weiss);
}
.uebersicht picture,
.uebersicht__bild {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uebersicht::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(46 24 11 / .88);
}
.uebersicht__inhalt { position: relative; z-index: 1; }
.uebersicht h2 {
  margin-bottom: 2.5rem;
  color: var(--weiss);
}
@media (min-width: 768px) {
  .uebersicht { padding: 4rem 0 6rem; }
  .uebersicht h2 { text-align: center; }
}
.uebersicht__raster {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem 3rem;
}
.uebersicht__gruppe { flex: 0 1 300px; }
.uebersicht h3 {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
  color: var(--weiss);
  font-size: 1.25rem;
  font-weight: 400;
}
.uebersicht h3 svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  margin-top: .2em;
}
.uebersicht ul {
  margin: 0;
  padding-left: 1.6rem;
  list-style: none;
}
.uebersicht li { line-height: 1.8; }

/* ---------- Kontakt ---------- */
.kontakt {
  display: grid;
  max-width: 1920px;
  margin-inline: auto;
  background: #fff;
}
@media (min-width: 992px) {
  .kontakt { grid-template-columns: 7fr 5fr; }
}
.kontakt__formular { padding: 3rem 1.25rem; }
@media (min-width: 576px) {
  .kontakt__formular { padding: 4rem 12%; }
}
.kontakt__formular h2 { text-align: center; margin-bottom: 1.5rem; }
.kontakt__wege {
  display: grid;
  justify-items: center;
  gap: .25rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}
.kontakt__bild { position: relative; min-height: 300px; }
.kontakt__bild picture,
.kontakt__bild img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 991.98px) {
  .kontakt__bild { aspect-ratio: 3 / 2; min-height: 0; }
}

/* ---------- Formular ---------- */
.formular__hinweis { font-size: .9rem; color: var(--grau); }
.formular__reihe { display: grid; gap: 0 1.5rem; }
@media (min-width: 768px) {
  .formular__reihe { grid-template-columns: 1fr 1fr; }
}
.feld { margin-bottom: 1.25rem; }
.feld label { display: block; margin-bottom: .35rem; font-weight: 700; }
.pflicht { color: var(--braun); }
.feld input:not([type="checkbox"]),
.feld textarea {
  display: block;
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid #767676;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.feld textarea { min-height: 8rem; resize: vertical; }
.feld input:focus-visible,
.feld textarea:focus-visible {
  border-color: var(--braun);
  outline: 3px solid var(--braun);
  outline-offset: 0;
}
.feld [aria-invalid="true"] { border-color: #b00020; border-width: 2px; }
.feld__fehler {
  margin: .35rem 0 0;
  color: #b00020;
  font-size: .95rem;
  font-weight: 700;
}
.feld--checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .75rem;
  align-items: start;
}
.feld--checkbox input {
  width: 1.375rem;
  height: 1.375rem;
  margin: .1rem 0 0;
  accent-color: var(--braun);
}
.feld--checkbox label { font-weight: 400; }
.feld--checkbox .feld__fehler { grid-column: 2; }
.feld--hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.formular__fehler {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 5px solid #b00020;
  background: #fdecee;
}
.formular__fehler:focus { outline: 3px solid #b00020; outline-offset: 2px; }
.formular__fehler h3 { margin: 0 0 .5rem; color: #b00020; font-size: 1.1rem; }
.formular__fehler ul { margin: 0; padding-left: 1.25rem; }
.formular__status:not(:empty) {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-left: 5px solid var(--braun);
  background: var(--beige);
}
.formular__status.is-fehler { border-left-color: #b00020; background: #fdecee; }
.formular__status:focus { outline: 3px solid var(--braun); outline-offset: 2px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 3rem 0 1.5rem;
  background: var(--beige);
  color: var(--braun);
  text-align: center;
}
.site-footer__inner {
  display: grid;
  justify-items: center;
  gap: 2rem;
}
.site-footer__logo { width: 220px; }
.site-footer__adresse p,
.site-footer__kontakt { margin: 0 0 1rem; }
.site-footer__kontakt { padding: 0; list-style: none; }
.site-footer__kontakt li { margin-bottom: .35rem; }
.site-footer a { color: var(--braun); }
.site-footer a:hover { color: var(--text); }
@media (min-width: 768px) {
  .site-footer { padding-top: 5rem; text-align: left; }
  .site-footer__inner {
    grid-template-columns: auto auto auto;
    justify-content: space-between;
    align-items: start;
  }
  .site-footer__logo { width: 250px; }
}
.site-footer__meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(89 45 44 / .3);
  font-size: .95rem;
}
.site-footer__meta ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Unterseiten (Impressum, Datenschutz, 404) ---------- */
.rechtstext {
  max-width: 860px;
  padding-top: calc(var(--header-h) + 6rem);
  padding-bottom: 4rem;
}
@media (min-width: 992px) {
  .rechtstext { padding-top: calc(var(--header-h) + 5rem); }
}
.rechtstext h2 { margin-top: 2.5rem; font-size: 1.9rem; }
.rechtstext h3 { margin-top: 2rem; font-size: 1.2rem; }
.rechtstext h4 { margin-top: 1.5rem; font-size: 1.05rem; }
.rechtstext ul { padding-left: 1.25rem; }
.zurueck { margin-top: 3rem; }
.zurueck .button { color: var(--weiss); }
.zurueck .button:hover,
.zurueck .button:focus-visible { color: var(--braun); }

/* ---------- Windows-Kontrastmodus ---------- */
@media (forced-colors: active) {
  .nav-toggle__bar { background: CanvasText; }
  .leistung__text,
  .uebersicht::after { background: Canvas; }
  .galerie__nav,
  .lightbox__btn { border-color: ButtonText; }
}

/* ---------- Druck ---------- */
@media print {
  .site-header,
  .nav-toggle,
  .skip-link,
  .hero,
  .galerie,
  .kontakt__bild,
  .naht,
  .site-footer__meta { display: none !important; }
  .intro { margin-top: 0; }
  .rechtstext { padding-top: 0; }
  .leistung__text,
  .uebersicht { background: none; color: #000; }
  .leistung__text h3,
  .uebersicht h2,
  .uebersicht h3 { color: #000; }
  .leistung picture,
  .uebersicht picture,
  .uebersicht::after { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; }
}
