/* Photography only: preserve the approved palette, typography and page layout. */
main .photo-image { object-position: var(--photo-position, 50% 50%); }
.hero-photo-poolhouse .photo-image { object-position: 50% 55%; }
.page-wide-photo.training-photo .photo-image { object-position: var(--photo-position, 50% 50%); }

/* The portfolio and model references keep the full source composition. */
.project-grid:not(.project-grid-featured) .project-image .photo-image,
.model-cards .photo-image {
  height: auto;
  aspect-ratio: var(--photo-ratio);
  object-fit: contain;
}

/* Give every portfolio image a consistent, generous landscape frame. The
   original source remains untouched and opens in full inside the lightbox. */
.project-grid:not(.project-grid-featured) {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-items: stretch;
  gap: clamp(30px, 3.4vw, 46px) 22px;
}
.project-grid:not(.project-grid-featured) > .project-card {
  grid-column: span 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding-top: 0;
  margin: 0;
  overflow: visible;
  background: transparent;
}
.project-grid:not(.project-grid-featured) > .project-card[hidden] { display: none; }
.project-grid:not(.project-grid-featured) .project-image {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--limestone, #e3dccf);
}
.project-grid:not(.project-grid-featured) .project-image .photo-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: var(--photo-position, 50% 50%);
}
.project-grid:not(.project-grid-featured) > .project-card::after { display: none; }
.project-grid:not(.project-grid-featured) .project-card figcaption {
  position: static;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 9px;
  left: auto;
  right: auto;
  bottom: auto;
  padding: 17px 0 0;
  color: var(--deep);
}
.project-grid:not(.project-grid-featured) .project-card .project-kind {
  color: var(--olive);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: .035em;
  text-transform: none;
}
#project-status { font-size: 16px; line-height: 1.5; }
.project-filters .filter-button { min-height: 48px; font-size: 18px; line-height: 1.3; }
.project-grid:not(.project-grid-featured) .project-card figcaption h3 {
  margin: 0;
  color: var(--deep);
  font-family: var(--serif);
  font-size: clamp(21px, 1.7vw, 25px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -.015em;
}
.project-grid:not(.project-grid-featured) .project-card figcaption p {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.project-grid:not(.project-grid-featured) .project-image:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 4px;
}
.project-grid[data-filter="all"]:not(.project-grid-featured) > .project-card:nth-child(10) {
  grid-row: 4;
  grid-column: 2 / span 2;
}
.project-grid[data-filter="all"]:not(.project-grid-featured) > .project-card:nth-child(11) {
  grid-row: 4;
  grid-column: 4 / span 2;
}
.project-grid[data-filter="own"]:not(.project-grid-featured) > .project-card:nth-child(7) {
  grid-row: 3;
  grid-column: 3 / span 2;
}
.project-grid[data-filter="niveko"]:not(.project-grid-featured) > .project-card:last-child {
  grid-row: 2;
  grid-column: 3 / span 2;
}

@media (max-width: 1100px) {
  .project-grid:not(.project-grid-featured) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 20px; }
  .project-grid[data-filter="all"]:not(.project-grid-featured) > .project-card:nth-child(10) { grid-row: auto; grid-column: span 2; }
  .project-grid[data-filter="all"]:not(.project-grid-featured) > .project-card:nth-child(11) { grid-row: 6; grid-column: 2 / span 2; }
  .project-grid[data-filter="own"]:not(.project-grid-featured) > .project-card:nth-child(7) { grid-row: 4; grid-column: 2 / span 2; }
  .project-grid[data-filter="niveko"]:not(.project-grid-featured) > .project-card:last-child { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 620px) {
  .project-grid:not(.project-grid-featured) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 0; }
  .project-grid:not(.project-grid-featured) > .project-card { grid-column: 1 / -1; grid-row: auto; }
  .project-grid[data-filter="all"]:not(.project-grid-featured) > .project-card:nth-child(10),
  .project-grid[data-filter="all"]:not(.project-grid-featured) > .project-card:nth-child(11),
  .project-grid[data-filter="own"]:not(.project-grid-featured) > .project-card:nth-child(7),
  .project-grid[data-filter="niveko"]:not(.project-grid-featured) > .project-card:last-child { grid-column: 1 / -1; grid-row: auto; }
  .project-grid:not(.project-grid-featured) .project-card figcaption { gap: 7px; padding-top: 14px; }
  .project-grid:not(.project-grid-featured) .project-card figcaption h3 { font-size: 24px; }
}
.photo-zoom { display: block; position: relative; overflow: hidden; }
.image-expand { top: 14px; right: 14px; bottom: auto; pointer-events: none; }
.photo-zoom .image-expand { transition: opacity .2s, transform .2s; }
@media (hover: hover) {
  .photo-zoom .image-expand { opacity: 0; transform: translateY(-3px); }
  .photo-zoom:hover .image-expand,
  .photo-zoom:focus-visible .image-expand { opacity: 1; transform: none; }
}

/* On a single-column screen, wide pools and upright detail photos need their
   own proportions. The two featured homepage images retain their equal frames. */
@media (max-width: 820px) {
  .hero-photo .photo-image,
  .split figure .photo-image,
  .page-wide-photo .photo-image,
  .page-wide-photo.training-photo .photo-image,
  .model-visual .photo-image,
  .model-cards .photo-image,
  .service-card .photo-image,
  .workmanship-grid .photo-image,
  .gallery-wide .photo-image,
  .team-pictures .photo-image {
    height: auto;
    max-height: none;
    aspect-ratio: var(--photo-ratio);
    object-fit: contain;
  }
}

/* The enlarged view always shows the full image, with no cropping or border. */
.gallery-dialog { width: min(1200px, 96vw); max-height: calc(100dvh - 28px); padding: 20px; }
.gallery-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex: 0 0 auto; }
.dialog-header > div { min-width: 0; }
.dialog-header h2 { font-size: 27px; line-height: 1.2; letter-spacing: -.025em; }
.dialog-credit { font-size: 12px; line-height: 1.5; color: var(--deep); letter-spacing: .09em; text-transform: uppercase; margin-bottom: 7px; }
.dialog-close { position: static; flex: 0 0 46px; width: 46px; height: 46px; font-size: 28px; }
.dialog-media { display: grid; place-items: center; min-height: 0; flex: 0 1 auto; }
.dialog-media[aria-busy="true"] { min-height: 180px; }
.dialog-photo { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 230px); object-fit: contain; background: transparent; }
.dialog-photo[hidden], .dialog-status[hidden] { display: none; }
.dialog-status { color: var(--muted); font-size: 16px; padding: 28px; max-width: 570px; text-align: center; }
.dialog-caption { font-size: 15px; line-height: 1.5; color: var(--muted); padding: 0; flex: 0 0 auto; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 10px; flex: 0 0 auto; }
.dialog-navigation { display: flex; align-items: center; gap: 16px; }
.dialog-navigation button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--line); background: transparent; color: var(--deep); min-width: 46px; min-height: 46px; padding: 8px 14px; font-size: 15px; }
.dialog-navigation button:hover:not(:disabled) { border-color: var(--deep); }
.dialog-navigation button:disabled { opacity: .4; }
.dialog-count { font-size: 14px; color: var(--deep); white-space: nowrap; min-width: 42px; text-align: center; }
.dialog-original { display: inline-flex; align-items: center; gap: 12px; min-height: 46px; font-size: 15px; color: var(--deep); white-space: nowrap; }
.dialog-original:hover { text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 540px) {
  .gallery-dialog { padding: 14px; gap: 10px; }
  .dialog-header { gap: 14px; }
  .dialog-header h2 { font-size: 23px; }
  .dialog-credit { font-size: 12px; letter-spacing: .06em; }
  .dialog-close { flex-basis: 44px; width: 44px; height: 44px; }
  .dialog-photo { max-height: calc(100dvh - 250px); }
  .dialog-caption { font-size: 14px; }
  .dialog-actions { gap: 12px; }
  .dialog-navigation { gap: 8px; }
  .dialog-navigation button { min-width: 44px; min-height: 44px; padding: 7px; }
  .dialog-control-label { display: none; }
  .dialog-original { font-size: 14px; gap: 8px; }
}
@media (max-height: 550px) {
  .gallery-dialog[open] { gap: 8px; }
  .dialog-header h2 { font-size: 21px; }
  .dialog-credit { margin-bottom: 3px; }
  .dialog-caption { display: none; }
  .dialog-photo { max-height: calc(100dvh - 210px); }
}
