/* Scoped reference viewer; Webflow media sizing, crops and effects stay intact. */
html {
  /* Keep the page width stable when the modal locks scrolling. */
  scrollbar-gutter: stable;
}

.fm-gallery-preview {
  position: relative;
  cursor: pointer;
}
.fm-gallery-preview:focus-visible {
  outline: 3px solid var(--huomio, #08e8de);
  outline-offset: -3px;
}
.fm-gallery-dialog-close,
.fm-gallery-dialog-arrow,
.fm-gallery-dialog-retry {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
  border: 1px solid var(--huomio, #08e8de);
  border-radius: 0;
  color: #fff;
  background: rgba(15, 15, 15, .9);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background-color .18s, color .18s;
  flex-shrink: 0;
}
.fm-gallery-dialog-close:hover,
.fm-gallery-dialog-arrow:hover,
.fm-gallery-dialog-retry:hover {
  color: #0f0f0f;
  background: var(--huomio, #08e8de);
}
.fm-gallery-dialog-close:focus-visible,
.fm-gallery-dialog-arrow:focus-visible,
.fm-gallery-dialog-retry:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.fm-gallery-dialog-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 9px;
}
.fm-gallery-dialog-arrow[hidden],
.fm-gallery-dialog-counter[hidden] {
  display: none;
}
.fm-gallery-dialog-arrow svg {
  display: block;
  width: 24px;
  height: 24px;
  pointer-events: none;
}
html.fm-gallery-open,
html.fm-gallery-open body {
  overflow: hidden;
}
.fm-gallery-dialog {
  width: min(96vw, 76rem);
  max-width: none;
  height: 92vh;
  height: 92dvh;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(8, 232, 222, .55);
  color: #fff;
  background: #0f0f0f;
  overscroll-behavior: contain;
}
.fm-gallery-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.fm-gallery-dialog::backdrop {
  background: rgba(0, 0, 0, .88);
}
.fm-gallery-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 12px 16px;
}
.fm-gallery-dialog-title {
  min-width: 0;
  margin: 0;
  color: #fff;
  font-family: 'Clash Display', sans-serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 1px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.fm-gallery-dialog-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.fm-gallery-dialog-counter {
  min-width: 42px;
  margin: 0 4px 0 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: center;
}
.fm-gallery-dialog-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}
.fm-gallery-dialog-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}
.fm-gallery-dialog-retry[hidden] {
  display: none;
}
.fm-gallery-dialog-status-message {
  max-width: 30rem;
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
}
.fm-gallery-dialog-status-message:not(:empty) {
  padding: 8px 12px;
  background: rgba(15, 15, 15, .9);
}
.fm-gallery-dialog-retry {
  pointer-events: auto;
}
.fm-gallery-dialog-stage-error > .fm-gallery-dialog-image,
.fm-gallery-dialog-stage-error > .fm-gallery-dialog-video {
  visibility: hidden;
}
.fm-gallery-dialog-image,
.fm-gallery-dialog-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.fm-gallery-dialog-video {
  min-width: 0;
  background: #000;
}
.fm-gallery-dialog-stage-photo,
.fm-gallery-dialog-image {
  /* Keep vertical gestures and pinch zoom native; only photo swipes are handled. */
  touch-action: pan-y pinch-zoom;
}
@media (max-width: 479px) {
  .fm-gallery-dialog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  .fm-gallery-dialog-controls {
    gap: 8px;
  }
  .fm-gallery-dialog-counter {
    margin-right: auto;
    text-align: left;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fm-gallery-dialog-close,
  .fm-gallery-dialog-arrow,
  .fm-gallery-dialog-retry {
    transition: none;
  }
}
