/* =====================================================================
   Template "gerster" – template.css
   Nachbau der Aufmachung von gerster-holzbau.de ohne Framework:
   weißer Kopf mit Logo und Social-Links, feste Navigation links (260 px),
   Inhalt auf hellgrauer Fläche in weißen Karten, roter Akzent #a01515.
   ===================================================================== */

:root {
  --g-accent: #a01515;
  --g-accent-dark: #7d1010;
  --g-text: #555555;
  --g-heading: #222222;
  --g-muted: #8a8f94;
  --g-bg: #ffffff;
  --g-surface: #f8f9fa;
  --g-surface-2: #eef0f2;
  --g-border: #e3e6e8;
  --g-font-body: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --g-font-head: "Quicksand", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --g-header-h: 84px;
  --g-nav-w: 260px;
  --g-radius: 10px;
  --g-radius-sm: 6px;
  --g-shadow: 0 6px 24px rgba(20, 24, 30, 0.08);
  --g-content-max: 1240px;
  color-scheme: light;
}

/* --- Grundlagen ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  font-family: var(--g-font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--g-text);
  background: var(--g-bg);
}
img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--g-accent); text-decoration: none; }
a:hover, a:focus { color: var(--g-accent-dark); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--g-accent); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--g-border); margin: 1.5rem 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--g-font-head);
  color: var(--g-heading);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}
h1 { font-size: 1.9rem; color: var(--g-accent); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
h4, h5, h6 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.3em; }
figure { margin: 0; }
figcaption { font-size: 0.9rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--g-border); text-align: left; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--g-accent); color: #fff; padding: 0.5rem 1rem; border-radius: var(--g-radius-sm);
}
.skip-link:focus { left: 8px; }

/* --- Buttons ---------------------------------------------------------- */
.btn, .btn-primary, .btn-secondary, button.btn {
  display: inline-block;
  font-family: var(--g-font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.3;
  padding: 0.6rem 1.9rem;
  border-radius: var(--g-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-primary, button.btn-primary { background: var(--g-accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--g-accent-dark); color: #fff; text-decoration: none; }
.btn-secondary, button.btn-secondary { background: #fff; color: var(--g-accent); border-color: var(--g-accent); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--g-accent); color: #fff; text-decoration: none; }

/* --- Kopf -------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--g-header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.25rem 0 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--g-border);
}
.site-logo { display: inline-flex; flex-direction: column; justify-content: center; color: var(--g-heading); text-decoration: none; }
.site-logo:hover, .site-logo:focus { text-decoration: none; color: var(--g-heading); }
.site-logo img { width: auto; height: 60px; max-width: 320px; }
.site-logo-text { font-family: var(--g-font-head); font-weight: 700; font-size: 1.7rem; letter-spacing: 0.02em; }
.site-tagline { font-size: 0.72rem; color: var(--g-muted); }
.site-header-right { display: flex; align-items: center; gap: 1rem; }
.social-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.9rem; }
.social-links a { display: inline-flex; width: 34px; height: 34px; color: var(--g-accent); }
.social-links svg { width: 100%; height: 100%; fill: currentColor; }
.social-links a:hover, .social-links a:focus { color: var(--g-accent-dark); }

/* Hamburger (nur mobil sichtbar) */
.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 10px;
  background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: space-between;
}
.nav-toggle-bar { display: block; height: 3px; background: var(--g-heading); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(10.5px) 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(-10.5px) rotate(-45deg); }

/* --- Navigation links --------------------------------------------------- */
.site-nav {
  position: fixed; top: var(--g-header-h); bottom: 0; left: 0; z-index: 40;
  width: var(--g-nav-w);
  padding: 1.75rem 0 1.5rem;
  background: #fff;
  border-right: 1px solid var(--g-border);
  overflow-y: auto;
  font-family: var(--g-font-head);
}
.nav-close { display: none; }
.site-nav .mod-menu, .site-nav .mod-menu__sub { list-style: none; margin: 0; padding: 0; }
.site-nav .nav-item { position: relative; margin: 0; }
.site-nav .mod-menu > .nav-item { padding: 0; }
.site-nav .mod-menu__link,
.site-nav .mod-menu__heading,
.site-nav .mod-menu__separator {
  display: block;
  padding: 0.55rem 2.5rem 0.55rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--g-heading);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.site-nav .mod-menu__heading { cursor: default; }
.site-nav .mod-menu__link:hover,
.site-nav .mod-menu__link:focus,
.site-nav .nav-item.active > .mod-menu__link,
.site-nav .nav-item.current > .mod-menu__link { color: var(--g-accent); border-left-color: var(--g-accent); text-decoration: none; }
.site-nav .submenu-toggle {
  position: absolute; right: 1.25rem; top: 0.35rem;
  width: 28px; height: 28px; line-height: 1;
  background: none; border: 0; cursor: pointer;
  font-size: 1.3rem; font-weight: 400; color: var(--g-muted);
}
.site-nav .submenu-toggle[aria-expanded="true"] { color: var(--g-accent); }
.site-nav .mod-menu__sub { display: none; padding: 0.2rem 0 0.4rem; }
.site-nav .nav-item.open > .mod-menu__sub,
.site-nav .nav-item.active > .mod-menu__sub { display: block; }
.site-nav .mod-menu__sub .mod-menu__link { padding-left: 3.25rem; font-size: 0.88rem; font-weight: 500; color: var(--g-text); }
.site-nav .mod-menu__sub .mod-menu__link:hover,
.site-nav .mod-menu__sub .nav-item.current > .mod-menu__link { color: var(--g-accent); }
.nav-phone { display: none; margin: 1.5rem 2rem 0; }

/* --- Hauptbereich -------------------------------------------------------- */
.site-main {
  margin-left: var(--g-nav-w);
  padding: calc(var(--g-header-h) + 1.25rem) 1.5rem 2.5rem;
  min-height: 100vh;
}
.site-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; }
.site-cta .btn { font-size: 0.9rem; padding: 0.5rem 1.6rem; }
.site-hero { margin: 0 0 1.5rem; }
.site-hero img { width: 100%; border-radius: var(--g-radius); }
.site-content {
  background: var(--g-surface);
  border-radius: 20px;
  padding: 1.5rem;
  max-width: var(--g-content-max);
}
.site-content > .card { margin-bottom: 1.5rem; }
.site-content .alert { border-radius: var(--g-radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; background: #fff; border: 1px solid var(--g-border); }
.site-content .alert-success { border-color: #9cd4a8; }
.site-content .alert-danger, .site-content .alert-error { border-color: var(--g-accent); }

/* Modul-Chrome "card" und Joomla-Standardklassen */
.card { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 1.5rem; }
.card-header, .card .module-title { font-family: var(--g-font-head); font-weight: 700; font-size: 1.15rem; margin: 0 0 0.75rem; color: var(--g-heading); }
.card-body { padding: 0; }
.com-content-article, .com-content-article__body, .com-content-category, .com-contact { background: #fff; border-radius: var(--g-radius); padding: 1.75rem; box-shadow: var(--g-shadow); }
.com-content-article .page-header h1, .com-content-article .article-header h1 { margin-bottom: 1rem; }
.article-info, .com-content-article__body > .article-info { color: var(--g-muted); font-size: 0.85rem; }
.com-content-article .article-info-term { display: none; }
.com-content-article__body img:not([class]) { border-radius: var(--g-radius-sm); }
.com-content-article__body > p:first-of-type { margin-top: 0; }
.com-content-article__body > :last-child { margin-bottom: 0; }

/* --- Inhaltsbausteine (Klassen aus den Beitrags-HTML-Dateien) --------------- */

/* Startseite: Hero mit Buttons */
.hero { position: relative; margin: 0 0 1.5rem; }
.hero img { width: 100%; border-radius: var(--g-radius); }
.hero .cta { display: flex; gap: 0.6rem; margin: 1rem 0 0; }
.intro { text-align: center; margin: 0 auto 2rem; max-width: 760px; }
.intro h1 { color: var(--g-heading); margin-bottom: 0.2rem; }
.intro img { width: 100%; max-width: 760px; margin: 1rem auto; border-radius: var(--g-radius); }

/* Karten (Leistungen) */
.leistungen h2, .leistungsspektrum h2 { text-align: center; }
.karten {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 0 0 2rem;
}
.karten figure { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); overflow: hidden; display: flex; flex-direction: column; }
.karten figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.karten figcaption { padding: 1rem 1.25rem 1.25rem; text-align: center; font-size: 0.9rem; }
.karten figcaption h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.karten figcaption p { margin: 0; }

/* Leistungsspektrum: Bild + zentrierter Text in weißer Karte */
.leistungsspektrum { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); overflow: hidden; margin: 0 0 2rem; text-align: center; }
.leistungsspektrum img { width: 100%; }
.leistungsspektrum p { padding: 0 1.5rem; }
.leistungsspektrum p:first-of-type { padding-top: 1.5rem; }
.leistungsspektrum p:last-child { padding-bottom: 1.5rem; margin: 0; }

/* Handel: rote Box + Profilbleche-Liste links, Lagertext und Bilder rechts (Wrapper .handel-links / .handel-rechts) */
.handel { display: grid; grid-template-columns: minmax(220px, 30%) 1fr; gap: 1.5rem; align-items: start; margin: 0 0 1rem; }
.handel-box { background: var(--g-accent); color: #fff; padding: 1.25rem; border-radius: var(--g-radius-sm); margin: 0 0 1rem; }
.handel-box strong { color: #fff; }
.handel-liste { background: #fff; border-radius: var(--g-radius-sm); padding: 1rem 1.25rem; }
.handel-liste h3 { margin-bottom: 0.75rem; }
.handel-liste ul { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.handel-liste li::before { content: "○ "; color: var(--g-muted); }
.handel-rechts h2 { text-align: left; margin-top: 0; }
.handel-rechts hr { margin: 0 0 1rem; }
.handel-rechts img { width: 100%; border-radius: var(--g-radius-sm); margin-bottom: 1rem; }

/* Galerien (Produkte, Baustellen) */
.galerie {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 0 0 2rem;
}
.galerie figure { background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); overflow: hidden; }
.galerie figure a { display: block; }
.galerie figure img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.galerie figcaption { background: var(--g-accent); color: #fff; padding: 0.55rem 0.9rem; font-family: var(--g-font-head); font-weight: 600; font-size: 0.9rem; }
.galerie-bestellbar figure { background: var(--g-surface-2); box-shadow: none; }
.galerie-bestellbar figure img { object-fit: contain; padding: 0.75rem; }
.galerie:not(.baustellen) figure img { aspect-ratio: auto; }
.galerie.baustellen figure img { aspect-ratio: 1 / 1; }
.baustellen + h2, .galerie + h2 { margin-top: 0.5rem; }

/* Stellenanzeigen (Karriere): Bild links, Text rechts, bei jeder zweiten Stelle gespiegelt */
.stellen { display: grid; gap: 1.5rem; margin: 1.5rem 0 2rem; }
.stelle { display: grid; grid-template-columns: minmax(240px, 1fr) 1.4fr; gap: 1.5rem; align-items: center; background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 1.25rem; }
.stelle:nth-child(even) > img { order: 2; }
.stelle img { width: 100%; border-radius: var(--g-radius-sm); }
.stelle h2 { font-size: 1.2rem; }
.stelle-text > :last-child { margin-bottom: 0; }

/* Zeitstrahl (Über uns) */
.zeitstrahl { list-style: none; margin: 2rem 0; padding: 0; position: relative; }
.zeitstrahl::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--g-border); transform: translateX(-50%); }
.zeitstrahl li { position: relative; width: calc(50% - 2.5rem); margin: 0 0 2rem; background: #fff; border-radius: var(--g-radius); box-shadow: var(--g-shadow); padding: 1.25rem 1.5rem; }
.zeitstrahl li:nth-child(odd) { margin-right: auto; }
.zeitstrahl li:nth-child(even) { margin-left: auto; }
.zeitstrahl li::after { content: ""; position: absolute; top: 1.6rem; width: 12px; height: 12px; border-radius: 50%; background: var(--g-accent); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--g-accent); }
.zeitstrahl li:nth-child(odd)::after { right: calc(-2.5rem - 6px); }
.zeitstrahl li:nth-child(even)::after { left: calc(-2.5rem - 6px); }
.zeitstrahl .jahr { position: absolute; top: 1rem; background: var(--g-accent); color: #fff; font-family: var(--g-font-head); font-weight: 700; font-size: 0.85rem; padding: 0.25rem 0.9rem; border-radius: 4px; white-space: nowrap; }
.zeitstrahl li:nth-child(odd) .jahr { left: calc(100% + 4rem); }
.zeitstrahl li:nth-child(even) .jahr { right: calc(100% + 4rem); }
.zeitstrahl h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.zeitstrahl p { margin: 0; font-size: 0.92rem; }

/* Karte (Anfahrt) */
.karte { border-radius: var(--g-radius); overflow: hidden; margin: 0 0 1rem; }
.karte iframe { display: block; width: 100%; min-height: 420px; border: 0; }

/* --- Lightbox ------------------------------------------------------------ */
.lb { position: fixed; inset: 0; z-index: 90; background: rgba(15, 17, 20, 0.92); display: flex; align-items: center; justify-content: center; padding: 3rem 1rem; }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: calc(100vh - 7rem); width: auto; height: auto; border-radius: var(--g-radius-sm); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lb-caption { position: absolute; left: 0; right: 0; bottom: 1rem; text-align: center; color: #fff; font-family: var(--g-font-head); font-weight: 600; padding: 0 3rem; }
.lb-btn { position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lb-btn:hover, .lb-btn:focus { background: var(--g-accent); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

/* --- Fußbereich ----------------------------------------------------------- */
.site-footer { margin-left: var(--g-nav-w); background: var(--g-surface); border-top: 1px solid var(--g-border); padding: 2.5rem 1.5rem 1.5rem; font-size: 0.92rem; }
.site-footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: var(--g-content-max); }
.site-footer h3, .site-footer .card-header, .site-footer .module-title {
  font-size: 1rem; font-weight: 600; color: var(--g-text); padding-left: 0.8rem; margin-bottom: 1rem;
  border-left: 4px solid var(--g-accent); border-bottom: 1px solid var(--g-accent); padding-bottom: 0.4rem;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer iframe { width: 100%; min-height: 220px; border: 0; border-radius: var(--g-radius-sm); }
.site-footer-bottom { max-width: var(--g-content-max); margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--g-border); color: var(--g-muted); font-size: 0.85rem; }
.site-copyright { margin: 0; }

/* Nach oben */
.back-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45;
  width: 44px; height: 44px; border-radius: 50%; background: var(--g-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--g-shadow);
}
.back-top svg { width: 22px; height: 22px; fill: currentColor; }
.back-top:hover, .back-top:focus { background: var(--g-accent-dark); color: #fff; }
.back-top[hidden] { display: none; }

/* --- Formulare (Kontakt, Login) -------------------------------------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], textarea, select {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--g-border); border-radius: var(--g-radius-sm); font: inherit; color: var(--g-heading); background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: var(--g-accent); outline: none; box-shadow: 0 0 0 3px rgba(160, 21, 21, 0.15); }
.form-row, .control-group { margin-bottom: 1rem; }
label, .control-label { display: block; font-weight: 600; margin-bottom: 0.3rem; color: var(--g-heading); }
.com-contact__form fieldset { border: 0; padding: 0; margin: 0; }
.com-contact__form legend { font-family: var(--g-font-head); font-weight: 700; margin-bottom: 1rem; }
.com-contact__form button[type="submit"], .com-contact__form .btn, form .btn-primary { background: var(--g-accent); color: #fff; }
.invalid { border-color: var(--g-accent) !important; }

/* --- Fehler- und Offline-Seite --------------------------------------------- */
.error-wrap { max-width: 640px; margin: 10vh auto; padding: 2rem; text-align: center; }
.error-code { font-family: var(--g-font-head); font-size: 5rem; font-weight: 700; color: var(--g-accent); margin: 0; line-height: 1; }
.error-details { text-align: left; font-size: 0.8rem; overflow: auto; background: var(--g-surface); padding: 1rem; border-radius: var(--g-radius-sm); margin: 1rem 0; }
.offline-logo { width: 240px; margin: 0 auto 1.5rem; }
.offline-login { max-width: 360px; margin: 2rem auto 0; text-align: left; }
.component-wrap { padding: 1.5rem; }

/* --- Responsiv -------------------------------------------------------------- */
@media (max-width: 1100px) {
  .handel { grid-template-columns: 1fr; }
  .zeitstrahl::before { left: 1rem; }
  .zeitstrahl li, .zeitstrahl li:nth-child(odd), .zeitstrahl li:nth-child(even) { width: auto; margin: 0 0 1.5rem 3.5rem; }
  .zeitstrahl li:nth-child(odd)::after, .zeitstrahl li:nth-child(even)::after { left: calc(-2.5rem - 6px); right: auto; }
  .zeitstrahl .jahr, .zeitstrahl li:nth-child(odd) .jahr, .zeitstrahl li:nth-child(even) .jahr { position: static; display: inline-block; margin-bottom: 0.5rem; }
}

@media (max-width: 991px) {
  :root { --g-header-h: 68px; }
  .site-header { padding: 0 0.75rem 0 1rem; }
  .site-logo img { height: 46px; }
  .nav-toggle { display: flex; order: 3; }
  .site-header-right { order: 2; }
  .social-links a { width: 28px; height: 28px; }
  .site-nav {
    width: min(320px, 85vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
    z-index: 60;
    top: 0; padding-top: 3.5rem;
  }
  .site-nav.is-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,0.25); }
  .nav-close { display: block; position: absolute; top: 0.5rem; right: 0.5rem; width: 44px; height: 44px; background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--g-heading); cursor: pointer; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,0.4); }
  .nav-backdrop[hidden] { display: none; }
  .nav-phone { display: inline-block; }
  .site-main, .site-footer { margin-left: 0; }
  .site-main { padding: calc(var(--g-header-h) + 1rem) 1rem 2rem; }
  .site-content { padding: 1rem; border-radius: 14px; }
  .site-footer-grid { grid-template-columns: 1fr; }
  .stelle { grid-template-columns: 1fr; }
  .stelle:nth-child(even) > img { order: 0; }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.3rem; }
  .com-content-article, .com-content-article__body, .com-content-category, .com-contact { padding: 1.25rem; }
  .karten, .galerie { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .karten { grid-template-columns: 1fr; }
  .site-cta .btn { flex: 1 1 auto; text-align: center; }
  .error-code { font-size: 3.5rem; }
}

@media print {
  .site-header, .site-nav, .nav-backdrop, .site-cta, .back-top, .lb { display: none !important; }
  .site-main, .site-footer { margin-left: 0; padding: 0; }
  .site-content, .com-content-article, .card { box-shadow: none; background: #fff; }
}
