/* ============================================================
   MALIMMO — Projekt-Detailseite (Subpage) + Lightbox
   Nutzt die Tokens/Variablen aus styles.css
   ============================================================ */

/* ---------- PROJECT HERO ---------- */
.phero {
  position: relative; min-height: 88vh; display: flex; align-items: flex-end;
  overflow: hidden;
}
.phero__img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: scale(1.06); animation: pheroZoom 14s ease-out forwards;
}
@keyframes pheroZoom { to { transform: scale(1); } }
.phero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 3%, rgba(14,19,27,.6) 38%, rgba(14,19,27,.25) 75%, rgba(14,19,27,.45));
}
.phero__inner {
  position: relative; z-index: 2; width: 100%; max-width: var(--container);
  margin: 0 auto; padding: 0 clamp(20px,5vw,48px) clamp(44px,7vw,84px);
}
.phero__back {
  display: inline-flex; align-items: center; gap: 9px; color: rgba(255,255,255,.8);
  font-weight: 600; font-size: .9rem; letter-spacing: .04em; margin-bottom: 26px;
  transition: color .3s, gap .3s;
}
.phero__back:hover { color: #fff; gap: 14px; }
.phero__tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: #fff; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.34); padding: 6px 14px; border-radius: 100px; margin-bottom: 20px;
}
.phero__title {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; color: #fff;
  font-size: clamp(1.6rem, 6.2vw, 5.2rem); line-height: 1.05; overflow-wrap: break-word;
}
.phero__sub { color: rgba(255,255,255,.82); margin-top: 18px; font-size: clamp(1rem,2vw,1.2rem); max-width: 640px; }

/* ---------- FACTS BAR ---------- */
.facts { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.facts__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: clamp(28px,4vw,44px) 0;
}
.fact { text-align: center; position: relative; padding: 6px 14px; }
.fact::after { content:""; position:absolute; top:20%; right:0; height:60%; width:1px; background: var(--line); }
.fact:last-child::after { display: none; }
.fact span { display: block; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px; }
.fact strong { font-family: var(--font-display); font-size: clamp(1.05rem,2vw,1.5rem); color: var(--text); }

/* ---------- INTRO ---------- */
.pintro__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(36px,6vw,80px); align-items: start; }
.pintro__text p { color: var(--muted); font-size: 1.08rem; margin-top: 20px; }
.pintro__text .section__title { text-align: left; }
.pintro__side {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(26px,3vw,38px); position: sticky; top: 100px;
}
.pintro__side h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 22px; }
.ticks { display: grid; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); font-size: .98rem; }
.ticks li::before {
  content: "✓"; flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--accent-deep); font-size: .76rem; margin-top: 1px;
}

/* ---------- GALLERY ---------- */
.gallery-section { background: var(--bg-2); border-top: 1px solid var(--line); }
.gallery__label {
  font-family: var(--font-display); font-size: clamp(1.3rem,2.4vw,1.8rem); font-weight: 700;
  margin: clamp(34px,5vw,56px) 0 22px; display: flex; align-items: center; gap: 16px;
}
.gallery__label::before { content:""; width: 26px; height: 2px; background: var(--accent); }
.gallery__label:first-of-type { margin-top: 0; }
.gallery { columns: 3; column-gap: 16px; }
.gallery__item {
  break-inside: avoid; margin: 0 0 16px; border-radius: 14px; overflow: hidden;
  position: relative; cursor: pointer; border: 1px solid var(--line);
  background: var(--bg-3);
}
.gallery__item img { width: 100%; height: auto; display: block; transition: transform .8s var(--ease), filter .5s; }
.gallery__item::after {
  content: ""; position: absolute; inset: 0; background: rgba(14,19,27,.0); transition: background .4s;
}
.gallery__item:hover img { transform: scale(1.05); }
.gallery__item:hover::after { background: rgba(14,19,27,.18); }
.gallery__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 18px 14px;
  font-size: .85rem; font-weight: 500; color: #fff;
  background: linear-gradient(to top, rgba(11,15,21,.85), transparent);
  transform: translateY(8px); opacity: 0; transition: .4s var(--ease);
}
.gallery__item:hover .gallery__cap { transform: none; opacity: 1; }
.gallery__zoom {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%; color: var(--on-accent);
  background: var(--accent); opacity: 0; transform: scale(.6); transition: .4s var(--ease);
}
.gallery__item:hover .gallery__zoom { opacity: 1; transform: none; }

@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 560px) { .gallery { columns: 1; } }

/* ---------- PROJECT CTA ---------- */
.pcta { text-align: center; position: relative; overflow: hidden; }
.pcta::before { content:""; position:absolute; width:46vw; height:46vw; border-radius:50%;
  top:-30%; left:50%; transform:translateX(-50%); background: radial-gradient(circle, rgba(180,198,224,.16), transparent 65%); filter: blur(30px); }
.pcta__inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.pcta p { color: var(--muted); margin: 18px 0 32px; font-size: 1.1rem; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 9995; display: flex; align-items: center; justify-content: center;
  background: rgba(9,12,18,.94); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 90vw; max-height: 82vh; border-radius: 10px; object-fit: contain;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); transform: scale(.96); transition: transform .35s var(--ease);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__cap {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: #eef2f8; font-size: .95rem; background: rgba(14,19,27,.7); border: 1px solid rgba(255,255,255,.16);
  padding: 8px 18px; border-radius: 100px; backdrop-filter: blur(6px);
}
.lightbox__count { position: absolute; top: 26px; left: 28px; color: rgba(255,255,255,.6); font-size: .85rem; letter-spacing: .08em; }
.lightbox__close, .lightbox__nav {
  position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; color: #eef2f8; font-size: 1.6rem; line-height: 1;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); transition: .3s var(--ease);
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--accent); color: var(--on-accent); transform: scale(1.08); }
.lightbox__close { top: 22px; right: 24px; }
.lightbox__nav { top: 50%; margin-top: -26px; }
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }
@media (max-width: 600px) {
  .lightbox__nav { width: 44px; height: 44px; }
  .lightbox__prev { left: 8px; } .lightbox__next { right: 8px; }
}

/* ---------- SUBPAGE NAV (always solid) ---------- */
.subpage .nav { background: rgba(244,246,249,.82); backdrop-filter: blur(18px) saturate(140%); border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .facts__grid { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
  .fact:nth-child(2)::after { display: none; }
  .pintro__grid { grid-template-columns: 1fr; }
  .pintro__side { position: static; }
}
