/* ---------- Design tokens ---------- */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --alt: #efe9e0;
  --ink: #201b14;
  --muted: #6f675b;
  --line: #e2dccf;
  --accent: #6b4f34;        /* Schreinerei — warm wood */
  --accent-care: #4b5d5a;   /* Bestattungen — ruhiger Schiefer-Grünton */
  --radius: 16px;
  --maxw: 1100px;
  --space: clamp(4rem, 9vw, 8rem);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Georgia", "Iowan Old Style", "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px; /* offset for the sticky header */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
  text-wrap: balance;          /* gleichmäßigere Zeilenumbrüche in Überschriften */
}

p { margin: 0; text-wrap: pretty; }   /* verhindert einzelne Wörter am Zeilenende */
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Sichtbarer Fokusrahmen für Tastatur-Navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Sprung-Link (nur bei Tastaturfokus sichtbar) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #57402a; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  flex-wrap: wrap;               /* Links rutschen bei wenig Platz in die nächste Zeile */
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 0.5rem 2rem;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand span { color: var(--muted); font-weight: 500; }

.nav-links {
  display: flex;
  flex-wrap: wrap;               /* Menüpunkte brechen bei Bedarf um, kein Hamburger nötig */
  justify-content: center;
  gap: 0.6rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.95rem;
  color: var(--muted);
  position: relative;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1.5px;
  background: var(--ink);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  text-align: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5rem);
  margin-bottom: 1.5rem;
}
.hero-lede {
  max-width: 52ch;
  margin: 0 auto 2.5rem;
  color: var(--muted);
  font-size: 1.15rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Two branches ---------- */
.branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  padding-bottom: var(--space);
}
.branch {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* Inhalt am unteren Rand der Kachel */
  min-height: 300px;
  padding: 2.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  background-color: #2b2620;
  background-size: cover;
  background-position: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.branch:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.45);
}
/* Schreinerei — echtes Werkstattfoto mit dunklem Verlauf für Lesbarkeit */
.branch-wood {
  background-image:
    linear-gradient(155deg, rgba(30, 22, 14, 0.35), rgba(30, 22, 14, 0.82)),
    url("piqsels.com-id-zbspd.jpg");
}
/* Bestattungen — ruhiger, kühler Farbverlauf statt Foto */
.branch-care {
  background-image: linear-gradient(155deg, #55686a, #34413f);
}
.branch h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.2rem;
  margin: 1.5rem 0 0.6rem;
}
.branch p { color: #fff; opacity: 0.9; max-width: 34ch; }
.branch-arrow {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space); }
.section-alt { background: var(--alt); padding-block: var(--space); }

/* Bestattungen: ruhigerer, kühler Akzent zur Unterscheidung vom Schreiner-Bereich */
.section-alt .service { border-top-color: var(--accent-care); }

.section-head {
  max-width: 46ch;
  margin-bottom: 3rem;
}
.section-head .eyebrow { margin-bottom: 0.75rem; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 0.9rem;
}
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 2.5rem 2rem;
}
.service { border-top: 2px solid var(--accent); padding-top: 1.25rem; }
.service-index {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.service h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.service p { color: var(--muted); }

/* ---------- Carousel / Bildergalerie ---------- */
.carousel {
  position: relative;
  margin-top: 3.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1712;
}
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.carousel-viewport { overflow: hidden; }

.carousel-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
}
.slide img {
  width: 100%;
  height: clamp(240px, 54vw, 560px);
  object-fit: cover;
  display: block;
}
.slide-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 68%;
  padding: 2.5rem 1.5rem 1.35rem;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.05rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }

.carousel-dots {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
}
.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-dot.is-active { background: #fff; transform: scale(1.3); }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
.about-text h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 1.25rem;
}
.about-text p { color: var(--muted); font-size: 1.1rem; margin-bottom: 1rem; }
.about-quote {
  margin: 0;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.5;
}
.about-quote cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-style: normal;
  color: var(--muted);
}

/* ---------- Contact / CTA ---------- */
.cta {
  text-align: center;
  padding-block: var(--space);
}
.cta h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 1rem;
}
.cta > p {
  color: var(--muted);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.5rem;
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: left;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.contact-card h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.contact-card > p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.contact-card a {
  display: block;
  font-size: 1.05rem;
  color: var(--accent);
  margin-top: 0.3rem;
  transition: color 0.2s ease;
}
.contact-card a:hover { color: var(--ink); }
.contact-address {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Footer (dunkles Band als Abschluss) ---------- */
.site-footer {
  background: var(--ink);
  color: #e7e2d8;
  padding-block: 3rem;
}
.site-footer .brand { color: #fff; }
.site-footer .brand span { color: rgba(255, 255, 255, 0.55); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-copy { color: rgba(255, 255, 255, 0.55); font-size: 0.9rem; }
.footer-social {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-social a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s ease;
}
.footer-social a:hover { color: #fff; }

/* ---------- Fluid statt Breakpoints ----------
   Das Layout passt sich allein über flexible Grids (auto-fit + minmax),
   flex-wrap und clamp() an jede Breite an – ganz ohne Media Queries und
   ohne JavaScript. Dadurch funktioniert es auch dann, wenn die Seite in
   einem Frame ohne eigenes Viewport-Meta angezeigt wird.
   Die einzige verbleibende Media-Query betrifft die Bewegungs-Vorliebe
   des Nutzers (Barrierefreiheit), nicht die Bildschirmbreite. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .branch:hover { transform: none; }
  .carousel-track { transition: none; }
}
