/* =================================================================
   UPGRADE Okt. 2026: Foto-Hero, Referenz-Galerie mit Filter,
   Aktuelles aus dem Engagement, Lightbox, mobile Aktionsleiste
   ================================================================= */

/* ---------- Hero mit echten Baustellenfotos ---------- */
.hero-quick {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 14px;
  color: rgba(255,255,255,0.62);
  opacity: 0;
  animation: heroIn 1s var(--ease) 1s forwards;
}
.hero-quick a { color: var(--white); font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 1px; }
.hero-quick a:hover { border-color: var(--red); }
.hero-quick .dot { width: 6px; height: 6px; border-radius: 50%; background: #3fbf6f; box-shadow: 0 0 0 4px rgba(63,191,111,0.18); display: inline-block; margin-right: 8px; }

.hero-collage {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: max(24px, calc((100vw - var(--container)) / 2 + 24px));
  width: min(40vw, 600px);
  aspect-ratio: 6 / 6.4;
  transform: translateY(-46%);
}
.hc {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--jet-blue-2);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.65);
  opacity: 0;
  animation: hcIn 1.2s var(--ease) forwards;
}
.hc img { width: 100%; height: 100%; object-fit: cover; animation: hcZoom 18s ease-in-out infinite alternate; }
.hc-1 { left: 0; top: 0; width: 64%; height: 58%; animation-delay: 0.45s; }
.hc-2 { right: 0; top: 14%; width: 40%; height: 52%; animation-delay: 0.65s; }
.hc-3 { left: 14%; bottom: 0; width: 58%; height: 38%; animation-delay: 0.85s; }
.hc-2 img { animation-delay: -6s; }
.hc-3 img { animation-delay: -12s; }
.hc::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  pointer-events: none;
}
.hc-stamp {
  position: absolute;
  right: 4%;
  bottom: 8%;
  background: var(--red);
  color: var(--white);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border-radius: 2px;
  opacity: 0;
  animation: heroIn 1s var(--ease) 1.3s forwards;
  box-shadow: 0 18px 30px -16px rgba(0,0,0,0.6);
}
@keyframes hcIn { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes hcZoom { from { transform: scale(1); } to { transform: scale(1.09); } }
@media (min-width: 1025px) {
  .hero-has-collage h1 { font-size: clamp(3rem, 6.2vw, 6.2rem); }
  .hero-has-collage .hero-sub { max-width: 40ch; }
  .hero-has-collage .hero-inner > * { max-width: 50%; }
}
@media (max-width: 1024px) {
  .hero-collage {
    position: relative;
    top: auto; right: auto;
    transform: none;
    width: 100%;
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 10px;
    margin-top: 40px;
    padding: 0 24px;
  }
  .hc { position: relative; inset: auto !important; width: auto !important; height: 150px !important; }
  .hc-stamp { display: none; }
  .hero { flex-direction: column; justify-content: center; }
}
@media (max-width: 480px) {
  .hero-collage { grid-template-columns: 1.3fr 1fr; }
  .hc { height: 120px !important; }
  .hc-3 { display: none; }
}

/* ---------- Filter-Chips (Referenzen) ---------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -24px 0 32px;
}
.chip {
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.14);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { border-color: var(--jet-blue); }
.chip[aria-pressed="true"] { background: var(--jet-blue); border-color: var(--jet-blue); color: var(--white); }
.chip .n { opacity: 0.55; margin-left: 4px; font-weight: 500; }

/* ---------- Referenzen als Mauerwerk-Galerie (keine Löcher) ---------- */
.refs-grid.refs-masonry {
  display: block;
  columns: 3 300px;
  column-gap: 18px;
}
.refs-masonry .ref-card {
  break-inside: avoid;
  margin: 0 0 18px;
  width: 100%;
  cursor: zoom-in;
}
.refs-masonry .ref-photo { position: relative; inset: auto; }
.refs-masonry .ref-photo img { height: auto; aspect-ratio: var(--ar, 4/3); }
.refs-masonry .ref-card[hidden] { display: none; }
.refs-more { margin-top: 28px; display: flex; justify-content: center; }
.btn-dark-outline {
  background: transparent;
  color: var(--jet-blue);
  border: 1px solid rgba(44,54,63,0.35);
}
.btn-dark-outline:hover { background: var(--jet-blue); color: var(--white); }

/* ---------- Aktuelles / Engagement ---------- */
.aktuell-section { background: var(--white); }
.aktuell-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; }
.aktuell-head .section-head { margin-bottom: 0; }
.aktuell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.aktuell-grid.n1 { grid-template-columns: minmax(0, 560px); }
.refs-more[hidden], .aktuell-section[hidden] { display: none; }
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(0,0,0,0.3); }
.news-card .news-img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--jet-blue); cursor: zoom-in; }
.news-card .news-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.news-card:hover .news-img img { transform: scale(1.04); }
.news-card .news-count {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(44,54,63,0.9); color: var(--white);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  padding: 6px 10px; border-radius: 100px;
}
.news-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.news-date { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.news-body h3 { font-size: 1.2rem; line-height: 1.2; }
.news-body p { color: var(--text-muted); font-size: 15px; }
.news-link { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 700; color: var(--red); display: inline-flex; gap: 6px; align-items: center; }
.news-link:hover { text-decoration: underline; }

/* Soziales: ausführliche Beiträge */
.posts { display: flex; flex-direction: column; gap: 28px; margin-top: 36px; }
.post {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px -32px rgba(0,0,0,0.35);
}
.post:nth-child(even) { grid-template-columns: 1fr 1.15fr; }
.post:nth-child(even) .post-media { order: 2; }
.post-media { display: grid; gap: 6px; background: var(--jet-blue); padding: 6px; }
.post-media.n1 { grid-template-columns: 1fr; }
.post-media.n2 { grid-template-columns: 1fr 1fr; }
.post-media.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-media.n3 .pm:first-child { grid-row: span 2; }
.post-media.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pm { position: relative; overflow: hidden; border-radius: 3px; min-height: 160px; cursor: zoom-in; background: var(--jet-blue-2); }
.post-media.n1 .pm { min-height: 340px; }
.pm img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform 0.6s var(--ease); }
.pm:hover img { transform: scale(1.04); }
.pm .more { position: absolute; inset: 0; background: rgba(44,54,63,0.72); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; }
.post-body { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.post-body h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.post-body p { color: var(--text-muted); white-space: pre-line; }
.posts-empty { color: var(--text-muted); }

@media (max-width: 1024px) {
  .post, .post:nth-child(even) { grid-template-columns: 1fr; }
  .post:nth-child(even) .post-media { order: 0; }
}
@media (max-width: 640px) {
  .aktuell-grid { grid-template-columns: 1fr; }
  .refs-grid.refs-masonry { columns: 1; }
  .post-media.n1 .pm { min-height: 240px; }
}

/* Teamfotos dynamisch (beliebige Anzahl) */
.team-strip.team-dyn { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.karriere-team-grid.team-dyn { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.team-dyn figure { cursor: zoom-in; }
@media (max-width: 640px) {
  .team-strip.team-dyn, .karriere-team-grid.team-dyn { grid-template-columns: 1fr 1fr; gap: 10px; }
  .team-dyn figcaption { font-size: 11px; }
}

/* ---------- Lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,19,23,0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.lb.open { opacity: 1; pointer-events: auto; }
.lb-fig { margin: 0; max-width: min(92vw, 1400px); max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-fig img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 4px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); }
.lb-cap { color: rgba(255,255,255,0.85); font-size: 15px; text-align: center; max-width: 70ch; }
.lb-cap .lb-n { color: rgba(255,255,255,0.45); margin-left: 10px; font-size: 13px; }
.lb-btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lb-btn:hover { background: var(--red); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb.single .lb-prev, .lb.single .lb-next { display: none; }
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}

/* ---------- Kontaktformular: Erfolg ---------- */
.form-done { display: none; text-align: left; }
.form-card.sent .form-grid, .form-card.sent .form-submit { display: none; }
.form-card.sent .form-done { display: flex; flex-direction: column; gap: 14px; }
.form-done h3 { font-size: 1.5rem; }
.form-done p { color: var(--text-muted); }
.form-done .form-done-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ---------- Mobile Aktionsleiste ---------- */
.mbar { display: none; }
@media (max-width: 768px) {
  .mbar {
    display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(44,54,63,0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.08);
    transform: translateY(110%);
    transition: transform 0.35s var(--ease);
  }
  .mbar.show { transform: none; }
  .mbar a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; border-radius: 4px;
    font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  }
  .mbar .mb-call { border: 1px solid rgba(255,255,255,0.3); color: var(--white); }
  .mbar .mb-main { background: var(--red); color: var(--white); }
  .mbar svg { width: 18px; height: 18px; }
  body.has-mbar { padding-bottom: 70px; }
  body.has-mbar .ca-launcher { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .hc, .hc img, .hc-stamp, .hero-quick { animation: none; opacity: 1; }
}
