/* =========================================================
   SECTIONS.CSS
   Zuständigkeit:
   - Globale Section-Regeln
   - Hero
   - Services
   - Portfolio
   - About
   - Contact
   - Portfolio-Unterseite
   - Responsive Verhalten dieser Bereiche

   Hinweis:
   - Wiederverwendbare Komponenten wie Buttons, Cards,
     Section-Head etc. liegen in components.css
   - Layout-Grundregeln wie Container, Grid, Wrapper etc.
     liegen idealerweise in layout.css
   ========================================================= */


/* =========================================================
   GLOBALE SECTION-REGELN
   ========================================================= */

section[id] {
  scroll-margin-top: calc(var(--header-height) - 11rem);
}

.section {
  padding-block: clamp(4rem, 8vw, 6rem);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
  padding-top: clamp(3rem, 5vw, 4rem);
}

.hero__inner {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  min-height: calc(100vh - var(--header-height) - 2rem);
}

.hero__content {
  display: grid;
  gap: var(--space-5);
  align-content: center;
}

.hero__eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.hero__title {
  max-width: 11ch;
  font-size: var(--text-hero);
}

.hero__text {
  max-width: 52ch;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-top: var(--space-2);
}

.hero__media {
  justify-self: end;
  width: min(100%, 520px);
  height: 500px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-2xl) - var(--space-3));
  background: var(--color-bg);
}


/* =========================================================
   SERVICES
   ========================================================= */

.services {
  background: transparent;
}

.services .section-head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.service-card {
  min-height: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-card);
  box-shadow: var(--shadow-sm);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-text-faint);
  box-shadow: var(--shadow-md);
}

.service-card__link {
  display: grid;
  gap: var(--space-3);
  height: 100%;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  color: inherit;
  text-decoration: none;
}

.service-card__title {
  font-size: var(--text-lg);
  line-height: 1.25;
}

.service-card__text {
  max-width: 34ch;
  color: var(--color-text-muted);
}


/* =========================================================
   PORTFOLIO
   Hinweis:
   - eigener Override für kompakteren unteren Abschluss
   - Button sitzt dadurch näher unter den Projektkacheln
   ========================================================= */

.portfolio {
  background: transparent;
  padding-bottom: 2rem;
}

.portfolio .section-head__title {
  max-width: 18ch;
  text-wrap: balance;
}

.portfolio__grid--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.portfolio__actions {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}


/* =========================================================
   ABOUT
   ========================================================= */

.about__inner {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.75fr);
}

.about__content {
  display: grid;
  gap: var(--space-4);
  align-content: center;
}

.about__text {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.about__media {
  min-height: 560px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-card);
  box-shadow: var(--shadow-md);
}

.about__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-2xl) - var(--space-3));
  background: var(--color-bg);
}


/* =========================================================
   CONTACT
   ========================================================= */

.contact__inner {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  padding: clamp(1.5rem, 2vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-card);
  box-shadow: var(--shadow-sm);
}

.contact__content {
  display: grid;
  gap: var(--space-4);
}

.contact__text {
  max-width: 34ch;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.contact__info {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}


/* =========================================================
   PORTFOLIO PAGE
   ========================================================= */

.portfolio-page .section-head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.portfolio-page__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.portfolio-cta {
  padding-top: 0;
}


/* =========================================================
   RESPONSIVE ≤ 1023px
   ========================================================= */

@media (max-width: 1023px) {
  .hero__inner,
  .about__inner,
  .contact__inner {
    grid-template-columns: 1fr;
  }

  .services__grid,
  .portfolio__grid--3,
  .portfolio-page__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero__inner {
    min-height: auto;
  }

  .hero__media {
    justify-self: start;
    width: min(100%, 560px);
    height: 420px;
  }

  .about__media {
    min-height: 420px;
  }

  .contact__info {
    justify-content: flex-start;
  }
}


/* =========================================================
   RESPONSIVE ≤ 699px
   ========================================================= */

@media (max-width: 699px) {
  .section {
    padding-block: clamp(3rem, 10vw, 4.5rem);
  }

  .hero__title {
    max-width: 12ch;
  }

  .hero__text,
  .about__text,
  .contact__text {
    font-size: var(--text-base);
  }

  .services__grid,
  .portfolio__grid--3,
  .portfolio-page__grid {
    grid-template-columns: 1fr;
  }

  .service-card__text {
    max-width: none;
  }

  .hero__media {
    height: 320px;
  }

  .about__media {
    min-height: 320px;
  }

  .contact__inner {
    padding: var(--space-5);
  }

  .portfolio {
    padding-bottom: 1.5rem;
  }

  .portfolio .section-head__title {
    max-width: 10ch;
  }

  .portfolio__actions {
    margin-top: 0.5rem;
  }
}