/* Projektseiten (seite/projekte/*.html), zusätzlich zu stil.css */
.p-kopf { padding-block: clamp(32px, 7vh, 80px) var(--a5); }
.p-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 560; color: var(--tinte); margin-bottom: var(--a2); }
.p-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blau-tief); }
.p-kopf h1 { font: 800 clamp(3rem, 9vw, 8rem)/.92 var(--titel); letter-spacing: -.045em; overflow-wrap: anywhere; }
.p-titelzeile { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.p-symbol { flex-shrink: 0; width: clamp(56px, 8vw, 112px); }
.p-symbol img { width: 100%; height: auto; }
.p-kurz { margin-top: var(--a3); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.45; max-width: 36ch; }
.p-kopf .links { margin-top: var(--a3); }

/* Titelbild: als Bild, im Laptop oder im Handy */
.p-titelbild { margin-block: 0 var(--sektion); }
.p-titelbild .bild-auf { border-radius: var(--r-gross); overflow: hidden; background: var(--sand); box-shadow: 0 40px 80px -50px rgba(15, 35, 48, .45); }
.p-titelbild img { width: 100%; height: auto; }
.p-titelbild.titel-laptop, .p-titelbild.titel-handy { background: var(--sand); border-radius: var(--r-gross); padding: clamp(32px, 6vw, 72px) clamp(24px, 6vw, 96px) clamp(40px, 6vw, 80px); }
.p-titelbild .geraet-rahmen { margin-inline: auto; }
.p-titelbild .geraet-rahmen.laptop { max-width: 860px; }
.p-titelbild .geraet-rahmen.handy { max-width: min(300px, 64vw); }

.p-abschnitt { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--a4) var(--a6); padding-bottom: var(--sektion); }
.p-abschnitt h2, .p-galerie h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.015em; }
.p-text { display: grid; gap: var(--a3); }
.p-text p { font-size: 1.1875rem; line-height: 1.65; max-width: 62ch; }
.p-tags { align-self: start; }
.p-tags li { font-size: 1rem; padding: 10px 15px; }

/* Galerie: Desktop Raster (Querformat 2 je Reihe, Hochformat 4 je Reihe), Handy ein wischbares Band */
/* content-visibility: Die Galerie wird erst aufgebaut, wenn sie in die Nähe kommt. So laden ihre
   Bilder nicht gleichzeitig mit dem Titelbild (LCP). Die geschätzte Höhe hält die Bildlaufleiste ruhig. */
.p-galerie { padding-bottom: var(--sektion); content-visibility: auto; contain-intrinsic-size: auto 1200px; }
.p-galerie-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--a2); margin-bottom: var(--a5); }
.p-galerie-hinweis { color: var(--grau); }
.p-raster { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--a4); align-items: start; }
.p-raster figure { margin: 0; }
.p-raster .quer { grid-column: span 6; }
.p-raster .hoch { grid-column: span 3; }
.g-bild { display: block; border-radius: var(--r); overflow: hidden; background: var(--sand); cursor: zoom-in; }
.g-bild { transition: translate .35s var(--weich), box-shadow .35s var(--weich); }
.g-bild img { width: 100%; height: auto; }
/* Darüberfahren: das Bild hebt sich (kein Zoom, der die Ränder abschneiden würde) */
.g-bild:hover { translate: 0 -4px; box-shadow: 0 18px 36px -24px rgba(15, 35, 48, .5); }
.hoch .g-bild { border: 6px solid #0b1620; border-radius: 28px; }
.p-raster figcaption { margin-top: var(--a1); color: var(--grau); font-size: .9375rem; }

/* Große Ansicht (Lightbox). Nur Bild und Steuerung, Bild nie beschnitten. */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(9, 21, 29, .94); color: var(--papier); overflow: hidden; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lb-figur { margin: 0; display: grid; justify-items: center; gap: var(--a2); padding: 72px clamp(16px, 9vw, 120px) 56px; width: 100%; height: 100%; align-content: center; }
.lb-bild { max-width: 100%; max-height: calc(100dvh - 190px); width: auto; height: auto; object-fit: contain; border-radius: 10px; background: #0b1620; }
.lb-text { max-width: 70ch; text-align: center; color: var(--dunkel-text); font-size: .9375rem; }
.lb-zaehler { position: absolute; top: 24px; left: 24px; margin: 0; font-weight: 560; color: var(--dunkel-text); font-variant-numeric: tabular-nums; }
.lb-knopf { position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(251, 250, 247, .12); color: var(--papier); transition: background-color .2s; }
.lb-knopf:hover { background: rgba(251, 250, 247, .24); }
.lb-knopf:focus-visible { outline: 3px solid var(--blau-hell); outline-offset: 3px; }
.lb-knopf svg { width: 22px; height: 22px; }
.lb-zu { top: 12px; right: 12px; }
.lb-zurueck { left: 16px; top: 50%; translate: 0 -50%; }
.lb-weiter { right: 16px; top: 50%; translate: 0 -50%; }
.lightbox.einzeln .lb-zurueck, .lightbox.einzeln .lb-weiter { display: none; }

/* Nächstes Projekt auf Nachtblau */
.p-weiter { background: var(--tinte); }
.p-weiter a { display: flex; align-items: center; justify-content: space-between; gap: var(--a5); padding-block: var(--a6); text-decoration: none; color: var(--papier); }
.p-weiter :focus-visible { outline-color: var(--blau-hell); }
.p-weiter-text { display: grid; gap: var(--a1); min-width: 0; max-width: 100%; }
.p-weiter-hinweis { color: var(--dunkel-text); font-weight: 560; }
.p-weiter-titel { overflow-wrap: anywhere; font: 800 clamp(1.875rem, 6vw, 5rem)/.95 var(--titel); letter-spacing: -.04em; text-decoration: underline; text-decoration-color: var(--dunkel-linie); text-decoration-thickness: 3px; text-underline-offset: .12em; transition: text-decoration-color .2s; }
.p-weiter a:hover .p-weiter-titel { text-decoration-color: var(--blau-hell); }
/* Ruhig, nicht gedreht: das Bild steht ganz in der Fläche */
.p-weiter-bild { width: min(360px, 40%); flex-shrink: 0; border-radius: var(--r); overflow: hidden; transition: translate .4s var(--weich); }
.p-weiter a:hover .p-weiter-bild { translate: 0 -6px; }
.p-weiter-bild { aspect-ratio: 16 / 10; background: var(--grund, #1b2c38); }
.p-weiter-bild img { width: 100%; height: 100%; object-fit: contain; }
/* Handy-Projekte: höhere Fläche (320 px), damit das Handy groß genug ist */
.p-weiter-bild.hoch { display: grid; place-items: center; background: #1b2c38; container-type: size; aspect-ratio: auto; height: 320px; width: 280px; }
.p-weiter-bild.hoch .mini-handy { height: 90cqh; }
.p-weiter-bild.hoch img { width: auto; height: 100%; object-fit: initial; }

@media (max-width: 800px) {
  .p-abschnitt { grid-template-columns: 1fr; }
  .p-weiter a { flex-direction: column; align-items: flex-start; }
  .p-weiter-bild { width: 100%; }
}
/* Handy: Galerie als Band zum Wischen, das nächste Bild schaut am Rand heraus */
@media (max-width: 700px) {
  .p-raster {
    display: flex; gap: var(--a2); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--rand)); padding: 4px var(--rand) var(--a2); scroll-padding-inline: var(--rand);
  }
  .p-raster li { flex: 0 0 auto; scroll-snap-align: start; }
  .p-raster .quer { width: 82vw; }
  .p-raster .hoch { width: 56vw; }
  .lb-figur { padding: 64px 12px 92px; }
  .lb-bild { max-height: calc(100dvh - 190px); }
  .lb-zurueck, .lb-weiter { top: auto; bottom: 20px; translate: none; }
  .lb-zurueck { left: calc(50% - 64px); }
  .lb-weiter { right: calc(50% - 64px); }
}
