.vig-gallery {
  --vig-columns: 3; --vig-row-height: 220px; --vig-gap: 18px; --vig-radius: 16px;
  --vig-overlay: #09172366; --vig-zoom: 1.035; --vig-duration: 420ms;
  --vig-icon: #fff; --vig-caption: #fff; --vig-caption-bg: #091723b3;
  display: grid; grid-template-columns: repeat(var(--vig-columns), minmax(0, 1fr));
  grid-auto-rows: var(--vig-row-height); grid-auto-flow: row dense; gap: var(--vig-gap);
}
.vig-gallery, .vig-gallery * { box-sizing: border-box; }
.vig-gallery--grid4 { --vig-columns: 4; }
.vig-gallery--left, .vig-gallery--right { --vig-columns: 2; }
.vig-gallery--bento-left, .vig-gallery--bento-right { --vig-columns: 4; }
.vig-gallery--editorial { --vig-columns: 6; }
.vig-gallery--mosaic { --vig-columns: 4; }
.vig-gallery--left .vig-item:nth-child(3n+1) { grid-column: 1; grid-row: span 2; }
.vig-gallery--right .vig-item:nth-child(3n+1) { grid-column: 2; grid-row: span 2; }
.vig-gallery--bento-left .vig-item:nth-child(5n+1) { grid-column: 1 / span 2; grid-row: span 2; }
.vig-gallery--bento-right .vig-item:nth-child(5n+1) { grid-column: 3 / span 2; grid-row: span 2; }
.vig-gallery--editorial .vig-item:nth-child(4n+1) { grid-column: span 3; grid-row: span 2; }
.vig-gallery--editorial .vig-item:nth-child(4n+2) { grid-column: span 3; }
.vig-gallery--editorial .vig-item:nth-child(4n+3) { grid-column: span 2; }
.vig-gallery--mosaic .vig-item:nth-child(6n+1), .vig-gallery--mosaic .vig-item:nth-child(6n+4) { grid-column: span 2; }
.vig-gallery--mosaic .vig-item:nth-child(6n+2) { grid-row: span 2; }
.vig-gallery:is(.vig-gallery--left, .vig-gallery--right) .vig-item:nth-child(3n+1):nth-last-child(-n+2) { grid-column: auto; grid-row: auto; }
.vig-gallery:is(.vig-gallery--left, .vig-gallery--right) .vig-item:nth-child(3n+1):last-child { grid-column: 1 / -1; }
.vig-gallery--editorial .vig-item:nth-child(4n+1):nth-last-child(2) { grid-row: auto; }
.vig-gallery--editorial .vig-item:nth-child(4n+1):last-child { grid-column: 1 / -1; grid-row: auto; }
.vig-gallery--editorial .vig-item:nth-child(4n+3):last-child { grid-column: span 3; }
/* Keep the final incomplete bento group balanced rather than leaving a tall orphan. */
.vig-gallery:is(.vig-gallery--bento-left, .vig-gallery--bento-right) .vig-item:nth-child(5n+1):nth-last-child(-n+4) { grid-column: span 2; grid-row: auto; }
.vig-gallery:is(.vig-gallery--bento-left, .vig-gallery--bento-right) .vig-item:nth-child(5n+1):nth-last-child(4) { grid-column: auto; }
.vig-gallery:is(.vig-gallery--bento-left, .vig-gallery--bento-right) .vig-item:nth-child(5n+1):last-child { grid-column: 1 / -1; }
.vig-gallery:is(.vig-gallery--bento-left, .vig-gallery--bento-right) .vig-item:nth-child(5n+2):last-child { grid-column: span 2; }
.vig-gallery .vig-item {
  position: relative; display: block; min-width: 0; min-height: 0; margin: 0; padding: 0;
  border-radius: var(--vig-radius); overflow: hidden; isolation: isolate;
  background: #e7ecee; text-decoration: none; color: inherit;
}
.vig-gallery a.vig-item { cursor: zoom-in; }
.vig-gallery .vig-image {
  display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center;
  transition: transform var(--vig-duration) cubic-bezier(.2, 0, 0, 1);
}
.vig-gallery .vig-overlay { position: absolute; inset: 0; pointer-events: none; background: var(--vig-overlay); opacity: 0; transition: opacity var(--vig-duration) ease; }
.vig-gallery .vig-open {
  position: absolute; top: 16px; right: 16px; display: grid; place-items: center;
  width: 40px; height: 40px; border: 1px solid #ffffff5c; border-radius: 50%;
  color: var(--vig-icon); background: #09172350; opacity: 0; pointer-events: none;
  transition: opacity var(--vig-duration) ease;
}
.vig-gallery .vig-open svg { width: 20px; height: 20px; }
.vig-gallery .vig-caption {
  position: absolute; inset: auto 16px 16px; width: fit-content; max-width: calc(100% - 32px);
  padding: 9px 13px; border-radius: 9px; background: var(--vig-caption-bg); color: var(--vig-caption);
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.45;
  opacity: 0; pointer-events: none; overflow-wrap: anywhere; transition: opacity var(--vig-duration) ease;
}
.vig-gallery.vig-captions--always .vig-caption { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .vig-gallery:not(.vig-hover--overlay):not(.vig-hover--none) .vig-item:hover .vig-image { transform: scale(var(--vig-zoom)); }
  .vig-gallery:not(.vig-hover--none):not(.vig-hover--zoom) .vig-item:hover .vig-overlay { opacity: 1; }
  .vig-gallery:not(.vig-hover--none) .vig-item:hover :is(.vig-open, .vig-caption) { opacity: 1; }
}
.vig-gallery .vig-item:focus-visible { outline: 3px solid #ed9308; outline-offset: 4px; }
.vig-gallery .vig-item:focus-visible :is(.vig-overlay, .vig-open, .vig-caption) { opacity: 1; }
@media (hover: none) { .vig-gallery.vig-captions--hover .vig-caption, .vig-gallery .vig-open { opacity: 1; } }
@media (max-width: 1024px) {
  .vig-gallery { --vig-columns: 2; --vig-row-height: 240px; }
  .vig-gallery[class] .vig-item:nth-child(n):nth-last-child(n) { grid-column: auto; grid-row: auto; }
}
@media (max-width: 767px) { .vig-gallery { --vig-columns: 1; --vig-row-height: 260px; } }
.vig-empty { padding: 32px; border: 1px dashed #bcc8ce; border-radius: 12px; color: #526773; text-align: center; }
/* A single native dialog is shared by all galleries on the current document. */
dialog.vig-lightbox {
  position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  padding: 20px; margin: 0; border: 0; box-sizing: border-box; color: #fff; background: #07121af5;
  font-family: system-ui, sans-serif;
}
dialog.vig-lightbox[open] { display: flex; flex-direction: column; gap: 14px; }
.vig-lightbox::backdrop { background: #07121a; }
.vig-lightbox .vig-lb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
.vig-lightbox .vig-lb-counter { font-size: 13px; color: #c7d2da; padding-inline: 12px; }
.vig-lightbox .vig-lb-stage { position: relative; display: grid; place-items: center; min-height: 0; flex: 1; width: 100%; touch-action: pan-y pinch-zoom; }
.vig-lightbox .vig-lb-figure { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; margin: 0; gap: 16px; }
.vig-lightbox .vig-lb-image { display: block; object-fit: contain; min-height: 0; max-height: 100%; max-width: calc(100% - 128px); flex: 0 1 auto; width: auto; height: auto; border-radius: 5px; }
.vig-lightbox .vig-lb-caption { color: #e6edf2; font-size: 14px; line-height: 1.5; max-width: min(800px, 90%); max-height: 18vh; overflow: auto; text-align: center; flex: 0 0 auto; overflow-wrap: anywhere; }
.vig-lightbox .vig-lb-status { position: absolute; inset: 45% 10% auto; text-align: center; pointer-events: none; font-size: 14px; }
.vig-lightbox button.vig-lb-button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid #ffffff40; border-radius: 50%; color: #fff; background: #ffffff0d;
  cursor: pointer; transition: background-color 180ms ease; appearance: none;
}
.vig-lightbox button.vig-lb-button:hover { background: #ffffff20; }
.vig-lightbox .vig-lb-button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.vig-lightbox .vig-lb-button svg { width: 22px; height: 22px; }
.vig-lightbox .vig-lb-prev, .vig-lightbox .vig-lb-next { position: absolute; top: calc(50% - 22px); }
.vig-lightbox .vig-lb-prev { left: 0; }.vig-lightbox .vig-lb-next { right: 0; }
.vig-lightbox [hidden] { display: none !important; }
@media (max-width: 767px) {
  dialog.vig-lightbox { padding: 14px; }
  .vig-lightbox .vig-lb-image { max-width: 100%; max-height: calc(100% - 65px); }
  .vig-lightbox .vig-lb-stage { padding-bottom: 60px; box-sizing: border-box; }
  .vig-lightbox .vig-lb-prev, .vig-lightbox .vig-lb-next { top: auto; bottom: 0; }
  .vig-lightbox .vig-lb-prev { left: calc(50% - 52px); }.vig-lightbox .vig-lb-next { right: calc(50% - 52px); }
}
@media (prefers-reduced-motion: reduce) {
  .vig-gallery .vig-image, .vig-gallery .vig-overlay, .vig-gallery .vig-open, .vig-gallery .vig-caption { transition: none; }
  .vig-gallery[class] .vig-item:hover .vig-image { transform: none !important; }
  .vig-lightbox button.vig-lb-button { transition: none; }
}
