/* 2026 item exhibit/media gallery. The 813px initial width is recorded on
   the captured driver's gallery element (reference/itd-item-frame.txt).
   It deliberately overlays adjacent item content instead of shrinking a
   diagnostic image until it becomes unreadable. */
.s1-media-viewer {
  position: relative;
  z-index: 20;
  width: min(813px, calc(100vw - 150px));
  box-sizing: border-box;
  border: 1px solid #c7c7c7;
  padding: 8px;
  background: #fff;
  color: #000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  transform-origin: top left;
  zoom: calc(1 / var(--zoom));
  margin-left: -212px;
}
.s1-media-viewer[hidden], .s1-media-content[hidden],
.s1-media-open[hidden], .s1-media-contrast-popover[hidden] { display: none !important; }

.s1-media-drag-handle {
  height: 7px;
  margin: -8px -8px 7px;
  border-top: 4px solid #078ec0;
  background: #004976;
  cursor: move;
  touch-action: none;
  position: relative;
}
.s1-media-viewer--dragging { user-select: none; }
.s1-media-close {
  position: absolute;
  z-index: 2;
  right: 3px;
  top: 7px;
  width: 25px;
  height: 25px;
  padding: 0 0 2px;
  border: 1px solid #004976;
  border-radius: 4px;
  background: #fff;
  color: #004976;
  font: bold 22px/20px Arial, sans-serif;
  cursor: pointer;
}
.s1-media-close:hover, .s1-media-close:focus-visible {
  background: #004976;
  color: #fff;
  outline: 2px dotted #004976;
  outline-offset: 2px;
}

.s1-media-tabs {
  display: flex;
  gap: 2px;
  margin: 0 30px 6px 64px;
  min-height: 25px;
}
.s1-media-tabs button {
  border: 1px solid #8b8b8b;
  border-bottom: 0;
  background: #eee;
  color: #000;
  padding: 3px 12px;
  font: 12px Arial, sans-serif;
  cursor: pointer;
}
.s1-media-tabs button[aria-selected="true"] { background: #fff; font-weight: bold; }

.s1-media-viewer__body {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  border: 1px solid #c7c7c7;
  background: #fff;
}
.s1-media-toolbar {
  position: relative;
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 3px 9px;
  background: #fff;
}
.s1-media-tool {
  border: 0;
  background: transparent;
  color: #000;
  padding: 2px 0;
  min-height: 49px;
  font: 14px/1 Arial, sans-serif;
  cursor: pointer;
}
.s1-media-tool:hover .s1-media-tool__label,
.s1-media-tool:focus-visible .s1-media-tool__label { text-decoration: underline; }
.s1-media-tool:focus-visible { outline: 2px dotted #004976; outline-offset: -1px; }
.s1-media-tool__icon {
  display: block;
  width: 31px;
  height: 31px;
  margin: 0 auto 2px;
  font: 30px/30px Arial, sans-serif;
}
.s1-media-icon--invert::before { content: "◐"; }
.s1-media-icon--contrast::before { content: "☀"; }
.s1-media-icon--zoom::before { content: "⊕"; }
.s1-media-tool__label { display: block; }
.s1-media-tool[aria-pressed="true"] { background: #d7dced; }

.s1-media-contrast-popover {
  position: absolute;
  z-index: 3;
  left: 58px;
  bottom: 49px;
  width: 178px;
  padding: 8px;
  border: 1px solid #777;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .3);
  white-space: nowrap;
}
.s1-media-contrast-popover label { display: block; }
.s1-media-contrast-popover input { width: 104px; vertical-align: middle; }
.s1-media-contrast-popover button { margin-top: 5px; }

.s1-media-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 260px;
  overflow: auto;
  background: #f9f9f9;
}
.s1-media-content { max-width: 100%; max-height: 100%; text-align: center; }
.s1-media-image {
  display: block;
  max-width: 100%;
  max-height: 620px;
  width: auto;
  height: auto;
  margin: auto;
  transition: filter .08s linear;
}
.s1-media-content video { display: block; max-width: 100%; max-height: 620px; }
.s1-media-content audio { width: min(520px, 100%); }
.s1-media-audio-art { font-size: 96px; color: #004976; margin: 42px 0 20px; }
.s1-media-transcript { max-width: 40rem; margin: 10px auto; text-align: left; }

.s1-media-open {
  border: 1px solid #004976;
  border-radius: 3px;
  background: linear-gradient(#078ec0, #004976);
  color: #fff;
  padding: 5px 12px;
  font: 14px Arial, sans-serif;
  cursor: pointer;
}

.s1-media-viewer--fullscreen {
  position: fixed;
  inset: 8px 8px 68px 112px;
  width: auto;
  height: auto;
  z-index: 1100;
  margin: 0;
  transform: none !important;
  zoom: 1;
  max-width: none !important;
}
.s1-media-viewer--fullscreen .s1-media-viewer__body { height: calc(100% - 8px); }
.s1-media-viewer--fullscreen .s1-media-stage { height: 100%; }
.s1-media-viewer--fullscreen .s1-media-image,
.s1-media-viewer--fullscreen video { max-width: 100%; max-height: 100%; }

html.white-on-black .s1-media-viewer,
html.white-on-black .s1-media-viewer__body,
html.white-on-black .s1-media-toolbar,
html.white-on-black .s1-media-stage,
html.white-on-black .s1-media-contrast-popover {
  background: #000;
  color: #fff;
  border-color: #fff;
}
html.white-on-black .s1-media-tool { color: #fff; }
html.white-on-black .s1-media-tool[aria-pressed="true"] { background: #325b77; }
html.white-on-black .s1-media-close {
  background: #000;
  border-color: #fff;
  color: #fff;
}
html.white-on-black .s1-media-tabs button { background: #000; color: #fff; border-color: #fff; }
html.white-on-black .s1-media-tabs button[aria-selected="true"] { background: #fff; color: #000; }

html.hasViewer:not(.zoom100) .s1-media-viewer,
html.labActive .s1-media-viewer { margin-left: 15px; }

@media (max-width: 800px) {
  .s1-media-viewer { width: calc(100vw - 135px); }
  .s1-media-viewer__body { grid-template-columns: 54px minmax(0, 1fr); }
}
