/* Large photo viewer: navigation stays outside the photograph. */
.gallery-browse { display:none; }
.project-gallery figure { position:relative; }
.project-gallery figcaption { position:absolute; inset:auto 0 0; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; gap:18px; padding:42px 24px 22px; background:linear-gradient(transparent,rgba(6,23,30,.62) 38%,rgba(6,23,30,.88)); pointer-events:none; }
.project-gallery .gallery-number { color:#efb18b; font-size:11px; font-weight:600; letter-spacing:.08em; white-space:nowrap; font-variant-numeric:tabular-nums; }
.project-gallery .gallery-title { color:#fff; font-size:16px; font-weight:500; line-height:1.55; }
/* Uniform previews; the full photograph remains available in the viewer. */
.project-gallery a { background:transparent; aspect-ratio:1; overflow:hidden; }
.project-gallery img { display:block; width:100%; height:100%; aspect-ratio:auto; max-height:none; object-fit:cover; object-position:center; }
dialog.photo-dialog { padding:0; border:0; background:#091c23; color:#fff; overflow:hidden; height:100vh; height:100dvh; }
dialog.photo-dialog[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; align-items:stretch; justify-content:stretch; }
.photo-dialog .photo-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 24px; padding-top:max(12px,env(safe-area-inset-top)); border-bottom:1px solid #ffffff1f; }
.photo-dialog .photo-counter { font-size:13px; color:#cad5d8; }
.photo-dialog button { position:static; display:flex; align-items:center; justify-content:center; flex-shrink:0; cursor:pointer; width:48px; height:48px; min-width:48px; min-height:48px; padding:0; border:1px solid #ffffff4d; border-radius:50%; color:white; background:#ffffff0a; font-size:24px; }
.photo-dialog button:hover { background:#ffffff20; }
.photo-dialog button:focus-visible { outline:2px solid #efb996; outline-offset:3px; }
.photo-dialog .photo-close { width:auto; border-radius:6px; gap:14px; padding:0 14px; font-size:13px; }
.photo-close span { font-size:27px; line-height:1; }
.photo-dialog .photo-stage { position:relative; min-height:0; display:grid; place-items:center; touch-action:pan-y pinch-zoom; user-select:none; overflow:hidden; }
.photo-dialog .photo-stage img { display:block; width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; min-height:0; }
.photo-status { position:absolute; left:20px; right:20px; text-align:center; font-size:14px; color:#cad5d8; pointer-events:none; }
.photo-bottom { padding:14px 24px; padding-bottom:max(14px,env(safe-area-inset-bottom)); border-top:1px solid #ffffff1f; }
.photo-navigation { max-width:1000px; margin:auto; display:grid; grid-template-columns:48px minmax(0,1fr) 48px; gap:20px; align-items:center; }
.photo-dialog .photo-caption { margin:0; font-size:14px; line-height:1.5; text-align:center; }
.photo-hint { display:none; }
@media (max-width:700px) {
  .project-gallery { display:grid; grid-auto-flow:column; grid-auto-columns:100%; grid-template-columns:none; gap:16px; align-items:start; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x mandatory; scrollbar-width:none; }
  .project-gallery::-webkit-scrollbar { display:none; }
  .project-gallery figure { scroll-snap-align:start; scroll-snap-stop:always; }
  .project-gallery a { aspect-ratio:4/5; }
  .project-gallery { overflow-y:hidden; }
  .project-gallery figcaption { padding:36px 16px 18px; gap:12px; }
  .project-gallery .gallery-number { font-size:10px; }
  .project-gallery .gallery-title { font-size:14px; line-height:1.5; }
  .gallery-browse { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:10px; }
  .gallery-swipe-hint { color:var(--muted); font-size:11px; }
  .gallery-browse .gallery-count { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .gallery-arrows { display:flex; align-items:center; flex-shrink:0; gap:2px; }
  .gallery-browse button { width:44px; height:44px; border:0; border-radius:0; background:transparent; color:var(--ink); font-size:24px; cursor:pointer; }
  .gallery-browse button:disabled { opacity:.25; cursor:default; }
  .gallery-browse button:not(:disabled):hover { color:var(--copper); }
  .photo-dialog .photo-toolbar { padding:10px 16px; padding-top:max(10px,env(safe-area-inset-top)); }
  .photo-bottom { padding:12px 16px; padding-bottom:max(16px,env(safe-area-inset-bottom)); }
  .photo-navigation { gap:12px; }
  .photo-dialog .photo-caption { font-size:12px; line-height:1.5; }
  .photo-hint { display:block; margin-top:14px; text-align:center; font-size:11px; color:#9dafb6; }
}
@media (max-height:500px) and (orientation:landscape) {
  .photo-dialog .photo-toolbar { padding-block:4px; }
  .photo-dialog .photo-toolbar button { height:40px; min-height:40px; }
  .photo-bottom { padding-block:6px; }
  .photo-hint { display:none; }
}
