/* Updated: renamed classes to avoid theme collisions (.gallery-item etc.) */
/* Force removal of legacy WP / theme styles targeting .gallery-item */

/* Constrain width so page is not full-bleed (match Contact-Us spacing philosophy) */
#galleryPage #primary.container { max-width:1320px !important; width:100%; padding:0 24px !important; margin:0 auto; }
#galleryPage .gallery-wrapper { margin:0 auto; padding:34px 10px 60px; max-width:100%; }
/* Optional panel look (comment out if not needed) */
/* #galleryPage .gallery-wrapper { background:#fff; border:1px solid #e6e6e9; border-radius:22px; box-shadow:0 4px 20px -10px rgba(0,0,0,.08); } */

#galleryPage .gallery-grid { 
	/* Switched to flex for natural centering when there are few images */
	display:flex !important; 
	flex-wrap:wrap; 
	gap:22px; 
	width:100%; 
	margin:0 auto; 
	align-items:stretch; 
	justify-content:center; /* center the row contents */
}

#galleryPage .gallery-grid .sd-gallery-item { position:relative; overflow:hidden; border-radius:14px; background:#f3f3f3; aspect-ratio:4/3; box-shadow:0 2px 4px rgba(0,0,0,.08); transition:.3s; width:260px !important; flex:0 0 260px; }
#galleryPage .gallery-grid .sd-gallery-item:hover { box-shadow:0 10px 26px -6px rgba(0,0,0,.25); transform:translateY(-3px); }

#galleryPage .gallery-grid .sd-gallery-item-content { position:absolute; inset:0; width:100%; height:100%; }
#galleryPage .gallery-grid img.sd-gallery-img { width:100% !important; height:100% !important; object-fit:cover; object-position:center; display:block; transition:transform .35s ease; cursor:pointer; }
#galleryPage .gallery-grid .sd-gallery-item:hover img.sd-gallery-img { transform:scale(1.05); }

#galleryPage .gallery-grid .sd-gallery-caption { position:absolute; left:0; right:0; bottom:0; padding:10px 12px 9px; background:linear-gradient(to top,rgba(0,0,0,.60),rgba(0,0,0,.15),rgba(0,0,0,0)); color:#fff; font-size:14px; line-height:1.25; opacity:1; font-weight:500; pointer-events:none; }
/* Hover no longer needed; keep rule stub (optional) */
#galleryPage .gallery-grid .sd-gallery-item:hover .sd-gallery-caption { opacity:1; }

@media (max-width:650px){ #galleryPage .gallery-grid .sd-gallery-caption { font-size:13px; padding:8px 10px 8px; } }

#galleryPage .gallery-grid .sd-gallery-item, 
#galleryPage .gallery-grid .sd-gallery-item * { float:none !important; max-width:none !important; }

@media (max-width:1400px){ #galleryPage .gallery-grid{gap:20px;} #galleryPage .gallery-grid .sd-gallery-item{width:240px !important; flex:0 0 240px;} }
@media (max-width:1100px){ #galleryPage .gallery-grid{gap:18px;} #galleryPage .gallery-grid .sd-gallery-item{width:220px !important; flex:0 0 220px;} }
@media (max-width:900px){ #galleryPage .gallery-grid{gap:16px;} #galleryPage .gallery-grid .sd-gallery-item{width:200px !important; flex:0 0 200px;} }
@media (max-width:650px){ #galleryPage .gallery-grid{gap:14px;} #galleryPage .gallery-grid .sd-gallery-item{width:180px !important; flex:0 0 180px;} }
@media (max-width:480px){ #galleryPage .gallery-grid{gap:12px; justify-content:center;} #galleryPage .gallery-grid .sd-gallery-item{width:160px !important; flex:0 0 160px;} }

/* Let items scale down slightly on very narrow screens */
@media (max-width:360px){ #galleryPage .gallery-grid .sd-gallery-item{width:140px !important; flex:0 0 140px;} }