.yd-gallery { display:grid; gap:1rem; }
.yd-gallery.columns-2 { grid-template-columns:repeat(2,1fr); }
.yd-gallery.columns-3 { grid-template-columns:repeat(3,1fr); }
.yd-gallery.columns-4 { grid-template-columns:repeat(4,1fr); }
.yd-gallery.columns-5 { grid-template-columns:repeat(5,1fr); }
.yd-gallery.columns-6 { grid-template-columns:repeat(6,1fr); }

@media (max-width:1024px){ .yd-gallery.columns-4,.yd-gallery.columns-5,.yd-gallery.columns-6{ grid-template-columns:repeat(3,1fr);} }
@media (max-width:768px){ .yd-gallery { grid-template-columns:repeat(2,1fr) !important; } }
@media (max-width:480px){ .yd-gallery { grid-template-columns:1fr !important; } }

.yd-gallery-item{ position:relative; overflow:hidden; background:#eef1f5; }
.yd-gallery-item a{ display:block; position:relative; }
.yd-gallery-item img{ width:100%; height:auto; display:block; transition: transform .3s ease; }
.yd-gallery-item a:hover img, .yd-gallery-item a:focus img{ transform: scale(1.03); }

/* Overlay inside the link */
.yd-overlay{ position:absolute; inset:0; background:var(--yd-overlay-bg, #5F3D5DB0); display:flex; justify-content:center; text-align:center; opacity:0; transition:opacity .2s ease-in-out; pointer-events:none; z-index:2; }
.yd-gallery-item a:hover .yd-overlay, .yd-gallery-item a:focus .yd-overlay{ opacity:1; }

.yd-overlay-title{ color:var(--yd-overlay-text, #fff); margin:auto; font-weight:600; font-size:var(--yd-overlay-size, 1.1rem); }

.yd-pagination{ margin-top:1rem; text-align:center; }
.yd-empty{ padding:1rem; text-align:center; color:#666; background:#fafafa; border:1px dashed #e2e2e2; border-radius:6px; }
