.gallery { background:#f3eeee; scroll-margin-top:110px; }
.gallery h2 { color:#0a0a0b; margin-bottom:0; }
.gallery .section-number { color:#a8141a; }
.gallery-showcase { display:grid; grid-template-columns:minmax(180px,.72fr) minmax(0,1.55fr); align-items:center; gap:clamp(24px,5vw,88px); min-height:430px; }
.gallery-copy { align-self:stretch; display:flex; flex-direction:column; justify-content:center; }
.gallery-copy .section-number { align-self:flex-start; margin:0 0 auto; }
.gallery-copy h2 { margin:auto 0; }
.gallery-stage { position:relative; min-width:0; height:clamp(300px,34vw,430px); }
.gallery-upload { display:none; position:relative; cursor:pointer; white-space:nowrap; }
.editing .gallery-upload:not([hidden]) { display:inline-flex; align-items:center; }
.gallery-upload.uploading { opacity:.55; pointer-events:none; }
.gallery-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.gallery-empty { position:absolute; inset:50% auto auto 50%; z-index:10; margin:0; color:#625b5c; font-size:1rem; transform:translate(-50%,-50%); }
.gallery-grid { --gallery-front-width:60%; --gallery-card-height:72%; position:relative; width:100%; height:100%; margin:0; overflow:hidden; }
.gallery-grid::before,.gallery-grid::after { content:none; }
.gallery-tile { position:absolute; width:var(--gallery-front-width); height:auto; margin:0; aspect-ratio:3 / 2; overflow:visible; filter:drop-shadow(-12px 14px 18px #0005); transition:transform .3s ease,filter .3s ease; }
.gallery-tile:nth-child(1) { left:20%; bottom:14%; z-index:3; }
.gallery-tile:hover,.gallery-tile:focus-within { z-index:8; transform:translateY(-7px); filter:drop-shadow(-14px 18px 22px #0007); }
.gallery-open { display:block; width:100%; height:100%; padding:0; border:2px solid #ffffff20; border-radius:17px; background:#0a0a0b; overflow:hidden; cursor:zoom-in; }
.gallery-open img { display:block; width:100%; height:100%; object-fit:contain; object-position:center; transition:filter .35s ease; }
.gallery-open:hover img,.gallery-open:focus-visible img { filter:brightness(1.06); }
.gallery-remove { display:none; position:absolute; top:12px; right:12px; border:0; border-radius:999px; padding:8px 14px; color:#0a0a0b; background:#fff; font:inherit; font-weight:700; cursor:pointer; }
.editing .gallery-remove { display:block; }
.story-section { background:#f3eeee; scroll-margin-top:110px; }
.gallery-viewer { position:fixed; width:min(94vw,1200px); max-width:none; height:min(92vh,850px); max-height:none; padding:20px 74px 42px; border:0; border-radius:18px; background:#0a0a0b; box-shadow:0 30px 100px #0008; overflow:hidden; }
.gallery-viewer::backdrop { background:#080000dd; }
.gallery-viewer figure { display:grid; grid-template-rows:minmax(0,1fr) auto; width:100%; height:100%; margin:0; }
.gallery-viewer img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.gallery-viewer figcaption { padding-top:12px; color:#fff; text-align:center; font-weight:700; }
.gallery-viewer button { position:absolute; z-index:2; width:48px; height:48px; border:0; border-radius:50%; background:#fff; color:#0a0a0b; font:inherit; font-size:2.2rem; line-height:1; cursor:pointer; box-shadow:0 8px 24px #0005; }
.gallery-viewer .gallery-close { top:16px; right:16px; }
.gallery-arrow { top:50%; transform:translateY(-50%); }
.gallery-arrow-previous { left:14px; }
.gallery-arrow-next { right:14px; }
.gallery-order-controls { position:absolute; left:50%; bottom:10px; z-index:3; display:flex; gap:10px; transform:translateX(-50%); }
.gallery-order-controls[hidden] { display:none; }
.gallery-viewer .gallery-order-button { position:static; width:auto; height:auto; min-width:112px; padding:9px 14px; border-radius:999px; background:#fff; color:#0a0a0b; font-size:.9rem; line-height:1.2; transform:none; }
.gallery-viewer .gallery-order-button:disabled { opacity:.4; cursor:not-allowed; }
@media(max-width:900px) { .gallery-showcase { grid-template-columns:minmax(150px,.6fr) minmax(0,1.4fr); gap:24px; min-height:370px; } .gallery-stage { height:340px; } }
@media(max-width:620px) {
  .gallery-showcase { display:block; min-height:0; }
  .gallery-copy { display:grid; grid-template-columns:1fr auto; align-items:end; gap:18px; }
  .gallery-copy .section-number { grid-column:1 / -1; margin:0 0 34px; }
  .gallery-copy h2 { margin:0; }
  .gallery-copy .gallery-upload { justify-self:end; }
  .gallery-stage { height:280px; margin-top:24px; }
  .gallery-grid { --gallery-front-width:72%; --gallery-card-height:70%; }
  .gallery-tile:nth-child(1) { left:14%; bottom:15%; }
  .gallery-open { border-radius:13px; }
  .gallery-viewer { width:100vw; height:100dvh; padding:62px 14px 54px; border-radius:0; }
  .gallery-viewer .gallery-close { top:12px; right:12px; }
  .gallery-arrow { top:auto; bottom:10px; transform:none; }
  .gallery-arrow-previous { left:16px; }
  .gallery-arrow-next { right:16px; }
  .gallery-order-controls { bottom:12px; }
  .gallery-viewer .gallery-order-button { min-width:104px; padding:8px 12px; font-size:.82rem; }
}
