/* Gallery enhancements use the shared grid, dialog, color and focus styles. */
html.gallery-pending #galleryGrid .gallery-card:nth-child(n+7){display:none}
.amenity .amenity-photo{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;margin-top:12px;color:var(--green);font-size:.85rem;font-weight:600;line-height:1.5;text-decoration:underline;text-underline-offset:4px}
.amenity .amenity-photo+.amenity-photo{margin-top:2px}
.amenity .amenity-photo .icon{flex-shrink:0;width:18px;height:18px}
.gallery-grid{align-items:start}
.gallery-card .gallery-trigger img{aspect-ratio:4/3}
.gallery-card figcaption{padding:16px 18px 18px}
/* A large exterior image leads the complete desktop collection. Keeping
   DOM order and normal flow for the remaining cards preserves keyboard order. */
@media(min-width:1100px){
 .gallery-grid[data-gallery-layout="featured"]>.gallery-card--feature{grid-column:span 2;grid-row:span 2;align-self:stretch;display:grid;grid-template-rows:minmax(0,1fr) auto}
 .gallery-grid[data-gallery-layout="featured"]>.gallery-card--feature .gallery-trigger{min-height:0}
 .gallery-grid[data-gallery-layout="featured"]>.gallery-card--feature picture{display:block;height:100%}
 .gallery-grid[data-gallery-layout="featured"]>.gallery-card--feature img{height:100%;aspect-ratio:auto;object-fit:cover}
 .gallery-grid[data-gallery-layout="featured"]>.gallery-card--feature figcaption{padding:20px 22px;font-size:1.05rem}
}
/* One thumbnail frame keeps mixed rows compact; portrait equipment remains
   completely visible inside it. The lightbox still uses the original photo. */
.gallery-card--portrait .gallery-trigger img{object-fit:contain;background:var(--surface)}
.gallery-card--portrait .gallery-trigger:hover img{transform:none}
.gallery-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:18px;margin-bottom:26px}
.gallery-filters{display:flex;flex-wrap:wrap;gap:9px}
.gallery-filter,.gallery-more-button{min-height:46px;padding:11px 19px;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink);font-size:.9rem;line-height:1.4;font-weight:600}
.gallery-filter:hover,.gallery-more-button:hover{background:var(--surface)}
.gallery-filter[aria-pressed="true"]{border-color:var(--green);background:var(--green);color:var(--on-green)}
.gallery-results{font-size:.875rem;color:var(--muted);line-height:1.5}
.gallery-more-control{display:flex;justify-content:center;margin-top:28px}
.gallery-more-control:has([hidden]){margin-top:0}
.gallery-more-button{border-radius:8px;min-width:190px}
#galleryImageStage{min-height:120px;touch-action:pan-y pinch-zoom}
#galleryImageStage[data-state="loading"],#galleryImageStage[data-state="error"]{min-height:clamp(120px,calc(100dvh - 390px),340px)}
#galleryImageStage img{max-height:clamp(120px,calc(100dvh - 390px),620px);user-select:none;-webkit-user-select:none}
.gallery-dialog .dialog-top{position:sticky;top:-16px;z-index:2;padding-block:6px;background:var(--bg)}
.gallery-dialog .dialog-bottom>.icon-button{flex-shrink:0}
.gallery-room-description{max-width:720px;margin:8px auto 0;text-align:center;color:var(--muted);font-size:.875rem;line-height:1.5}
.gallery-thumbnails{display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;max-width:100%;padding:7px 4px;margin-top:12px;scroll-behavior:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
.gallery-thumbnail{position:relative;flex:0 0 88px;width:88px;height:68px;min-width:44px;min-height:44px;padding:3px;border:2px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}
.gallery-thumbnail:hover{border-color:var(--green)}
.gallery-thumbnail:focus-visible{outline-offset:-4px}
.gallery-thumbnail[aria-current="true"]{border-color:var(--green);background:var(--green)}
.gallery-thumbnail img{width:100%;height:100%;object-fit:contain;border-radius:3px;user-select:none;-webkit-user-select:none}
.gallery-thumbnail-number{position:absolute;right:4px;bottom:4px;min-width:19px;padding:1px 4px;border-radius:3px;background:var(--card);color:var(--ink);font-size:.7rem;font-weight:700;line-height:1.4}
.gallery-thumbnail[aria-current="true"] .gallery-thumbnail-number{background:var(--green);color:var(--on-green)}
.gallery-image-feedback{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}
.gallery-image-status:not(:empty){padding-top:14px;font-size:.9rem;color:var(--muted);text-align:center}
.gallery-image-feedback .text-button{margin-top:10px}
.gallery-dialog-footer{text-align:center;margin-top:14px;border-top:1px solid var(--line);padding-top:6px}
.gallery-dialog-footer>.text-link{font-size:.875rem;justify-content:center}
.gallery-dialog-footer>.text-link .icon{width:17px;height:17px}
.gallery-dialog-footer>p{color:var(--muted);font-size:.75rem;line-height:1.5}
@media(max-width:900px){.gallery-dialog .dialog-top{top:-12px}}
@media(max-width:600px){.gallery-tools{gap:13px;margin-bottom:22px}.gallery-filters{gap:7px}.gallery-filter{padding:10px 14px;font-size:.8rem;min-height:44px}.gallery-results{font-size:.8rem}.gallery-more-button{font-size:.85rem}.gallery-dialog-footer>p{max-width:280px;margin-inline:auto}.gallery-room-description{font-size:.8rem}.gallery-thumbnail{flex-basis:76px;width:76px;height:60px}.gallery-image-status:not(:empty){font-size:.85rem}}
/* Keep the selected photo and its controls together on short landscape screens.
   Scope grid display to open dialogs so the native closed state stays hidden. */
@media(orientation:landscape) and (max-height:500px) and (min-width:480px){
 .gallery-dialog[open]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);grid-template-areas:"image top" "image caption" "image description" "image thumbnails" "image footer";grid-template-rows:auto auto auto auto auto;gap:4px 12px;width:calc(100% - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:8px}
 .gallery-dialog .dialog-top{grid-area:top;position:static;padding:0;margin:0;gap:8px}
 #galleryImageStage{grid-area:image;min-width:0;min-height:0}
 #galleryImageStage[data-state="loading"],#galleryImageStage[data-state="error"]{min-height:0}
 #galleryImageStage img{width:100%;height:100%;max-height:calc(100dvh - 34px);object-fit:contain}
 .gallery-image-feedback{grid-area:image;align-self:center;z-index:1;padding:12px;gap:8px}
 #galleryImageStage[data-state="ready"]+.gallery-image-feedback{display:none}
 .gallery-image-status:not(:empty){padding:0;font-size:.8rem;line-height:1.5}
 .gallery-image-feedback .text-button{margin:0}
 .gallery-dialog .dialog-bottom{grid-area:caption;margin:0;gap:6px}
 .gallery-dialog .dialog-bottom p{font-size:.8rem;line-height:1.35}
 .gallery-room-description{grid-area:description;margin:0;text-align:left;font-size:.75rem;line-height:1.4}
 .gallery-thumbnails{grid-area:thumbnails;align-self:center;min-width:0;margin:0;padding:4px;gap:6px}
 .gallery-thumbnail{flex-basis:64px;width:64px;height:48px}
 .gallery-dialog-footer{grid-area:footer;margin:0;padding:0;border:0}
 .gallery-dialog-footer>.text-link{font-size:.8rem}
 .gallery-dialog-footer>p{display:none}
}
