/* The page keeps its three editorial images; the full selection opens on demand. */
a.project-image { display: block; cursor: zoom-in; }
a.project-image:focus-visible { outline-offset: 5px; }
.project-note .gallery-download { display: block; width: fit-content; margin-top: 18px; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.gallery-dialog { position: fixed; inset: 0; margin: auto; border: 0; padding: 24px; width: calc(100vw - 40px); height: calc(100dvh - 40px); max-width: 1600px; max-height: none; color: var(--ink); background: var(--paper); overflow: hidden; }
.gallery-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px; animation: gallery-arrives 150ms ease-out; }
.gallery-dialog::backdrop { background: rgb(20 27 24 / 76%); }
.gallery-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.gallery-title { font-size: 38px; line-height: 1; color: var(--blue); }
.gallery-close { display: inline-flex; gap: 14px; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; padding: 0 0 0 12px; background: transparent; font-size: 13px; }
.gallery-close span { font-size: 30px; line-height: 1; font-weight: 400; }
/* Keep modal focus, but show its outline only during keyboard navigation. */
.gallery-dialog[data-input-mode="pointer"] button:focus { outline: none; }
.gallery-stage { display: grid; place-items: center; position: relative; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: auto; }
.gallery-image { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; animation: gallery-arrives 150ms ease-out; }
.gallery-image[hidden], .gallery-status[hidden], .gallery-retry[hidden] { display: none; }
.gallery-status { text-align: center; color: var(--muted); padding: 24px; }
.gallery-retry { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 8px 20px; color: var(--blue); border: 1px solid var(--blue); border-radius: 24px; background: transparent; }
.gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.gallery-caption { max-width: 70ch; font-size: 14px; line-height: 1.5; }
.gallery-navigation { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gallery-counter { min-width: 64px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.gallery-arrow { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--blue); border-radius: 50%; background: transparent; color: var(--blue); font-size: 24px; line-height: 1; }
.gallery-arrow:hover, .gallery-retry:hover { background: var(--blue); color: var(--paper); }
.gallery-arrow:disabled { opacity: .3; cursor: default; background: transparent; color: var(--blue); }
@keyframes gallery-arrives { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .gallery-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 16px; }
  .gallery-dialog[open] { gap: 12px; }
  .gallery-title { font-size: 32px; }
  .gallery-footer { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .gallery-caption { width: 100%; }
  .gallery-navigation { width: 100%; justify-content: flex-end; }
  .gallery-counter { margin-right: auto; min-width: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-dialog[open], .gallery-image { animation: none; }
}
