/* Project thumbnails remain ordinary image links without JavaScript. */
.gallery-link { display: block; overflow: hidden; border-radius: 14px; cursor: zoom-in; }
.gallery-link.wide img { height: 460px; }
.gallery-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.gallery-hint { color: var(--muted); font-size: 14px; }
html.photo-viewer-open { overflow: hidden; }
.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #171411;
  color: #fff;
  overflow: hidden;
}
.photo-viewer[open] { display: flex; flex-direction: column; gap: 12px; }
.photo-viewer::backdrop { background: #171411; }
.photo-toolbar { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.photo-counter { margin: 0; font-variant-numeric: tabular-nums; }
.photo-viewer button { min-width: 48px; min-height: 48px; border: 1px solid #777067; border-radius: 8px; background: #29241f; color: white; }
.photo-viewer button:hover { background: #4c4136; }
.photo-viewer :focus-visible { outline: 3px solid #e9c49f; outline-offset: 3px; }
.photo-close { padding: 8px 16px; }
.photo-close span { font-size: 24px; margin-left: 8px; vertical-align: middle; }
.photo-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; gap: 16px; align-items: center; }
.photo-figure { margin: 0; height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.photo-full { width: 100%; min-height: 0; flex: 1; object-fit: contain; touch-action: pan-y pinch-zoom; }
.photo-caption { flex-shrink: 0; text-align: center; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.photo-previous, .photo-next { font-size: 32px; line-height: 1; }
.photo-viewer button[hidden] { display: none; }
@media (max-width: 800px) { .gallery-link.wide img { height: 300px; } }
@media (max-width: 600px) {
  .photo-stage { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0,1fr) 48px; gap: 12px; }
  .photo-figure { grid-column: 1 / -1; grid-row: 1; }
  .photo-previous { grid-column: 1; grid-row: 2; justify-self: end; }
  .photo-next { grid-column: 2; grid-row: 2; justify-self: start; }
}

.photo-project { flex-shrink: 0; align-self: center; color: #ead4bc; text-align: center; text-underline-offset: 4px; font-size: 14px; }
.photo-project[hidden] { display: none; }

.photo-thumbnails { display: flex; flex: 0 0 auto; gap: 9px; overflow-x: auto; max-width: 100%; padding: 6px 3px 10px; scrollbar-width: thin; scrollbar-color: #8b6848 #29241f; }
.photo-thumbnails[hidden] { display: none; }
.photo-viewer .photo-thumbnail { flex: 0 0 92px; width: 92px; height: 70px; padding: 3px; border: 2px solid transparent; border-radius: 7px; }
.photo-viewer .photo-thumbnail[aria-pressed="true"] { border-color: #e9c49f; background: #4c4136; }
.photo-thumbnail img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
@media (max-width: 600px) { .photo-viewer .photo-thumbnail { flex-basis: 74px; width: 74px; height: 58px; } .photo-thumbnails { gap: 7px; } }
