/* Shared media viewer used only by the explicitly marked Rodiba templates. */
body.oc-gallery-open {
  overflow: hidden;
}

.oc-gallery-viewer, .oc-gallery-viewer * {
  box-sizing: border-box;
}

.oc-gallery-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #080c12;
  color: #fff;
  direction: ltr;
  font: 15px/1.5 Arial, sans-serif;
}

.oc-gallery-viewer:not([open]) {
  display: none;
}

.oc-gallery-viewer[open] {
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) auto auto;
}

.oc-gallery-viewer::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.oc-gallery-viewer button, .oc-gallery-viewer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #999;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.oc-gallery-viewer button:disabled {
  opacity: 0.35;
  cursor: default;
}

.oc-gallery-viewer button:hover:not(:disabled), .oc-gallery-viewer a:hover {
  background: transparent;
  color: #fff;
}

.oc-gallery-viewer :focus:not(:focus-visible) {
  outline: none;
}

.oc-gallery-viewer :focus-visible {
  outline: 2px solid #e7c995;
  outline-offset: -2px;
}

.oc-gallery-viewer [hidden] {
  display: none;
}

.oc-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
}

.oc-gallery-count {
  flex: 0 0 auto;
}

.oc-gallery-tools {
  display: flex;
  gap: 3px;
}

.oc-gallery-viewer svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  pointer-events: none;
}

.oc-gallery-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.oc-gallery-viewer .oc-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  background: transparent;
}

.oc-gallery-previous {
  left: 8px;
}

.oc-gallery-next {
  right: 8px;
}

.oc-gallery-media-frame {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 56px;
  overflow: auto;
}

.oc-gallery-media-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.oc-gallery-media-frame .oc-gallery-audio-poster {
  max-height: calc(100% - 80px);
}

.oc-gallery-media-frame video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.oc-gallery-media-frame audio {
  display: block;
  width: 560px;
  max-width: 100%;
  min-height: 54px;
  flex-shrink: 0;
}

.oc-gallery-media-frame.is-zoomed {
  justify-content: flex-start;
  align-items: flex-start;
}

.oc-gallery-media-frame.is-zoomed .oc-gallery-image {
  max-width: none;
  max-height: none;
  flex-shrink: 0;
}

.oc-gallery-caption {
  max-height: 96px;
  padding: 4px 16px;
  text-align: center;
  overflow: auto;
}

.oc-gallery-caption p {
  margin: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.8;
}

.oc-gallery-caption .oc-gallery-error {
  color: #ffd18a;
}

.oc-gallery-thumbnails {
  display: flex;
  justify-content: safe center;
  gap: 8px;
  max-height: 94px;
  padding: 8px 12px;
  overflow: auto;
}

.oc-gallery-thumbnails button {
  width: 88px;
  height: 66px;
  border-color: #6c7886;
}

.oc-gallery-thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oc-gallery-thumbnails button[aria-current=true] {
  border: 3px solid #e7c995;
}

@media (max-width: 767px) {
  .oc-gallery-viewer[open] {
    grid-template-rows: 46px minmax(0, 1fr) auto auto;
  }
  .oc-gallery-toolbar {
    padding-inline: 6px;
  }
  .oc-gallery-tools button, .oc-gallery-tools a {
    width: 36px;
    height: 36px;
  }
  .oc-gallery-media-frame {
    padding-inline: 34px;
  }
  .oc-gallery-viewer .oc-gallery-arrow {
    width: 30px;
    height: 40px;
    font-size: 34px;
  }
  .oc-gallery-previous {
    left: 2px;
  }
  .oc-gallery-next {
    right: 2px;
  }
  .oc-gallery-thumbnails {
    max-height: 70px;
    gap: 6px;
    padding: 6px;
  }
  .oc-gallery-thumbnails button {
    width: 62px;
    height: 46px;
  }
}
