.widget-gallery .section-title { margin-inline: auto; text-align: center; }
.widget-gallery .section-title p { margin-inline: auto; }
.widget-gallery__preview { position: relative; overflow-anchor: none; }
.widget-gallery__preview.is-collapsed .widget-gallery__window { max-height: var(--fold-height); overflow: clip; }
.widget-gallery__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.widget-gallery__reveal:not([hidden]) { display: flex; justify-content: center; padding-top: 1.5rem; }
.widget-gallery__preview.is-collapsed .widget-gallery__reveal { position: absolute; inset: auto 0 0; height: var(--fade-height); align-items: flex-end; padding: 0 1rem 1rem; background: linear-gradient(to bottom, transparent, var(--surface) 85%); pointer-events: none; }
.widget-gallery__reveal .btn { pointer-events: auto; box-shadow: 0 6px 24px #482b1426; }
.widget-gallery__tile { display: block; height: 100%; overflow: hidden; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: .75rem; cursor: zoom-in; text-decoration: none; }
.widget-gallery__tile:is(:hover, :focus-visible) { color: var(--link); border-color: var(--accent); }
.widget-gallery__frame { display: block; position: relative; aspect-ratio: 4 / 3; background: var(--paper); }
.widget-gallery__frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: .65rem; object-fit: contain; }
.widget-gallery__label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding: .7rem .85rem; font-weight: 700; }
.widget-gallery__label svg { color: var(--accent); }
.widget-gallery__dialog { width: fit-content; min-width: min(94vw, 25rem); max-width: min(94vw, 62rem); max-height: 94vh; max-height: 94dvh; padding: clamp(.85rem, 2vw, 1.25rem); margin: auto; overflow: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; box-shadow: var(--shadow); }
.widget-gallery__dialog::backdrop { background: rgb(36 23 14 / 78%); }
.widget-gallery__toolbar, .widget-gallery__controls { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.widget-gallery__toolbar h3 { margin: 0; font-size: 1.15rem; }
.widget-gallery__image { display: grid; place-items: center; margin-block: .85rem; }
.widget-gallery__image img { display: block; width: auto; max-width: 100%; max-height: 65vh; max-height: 65dvh; object-fit: contain; }
.widget-gallery__controls { color: var(--muted); font-size: .9rem; }
@media (max-width: 991.98px) { .widget-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; } }
@media (max-width: 479.98px) {
    .widget-gallery__grid { grid-template-columns: 1fr; }
    .widget-gallery__controls .btn { padding-inline: .5rem; font-size: .9rem; }
}
