/* ====================================
   Variablen & Basis
==================================== */

:root {
  --color-bg: #f1f1f1;
  --color-brown: #C9ADA7;
  --color-brown-dark: #6c4c3b;
  --color-text: #22223B;
  --color-accent: #020101;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Fira Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --spacing-section: 5rem;
  --spacing-section-small: 3rem;
  --radius-card: 12px;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 600;
  margin: 0 0 0.75rem;
  font-style: normal;
  color: var(--color-text);
}

h2 {
  text-align: center;
  font-size: 42px;
  margin-top: 1rem;
}

h3 {
  font-size: 24px;
}

p {
  font-weight: 300;
  margin: 0 0 1rem;
}


/* ====================================
   Layout: Container & Sections
==================================== */

.container {
  width: min(1100px, 100% - 2.5rem);
  margin: 0 auto;
}

.section {
  padding: 1.5em 0;
}

.section-brown {
  background: var(--color-brown);
  color: #fff;
}

.section-brown h2,
.section-brown h3,
.section-brown h5,
.section-brown p {
  color: var(--color-text);
}

.section-brown h3 {
  font-size: 2em;
}

.section-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  margin: var(--spacing-section-small) 0;
  border-color: #22223B;
}


/* ====================================
   Intro
==================================== */

.intro {
  min-height: 60vh;
  /* 50 % der Viewport-Höhe */
  margin-top: 5%;
  margin-bottom: 2, 5%;
  align-items: center;
  /* vertikal zentrieren */
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.intro-text h1 {
  font-size: clamp(5rem, 5vw, 5rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.intro-text {
  width: 80%;
}

/* Bild + Logo überlagert */
.intro-image-wrapper {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
}

.intro-image {
  width: 80%;
}

/* ====================================
   News
==================================== */

#news h2 {
  margin-bottom: 1.5rem;
}

.news-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 5rem;
  align-items: flex-start;
}

.news-cover {
  display: flex;
  justify-content: flex-end;
}

.news-cover img {
  max-width: 80%;
  height: auto;
  margin-top: 30px;
}

.news-text {
  max-width: 80%;
  height: auto;
}

.news-note {
  margin-top: 1.25rem;
  font-weight: 400;
  font-family: var(--font-serif);
}

.btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.6rem 1.5rem;
  border-radius: 2px;
  background: #4A4E69;
  color: var(--color-brown);
  text-decoration: none;
  font-weight: 400;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease,
    transform 0.1s ease, box-shadow 0.1s ease;
  max-width: 300px;
  margin: 0 auto;
}

.btn:hover {
  background: var(--color-brown-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}


/* 3x3 Bildgrid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: 70%;
  margin: 2.5rem auto;

}

.image-grid-item {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  /* quadratische Zelle */
  object-fit: cover;
  cursor: pointer;
}

/* Bild als Hintergrund via object-fit lösen */
.image-grid-item {
  height: auto;
  padding-bottom: 0;
}

/* Popup-Overlay */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.image-modal-overlay.is-open {
  display: flex;
}

/* Popup-Box */
.image-modal {
  position: relative;
  width: 1180px;
  max-width: 90vw;
  height: auto;
  max-height: none;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Bild im Popup */
.image-modal-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 90vh;
  /* damit es in den Viewport passt */
  object-fit: contain;
}

/* Close-Button */
.image-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 3.5rem;
  line-height: 1;
  cursor: pointer;
}

/* Pfeile */
.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  /* kein Hintergrund */
  color: #fff;
  font-size: 3.5rem;
  cursor: pointer;
}

.image-modal-prev {
  left: 0.75rem;
}

.image-modal-next {
  right: 0.75rem;
}

/* ====================================
   Subsection
==================================== */
.divider {
  margin: 5%;
  stroke: var(--color-text);
}

.sub-section {
  margin-top: var(--spacing-section-small);
  width: 70%;
  margin-left: auto;
  margin-right: auto;
}

.sub-heading {
  margin-bottom: 0.5rem;
}

.sub-subheading {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Desktop: zwei Spalten */
.sub-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start;
}

/* Standard-Reihenfolge: links Text, rechts Bild */
.sub-text {
  order: 1;
}

.sub-image {
  order: 2;
}


.text-block {
  width: 90%;
}

/* Zitate-Carousel */
.quote-carousel {
  width: 70%;
  max-width: 900px;
  margin: 1rem auto 0;
  overflow: hidden;
  position: relative;
}

.quote-carousel-track {
  display: flex;
  gap: 1.5rem;
  box-sizing: border-box;
}

.quote-slide {
  flex: 0 0 calc((100% - 2 * 1.5rem) / 3);
  box-sizing: border-box;
}


.quote-slide img {
  width: 100%;
  height: auto;
  display: block;
}


/* ====================================
   Projekte
==================================== */

#projects h2 {
  margin-bottom: 2rem;
}

/* 3er-Grid */
.projects-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem;
}

.project-card-minimal {
  background: transparent;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
}

.project-card-minimal img {
  margin-bottom: 0.75rem;
}

.project-card-minimal h3 {
  font-size: 1.2rem;
  margin: 0 0 0.25rem;
}

.project-card-minimal p {
  font-size: 0.95rem;
  margin: 0;
}


/* Popup-Overlay */

.project-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.project-modal-overlay.is-open {
  display: flex;
}

.project-modal {
  width: 80vw;
  height: auto;
  max-width: 100%;
  min-height: 320px;
  background: #eae3dc;
  border-radius: 2px;
  position: relative;
  box-sizing: border-box;
}

.project-modal-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 1.75rem;
  height: 100%;
}

.project-modal-image {
  position: relative;
}

.project-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pfeile */
.project-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 2;
}

.project-modal-prev {
  left: 0.5rem;
}

.project-modal-next {
  right: 0.5rem;
}

.project-modal-content {
  width: 80%;
  height: auto;
  padding: 1rem 1rem 0;
}

.project-modal-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.8rem;
}

.project-modal-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

.project-modal-more {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;

}

/* Close-Button */

.project-modal-close {
  position: absolute;
  right: 0.5rem;
  z-index: 10000;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 3.5rem;
  line-height: 1;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}


/* ====================================
   CTA
==================================== */

.section-cta {
  background: var(--color-text);
  color: var(--color-text);
  text-align: center;
  margin-top: 4.5em;
  border-radius: 2px;
}

.section-cta h3 {
  color: var(--color-brown);
}

.cta-inner {
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}


/* ====================================
   Footer
==================================== */

.logo {
  width: 50%;
  aspect-ratio: 3 / 2; 
  object-fit: contain;
  margin: 8rem auto;
}

.site-footer {
  padding: 1.5rem 0 2rem;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.6);
}


/* ====================================
   Responsive
==================================== */

@media (max-width: 900px) {

  .intro-grid,
  .news-grid,
  .two-column,
  .projects-grid-3,
  .cta-inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section {
    padding: 1.5rem;
  }

  .header-inner {
    justify-content: center;
  }

  .intro {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .intro-grid {
    gap: 0rem;
    /* Abstand zwischen Bild & Text verkleinern */
    width: 80%;
    margin-top: 0;
    margin-top: 0;
  }

  .intro-image-wrapper {
    max-width: 420px;
    /* Bild etwas kleiner */
    justify-content: flex-start;
    /* zentriert, kleiner Abstand nach unten */
  }

  .intro-text {
    width: 100%;
    margin-top: 0.3rem;
  }

  .news-cover {
    justify-content: center;
  }

  .news-cover img {
    max-width: 40%;
  }

  .news-text {
    margin: 0 auto;
  }

  .quote-carousel {
    width: 100%;
  }

  .quote-carousel .quote-slide.is-active {
    display: block;
  }

  .quote-slide {
    flex: 0 0 calc((100% - 1 * 1.5rem) / 2);
  }

  .sub-section {
    width: 100%;
  }

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

  .project-modal {
    max-width: 50vw;
    max-height: 95%;
    height: auto;
  }

  .project-modal-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0;
  }

  .project-modal-content {
    width: 100%;
  }

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

  .image-modal {
    width: 90vw;
    height: 70vh;
  }

  .quote-carousel {
    width: 90%;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .container {
    width: min(100% - 1.75rem, 100%);
  }

  .carousel-track {
    animation-duration: 40s;
  }

  .intro {
    padding-bottom: 0.5rem;
  }

  .intro-logo-overlay {
    width: 24%;
    left: 6%;
    top: 8%;
  }

  .intro-text {
    width: 100%;
  }

  .intro-text h1 {
    font-size: clamp(3rem, 3vw, 3rem);
    line-height: 1.1;
    letter-spacing: 0.02em;
  }

  h2 {
    font-size: 30px;
  }

  .news-grid {
    gap: 1em;
  }

  .news-cover img {
    max-width: 60%;
  }

  .news-text {
    max-width: 100%;
  }

  .image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin: 3em 0;
    width: 100%;
    gap: 0.5em;
  }

  .image-modal {
    width: 95vw;
    height: 70vh;
  }

  .sub-section {
    width: 100%;
    padding-inline: 1.5rem;
    margin-top: 0;
  }

  .sub-layout {
    grid-template-columns: 1fr;
  }

  .sub-image {
    order: 1;
    width: 60%;
  }

  .sub-text {
    order: 2;
  }

  .quote-slide {
    flex: 0 0 100%;
  }

  .project-modal {
    max-width: 90vw;
  }

  .project-modal-content {
    width: 100%;
  }

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

  .logo {
    width: 60%;
  }
}