/* Detail photos keep their complete composition, including portrait images. */
button.project-detail-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8eeeb;
  cursor: zoom-in;
}
.project-detail-photo > img.gallery-main {
  display: block;
  width: 100%;
  height: clamp(260px, 42vw, 540px);
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  transform: none;
  border-radius: 0;
  background: transparent;
}
.project-photo-expand {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  padding: 7px 12px;
  border-radius: 20px;
  background: #073d3ae8;
  color: white;
  font-size: 13px;
  pointer-events: none;
}
.detail-grid .gallery-thumbs button {
  padding: 3px;
  border: 2px solid transparent;
  background: #e8eeeb;
}
.detail-grid .gallery-thumbs button[aria-pressed="true"] { border-color: var(--petrol); }
.detail-grid .gallery-thumbs button > img {
  width: 100%; height: 72px; object-fit: contain; transform: none;
}
.project-detail-photo:focus-visible, .gallery-thumbs button:focus-visible {
  outline: 3px solid #b1904c; outline-offset: 4px;
}
dialog.project-lightbox {
  box-sizing: border-box;
  width: min(1400px, calc(100vw - 32px));
  max-width: none;
  height: min(960px, calc(100dvh - 32px));
  max-height: none;
  padding: 16px;
  border: 1px solid #ffffff38;
  border-radius: 18px;
  background: #102d2c;
  color: white;
  overflow: hidden;
}
dialog.project-lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
dialog.project-lightbox::backdrop {
  background: #061c24bd;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.project-lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-lightbox-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-lightbox button {
  flex-shrink: 0; width: 44px; height: 44px; padding: 0;
  border: 1px solid #ffffff60; border-radius: 50%;
  background: #ffffff12; color: white; font-size: 25px; cursor: pointer;
}
.project-lightbox button:hover { background: #ffffff2a; }
.project-lightbox button:focus-visible { outline: 3px solid #d5b578; outline-offset: 2px; }
.project-lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.project-lightbox-image { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.project-lightbox-image[hidden], .project-lightbox-error[hidden], .project-lightbox button[hidden] { display: none; }
.project-lightbox-error { text-align: center; }
.project-lightbox-navigation { display: flex; align-items: center; justify-content: center; gap: 24px; }
@media (max-width: 600px) {
  dialog.project-lightbox { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 12px; border-radius: 12px; }
  .project-lightbox-caption { font-size: 14px; }
}
