/* Scoped to the public gallery overlay; the original grid is unchanged. */
.sl-gallery {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, .94);
    overflow: hidden;
}
.sl-gallery[open] { display: flex; flex-direction: column; gap: 8px; }
.sl-gallery::backdrop { background: rgba(0, 0, 0, .9); }
.sl-gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 44px; }
.sl-gallery button { min-width: 44px; min-height: 44px; border: 1px solid #777; border-radius: 6px; background: #202020; color: #fff; cursor: pointer; }
.sl-gallery button:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.sl-gallery button[hidden] { display: none; }
.sl-gallery-close { font-size: 30px; line-height: 1; }
.sl-gallery-content { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; flex: 1; min-height: 0; }
.sl-gallery-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sl-gallery-stage { display: flex; align-items: center; justify-content: center; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
#modalImagemSrc { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.sl-gallery-navigation { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-top: 6px; }
#modalImagemLegenda { flex: 1; min-width: 0; margin: 0; max-height: 3.5em; overflow-y: auto; overflow-wrap: anywhere; text-align: center; color: #fff; line-height: 1.5; }
.sl-gallery-thumbnails { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 3px; }
.sl-gallery-thumbnails button { flex: 0 0 76px; padding: 3px; border: 2px solid transparent; }
.sl-gallery-thumbnails button[aria-current="true"] { border-color: var(--luz-principal, #c6a43f); box-shadow: inset 0 0 0 1px var(--luz-principal, #c6a43f); }
.sl-gallery-thumbnails img { display: block; width: 100%; height: 66px; object-fit: contain; }
.sl-gallery-content.sl-gallery-single { grid-template-columns: minmax(0, 1fr); }
.sl-gallery-single .sl-gallery-thumbnails { display: none; }
@media (max-width: 767px) {
    .sl-gallery-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 70px; gap: 8px; }
    .sl-gallery-thumbnails { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
    .sl-gallery-thumbnails button { flex-basis: 68px; }
    .sl-gallery-thumbnails img { height: 48px; }
    .sl-gallery-content.sl-gallery-single { grid-template-rows: minmax(0, 1fr); }
}
@media (max-height: 450px) and (max-width: 767px) {
    .sl-gallery-content { grid-template-rows: minmax(0, 1fr) 58px; }
    .sl-gallery-thumbnails img { height: 36px; }
}
