/* ====== Reset & Base ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --brand-red: #c00000;
  --brand-red-dark: #900000;
  --text: #000;
  --muted: #555;
  --bg-light: #f9f9f9;
  --border: #ddd;
  --container: 1320px;
  --carousel-gap: 16px;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,"Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: #fff;
}

.inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ====== Top-Bar (nicht sticky) ====== */
.top-bar {
  background: var(--brand-red);
  color: #fff;
  padding: 9px 0;
  font-size: 0.95rem;
  position: relative;
  z-index: 900;
}
.contact-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.icon-text { display: inline-flex; align-items: center; gap: 8px; color: #fff; white-space: nowrap; }
.icon { fill: #fff; display: inline-block; }
.contact-bar a { color: #fff !important; text-decoration: none; }
.contact-bar a:hover { text-decoration: underline; }

/* ====== Header / Nav (sticky) ====== */
.main-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10000;
  border-bottom: 1px solid var(--border);
}
.main-header.is-fixed{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  width: 100%;
}
body.sticky-has-fixed{ padding-top: var(--header-spacer, 0px); }

.breadcrumb,
.services,
.projects,
.about,
.contact-info,
.contact-form {
  position: relative;
  z-index: 1;
}

.header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Logo | NAV | CTA/Burger */
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  position: relative; /* Referenz fürs Dropdown */
}

/* ====== Logo (SVG per CSS Background) ====== */
.logo { justify-self: start; display: flex; align-items: center; background: transparent; }
.logo-link{
  display: block;
  width: 220px; height: 80px;
  background: url('../img/Altenburg-Logo.svg') no-repeat center / contain;
}
@media (max-width: 640px){
  .logo-link{ width: 180px; height: 40px; }
}

/* ====== Navigation ====== */
.main-nav { justify-self: center; position: static; overflow: visible; }
.main-nav ul { list-style: none; display: flex; gap: 24px; }
.main-nav a {
  text-decoration: none; color: #000; font-weight: 500;
  transition: color .2s ease; padding: 8px 6px; display: inline-block;
}
.main-nav a:hover { color: var(--brand-red); }

/* ====== CTA ====== */
.cta {
  justify-self: end;
  background: var(--brand-red); color: #fff;
  padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600;
  transition: background .2s ease, transform .1s ease;
}
.cta:hover { background: var(--brand-red-dark); }

/* ====== Burger ====== */
.header-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }

.burger {
  display: none;
  width: 28px; height: 22px;
  padding: 0; margin: 0;
  border: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  flex-direction: column; gap: 5px;
  z-index: 4001;
}
.burger span {
  display: block; height: 3px; border-radius: 2px; background: #000;
  transition: transform .3s ease, opacity .2s ease;
}
.burger.is-active span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2){ opacity: 0; }
.burger.is-active span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* Desktop-Menü */
.main-nav .menu { list-style: none; display: flex; gap: 24px; }

/* ====== Mobil-Menü ====== */
@media (max-width: 992px){
  .burger { display: flex; }
  .cta { display: none; }
  .main-nav .menu { display: none; }

  .main-nav .menu.is-open{
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    width: 100%;
    min-width: 200px;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    z-index: 3500;
    padding: 0; margin: 0;
  }
  .main-nav .menu.is-open li { border-bottom: 1px solid #eee; background: #fff; }
  .main-nav .menu.is-open li:last-child { border-bottom: none; }
  .main-nav .menu.is-open a { display: block; padding: 14px 20px; color: #000; }
}

/* ====== Hero ====== */
.hero {
  background: url('../img/dachdecker-background.jpg') center center/cover no-repeat;
  color: #fff;
}
.hero-overlay { background: rgba(0,0,0,.5); padding: 48px 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.hero-left h1 { font-size: 2.6rem; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; }
.hero-left p { margin: 4px 0; }
.hero-right {
  background: #fff; color: #000;
  border-radius: 10px; padding: 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.form-title { color: var(--brand-red); font-size: 1.35rem; font-weight: 700; margin-bottom: 12px; }

.hero h1,
.hero h2 { text-transform: uppercase; }

.hero-phone {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 600;
}
.hero-phone .icon { fill: #fff; }
.hero-phone a { color: #fff; text-decoration: none; }
.hero-phone a:hover { text-decoration: underline; }
.hero-phone .hero-hours { font-size: 0.9rem; font-weight: 400; margin-left: 12px; color: #ddd; }

/* ====== Breadcrumb ====== */
.breadcrumb {
  background: #f5f5f5;
  font-size: 0.95rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;                  /* horizontal scroll */
  -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
  scroll-snap-type: x mandatory;     /* Scroll Snap aktivieren */
  position: relative;
}

/* Scroll-Hinweis: Schatten an den Rändern */
.breadcrumb::before,
.breadcrumb::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  pointer-events: none;             /* lässt Scrollen zu */
}

.breadcrumb::before {
  left: 0;
  background: linear-gradient(to right, #f5f5f5 0%, rgba(245, 245, 245, 0) 100%);
}

.breadcrumb::after {
  right: 0;
  background: linear-gradient(to left, #f5f5f5 0%, rgba(245, 245, 245, 0) 100%);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;                 /* keine Zeilenumbrüche */
  gap: 6px;
  padding: 0 10px;                   /* etwas Abstand zu den Schatten */
}

.breadcrumb li {
  color: var(--muted);
  white-space: nowrap;                /* verhindert, dass Text umbricht */
  scroll-snap-align: start;          /* jedes Item „snapt“ am Start */
}

.breadcrumb li+li:before {
  content: "›";
  margin: 0 6px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--brand-red);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}


/* Hero Intro mit Logo links */
.hero-intro { display: flex; align-items: flex-start; gap: 20px; margin-top: 20px; }
.hero-logo { width: 80px; height: auto; flex-shrink: 0; }
.hero-text { flex: 1; }
.hero-hours { margin-left: 10px; font-size: 0.95rem; color: var(--muted); }

@media (max-width: 640px) {
  .hero-intro { flex-direction: column; align-items: center; text-align: center; }
  .hero-logo { margin-bottom: 12px; }
}

/* ====== Formular ====== */
form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input, select, textarea {
  width: 100%; padding: 12px 12px;
  border: 1px solid #ccc; border-radius: 6px;
  font-size: 1rem; font-family: inherit; color: #333; background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
select {
  appearance: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='M4 6l4 4 4-4' fill='gray'/></svg>") no-repeat right 12px center / 16px;
  color: #666;
}
button[type="submit"] {
  background: var(--brand-red); color: #fff; border: none;
  padding: 12px 18px; border-radius: 8px; font-weight: 700; cursor: pointer;
  transition: background .2s ease, transform .05s ease;
}
button[type="submit"]:hover { background: var(--brand-red-dark); }
.privacy-hint { font-size: .85rem; color: #555; margin-top: -4px; }

/* ====== Services ====== */
.services { background: #fff; color: #000; padding: 56px 0; }
.services h2 { font-size: 1.9rem; font-weight: 700; margin-bottom: 24px; text-align: left; }
.service-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.service-buttons button {
  background: #f5f5f5; color: #000; border: 1px solid #ccc;
  padding: 10px 14px; border-radius: 8px; font-size: 1rem;
  cursor: pointer; transition: all .2s ease;
}
.service-buttons button:hover { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }

/* ====== Projekte / Carousel (final) ====== */

/* ====== Projekte / Carousel ====== */


.projects{
  background: var(--bg-light);
  color: #000;
  padding: 56px 0;
}
.projects h2{
  font-size: 1.9rem;
  margin-bottom: 20px;
  text-align: left;
}

.carousel-wrapper{
  position: relative;
  overscroll-behavior-x: contain;
  width: 100%;
}

.carousel{
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  gap: var(--carousel-gap);
  overflow-x: auto;
  padding: 8px 0 12px;

  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  -webkit-overflow-scrolling: touch;

  /* WICHTIG: size-containment raus */
  contain: content;
  min-width: 0;

  /* Desktop: 3 Kacheln */
  grid-auto-columns: calc((100% - 2*var(--carousel-gap)) / 3);
}

/* Scrollbar dezent */
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* === Einzelne Karten === */
.carousel-item{
  min-width: 0;
  scroll-snap-align: start;
  background:#fff;
  border:1px solid #eee;
  border-radius:10px;
  padding:14px;
  box-shadow:0 3px 12px rgba(0,0,0,.08);
  transition: box-shadow .2s ease, transform .15s ease;
  display:flex;
  flex-direction:column;
  min-height:100%;
}
.carousel-item:hover{
  box-shadow:0 6px 18px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

/* Vorher/Nachher */
.before-after{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:10px;
}
.before-after figure{
  position:relative;
  margin:0;
  background:#f2f2f2;
  border-radius:8px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.before-after img{
  width:100%;
  aspect-ratio:16/10;
  object-fit:cover;
  display:block;
  border-radius:8px;
}
.before-after figcaption{
  position:absolute;
  left:8px; top:8px;
  z-index:1;
  background:rgba(0,0,0,.6);
  color:#fff;
  font-size:.8rem;
  padding:4px 8px;
  border-radius:4px;
}

/* Typo */
.project-title{ font-size:1.05rem; margin:6px 0 4px; color:#000; }
.carousel-item p{ font-size:.95rem; color:#000; }
.project-meta{ margin:2px 0; font-size:.95rem; color:#000; }
.project-meta strong{ font-weight:700; }

/* Nur Bilder sind Links – Texte bleiben neutral */
.project-link{
  display:block;
  text-decoration:none;
  color:inherit;
}
.project-link:hover .before-after figure img{
  transform: scale(1.01);
  transition: transform .2s ease;
}

/* Sicherheit: Links im Item neutral */
.projects .carousel-item a,
.projects .carousel-item a:hover,
.projects .carousel-item a:focus{
  color: inherit;
  text-decoration: none;
}

/* === Pfeile links/rechts === */
.carousel-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:42px; height:42px;
  border:none;
  border-radius:50%;
  background:#fff;
  box-shadow:0 4px 14px rgba(0,0,0,.15);
  cursor:pointer;
  font-size:22px;
  line-height:42px;
  text-align:center;
  color:#333;
  transition: background .2s ease, transform .1s ease, opacity .2s ease;
  z-index:2;
}
.carousel-btn:hover{
  background:#f4f4f4;
  transform:translateY(calc(-50% - 1px));
}
.carousel-btn.prev{ left:-6px; }
.carousel-btn.next{ right:-6px; }
.carousel-btn:disabled{
  opacity:.35;
  cursor:default;
  pointer-events:none;
}

/* === Mobil: 1 Kachel === */
@media (max-width: 640px){
  .carousel{ grid-auto-columns: 100%; }
}



/* ====== Über uns ====== */
.about { background: #fff; color: #000; padding: 56px 0; }
.about h2 { font-size: 1.9rem; margin-bottom: 16px; text-align: left; }
.about p { margin-bottom: 16px; }

/* ====== Footer ====== */
.site-footer{ background: #121212; color: #eee; }
.site-footer a{ color: #fff; text-decoration: none; }
.site-footer a:hover{ color: var(--brand-red); text-decoration: underline; }

.footer-grid{
  display: grid;
  gap: 28px;
  padding: 48px 0 28px;
  grid-template-columns: 1.2fr 1fr 1fr 0.4fr; /* Brand | Kontakt | Hours | Nav */
}
.site-footer .inner { padding-left: 20px; padding-right: 20px; }

/* Footer-Logo als Background + Filter (robust) */
.footer-brand .footer-logo{
  width: 200px; height: 52px; display: block; margin-bottom: 10px;
  background-image: url('../img/Altenburg-Logo.svg');
  background-repeat: no-repeat; background-position: left center; background-size: contain;
  filter: brightness(0) invert(1); /* Schwarz->Weiß */
}
.footer-brand .footer-logo:hover{ filter: invert(1) brightness(1.3); }

.footer-tagline{ color: #cfcfcf; font-size: .95rem; line-height: 1.5; }
.footer-social{ margin-top: 12px; display: flex; gap: 10px; }
.footer-social .social{
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: #3b5998; color: #fff; transition: background .2s ease, color .2s ease;
}
.footer-social .social:hover{ background: var(--brand-red); color: #fff; }
.site-footer h3{ font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; color: #fff; margin-bottom: 10px; }

.footer-item{ display: flex; align-items: center; gap: 10px; margin: 8px 0; color: #e6e6e6; }
.footer-item .icon{ width: 18px; height: 18px; fill: #fff; opacity: .9; }

.footer-hours .hours{ list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; width:70%; }
.footer-hours .hours li{ display: grid; grid-template-columns: 1fr auto; gap: 12px; color: #e6e6e6; font-size: .95rem; }
.footer-hours .hours li span:last-child{ color: #fff; }

.footer-nav ul{ list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-nav a{ color: #eaeaea; }
.footer-nav a:hover{ color: #fff; }

.footer-bottom{ border-top: 1px solid rgba(255,255,255,.1); background: #0c0c0c; color: #cfcfcf; padding: 14px 0; }
.footer-bottom-row{ display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .95rem; }
.footer-bottom-row .madeby a{ color: #eaeaea; }
.footer-bottom-row .madeby a:hover{ color: var(--brand-red); }

/* Accessible helper */
.sr-only{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ====== Responsive Footer ====== */
@media (max-width: 992px){
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .footer-grid{ grid-template-columns: 1fr; }
  .footer-bottom-row{ flex-direction: column; text-align: center; }
}

/* ====== Responsive Global ====== */
@media (max-width: 992px){
  .main-nav ul { display: none; }
  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px; height: 22px; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer;
    -webkit-appearance: none; appearance: none; z-index: 4001;
  }
  .burger span{
    display: block !important; width: 100% !important; height: 3px !important; background-color: #000 !important;
    border-radius: 2px; line-height: 0; font-size: 0;
  }
  .cta { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px){
  .contact-bar{ justify-content: center; align-items: center; gap: 1.5rem; flex-wrap: nowrap; }
  .contact-bar > .icon-text { display: none; }
  .contact-bar > .icon-text.phone,
  .contact-bar > .icon-text.emergency { display: inline-flex; align-items: center; gap: 6px; }
  .contact-bar > .icon-text.phone span,
  .contact-bar > .icon-text.emergency span { display: inline; color: #fff; }
  .logo { margin-left: 12px; }
  .burger { margin-right: 12px; }
  .hero-left h1 { font-size: 2rem; }
  .projects h2, .services h2, .about h2 { font-size: 1.6rem; }
}

/* ====== Leistungs-Links (Details & Schwerpunkte) – mit SVG-Icon ====== */
.about a{
  color: var(--brand-red);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
  transition: color .2s ease;
}
.about a::before{
  content: "";
  display: inline-block;
  width: 1em; height: 1em; flex: 0 0 auto;
  background-repeat: no-repeat; background-size: contain; background-position: center;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'>\
<path d='M9 6l6 6-6 6' fill='none' stroke='%23c00000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>");
  transform: translateY(1px);
}
.about a:hover{ color: var(--brand-red-dark); text-decoration: underline; }
.about a:hover::before{
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'>\
<path d='M9 6l6 6-6 6' fill='none' stroke='%23900000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>");
}

/* ====== Projekt-Kachel-Raster (Projektseiten) ====== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.project-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
  transition: transform .2s ease;
}
.project-card:hover { transform: translateY(-3px); }
.project-card figure { margin: 0 0 12px 0; }
.project-card img { width: 100%; height: auto; border-radius: 6px; display: block; }
.project-card figcaption { font-size: .9rem; color: var(--muted); margin-top: 4px; }

/* Projekte-Raster: einheitliche Bildgröße */
.project-grid .project-card figure{
  /* feste, einheitliche Fläche */
  aspect-ratio: 16 / 10;     /* ggf. 4/3 wählen, wenn dir das besser gefällt */
  background: #f2f2f2;       /* grauer Hintergrund für kleinere/hellere Bilder */
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 12px 0;
  display: block;
}

.project-grid .project-card figure img{
  width: 100%;
  height: 100%;
  object-fit: cover;         /* füllt die Fläche ohne Verzerren */
  display: block;
}

/* Einheitliche Größe für Detailbilder in Projektseiten (p1–p6) */
.project-grid .project-card figure {
  aspect-ratio: 16 / 10;      /* gleichmäßige Fläche */
  background: #f2f2f2;        /* neutraler Hintergrund */
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 12px 0;
  display: block;
}

.project-grid .project-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* Bild füllt die Fläche ohne zu verzerren */
  display: block;
  border-radius: 8px;
}

/* Auf Projekte-Seiten keine Pfeile vor Links */
.projekte-page .about a::before {
  content: none;
}

.about a.project-link::before {
  content: none;
}


/* ====== Kontaktbereich ====== */
.contact-info a { color: var(--brand-red); font-weight: 600; text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

/* ---------- MOBILE ANPASSUNG HERO-BEREICH ---------- */
@media (max-width: 768px) {

  /* Uhrzeit ausblenden */
  .hero-phone .hero-hours {
    display: none;
  }

  /* Telefonzeile: Symbol und Nummer nebeneinander */
  .hero-phone {
    display: flex;
    flex-direction: row; /* Symbol und Nummer in einer Zeile */
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }

  /* SVG etwas kleiner */
  .hero-phone svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* Telefonnummer etwas größer */
  .hero-phone a {
    font-size: 1.2em;
    color: inherit;
    text-decoration: none;
  }
  .hero-text p {
    text-align: left;
  }
}

