﻿:root {
  --bg: #f7f4ee;
  --surface: #fffdfa;
  --line: #d7cebf;
  --text: #2a241d;
  --muted: #61584d;
  --accent: #a64023;
  --accent-dark: #7c301a;
  --offset: 5.2rem;
}

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

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

body {
  font-family: "Segoe UI", "Candara", "Arial", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, #efe7d8 0%, transparent 25%),
    radial-gradient(circle at 88% 4%, #ece3d3 0%, transparent 29%),
    var(--bg);
}

a {
  color: var(--accent-dark);
}

.layout {
  width: min(1260px, calc(100% - 2rem));
  margin: 1rem auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 1rem;
}

@media (min-width: 1201px) {
  .layout {
    display: block;
    width: min(1260px, calc(100% - 2rem));
    margin: 1rem auto;
    padding-left: 296px;
  }

  .sidebar {
    position: fixed;
    top: 1rem;
    left: max(1rem, calc((100vw - 1260px) / 2));
    width: 280px;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    z-index: 30;
  }

  .content {
    margin-left: 0;
  }
}

.logo-wrap img {
  width: 170px;
  max-width: 100%;
  display: block;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 0.45rem 0.7rem;
  margin-top: 0.75rem;
  font-weight: 700;
}

.side-nav {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.side-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  font-weight: 600;
}

.side-nav a:hover,
.side-nav a:focus {
  background: #efe6d9;
}

.side-nav a[aria-current="page"] {
  background: #eadac5;
  border: 1px solid #d0bca3;
}

.nav-details.current summary {
  background: #eadac5;
  border-bottom: 1px solid #d0bca3;
}

.nav-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.nav-details summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.6rem;
  font-weight: 700;
  color: var(--text);
  background: #efe7da;
  border: 1px solid #ddcfba;
  border-radius: 8px;
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.nav-details summary::-webkit-details-marker {
  display: none;
}

.nav-details summary::after {
  content: "\25B8";
  float: right;
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.nav-details[open] summary {
  background: #f4ece0;
  border-bottom: 1px solid var(--line);
}

.nav-details[open] summary::after {
  content: "\25BE";
}

.nav-sub-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 0.35rem;
  transition: max-height 0.82s ease, opacity 0.55s ease, padding 0.82s ease;
}

.nav-sub-links a {
  font-weight: 500;
  margin-left: 0.45rem;
  padding-left: 0.8rem;
  border-left: 2px solid #d9c8b2;
}

.side-note {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.content {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 1.2rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  opacity: 1;
  transform: translateX(0);
  animation: contentSlideIn 0.2s ease both;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.content.page-leave {
  opacity: 0.9;
  transform: translateX(-10px);
}

@keyframes contentSlideIn {
  from {
    opacity: 0.9;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (min-width: 1201px) {
  .content {
    animation: contentSlideInDesktop 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .content.page-leave {
    opacity: 0.94;
    transform: translateX(12px);
  }
}

@keyframes contentSlideInDesktop {
  from {
    opacity: 0.88;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.detail-content {
  scroll-behavior: smooth;
}

.breadcrumbs {
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs a {
  text-decoration: none;
}

.hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.overline {
  margin: 0 0 0.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.84rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Bahnschrift", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  line-height: 1.14;
}

h1 {
  font-size: clamp(1.8rem, 3.3vw, 2.7rem);
  margin: 0 0 0.7rem;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  margin: 0 0 0.7rem;
}

h3 {
  margin: 0 0 0.5rem;
}

p {
  line-height: 1.58;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.62rem 0.88rem;
  border-radius: 10px;
  font-weight: 700;
}

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

.btn.primary:hover,
.btn.primary:focus {
  background: var(--accent-dark);
}

.btn.light {
  border: 1px solid var(--line);
  color: var(--text);
}

.hero-image {
  margin: 1rem 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  display: block;
  max-height: 360px;
  object-fit: cover;
}

.section {
  margin-top: 1.15rem;
  padding-top: 0.3rem;
  scroll-margin-top: var(--offset);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.service-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title a {
  color: var(--accent-dark);
  font-weight: 700;
}

.lead {
  color: var(--muted);
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.contact {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.impressum-box {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
}

.impressum-box h3 {
  margin-bottom: 0.4rem;
  font-size: 1.02rem;
  color: var(--text);
}

.impressum-box p {
  margin: 0.35rem 0;
  line-height: 1.5;
}

.contact-form-wrap {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.55s ease, opacity 0.35s ease, margin 0.55s ease;
  margin-top: 0;
}

.contact-form-wrap.open {
  max-height: 900px;
  opacity: 1;
  margin-top: 0.8rem;
}

.contact-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.contact-form textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid #d9bfa5;
  outline-offset: 1px;
}

.form-actions {
  margin-top: 0.2rem;
}

.form-note {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  background: #f2eadf;
  font-family: "Bahnschrift", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
}

.data-table tbody tr:nth-child(even) {
  background: #fcf8f2;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.diagram {
  margin: 0.9rem 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: #fff;
}

.diagram figcaption {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.diagram svg {
  width: 100%;
  height: auto;
}

.diagram rect {
  fill: #f2eadf;
  stroke: #c8bba8;
  stroke-width: 2;
}

.diagram line {
  stroke: #9d8c74;
  stroke-width: 2.2;
}

.diagram text {
  fill: #312a22;
  font-family: "Segoe UI", "Candara", sans-serif;
  font-size: 16px;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.image-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.image-grid img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.image-grid figcaption {
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Startseite: staerkere visuelle Trennung der Hauptgruppen */
.page-home #leistungen,
.page-home #offroad,
.page-home #van,
.page-home #kontakt {
  margin-top: calc(2rem + 30px);
  padding: 1.1rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.page-home #leistungen {
  border-left: 6px solid #b4785c;
  background: linear-gradient(180deg, #fffdf9 0%, #fff 100%);
}

.page-home #offroad {
  border-left: 6px solid #8f6c4f;
  background: linear-gradient(180deg, #fdf9f3 0%, #fff 100%);
}

.page-home #van {
  border-left: 6px solid #7d5539;
  background: linear-gradient(180deg, #fcf7f1 0%, #fff 100%);
}

.page-home #kontakt {
  border-left: 6px solid #a64023;
  background: linear-gradient(180deg, #f8efe6 0%, #fff 100%);
}

/* Detailseiten: gleiche Trennlogik wie Startseite, etwas dezenter */
body:not(.page-home) .section {
  margin-top: calc(1.15rem + 30px);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

body:not(.page-home) .section:nth-of-type(even) {
  background: linear-gradient(180deg, #fdf9f3 0%, #fff 100%);
}

@media (max-width: 1200px) {
  :root {
    --offset: 6rem;
  }

  .layout {
    width: calc(100% - 1rem);
    margin: 0.5rem auto 1rem;
    padding-top: calc(6.1rem + env(safe-area-inset-top, 0px));
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    min-height: 58px;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0;
    background: var(--surface);
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: 0 9px 24px rgba(0, 0, 0, 0.16);
  }

  .logo-wrap {
    display: inline-flex;
    align-items: center;
    min-width: 0;
  }

  .logo-wrap img {
    width: 92px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0;
    margin-left: auto;
    padding: 0.45rem 0.65rem;
    line-height: 1;
  }

  .menu-toggle::before {
    content: "\2630";
    font-size: 1rem;
  }

  .menu-toggle[aria-expanded="true"]::before {
    content: "\2715";
  }

  .side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: max-height 0.5s ease, opacity 0.35s ease, transform 0.5s ease, padding 0.35s ease, border-color 0.35s ease;
    margin-top: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0;
    background: #fff;
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    top: calc(100% - 0.2rem);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    z-index: 40;
  }

  .side-nav.open {
    max-height: 85vh;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    border-color: var(--line);
    padding: 0.35rem;
  }

  .side-note {
    display: none;
  }

  .service-grid {
    grid-template-columns: 1fr 1fr;
  }

  .columns-3 {
    grid-template-columns: 1fr;
  }

  .data-table {
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .content {
    padding: 0.9rem;
  }

  .sidebar {
    padding: 0.4rem 0.6rem;
  }

  .side-nav {
    left: 0.5rem;
    right: auto;
    width: min(80vw, 420px);
  }

  .logo-wrap img {
    width: 86px;
  }

  .service-grid,
  .columns {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .page-home #leistungen,
  .page-home #offroad,
  .page-home #van,
  .page-home #kontakt {
    margin-top: calc(1.35rem + 30px);
  }

  body:not(.page-home) .section {
    margin-top: calc(1.15rem + 24px);
    padding: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .content {
    animation: none;
  }

  .side-nav,
  .nav-sub-links {
    transition: none;
  }
}

