/* ===== Grundlagen ===== */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/Montserrat-Regular.woff2) format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/Montserrat-Bold.woff2) format("woff2");
}

:root {
  --c-dark: #303030;
  --c-text: #222;
  --c-muted: #606266;
  --c-light-muted: #888;
  --c-bg: #f0f0f0;
  --c-border: #dcdfe6;
  --c-green: #488e32;
  --c-green-bg: #e4efe0;
  --c-error: #f56c6c;
  --shadow-card: 5px 5px 25px 0 rgba(0, 0, 0, 0.4);
  --nav-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 14px;
  word-spacing: 1px;
  color: var(--c-text);
  background: #fff;
}

a { text-decoration: none; color: #000; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  background: #fff;
  padding: 10px 16px;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ===== Buttons ===== */
.button {
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  transition: 0.2s;
  display: inline-block;
  font-family: inherit;
  font-size: 14px;
  text-align: center;
}
.button.green {
  color: var(--c-green);
  border-color: var(--c-green);
  background-color: var(--c-green-bg);
}
.button.green:hover {
  color: var(--c-green-bg);
  background-color: var(--c-green);
}
.button.big { padding: 14px 28px; font-size: 15px; }
.button:disabled { opacity: 0.6; cursor: wait; }

/* ===== Navigation ===== */
#theNavigation {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background-color: #fff;
  box-shadow: 0 10px 10px 0 rgba(0, 0, 0, 0.1);
}
#theNavigation .bar {
  padding: 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  color: var(--c-dark);
  min-height: var(--nav-height);
}
#theNavigation .brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
#theNavigation .brand .icon { width: auto; height: 24px; }
#theNavigation .menu a {
  display: inline-block;
  color: var(--c-dark);
  padding: 20px;
  transition: background-color 0.3s, color 0.3s;
}
#theNavigation .menu a:hover { background-color: #f2f2f2; color: #000; }

#menuToggler {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
#menuToggler span {
  display: block;
  width: 33px;
  height: 4px;
  margin-bottom: 5px;
  background: var(--c-dark);
  border-radius: 3px;
  transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1), opacity 0.4s ease;
}
#menuToggler span:last-child { margin-bottom: 0; }
#menuToggler.toggled span:first-child { transform: translateY(9px) rotate(45deg); }
#menuToggler.toggled span:nth-child(2) { opacity: 0; }
#menuToggler.toggled span:last-child { transform: translateY(-9px) rotate(-45deg); }

/* ===== Sektionen ===== */
section { padding: 100px 80px 140px; background-color: var(--c-bg); }
section.firstSection { padding-top: 160px; }

section header { display: flex; justify-content: center; margin-bottom: 100px; }
section header div { border-bottom: 1px solid var(--c-text); padding: 0 50px 18px; }
section header h1,
section header h2 {
  font-weight: 300;
  font-size: 34px;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  color: var(--c-text);
  word-spacing: 10px;
}

/* ===== Landing / Hero ===== */
#theLanding { width: 100%; height: 100vh; position: relative; }
#theLanding .bgImg {
  position: absolute;
  inset: 0;
  background-image: url(/img/landing.jpg);
  background-position: top;
  background-size: cover;
  opacity: 0.5;
}
#theLanding .logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#theLanding .logocontainer { width: 30%; min-width: 280px; }
#theLanding .logocontainer img { width: 100%; height: auto; }

/* ===== Startseite: Brennholz ===== */
#brennholz .sectionMain { display: flex; gap: 0; }
#brennholz .sectionMain > * { flex: 1; padding: 0 80px; }
#brennholz .slider { padding-right: 60px; }
#brennholz .slider .imgContainer {
  height: 100%;
  min-height: 280px;
  background-size: cover;
  background-position: 50%;
}
#brennholz .info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 80px 30px 60px;
}
#brennholz .info p { font-size: 14px; line-height: 24px; width: 100%; }
#brennholz .info p:not(:last-child) { margin-bottom: 16px; }
#brennholz .info p span { color: #555; }
#brennholz .info p span a { color: #555; transition: color 0.3s; }
#brennholz .info p span a:hover { color: #000; }
#brennholz .firewoodBtns {
  display: flex;
  width: 100%;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 30px;
}

/* ===== Divider (Parallax) ===== */
.divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.divider::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--divider-img);
  background-size: cover;
  background-position: 50%;
  background-attachment: fixed;
  opacity: 0.8;
}
.divider .textContainer { width: 70%; margin: 80px 0; z-index: 1; }
.divider p {
  color: #fff;
  font-weight: 700;
  font-size: 26px;
  text-align: center;
  text-shadow: 2px 2px 4px #444;
}
.divider p:not(:last-child) { margin-bottom: 20px; }
.divider p a {
  color: #fff;
  text-shadow: 2px 2px 4px #444;
  transition: color 0.3s, text-shadow 0.3s;
}
.divider p a:hover { color: #eee; text-shadow: 2px 2px 8px #000; }

/* ===== Service-Karten ===== */
#spalten { padding-bottom: 100px; }
.service {
  display: flex;
  background-color: #fff;
  box-shadow: var(--shadow-card);
}
.service:not(:last-child) { margin-bottom: 100px; }
.service .img {
  flex: 0 0 250px;
  align-self: stretch;
  background-size: cover;
  background-position: 50%;
}
.service .content { padding: 40px; }
.service .content h3 { font-size: 18px; margin-bottom: 16px; }
.service .content p { line-height: 24px; }
.service .content a { text-decoration: underline; }
#spalten .sectionMain, #leistungen .sectionMain { margin: 0 40px; }

/* ===== YouTube Zwei-Klick-Fassade ===== */
.video-facade {
  position: relative;
  margin-top: 60px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-card);
}
.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
.video-facade .playBtn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 84px; height: 84px;
  border-radius: 50%;
  border: none;
  background: rgba(72, 142, 50, 0.92);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-facade .playBtn:hover { transform: translate(-50%, -50%) scale(1.08); background: var(--c-green); }
.video-facade .playBtn svg { width: 44px; height: 44px; }
.video-facade .hint {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  margin: 0;
  padding: 12px 16px;
  font-size: 12px;
  color: #eee;
  background: rgba(0, 0, 0, 0.6);
  text-align: center;
}
.video-facade .hint a { color: #fff; text-decoration: underline; }
.video-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== Footer ===== */
#theFooter {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 70px 50px 50px;
  background: #fff;
}
#theFooter .social { text-align: right; margin-bottom: 20px; }
#theFooter .social a { display: inline-block; margin-left: 6px; }
#theFooter .social svg { width: 24px; height: 24px; vertical-align: middle; }
#theFooter a:hover { text-decoration: underline; }
#theFooter .menu { list-style: none; display: flex; }
#theFooter .menu li:not(:last-child)::after { content: "|"; padding: 0 8px; }

/* ===== Bestellformular ===== */
#orderForm { max-width: 1100px; margin: 0 auto; }
#orderForm fieldset { border: none; margin-bottom: 60px; }
#orderForm legend {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 24px;
  color: var(--c-text);
}

.woodChooser { display: flex; gap: 50px; }
.woodlist { flex: 4; }
.woodDescription { flex: 5; }
.woodChooser .cutlist { flex: 4; }

/* Radio-Inputs unsichtbar, aber fokussierbar – Auswahl wird über die Zeile markiert */
.woodOption input,
.cutOption input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.woodOption {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 14px 18px;
  border-top: 1px solid #bbb;
  box-shadow: inset 0 0 0 0 var(--c-green);
  transition: background-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.woodOption:last-child { border-bottom: 1px solid #bbb; }
.woodOption:hover:not(.notAvailable) { background-color: #e7e7e7; }
.woodOption:has(input:checked) {
  background-color: var(--c-green-bg);
  box-shadow: inset 4px 0 0 0 var(--c-green);
  color: var(--c-green);
  font-weight: 700;
}
.woodOption:has(input:focus-visible) { outline: 2px solid var(--c-green); outline-offset: -2px; }
.woodOption.notAvailable { color: #bbb; cursor: auto; }
.woodOption .soldOut { font-style: italic; font-size: 10px; margin-left: auto; }

.woodDescription .description { line-height: 22px; color: var(--c-muted); white-space: pre-line; }
.cutlist .cutHint { font-weight: 700; margin-bottom: 10px; }
.cutOption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 12px 18px;
  border-top: 1px solid #bbb;
  cursor: pointer;
  box-shadow: inset 0 0 0 0 var(--c-green);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.cutOption:last-child { border-bottom: 1px solid #bbb; }
.cutOption:hover { background-color: #e7e7e7; }
.cutOption:has(input:checked) {
  background-color: var(--c-green-bg);
  box-shadow: inset 4px 0 0 0 var(--c-green);
}
.cutOption:has(input:checked) .cutLabel { color: var(--c-green); font-weight: 700; }
.cutOption:has(input:focus-visible) { outline: 2px solid var(--c-green); outline-offset: -2px; }
.cutOption .cutLabel { display: flex; align-items: center; gap: 10px; flex: 1; }
.cutOption .price { color: var(--c-light-muted); font-size: 12px; }

/* Eingabefelder */
.textInput { display: block; margin-bottom: 24px; color: var(--c-muted); }
.textInput .label { margin-bottom: 10px; display: block; }
.textInput input,
.textInput textarea {
  border-radius: 4px;
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-family: inherit;
  font-size: 14px;
  height: 40px;
  line-height: 40px;
  padding: 0 15px;
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 100%;
  background: #fff;
}
.textInput textarea { height: auto; line-height: 20px; padding: 10px 15px; resize: vertical; }
.textInput input::placeholder, .textInput textarea::placeholder { color: #c8cbd1; }
.textInput input:focus, .textInput textarea:focus { outline: 0; border-color: var(--c-green); }
.textInput input.invalid, .textInput textarea.invalid { border-color: var(--c-error); }

.inputRow { display: flex; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.inputRow .textInput { max-width: 320px; margin-bottom: 0; }
.inputUnit { display: flex; align-items: center; gap: 12px; }
.inputUnit .unit { color: var(--c-muted); }

.contactHint { color: var(--c-muted); margin-bottom: 24px; line-height: 20px; }
.contactGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 60px; }

/* Fehler & Footer */
.fieldError { color: var(--c-error); font-size: 12px; margin-top: 6px; display: block; line-height: 18px; }
.fieldError.formError { font-size: 14px; margin-bottom: 16px; text-align: center; }

.formFooter { display: flex; flex-direction: column; align-items: center; }
.formFooter .hp { position: absolute; left: -9999px; }
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 560px;
  color: var(--c-muted);
  line-height: 22px;
  margin-bottom: 28px;
  cursor: pointer;
}
.consent input { margin-top: 4px; accent-color: var(--c-green); width: 16px; height: 16px; flex-shrink: 0; }
.consent a { color: var(--c-muted); text-decoration: underline; }
.requiredHint { margin-top: 18px; color: var(--c-light-muted); font-size: 12px; }

/* ===== Erfolgs-Modal ===== */
#successModal {
  /* margin:auto explizit setzen – der globale Reset (* { margin: 0 })
     entfernt sonst die Browser-Zentrierung des <dialog> */
  margin: auto;
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
#successModal::backdrop { background: rgba(0, 0, 0, 0.55); }
#successModal .modalHeader {
  background: var(--c-green);
  color: #fff;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
#successModal .modalHeader svg { width: 40px; height: 40px; flex-shrink: 0; }
#successModal .modalHeader h2 { font-size: 18px; font-weight: 700; }
#successModal .modalIntro { padding: 24px 28px 0; line-height: 22px; color: var(--c-muted); }
#successModal .modalSummary { margin: 20px 28px; background: var(--c-bg); border-radius: 6px; padding: 18px 20px; }
#successModal .modalSummary h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--c-green);
  margin-bottom: 12px;
}
#successModal dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
}
#successModal dt { color: var(--c-light-muted); }
#successModal dd { font-weight: 700; color: var(--c-text); }
#successModal .modalMailNote { padding: 0 28px; color: var(--c-muted); font-size: 13px; }
#successModal form { padding: 20px 28px 28px; text-align: center; }

/* ===== Infos zu Brennholz ===== */
.articles article { display: flex; padding: 0 50px; }
.articles article:not(:last-child) { margin-bottom: 140px; }
.articles .content { flex: 2; }
.articles .content h3 { font-weight: 700; margin-bottom: 20px; letter-spacing: 2px; font-size: 16px; }
.articles .content p { line-height: 22px; }
.articles .content p:not(:last-child) { margin-bottom: 10px; }
.articles article:nth-child(even) .content { padding-left: 120px; }
.articles article:nth-child(odd) .content { padding-right: 120px; }
.articles .img { flex: 1; background-size: cover; background-position: 50%; min-height: 220px; }

/* ===== Rechtliches ===== */
.legal .legalContent { max-width: 800px; margin: 0 auto; }
.legal h2 { font-size: 20px; margin: 36px 0 14px; }
.legal h3 { font-size: 16px; margin: 26px 0 10px; }
.legal p, .legal li { line-height: 22px; margin-bottom: 10px; color: var(--c-text); }
.legal ul { padding-left: 22px; }
.legal a { text-decoration: underline; word-break: break-word; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  section { padding: 60px 45px; }
  section.firstSection { padding-top: 140px; }
  section header { margin-bottom: 40px; }
  section header div { padding: 0 25px 18px; }
  section header h1, section header h2 { font-size: 20px; }

  #brennholz .sectionMain { flex-direction: column; }
  #brennholz .sectionMain > * { padding: 0; }
  #brennholz .slider { margin-bottom: 30px; }
  #brennholz .info { padding: 0; }

  #spalten .sectionMain, #leistungen .sectionMain { margin: 0; }
  .service { flex-direction: column; }
  .service:not(:last-child) { margin-bottom: 40px; }
  .service .img { flex: 0 0 150px; min-height: 150px; }
  .service .content p { line-height: 20px; font-size: 13px; }

  .divider::before { background-attachment: scroll; }
  .divider p { font-size: 20px; }

  .woodChooser { flex-direction: column; gap: 30px; }
  .contactGrid { grid-template-columns: 1fr; }

  .articles article { flex-direction: column; padding: 0; }
  .articles article:nth-child(even) { flex-direction: column-reverse; }
  .articles article .content { padding: 0 !important; }
  .articles article .img { margin-top: 30px; flex: 0 0 150px; }
  .articles article:not(:last-child) { margin-bottom: 80px; }
}

@media (max-width: 900px) {
  #theNavigation .bar { padding: 0 24px; }
  #menuToggler { display: block; }
  #theNavigation .menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background-color: #fff;
    flex-direction: column;
    box-shadow: 0 10px 10px 0 rgba(0, 0, 0, 0.1);
  }
  #theNavigation .menu.toggled { display: flex; animation: fade-in 0.3s ease-in-out both; }
  #theNavigation .menu a { text-align: center; display: block; }

  #theLanding .logocontainer { width: 60%; }

  #theFooter { flex-direction: column-reverse; align-items: center; gap: 24px; }
  #theFooter .social { text-align: center; }
  #theFooter .menu { flex-direction: column; align-items: center; }
  #theFooter .menu li:not(:last-child)::after { content: ""; padding: 0; }
  #theFooter .menu li:not(:last-child) { margin-bottom: 8px; }
  #theFooter .copy { text-align: center; }

  .inputRow { gap: 10px; }
  .inputRow .textInput { max-width: none; width: 100%; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
