/* Project albums sit inside the same photographic blue frame as Services. */
.gallery-main {
  padding-block: 60px;
  color: #fff;
}

.gallery-intro {
  margin-bottom: clamp(22px, 2.3vw, 34px);
}
.gallery-intro h1 {
  margin: 0 0 clamp(16px, 1.8vw, 26px);
  color: #fff;
  font-size: clamp(3.25rem, 7.3vw, 6.875rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.045em;
  text-transform: uppercase;
  text-shadow: 0 3px 10px rgb(0 8 32 / 34%);
}
.gallery-intro h1 > span {
  color: var(--directory-orange);
}
.gallery-intro > p {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #e4edff;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.gallery-intro > p::before {
  content: "";
  flex: none;
  width: 27px;
  height: 7px;
  background: var(--directory-orange);
  transform: skewX(-28deg);
}

.gallery-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  margin-bottom: 22px;
  padding-block: 14px;
  border-block: 1px solid rgb(227 238 255 / 38%);
}
.gallery-filters,
.gallery-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.gallery-pagination {
  justify-content: center;
  margin-top: 32px;
}
.gallery-filters button,
.gallery-pagination button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgb(226 237 255 / 65%);
  border-radius: 6px;
  background: rgb(9 26 112 / 54%);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: none;
  transition: background 180ms, color 180ms, border-color 180ms;
}
.gallery-pagination button {
  min-width: 44px;
}
.gallery-filters button[aria-pressed="true"],
.gallery-pagination button[aria-current="page"] {
  border-color: #ffc79b;
  background: var(--directory-orange);
  color: #18223a;
}
.gallery-pagination button:disabled {
  opacity: .55;
  cursor: default;
}
.gallery-results {
  color: #e4edff;
  font-size: .875rem;
}
.gallery-albums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px 20px;
}
.gallery-albums,
.gallery-album {
  scroll-margin-top: calc(var(--site-header-height) + 20px);
}
.gallery-album {
  min-width: 0;
}
.gallery-album-open {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 4px;
  border: 1px solid rgb(204 222 255 / 66%);
  border-radius: 10px;
  background: linear-gradient(150deg, #1d2d43, #252a30 80%);
  color: #fff;
  box-shadow: 0 3px 0 rgb(20 39 92 / 78%), 0 10px 24px rgb(0 8 32 / 24%);
  transition: transform 180ms, border-color 180ms, box-shadow 180ms;
}
.gallery-album-image {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 2fr 1fr;
  gap: 3px;
  aspect-ratio: 1.45;
  border-radius: 6px 6px 2px 2px;
  overflow: hidden;
  background: #283447;
}
.gallery-album-cover { grid-column: 1 / -1; position: relative; min-height: 0; }
.gallery-album-detail { min-height: 0; overflow: hidden; }
.gallery-album-image img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
#sunrise-flat-roof .gallery-album-image img { object-position: center 12%; }
.gallery-cover-primary { transition: opacity 650ms ease; }
.gallery-cover-alternate { position: absolute; inset: 0; opacity: 0; transition: opacity 650ms ease; }

.gallery-album-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px clamp(12px, 1.2vw, 19px) 12px;
}
.gallery-location {
  margin-bottom: 5px;
  color: #d8e6f8;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .075em;
  line-height: 1.4;
  text-shadow: none;
}
.gallery-album-copy h2 {
  margin-bottom: 15px;
  color: #fff;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  text-shadow: none;
}
.gallery-album-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgb(215 230 252 / 27%);
}
.gallery-photo-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d8e6f8;
  font-size: .8125rem;
  white-space: nowrap;
}
.gallery-photo-count .icon {
  width: 16px;
  height: 16px;
  color: #ffb487;
}
.gallery-album-cta {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid rgb(255 180 135 / 68%);
  border-radius: 5px;
  color: #ffbf98;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-shadow: none;
}
.gallery-album-cta > span { display: none; }
.gallery-album-open:focus-visible,
.gallery-filters button:focus-visible,
.gallery-pagination button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.gallery-album-open:focus-visible .gallery-cover-alternate { opacity: 1; }
.gallery-fallback figure { margin: 28px 0; }
.gallery-fallback figcaption { padding-top: 12px; }
.gallery-main .gallery-empty { color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .gallery-filters button:not([aria-pressed="true"]):hover,
  .gallery-pagination button:not(:disabled, [aria-current="page"]):hover {
    background: #fff;
    border-color: #fff;
    color: #122b7c;
  }
  .gallery-album-open:hover {
    transform: translateY(-3px);
    border-color: var(--directory-orange);
    box-shadow: 0 13px 30px rgb(0 8 32 / 35%);
  }
  .gallery-album-open:hover .gallery-cover-alternate { opacity: 1; }
  .gallery-album-open:hover .gallery-album-cta {
    background: var(--directory-orange);
    border-color: var(--directory-orange);
    color: #18223a;
  }
}
@media (max-width: 1000px) {
  .gallery-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .gallery-main { padding: 38px 22px 40px; }
  .gallery-intro { margin-bottom: 20px; }
  .gallery-intro h1 { font-size: clamp(2.65rem, 10vw, 4.375rem); }
  .gallery-intro > p { font-size: .8125rem; letter-spacing: .07em; }
  .gallery-tools { gap: 9px; padding-block: 12px; margin-bottom: 16px; }
  .gallery-filters { gap: 6px; }
  .gallery-filters button, .gallery-pagination button { padding-inline: 10px; }
  .gallery-filters { width: 100%; }
  .gallery-results { font-size: .8125rem; }
  .gallery-albums { gap: 16px 10px; }
  .gallery-album-open { border-radius: 7px; padding: 3px; }
  .gallery-album-image { aspect-ratio: 1.2; gap: 2px; border-radius: 4px 4px 1px 1px; }
  .gallery-album-copy { padding: 10px 7px 8px; }
  .gallery-location { font-size: .75rem; letter-spacing: .035em; }
  .gallery-album-copy h2 { font-size: clamp(1rem, 3.6vw, 1.25rem); margin-bottom: 11px; }
  .gallery-album-meta { gap: 7px; padding-top: 8px; }
  .gallery-album-cta { padding: 4px 7px; font-size: .8125rem; }
  .gallery-photo-count { gap: 4px; font-size: .75rem; }
  .gallery-photo-count .icon { width: 13px; height: 13px; }
  .gallery-pagination { gap: 5px; margin-top: 24px; }
}
@media (max-width: 359px) {
  .gallery-main { padding-inline: 20px; }
  .gallery-albums { grid-template-columns: minmax(0, 1fr); }
  .gallery-album-image { aspect-ratio: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-album-open, .gallery-cover-primary, .gallery-cover-alternate,
  .gallery-filters button, .gallery-pagination button { transition: none; }
  .gallery-album-open:hover { transform: none; }
  .gallery-cover-alternate { display: none; }
}
@media (forced-colors: active) {
  .gallery-album-open, .gallery-album-cta { border-color: LinkText; }
  .gallery-filters button[aria-pressed="true"],
  .gallery-pagination button[aria-current="page"] { border: 3px solid Highlight; }
}

body.project-viewer-open { overflow: hidden; }
.project-viewer { padding: 0; border: 1px solid rgb(190 214 255 / 58%); border-radius: 10px; width: min(1280px, calc(100vw - 40px)); max-width: none; height: min(940px, calc(100dvh - 40px)); max-height: none; background: #101a2a; color: #fff; overflow: hidden; box-shadow: 0 24px 90px #0008; }
.project-viewer::backdrop { background: rgb(5 14 44 / 88%); }
.project-viewer-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.project-viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: var(--directory-header); border-bottom: 1px solid rgb(190 214 255 / 40%); }
.project-viewer-top p { color: #e4edff; font-size: .8125rem; letter-spacing: .12em; margin-bottom: 7px; }
.project-viewer-top h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.02em; color: #fff; text-shadow: none; }
.project-viewer-close, .project-viewer-arrow { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none; border: 1px solid #ffffff55; background: rgb(8 24 70 / 90%); color: #fff; border-radius: 50%; }
.project-viewer-close:hover, .project-viewer-arrow:hover { background: var(--blue); }
.project-viewer-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 14px 76px; touch-action: pan-y pinch-zoom; }
.project-viewer-image { width: 100%; height: 100%; object-fit: contain; user-select: none; }
.project-viewer-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
.project-viewer-prev { left: 16px; }
.project-viewer-next { right: 16px; }
.project-viewer-bottom { padding: 10px 24px 18px; border-top: 1px solid rgb(190 214 255 / 26%); background: #172946; }
.project-viewer-details { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; margin: 0 0 14px; }
.project-viewer-caption { color: #e4edff; font-size: 1rem; line-height: 1.5; }
.project-viewer-count { color: #e4edff; font-size: .875rem; white-space: nowrap; }
.project-viewer-thumbnails { display: flex; justify-content: center; gap: 10px; }
.project-viewer-thumb { flex: 0 1 84px; padding: 3px; border: 2px solid transparent; border-radius: 5px; opacity: .6; min-width: 0; }
.project-viewer-thumb img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 2px; }
.project-viewer-thumb[aria-pressed="true"] { border-color: var(--directory-orange); opacity: 1; }
.project-viewer-thumb:hover { opacity: 1; }
.project-viewer button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 680px) {
  .project-viewer { width: 100%; height: 100dvh; border: 0; border-radius: 0; margin: 0; }
  .project-viewer-top { padding: max(15px, env(safe-area-inset-top)) 16px 15px; }
  .project-viewer-top h2 { font-size: 17px; }
  .project-viewer-top p { font-size: .75rem; }
  .project-viewer-close { width: 44px; height: 44px; }
  .project-viewer-stage { padding: 8px 0; }
  .project-viewer-arrow { width: 44px; height: 44px; top: auto; bottom: 14px; transform: none; }
  .project-viewer-prev { left: 12px; }
  .project-viewer-next { right: 12px; }
  .project-viewer-bottom { padding: 12px 16px max(20px, env(safe-area-inset-bottom)); }
  .project-viewer-details { margin-bottom: 14px; gap: 12px; }
  .project-viewer-caption { font-size: .875rem; }
  .project-viewer-count { font-size: .8125rem; }
  .project-viewer-thumbnails { flex-wrap: wrap; gap: 5px; }
  .project-viewer-thumb { flex: 0 1 calc((100% - 20px) / 5); max-width: 64px; min-height: 44px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .project-viewer { height: 100dvh; width: 100%; margin: 0; border: 0; border-radius: 0; }
  .project-viewer-top { padding: 7px 16px; }
  .project-viewer-top p { display: none; }
  .project-viewer-top h2 { font-size: 16px; }
  .project-viewer-bottom { padding: 6px 18px; }
  .project-viewer-details { margin: 0; }
  .project-viewer-thumbnails { display: none; }
  .project-viewer-stage { padding: 4px 65px; }
  .project-viewer-arrow { top: 50%; bottom: auto; transform: translateY(-50%); }
}
