.photo-wall {
  --photo-gap: clamp(8px, 1vw, 18px);
  display: grid;
  gap: var(--photo-gap);
}
.fleet-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.work-wall { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.work-wall a { grid-column: span 2; }
.work-wall a:nth-child(-n+2) { grid-column: span 3; }
.photo-wall a {
  display: block;
  overflow: hidden;
  border-radius: clamp(12px, 1.4vw, 24px);
  background: #e8ebee;
  cursor: zoom-in;
}
.photo-wall img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.fleet-wall img { aspect-ratio: 16 / 10; }
.photo-wall a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

#work-photo-toggle {
  display: flex;
  margin: clamp(14px, 1.5vw, 24px) auto 0;
  min-height: 52px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--v2-surface);
  color: var(--v2-blue);
  font-size: var(--control);
  font-weight: 600;
}
#work-photo-toggle:is(:hover, :focus-visible) { background: var(--v2-light-blue); }

html:has(#photo-viewer[open]) { overflow: hidden; }
#photo-viewer {
  width: min(94vw, 1440px);
  height: 92vh;
  height: 92dvh;
  max-width: 100%;
  max-height: 100%;
  padding: 10px max(16px, 2vw);
  border: 0;
  border-radius: 22px;
  background: #132337;
  color: #fff;
}
#photo-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}
#photo-viewer::backdrop { background: rgb(9 17 31 / 90%); }
.photo-canvas {
  min-height: 0;
  min-width: 0;
  touch-action: pan-y pinch-zoom;
}
#photo-viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.photo-topbar, .photo-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.photo-topbar { justify-content: space-between; }
.photo-toolbar { justify-content: center; }
#photo-viewer button {
  min-height: 48px;
  padding: 8px 18px;
  border: 0;
  border-radius: 99px;
  color: #fff;
  background: #34425a;
  font-size: 18px;
}
#photo-viewer form button { background: #fff; color: var(--navy); }
#photo-viewer button:disabled { opacity: .48; cursor: default; }
#photo-viewer button:focus-visible { outline: 3px solid white; outline-offset: 2px; }
#photo-position { font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
  .work-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-wall a, .work-wall a:nth-child(-n+2) { grid-column: span 1; }
  .work-wall a:first-child, .fleet-wall a:first-child, .fleet-wall a:last-child { grid-column: 1 / -1; }
}

@media (max-width: 767px), (max-width: 960px) and (max-height: 500px) {
  #photo-viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-radius: 0;
  }
  .photo-topbar { padding-inline-start: 8px; }
  .photo-toolbar button { flex: 1; max-width: 220px; }
}
@media (min-width: 541px) and (max-width: 960px) and (max-height: 500px) {
  #photo-viewer[open] {
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
  }
  .photo-canvas { grid-area: 1 / 1 / 2 / -1; height: 100%; }
  .photo-topbar { display: contents; }
  #photo-position { grid-area: 2 / 1; padding-inline-start: 8px; }
  .photo-toolbar { grid-area: 2 / 2; }
  .photo-topbar form { grid-area: 2 / 3; justify-self: end; }
}
