/* Scoped layout resets protect the gallery from theme figure and image rules. */
.llg-gallery{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px!important;width:100%;margin:1.5em 0;clear:both;padding:0!important;box-sizing:border-box}
.llg-gallery.llg-ready{display:block!important}
.llg-gallery .llg-row{display:flex!important;flex-flow:row nowrap!important;gap:4px!important;width:100%!important;padding:0!important;margin:0 0 4px!important;border:0!important;box-sizing:border-box}
.llg-gallery .llg-row:last-child{margin-bottom:0!important}
.llg-gallery .llg-tile{display:block!important;position:relative!important;float:none!important;clear:none!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;overflow:hidden;background:#eee;box-sizing:border-box}
.llg-gallery.llg-ready .llg-row>.llg-tile{flex:var(--llg-ratio,1) 1 0%!important;width:0!important;height:100%!important}
.llg-gallery:not(.llg-ready) .llg-tile{width:auto!important}
.llg-gallery .llg-link{display:block;width:100%;height:100%;border:0!important;box-shadow:none!important}
.llg-gallery .llg-image{display:block!important;width:100%!important;height:100%!important;max-width:none!important;margin:0!important;object-fit:cover}
.llg-gallery:not(.llg-ready) .llg-image{height:auto!important}
.llg-gallery .llg-tile figcaption{position:absolute;bottom:0;left:0;right:0;padding:1.5em .6em .5em;margin:0;color:white;background:linear-gradient(transparent,rgba(0,0,0,.8));font:14px/1.4 system-ui,sans-serif;pointer-events:none;max-height:60%;overflow:auto}
.llg-gallery .llg-link:focus-visible{outline:3px solid #1675e0;outline-offset:-3px}
.llg-dialog{box-sizing:border-box;width:96vw;max-width:1600px;height:94vh;max-height:94vh;padding:50px 55px 60px;border:0;background:#111;color:#fff;overflow:hidden}
.llg-dialog::backdrop{background:rgba(0,0,0,.9)}
.llg-dialog .llg-full-image{display:block;width:100%;height:100%;object-fit:contain;margin:0}
.llg-dialog button{position:absolute;border:1px solid #777;background:#222;color:#fff;padding:8px 12px;font:22px/1 system-ui;cursor:pointer;border-radius:4px}
.llg-dialog button:focus-visible{outline:3px solid #65b6ff;outline-offset:3px}
.llg-close{right:12px;top:10px}.llg-prev{left:8px;top:45%}.llg-next{right:8px;top:45%}
.llg-dialog .llg-caption{position:absolute;bottom:10px;left:55px;right:55px;text-align:center;font:14px/1.4 system-ui;margin:0;max-height:44px;overflow:auto}
@media(max-width:600px){.llg-dialog{padding:50px 38px 65px}.llg-dialog .llg-caption{left:38px;right:38px}.llg-dialog button{padding:6px 8px}}

/* Square tiles retain a uniform grid even when the last row is incomplete. */
.llg-gallery.llg-square{display:grid!important;grid-template-columns:repeat(var(--llg-square-columns,3),minmax(0,1fr))!important}
.llg-gallery.llg-square>.llg-tile{aspect-ratio:1 / 1;width:auto!important;height:auto!important}
.llg-gallery.llg-square .llg-image{height:100%!important;object-fit:cover!important}
.llg-gallery.llg-square .llg-link{position:absolute;inset:0}
/* Keep thumbnails clear until the visitor points to or focuses the image. */
.llg-gallery .llg-tile figcaption{opacity:0!important;visibility:hidden!important}
.llg-gallery .llg-tile:hover figcaption,
.llg-gallery .llg-tile:focus-within figcaption{opacity:1!important;visibility:visible!important}
.llg-gallery .llg-tile:focus-visible{outline:3px solid #1675e0;outline-offset:-3px}

/* Natural-height masonry columns: photos retain their full aspect ratios. */
.llg-gallery.llg-columns{display:block!important;column-count:var(--llg-column-count,3);column-gap:4px!important}
.llg-gallery.llg-columns>.llg-tile{display:inline-block!important;vertical-align:top;break-inside:avoid;page-break-inside:avoid;width:100%!important;height:auto!important;margin:0 0 4px!important;aspect-ratio:auto}
.llg-gallery.llg-columns .llg-link{position:static;display:block;height:auto!important}
.llg-gallery.llg-columns .llg-image{height:auto!important;width:100%!important;object-fit:contain!important}
/* Responsive legacy YouTube shortcode; the requested size is an upper bound. */
.llg-youtube{position:relative;width:100%;margin:1.5em 0;padding:0;clear:both}
.llg-youtube iframe{position:absolute;inset:0;display:block;width:100%!important;height:100%!important;max-width:100%;border:0;margin:0}
