/* =========================================================
   Zimmerei H. Wiegandt – Hauptstylesheet
   ========================================================= */

:root {
  --wood: #74451f;
  --dark: #20231f;
  --cream: #f4f0e7;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--dark);
  line-height: 1.65;
  background: #fff;
}

body.lightbox-open {
  overflow: hidden;
}

a {
  color: var(--wood);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 2000;
  padding: 0.6rem 1rem;
  color: #fff;
  background: var(--wood);
}

/* Kopfbereich */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 1rem 1rem 0;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.header-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--max);
  margin: auto;
}

.header-logo {
  display: block;
  width: min(100%, 760px);
}

.header-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 145px;
  object-fit: contain;
}

.header-phone {
  margin: 0.35rem 0 0.8rem;
  font-size: 1.18rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 3vw, 3rem);
  max-width: var(--max);
  margin: auto;
  padding: 0.85rem;
  border-top: 1px solid #e5ddd4;
}

.site-header nav a {
  color: var(--dark);
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--wood);
}

.menu {
  display: none;
}

/* Startseiten-Hero */
.hero {
  padding: 7rem 1rem;
  color: #fff;
  background: linear-gradient(110deg, #30271f, #79512f);
}

.hero > div,
.section {
  max-width: var(--max);
  margin: auto;
}

.hero h1 {
  max-width: 850px;
  margin: 0.2rem 0 1rem;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 1.05;
}

.hero p {
  max-width: 740px;
  font-size: 1.15rem;
}

.eyebrow {
  color: #b87b46;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e5bd91;
}

.ghost {
  margin-left: 1rem;
  color: #fff;
}

.button {
  display: inline-block;
  padding: 0.7rem 1rem;
  color: #fff;
  text-decoration: none;
  background: var(--wood);
  border-radius: 0.35rem;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.button:hover,
.button:focus-visible {
  background: #5e3718;
  transform: translateY(-1px);
}

/* Allgemeine Inhalte */
.section {
  padding: 4.5rem 1rem;
}

.section h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
}

.prose {
  max-width: 850px;
}

.lead {
  font-size: 1.2rem;
}

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

.card {
  display: block;
  padding: 1.5rem;
  color: var(--dark);
  text-decoration: none;
  background: var(--cream);
  border: 1px solid #e0d7c9;
  border-radius: 0.5rem;
}

/* Leistungskacheln auf der Startseite: gesamte Kachel klickbar + Mouse-over */
.home-services .service-cards .card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.home-services .service-cards .card:hover,
.home-services .service-cards .card:focus-visible {
  transform: translateY(-3px);
  background-color: #f8f4ec;
  border-color: var(--wood);
  box-shadow: 0 10px 24px rgba(63, 43, 29, 0.12);
  outline: none;
}

.home-services .service-cards .card strong {
  display: inline-block;
  margin-top: auto;
  color: var(--wood);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25rem;
}

.home-services .service-cards .card:hover strong,
.home-services .service-cards .card:focus-visible strong {
  text-decoration-thickness: 2px;
}

.home-services-all {
  margin: 2rem 0 0;
  text-align: center;
}

/* Aufklappbare Bereiche */
details {
  padding: 1rem 0;
  border-bottom: 1px solid #ddd;
}

summary {
  font-weight: 700;
  cursor: pointer;
}

/* Galerien */
.project-gallery {
  margin-top: 3.5rem;
}

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

.gallery-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eee;
  border-radius: 0.45rem;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.035);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--wood);
  outline-offset: 3px;
}

.gallery-note {
  padding: 1rem;
  background: var(--cream);
  border-left: 4px solid var(--wood);
}

/* Lightbox */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  padding: 2.5rem 1rem;
  background: rgba(14, 12, 10, 0.94);
}

.lightbox figure {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  margin: 0;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  margin-top: 0.65rem;
  color: #fff;
  text-align: center;
}

.lightbox button {
  width: 56px;
  height: 56px;
  color: #fff;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 50%;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  background: var(--wood);
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem !important;
}

.lightbox-prev {
  grid-column: 1;
}

.lightbox-next {
  grid-column: 3;
}

.lightbox-count {
  position: absolute;
  bottom: 0.8rem;
  left: 50%;
  color: #fff;
  font-weight: 700;
  transform: translateX(-50%);
}

/* Rechtliche Seiten */
.legal-page h2 {
  margin-top: 2.5rem;
}

.legal-page p {
  max-width: 80ch;
}

.legal-warning {
  margin-top: 3rem;
  padding: 1.25rem;
  color: #33271d;
  background: #fff4df;
  border-left: 5px solid #a86422;
}

/* Fußbereich */
footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem max(1rem, calc((100% - var(--max)) / 2));
  color: #fff;
  background: var(--dark);
}

footer a {
  color: #fff;
}

/* Tablet */
@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Smartphone */
@media (max-width: 780px) {
  .header-logo img {
    max-height: 95px;
  }

  .menu {
    display: block;
    margin: 0 auto 0.6rem;
    padding: 0.55rem 1rem;
  }

  .site-header nav {
    display: none;
    flex-direction: column;
    text-align: center;
  }

  .site-header nav.open {
    display: flex;
  }

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

  .home-services .service-cards .card {
    min-height: auto;
  }

  .hero {
    padding: 5rem 1rem;
  }

  .ghost {
    display: inline-block;
    margin: 1rem 0 0;
  }

  footer {
    flex-direction: column;
    gap: 1rem;
  }

  .lightbox {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    padding: 3.5rem 0.3rem 2.5rem;
  }

  .lightbox button {
    width: 42px;
    height: 42px;
    font-size: 2.3rem;
  }

  .lightbox-image {
    max-height: calc(100vh - 7rem);
  }
}

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

  .button,
  .gallery-item img,
  .home-services .service-cards .card {
    transition: none;
  }

  .button:hover,
  .button:focus-visible,
  .home-services .service-cards .card:hover,
  .home-services .service-cards .card:focus-visible {
    transform: none;
  }
}
