/* Sky Regent Gallery: layout and mobile refinements on top of the theme's gallery styles. */
.skyg{--skyg-gap:14px;}
.skyg .gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:220px;grid-auto-flow:dense;gap:var(--skyg-gap);}
/* Feature tiles are assigned by class (recomputed after filtering) instead of nth-child. */
.skyg .gallery__item:nth-child(n){grid-column:auto;grid-row:auto;}
.skyg .gallery__item.is-wide{grid-column:span 2;grid-row:span 2;}
.skyg .gallery__item.is-tall{grid-row:span 2;}
.skyg .gallery__item[hidden]{display:none;}
.skyg .gallery__item:focus-visible{outline:3px solid var(--accent,#0B5CD5);outline-offset:3px;}
.skyg .gallery__item img{display:block;}

.skyg-count{display:inline-block;min-width:1.7em;margin-left:6px;padding:1px 7px;border-radius:999px;background:rgba(11,92,213,.1);font-size:.75rem;line-height:1.5;text-align:center;}
.skyg .gallery-filter button[aria-pressed="true"] .skyg-count{background:rgba(255,255,255,.24);}
.skyg-empty{margin:0;padding:40px 0;text-align:center;color:var(--muted,#5D6D84);}
.skyg-lb-count{display:block;margin-top:6px;font-size:.8rem;opacity:.7;}
.skyg-lightbox .lightbox__figure img{touch-action:pan-y;-webkit-user-select:none;user-select:none;}

@media (max-width:900px){
  .skyg .gallery{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:180px;}
}
/* Phones: one scrollable row of filter pills instead of a tall wrapped block. */
@media (max-width:640px){
  .skyg .gallery-filter{flex-wrap:nowrap;justify-content:flex-start;gap:8px;overflow-x:auto;margin-bottom:20px;padding:2px 2px 8px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none;}
  .skyg .gallery-filter::-webkit-scrollbar{display:none;}
  .skyg .gallery-filter button{flex:0 0 auto;padding:9px 16px;font-size:.85rem;white-space:nowrap;scroll-snap-align:center;}
  .skyg-lightbox{padding:56px 8px 84px;}
  .skyg-lightbox .lightbox__figure img{max-height:calc(100vh - 180px);max-height:calc(100dvh - 180px);}
}
@media (max-width:480px){
  .skyg{--skyg-gap:8px;}
  .skyg .gallery{grid-auto-rows:clamp(120px,40vw,170px);}
  .skyg .gallery__cap{padding:22px 10px 8px;font-size:.75rem;}
}
/* Touch screens have no hover: always show captions, drop hover-only zoom badge. */
@media (hover:none){
  .skyg .gallery__cap{opacity:1;transform:none;}
  .skyg .gallery__zoom{display:none;}
  .skyg .gallery__item:hover img{transform:none;opacity:1;}
}
@media (prefers-reduced-motion:reduce){
  .skyg .gallery__item img,.skyg .gallery__cap{transition:none;}
}
/* The theme's off-canvas mobile menu sits just off-screen inside the header and widens the
   phone layout to twice the screen width, which breaks full-screen overlays like the lightbox. */
@media (max-width:1024px){ .site-header{overflow-x:clip;} }
