/* Project detail pages: one narrow centered column, lots of white space. */

html, body { height: auto !important; overflow-y: auto !important; }

.pp { max-width: 860px; margin: 0 auto; padding: calc(80px + 3.5rem) 1.5rem 7rem; } /* same width and side margins as the homepage */

.pp h1 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: var(--weight-semibold); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 1rem; }
.pp-date { font-size: 0.88rem; font-weight: var(--weight-semibold); margin-bottom: 2rem; }

.pp p { font-size: 0.93rem; line-height: 1.75; margin-bottom: 1.1rem; }
.pp ul { margin: 0 0 1.25rem 1.25rem; padding: 0; list-style: disc; }
.pp li { font-size: 0.93rem; line-height: 1.7; margin-bottom: 0.4rem; }
.pp a { text-decoration: underline; text-underline-offset: 3px; }
.pp a:hover { opacity: 0.6; }

.pp h2 { font-size: 1.2rem; font-weight: var(--weight-semibold); letter-spacing: -0.01em; margin: 0 0 1rem; }
.pp h3 { font-size: 0.95rem; font-weight: var(--weight-semibold); margin: 2.25rem 0 0.6rem; }
.pp h2 + h3 { margin-top: 0; }
.pp-sec { margin-top: 4rem; }
.pp hr + .pp-sec { margin-top: 2.5rem; }
.pp hr { border: 0; border-top: 1px solid rgba(128, 128, 128, 0.45); margin: 3rem 0 0; }

.pp-images { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.75rem 0 0.5rem; }
.pp-images img { height: 200px; width: auto; max-width: 100%; object-fit: cover; display: block; }
.pp-images.small img { height: 140px; }
.pp-cap { font-size: 0.78rem !important; line-height: 1.5 !important; opacity: 0.65; margin-bottom: 0 !important; }
.pp-top { margin-top: 0; }

.pp-more { margin-top: 1.5rem; }
.pp-more summary { cursor: pointer; font-size: 0.9rem; font-weight: var(--weight-semibold); }

@media (max-width: 700px) {
  .pp-images img { height: 140px; }
  .pp-images.small img { height: 100px; }
}

/* ---- Pictures placed inside the technical details ---- */
.pp-fig { margin: 1.5rem 0; }
.pp-fig.narrow img { max-width: 520px; }
.pp-fig img { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 auto; }
.pp-fig.md img { max-width: 480px; }
.pp-fig.hero img { max-width: 560px; }
.pp-fig.wide img { max-width: 100%; }
.pp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pp-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pp-pair img, .pp-strip img { width: 100%; max-width: none; aspect-ratio: 4 / 3; object-fit: cover; display: block; margin: 0; }
.pp-pair.tall img { aspect-ratio: 3 / 4; }
.pp-loop { display: block; width: 100%; height: auto; background: #000; }
.pp-fig > .pp-loop { max-width: 520px; margin: 0 auto; }
.pp-fig.wide > .pp-loop { max-width: 100%; }
.pp-fig .pp-cap { margin-top: 0.5rem; }
.pp-sec > :last-child { margin-bottom: 0; }

/* ---- Top 5 gallery: one large picture plus thumbnails ---- */
.pp-top5 { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 0.5rem; }
.pp-top5 img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pp-top5 img:first-child { grid-column: 1 / -1; aspect-ratio: auto; max-height: 480px; }
.pp-hero { display: block; width: auto; max-width: 100%; max-height: 640px; margin: 0 auto; border-radius: 4px; }
.pp img.contain { object-fit: contain; background: rgba(128, 128, 128, 0.14); }

/* ---- Video ---- */
.pp-video { width: 100%; max-height: 520px; display: block; background: #000; margin: 0; }
.pp-video.finale { max-width: 100%; max-height: none; margin: 0; border: 1px solid rgba(128, 128, 128, 0.35); border-radius: 4px; }

/* ---- Click to enlarge ---- */
.pp img { cursor: zoom-in; }
.pp-lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; }
.pp-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-out; }


/* ---- Flip-through viewer: one photo, Prev/Next buttons ---- */
.pp-flip { margin: 1.5rem auto; max-width: 600px; }
.pp-flip-frame { position: relative; border: 1px solid rgba(128, 128, 128, 0.35); border-radius: 4px; overflow: hidden; background: #fff; }
.pp-flip-frame img { width: 100%; max-width: none; height: auto; display: block; cursor: default; margin: 0; }
.pp-flip-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; }
.pp-flip-btn {
  border: 1px solid currentColor; background: none; color: inherit; cursor: pointer;
  font: inherit; font-size: 0.85rem; padding: 0.4rem 0.9rem; border-radius: 999px;
}
.pp-flip-btn:disabled { opacity: 0.3; cursor: default; }
.pp-flip-count { font-size: 0.8rem; opacity: 0.6; }

/* ---- Rotatable 3D model ---- */
.pp-viewer { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 10; margin: 0 auto; border-radius: 4px; overflow: hidden; background: #fff; cursor: grab; }
.pp-viewer:active { cursor: grabbing; }
.pp-viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pp-viewer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; cursor: inherit; }
.pp-viewer.ready img { display: none; }
.pp-viewer img { object-fit: contain; }
.pp-model { margin-top: 1.25rem; }

/* ---- 3D viewer controls and part labels ---- */
.pv-ctl { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.pv-cubewrap { width: 124px; height: 124px; perspective: 430px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.pv-cubewrap:active { cursor: grabbing; }
.pv-cube { position: relative; width: 0; height: 0; transform-style: preserve-3d; }
.pv-piece { position: absolute; left: 0; top: 0; padding: 0; border: 0; backface-visibility: hidden; cursor: pointer; font: inherit; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em; color: #34373B; transition: background 0.12s ease, color 0.12s ease; }
.pv-piece.face { background: rgba(255, 255, 255, 0.96); outline: 1px solid rgba(52, 55, 59, 0.5); outline-offset: -1px; }
.pv-piece.edge { background: rgba(196, 199, 196, 0.95); outline: 1px solid rgba(52, 55, 59, 0.45); outline-offset: -1px; }
.pv-piece.corner { background: rgba(160, 165, 160, 0.97); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pv-piece:hover { background: #5E8157; color: #fff; }
.pv-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #34373B; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.pv-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv-btn:hover { background: #5E8157; color: #fff; }
.pv-tag { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; transition: opacity 0.2s ease; }
.pv-tag.hidden { opacity: 0; visibility: hidden; }
.pv-dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; background: #5E8157; box-shadow: 0 0 0 0 rgba(94, 129, 87, 0.6), 0 1px 4px rgba(0, 0, 0, 0.35); pointer-events: none; padding: 0; animation: pv-pulse 2.4s infinite; }
@keyframes pv-pulse { 70% { box-shadow: 0 0 0 9px rgba(94, 129, 87, 0), 0 1px 4px rgba(0, 0, 0, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(94, 129, 87, 0), 0 1px 4px rgba(0, 0, 0, 0.35); } }
.pv-name { position: absolute; left: 14px; top: -11px; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #34373B; font-size: 0.72rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.pv-tag.open .pp-viewer:fullscreen { max-width: none; aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; }
.pp-viewer:-webkit-full-screen { max-width: none; aspect-ratio: auto; width: 100vw; height: 100vh; border-radius: 0; }
.pv-pick { position: absolute; left: 0.7rem; bottom: 0.7rem; z-index: 6; max-width: 260px; padding: 0.6rem 0.75rem; border-radius: 8px; background: rgba(255, 255, 255, 0.96); color: #34373B; font-size: 0.72rem; line-height: 1.4; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 0.3rem; }
.pv-pick ol { margin: 0 0 0 1rem; padding: 0; list-style: decimal; }
.pv-pick li { font-size: 0.66rem; margin: 0; }
.pv-pick button { align-self: flex-start; border: 0; border-radius: 999px; background: #5E8157; color: #fff; font: inherit; font-weight: 600; padding: 0.25rem 0.7rem; cursor: pointer; }
