.corvin-lightbox-root {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.corvin-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.corvin-lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
}

.corvin-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.corvin-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.corvin-lightbox-close:hover,
.corvin-lightbox-close:focus {
  background: rgba(255, 255, 255, 0.22);
}

.corvin-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.corvin-lightbox-nav:hover,
.corvin-lightbox-nav:focus {
  background: rgba(255, 255, 255, 0.26);
}

.corvin-lightbox-nav:disabled,
.corvin-lightbox-nav[disabled] {
  opacity: 0.25;
  cursor: default;
}

.corvin-lightbox-nav--prev {
  left: 8px;
}

.corvin-lightbox-nav--next {
  right: 8px;
}

.corvin-lightbox-nav[hidden] {
  display: none;
}

html.corvin-lightbox-open {
  overflow: hidden;
}

.corvin-lightbox-trigger {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.corvin-lightbox-trigger img {
  display: block;
  pointer-events: none;
}

.corvin-lightbox-meta {
  margin-top: 12px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.corvin-lightbox-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.corvin-lightbox-place {
  opacity: 0.95;
  margin-bottom: 4px;
}

.corvin-lightbox-region {
  opacity: 0.95;
  margin-bottom: 4px;
}

.corvin-lightbox-address {
  opacity: 0.78;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.corvin-lightbox-caption {
  margin: 6px 0;
  white-space: pre-wrap;
}

.corvin-lightbox-gear,
.corvin-lightbox-exposure,
.corvin-lightbox-date {
  font-size: 0.88rem;
  opacity: 0.88;
  margin-top: 2px;
}

.corvin-lightbox-more {
  display: inline-block;
  margin-top: 10px;
  color: #fff;
  text-decoration: underline;
}

.corvin-lightbox-more:hover,
.corvin-lightbox-more:focus {
  text-decoration: none;
}

@media (max-width: 600px) {
  .corvin-lightbox-figure {
    max-height: min(85vh, calc(100dvh - 180px));
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .corvin-lightbox-img {
    max-height: min(58vh, calc(100dvh - 220px));
  }

  .corvin-lightbox-meta {
    margin-top: 10px;
    max-width: 100%;
    max-height: min(36vh, 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .corvin-lightbox-nav--prev {
    left: max(4px, env(safe-area-inset-left));
  }

  .corvin-lightbox-nav--next {
    right: max(4px, env(safe-area-inset-right));
  }

  .corvin-lightbox-close {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }
}
