/* ==========================================================================
   Hofmann Kachelofenbau – Stylesheet
   Aufbau: 1 Variablen · 2 Grundlagen · 3 Layout · 4 Komponenten · 5 Seiten · 6 Responsive
   Farben & Abstände lassen sich oben bei den Variablen zentral ändern.
   ========================================================================== */

/* 1 ── Variablen ────────────────────────────────────────────────────────── */
:root {
  --c-ember: #b8321f;          /* Hauptfarbe (Flammenrot aus dem Logo) */
  --c-ember-dark: #8f2314;
  --c-amber: #e08a2c;          /* Akzent (Glut) */
  --c-ink: #2a1f1a;            /* Dunkel (Ofen-Anthrazit, warm) */
  --c-ink-soft: #4a3d36;
  --c-clay: #8f6d53;           /* Ton aus dem alten Design */
  --c-cream: #faf6f0;          /* Seitenhintergrund */
  --c-sand: #f1e9de;           /* Abgesetzte Bereiche */
  --c-line: #e3d8c9;
  --c-white: #ffffff;
  --c-text: #2f2621;
  --c-muted: #6b5d54;
  --c-ok: #1f6b3a;
  --c-err: #a61b1b;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(42, 31, 26, .12);
  --shadow-sm: 0 2px 8px rgba(42, 31, 26, .10);
  --header-h: 76px;
  --container: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* 2 ── Grundlagen ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-ember-dark); text-underline-offset: .18em; }
a:hover { color: var(--c-ember); }
address { font-style: normal; }
ul, ol { padding: 0; margin: 0; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.18;
  color: var(--c-ink);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.35rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--c-amber); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--c-ink); color: #fff; padding: .7rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* 3 ── Layout ───────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
.center { text-align: center; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-soft { background: var(--c-sand); }
.section-dark { background: var(--c-ink); color: #eadfd3; }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-head { max-width: 720px; margin: 0 auto 2.5rem; }
.section-title { margin-bottom: .6em; }
.section-title.center { margin-bottom: 1.4em; }
.section-lead { font-size: 1.15rem; color: var(--c-muted); }
.section-dark .section-lead { color: #cdbfb1; }

.eyebrow {
  display: inline-block; margin: 0 0 .9rem;
  font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-ember);
}
.section-dark .eyebrow, .hero .eyebrow { color: var(--c-amber); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 240, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: block; line-height: 0; }
.brand img { width: 150px; height: 60px; }

.main-nav ul { list-style: none; display: flex; align-items: center; gap: .35rem; }
.main-nav a {
  display: block; padding: .55rem .95rem; border-radius: 999px;
  color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: .98rem;
  transition: background-color .2s, color .2s;
}
.main-nav a:hover, .main-nav a.is-active { background: var(--c-sand); color: var(--c-ember-dark); }
.main-nav a.nav-cta { background: var(--c-ember); color: #fff; margin-left: .4rem; }
.main-nav a.nav-cta:hover { background: var(--c-ember-dark); color: #fff; }

.nav-toggle {
  display: none; position: relative; width: 48px; height: 48px;
  background: transparent; border: 1px solid var(--c-line); border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--c-ink); border-radius: 2px;
  transition: transform .25s, opacity .25s, top .25s;
}
.nav-toggle-bars { top: 22px; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; left: 0; right: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* Footer */
.site-footer { background: var(--c-ink); color: #d9cbbd; padding-top: 3.5rem; font-size: .98rem; }
.site-footer a { color: #f4e8da; text-decoration: none; }
.site-footer a:hover { color: var(--c-amber); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand { font-family: var(--font-head); font-size: 1.35rem; color: #fff; margin: 0 0 .6rem; }
.footer-title { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; color: var(--c-amber); margin: 0 0 .8rem; }
.footer-list { list-style: none; display: grid; gap: .45rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem;
  border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.2rem; font-size: .9rem; color: #b6a797;
}
.footer-bottom p { margin: 0; }

/* 4 ── Komponenten ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--c-ember); color: #fff; box-shadow: 0 6px 18px rgba(184, 50, 31, .35); }
.btn-primary:hover { background: var(--c-ember-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.btn-ghost-dark { color: var(--c-ink); border-color: var(--c-ink); }
.btn-ghost-dark:hover { background: var(--c-ink); color: #fff; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }

.text-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; text-decoration: none; margin-top: .3rem; }
.text-link .icon { width: 18px; height: 18px; transition: transform .2s; }
.text-link:hover .icon { transform: translateX(4px); }

.icon { width: 24px; height: 24px; flex: none; }

/* Karten */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 2rem 1.75rem; box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 1.1rem;
  border-radius: 14px; background: #f8e6dd; color: var(--c-ember);
}
.card p { color: var(--c-muted); }

/* Zahlen / Fakten */
.facts { background: var(--c-white); border-block: 1px solid var(--c-line); }
.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding-block: 2.25rem; }
.fact { text-align: center; }
.fact-value { font-family: var(--font-head); font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 700; color: var(--c-ember); line-height: 1; margin: 0 0 .4rem; }
.fact-label { margin: 0; color: var(--c-muted); font-size: .95rem; max-width: 22ch; margin-inline: auto; }

/* Galerie */
.gallery { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery li { overflow: hidden; border-radius: var(--radius); background: #000; aspect-ratio: 4 / 5; }
.gallery-link { display: block; height: 100%; cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.gallery-link:hover img { transform: scale(1.05); opacity: .92; }

/* Lightbox (<dialog>) */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
  color: #fff; overflow: hidden;
}
.lightbox::backdrop { background: rgba(20, 14, 11, .92); }
.lightbox-inner { position: relative; display: grid; place-items: center; width: 100%; height: 100%; padding: 3.5rem 1rem 1.5rem; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox button {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px;
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 50%; cursor: pointer; font-size: 1.6rem; line-height: 1;
}
.lightbox button:hover { background: rgba(255,255,255,.28); }
.lightbox-close { top: .8rem; right: .8rem; }
.lightbox-prev { left: .8rem; top: 50%; translate: 0 -50%; }
.lightbox-next { right: .8rem; top: 50%; translate: 0 -50%; }

/* Formular */
.contact-form { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.25rem); box-shadow: var(--shadow); }
.field { margin-bottom: 1.15rem; }
.field label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .95rem; color: var(--c-ink); }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; padding: .8rem .95rem; font: inherit; color: var(--c-text);
  background: var(--c-cream); border: 1.5px solid var(--c-line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:hover, .field textarea:hover { border-color: #cdbba6; }
.field input:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--c-ember); box-shadow: 0 0 0 4px rgba(184, 50, 31, .15); }
.field [aria-invalid="true"] { border-color: var(--c-err); }
.field-error { margin: .35rem 0 0; font-size: .9rem; color: var(--c-err); }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: start; }
.field-check input { width: 1.2rem; height: 1.2rem; margin-top: .25rem; accent-color: var(--c-ember); }
.field-check label { font-weight: 400; font-size: .92rem; color: var(--c-muted); margin: 0; }
.field-check .field-error { grid-column: 2; }
.req { color: var(--c-ember); }
.form-note { margin: .9rem 0 0; font-size: .85rem; color: var(--c-muted); text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { margin: 0 0 1.2rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; font-weight: 500; }
.alert-success { background: #e8f5ec; border-color: #9fd2af; color: var(--c-ok); }
.alert-error { background: #fdeaea; border-color: #eaa9a9; color: var(--c-err); }
.form-status:focus { outline: none; }

/* Karte mit Einwilligung */
.map-consent {
  position: relative; display: grid; place-items: center; min-height: 380px; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--c-line); box-shadow: var(--shadow-sm);
  background:
    repeating-linear-gradient(45deg, rgba(143,109,83,.07) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(143,109,83,.07) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #efe5d7, #e7dac8);
}
.map-placeholder { text-align: center; max-width: 520px; padding: 2rem 1.5rem; }
.map-address { font-size: 1.1rem; }
.map-privacy { font-size: .92rem; color: var(--c-muted); }
.map-consent iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; margin: 1rem 0 0; font-size: .95rem; }

/* 5 ── Seiten ───────────────────────────────────────────────────────────── */
/* Startseite: Hero */
.hero { background: radial-gradient(1200px 500px at 85% 10%, #4a2c20 0%, transparent 60%), var(--c-ink); color: #eadfd3; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { color: #fff; margin-bottom: .45em; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.6; color: inherit; max-width: 58ch; }
.hero .lead { color: #d9cbbd; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-media { position: relative; isolation: isolate; }
.hero-media img {
  width: 100%; height: auto; aspect-ratio: 5 / 5.2; object-fit: cover; object-position: 50% 45%;
  border-radius: 26px; box-shadow: 0 30px 70px rgba(0,0,0,.45);
}
.hero-media::before {
  content: ""; position: absolute; inset: 18px -14px -14px 18px; z-index: -1;
  border: 2px solid rgba(224, 138, 44, .55); border-radius: 26px;
}

/* Innenseiten: Kopfbereich */
.page-hero { background: var(--c-sand); border-bottom: 1px solid var(--c-line); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero h1 { margin-bottom: .3em; }
.page-hero .lead { color: var(--c-muted); margin-bottom: 0; }
.page-hero .center-actions { justify-content: center; }

/* Fließtext (Über uns, Rechtstexte) */
.prose { font-size: 1.1rem; }
.prose p { color: #3d322c; }
.legal { font-size: 1rem; }
.legal h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.legal h2:first-child { margin-top: 0; }
.legal ul { padding-left: 1.3rem; margin: 0 0 1em; }
.legal li { margin-bottom: .5em; }
.legal a { overflow-wrap: anywhere; }

/* Über uns: Arbeitsschritte */
.steps { list-style: none; counter-reset: step; display: grid; gap: 1.1rem; }
.steps li {
  counter-increment: step; position: relative; background: var(--c-white); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1.5rem 1.5rem 1.2rem 5rem; box-shadow: var(--shadow-sm);
}
.steps li::before {
  content: counter(step); position: absolute; left: 1.25rem; top: 1.35rem;
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--c-ember); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem;
}
.steps h3 { margin-bottom: .35em; }
.steps p { margin: 0 0 .6em; color: var(--c-muted); }

.process-gallery { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.process-gallery figure { margin: 0; }
.process-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.process-gallery figcaption { margin-top: .8rem; text-align: center; font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--c-ink); }

.cta-band { background: var(--c-ember); color: #fff; padding-block: clamp(3rem, 7vw, 5rem); }
.cta-band h2 { color: #fff; margin-bottom: 1.2em; }
.cta-band .btn-primary { background: #fff; color: var(--c-ember-dark); box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.cta-band .btn-primary:hover { background: var(--c-cream); color: var(--c-ember-dark); }

/* Kontakt */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-list { list-style: none; display: grid; gap: 1.2rem; margin-top: 2rem; }
.contact-list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact-list .icon { width: 26px; height: 26px; margin-top: .15rem; color: var(--c-ember); }
.contact-list a { font-weight: 600; }

/* Einblend-Animation (nur wenn JavaScript aktiv ist; siehe main.js) */
.reveal-hidden { opacity: 0; transform: translateY(22px); }
.reveal-in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }

/* 6 ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 520px; }
  .hero-media::before { inset: 12px -8px -8px 12px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .process-gallery { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }

  /* Mobile Navigation */
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--c-cream); border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
    display: none; padding: .75rem var(--gutter) 1.25rem;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: .2rem; }
  .main-nav a { padding: .9rem 1rem; font-size: 1.05rem; border-radius: var(--radius-sm); }
  .main-nav a.nav-cta { margin: .5rem 0 0; text-align: center; }
}

@media (max-width: 560px) {
  :root { --header-h: 68px; }
  body { font-size: 1rem; }
  .brand img { width: 125px; height: 50px; }
  .facts-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .gallery { grid-template-columns: 1fr; }
  .gallery li { aspect-ratio: 4 / 4.4; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .steps li { padding: 4.3rem 1.25rem 1.1rem; }
  .steps li::before { top: 1.1rem; left: 1.25rem; }
  .map-consent { min-height: 320px; }
}

/* Ohne JavaScript: Navigation immer sichtbar */
@media (scripting: none) {
  .nav-toggle { display: none; }
  .main-nav { display: block; position: static; box-shadow: none; border: 0; padding: 0; background: none; }
  .main-nav ul { flex-direction: row; flex-wrap: wrap; }
  .site-header { position: static; }
  .header-inner { flex-wrap: wrap; }
}

/* Barrierefreiheit: Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal-hidden { opacity: 1; transform: none; }
}

@media print {
  .site-header, .nav-toggle, .contact-form, .map-consent, .cta-band, .to-top { display: none !important; }
  body { background: #fff; }
}
