/* Proportional rows, with a fully aligned final row and readable pagination. */
.gallery--justified { --gallery-gap:16px; display:flex; flex-direction:column; gap:var(--gallery-gap); columns:auto; }
.gallery__row { display:flex; align-items:stretch; gap:var(--gallery-gap); width:100%; }
.gallery__row .gallery__item { min-width:0; height:100%; margin:0; }
.gallery__row .gallery__trigger { height:100%; border-radius:14px; }
.gallery__row .gallery__trigger img { object-fit:cover; object-position:center; }
.gallery__footer { gap:1rem; margin-top:2rem; padding-top:1.5rem; border-top:1px solid var(--line); }
.gallery__count,:root[lang="ur"] .gallery__count,:root[lang="ar"] .gallery__count { font-size:.875rem; line-height:1.8; letter-spacing:0; text-transform:none; text-align:center; }
#gallery .gallery__more { display:inline-flex; align-items:center; justify-content:center; gap:.8rem; min-height:48px; padding:.8rem 1.6rem; border-radius:50px; border:1px solid var(--button-bg); background:var(--button-bg); color:var(--button-text); font-size:.875rem; line-height:1.7; }
#gallery .gallery__more:hover { background:var(--button-hover); border-color:var(--button-hover); }
@media(max-width:820px) { .gallery--justified { --gallery-gap:10px; } .gallery__row .gallery__trigger { border-radius:10px; } .gallery__footer { margin-top:1.5rem; padding-top:1.25rem; } }
@media(prefers-reduced-motion:reduce) { .gallery__trigger { transition:none; } }
@media(min-width:821px) {
 .section.gallery-section { padding-bottom:3rem; }
 .section.resources-section { padding-top:3rem !important; }
}
