/* Isolated from WordPress's built-in lightbox and article styles. */

.mi-gallery-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: #171717;
  overflow: hidden;
  font-family: inherit;
}

.mi-gallery-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
}

.mi-gallery-dialog::backdrop {
  background: #fff;
}

.mi-gallery-dialog * {
  box-sizing: border-box;
}

.mi-gallery-toolbar,.mi-gallery-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #fff;
  z-index: 1;
}

.mi-gallery-toolbar {
  border-bottom: 1px solid #dedede;
}

.mi-gallery-count {
  margin-right: auto;
  font-size: 14px;
}

.mi-gallery-footer {
  justify-content: space-between;
  border-top: 1px solid #dedede;
}

.mi-gallery-dialog button {
  flex-shrink: 0;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.mi-gallery-dialog button:disabled {
  opacity: .45;
  cursor: default;
}

.mi-gallery-caption {
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

.mi-gallery-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.mi-gallery-canvas {
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
  width: max-content;
  height: max-content;
  padding: 12px;
}

.mi-gallery-dialog .mi-gallery-photo {
  display: block;
  max-width: none!important;
  max-height: none!important;
  min-width: 0!important;
  min-height: 0!important;
  margin: 0;
  object-fit: contain;
  user-select: none;
  cursor: zoom-in;
}

.mi-gallery-dialog .mi-gallery-photo[hidden] {
  display: none;
}

.mi-gallery-stage.is-zoomed {
  cursor: grab;
}

.mi-gallery-stage.is-zoomed .mi-gallery-photo {
  cursor: grab;
}

.mi-gallery-stage.is-zoomed:active,.mi-gallery-stage.is-zoomed:active .mi-gallery-photo {
  cursor: grabbing;
}

.mi-gallery-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  margin: 0;
  max-width: 80vw;
  text-align: center;
  pointer-events: none;
}

.mi-gallery-status:empty {
  display: none;
}

@media(max-width:600px) {

.mi-gallery-toolbar,.mi-gallery-footer {
  padding: 8px;
  gap: 8px;
}

.mi-gallery-dialog button {
  font-size: 13px;
  padding: 8px 10px;
}
}

/* =========================================================
   MONOITALY — CIEMNY LIGHTBOX
   ========================================================= */

.mi-gallery-dialog,
.mi-gallery-dialog::backdrop {
  background: #101010;
  color: #eee;
}

.mi-gallery-dialog .mi-gallery-toolbar,
.mi-gallery-dialog .mi-gallery-footer {
  background: #101010;
  border: 0;
  padding: 14px 24px;
  gap: 12px;
}

.mi-gallery-dialog .mi-gallery-count {
  color: #aaa;
  font-size: 12px;
  letter-spacing: .12em;
}

.mi-gallery-dialog button {
  background: transparent;
  color: #ddd;
  border: 1px solid #ffffff26;
  border-radius: 0;
  min-width: 44px;
  min-height: 44px;
  transition: background .2s, border-color .2s;
}

.mi-gallery-dialog button:hover {
  background: #ffffff12;
  border-color: #ffffff60;
}

.mi-gallery-dialog :focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.mi-gallery-dialog button[data-action="close"] {
  font-size: 0;
  border: 0;
}

.mi-gallery-dialog button[data-action="close"]::after {
  content: "×";
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

.mi-gallery-dialog button[data-action="prev"],
.mi-gallery-dialog button[data-action="next"] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 56px;
  padding: 0;
  background: #101010b3;
  font-size: 26px;
}

.mi-gallery-dialog button[data-action="prev"] {
  left: 16px;
}

.mi-gallery-dialog button[data-action="next"] {
  right: 16px;
}

.mi-gallery-dialog .mi-gallery-footer {
  justify-content: center;
}

.mi-gallery-dialog .mi-gallery-caption {
  max-width: 760px;
  color: #aaa;
  font-size: 12px;
  line-height: 1.6;
}

.mi-gallery-dialog .mi-gallery-status {
  color: #ccc;
}

@media (max-width: 600px) {

.mi-gallery-dialog .mi-gallery-toolbar,
  .mi-gallery-dialog .mi-gallery-footer {
  padding: 8px 12px;
}

.mi-gallery-dialog button[data-action="prev"],
  .mi-gallery-dialog button[data-action="next"] {
  top: auto;
  bottom: 8px;
  transform: none;
  width: 44px;
  height: 44px;
}

.mi-gallery-dialog button[data-action="prev"] {
  left: 8px;
}

.mi-gallery-dialog button[data-action="next"] {
  right: 8px;
}

.mi-gallery-dialog .mi-gallery-footer {
  min-height: 60px;
  padding-left: 64px;
  padding-right: 64px;
}
}

@media (prefers-reduced-motion: reduce) {

.mi-gallery-dialog button {
  transition: none;
}
}
