.project-locations { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.location-card { display: flex; flex-direction: column; min-height: 300px; border-top: 3px solid var(--orange); }
.location-card > img, .location-cover, .location-image-placeholder { width: 100%; height: 190px; object-fit: cover; background: linear-gradient(135deg, #b2a28b, #344c5d); }
.location-cover { display: block; padding: 0; border: 0; overflow: hidden; cursor: pointer; }
.location-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.location-cover:hover img { transform: scale(1.03); }
.location-card .project-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.location-card h3 { margin: 7px 0 14px; font-size: 1.45rem; }
.view-gallery { margin-top: auto; padding: 0; border: 0; background: transparent; color: var(--ink); font: 700 .9rem "DM Sans", sans-serif; text-align: left; }
.view-gallery span { margin-left: 6px; color: var(--orange); font-size: 1.2em; }
.view-gallery:hover { color: var(--orange); }

html.gallery-open, body.gallery-open { overflow: hidden; overscroll-behavior: none; }
.gallery-dialog { width: min(1040px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.gallery-dialog > .close { position: fixed !important; top: 16px !important; right: 16px !important; z-index: 1001; display: grid; width: 42px; height: 42px; place-items: center; margin: 0; border-radius: 50%; background: #fff; color: #102333; box-shadow: 0 2px 12px rgb(0 0 0 / .28); }
.gallery-dialog h2 { margin-bottom: 8px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.gallery-thumb { position: relative; display: block; aspect-ratio: 1 / .72; padding: 0; border: 0; overflow: hidden; background: #102333; cursor: zoom-in; }
.gallery-thumb img, .gallery-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; background: #102333; }
.gallery-play { position: absolute; inset: 50% auto auto 50%; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; transform: translate(-50%, -50%); background: rgb(0 0 0 / .68); color: #fff; font-size: .75rem; }
.gallery-viewer { position: fixed; z-index: 1005; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 22px; background: rgb(3 14 23 / .96); }
.gallery-viewer[hidden] { display: none; }
.gallery-viewer-media { display: grid; width: 100%; height: 100%; place-items: center; overflow: hidden; }
.gallery-viewer-media img, .gallery-viewer-media video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-viewer-close, .gallery-viewer-nav { border: 0; background: rgb(255 255 255 / .9); color: #102333; cursor: pointer; }
.gallery-viewer-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; font-size: 2rem; line-height: 1; }
.gallery-viewer-nav { width: 44px; height: 56px; border-radius: 4px; font-size: 2.5rem; line-height: 1; }
.gallery-viewer-count { grid-column: 1 / -1; margin: 0; color: #fff; text-align: center; font-weight: 700; }
.admin-tabs { flex-wrap: wrap; }
.admin-tabs button { white-space: nowrap; }
.form-grid select { display: block; width: 100%; font: inherit; margin-top: 6px; padding: 11px; border: 1px solid #cbd2d1; border-radius: 2px; background: #fff; }

@media (max-width: 900px) { .project-locations { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .project-locations { grid-template-columns: 1fr; }
  .location-card { min-height: 0; }
  .location-card > img, .location-cover, .location-image-placeholder { height: 220px; }
  .gallery-dialog { position: fixed; inset: 8px; width: auto; height: auto; max-height: none; margin: 0; padding: 48px 14px 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  #gallery-dialog > .close { width: 40px; height: 40px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
  .gallery-thumb { aspect-ratio: 1 / .76; }
  .gallery-play { width: 30px; height: 30px; font-size: .65rem; }
  .gallery-viewer { gap: 8px; padding: 12px 8px 18px; }
  .gallery-viewer-nav { width: 34px; height: 48px; font-size: 2rem; }
  .gallery-viewer-close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 1.75rem; }
}
