/* Public gallery: only a verified saved collection or the live collection is shown. */
#photo-gallery.gallery-managed-grid .gallery-managed-tile {
  height: 100%; padding: 0; border: 0; color: var(--paper, #f7f0dd);
  background: #e4e7cc; cursor: zoom-in; text-align: center; font: inherit;
}
#photo-gallery.gallery-managed-grid .gallery-managed-tile img {
  object-fit: cover; transform: none;
}
#photo-gallery .gallery-managed-tile:hover img { transform: none; }
.gallery-managed-tile:focus-visible, .gallery-managed-controls button:focus-visible, .gallery-managed-retry:focus-visible,
.gallery-managed-dialog button:focus-visible, .gallery-managed-youtube-link:focus-visible {
  outline: 3px solid #c78930; outline-offset: 4px;
}
.gallery-managed-enlarge {
  position: absolute; right: 14px; bottom: 14px; padding: 6px 11px;
  background: #183f35e8; border: 1px solid #ffffff66; border-radius: 18px;
  font-size: 11px; line-height: 1.5; letter-spacing: .02em;
}
.gallery-managed-controls {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 22px;
}
.gallery-managed-controls[hidden] { display: none; }
.gallery-managed-controls button {
  min-height: 44px; border: 1px solid var(--line, #a9b393); border-radius: 24px;
  background: transparent; color: var(--ink, #173f37); padding: 9px 16px;
  font: inherit; font-size: 12px; cursor: pointer;
}
.gallery-managed-controls button:hover:not(:disabled) { background: #e2e7cc; }
.gallery-managed-controls .gallery-managed-nav { min-width: 46px; padding-inline: 12px; font-size: 20px; line-height: 1; }
.gallery-managed-controls button:disabled, .gallery-managed-dialog button:disabled { opacity: .45; cursor: default; }
.gallery-managed-status {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 18px 0 0; color: var(--ink, #173f37); font-size: 13px; line-height: 1.6;
}
.gallery-managed-status[hidden], .gallery-managed-retry[hidden] { display: none; }
.gallery-managed-status-text { margin: 0; }
.gallery-managed-retry {
  flex: 0 0 auto; min-height: 44px; padding: 9px 18px; border-radius: 24px;
  border: 1px solid var(--line, #a9b393); background: transparent; color: inherit;
  font: inherit; cursor: pointer;
}
.gallery-managed-retry:hover { background: #e2e7cc; }
#photo-gallery.gallery-managed-grid[data-count="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 1.8; }
#photo-gallery.gallery-managed-grid[data-count="1"] .gallery-main { grid-column: 1; grid-row: 1; border-radius: 3px 65px 3px 3px; }
#photo-gallery.gallery-managed-grid[data-count="2"] { grid-template-rows: 1fr; aspect-ratio: 2.5; }
#photo-gallery.gallery-managed-grid[data-count="2"] .gallery-main { grid-row: 1; }
#photo-gallery.gallery-managed-grid[data-count="2"] .gallery-frame--two { grid-row: 1; }
#photo-gallery[data-managed-gallery="true"][data-count="0"] { display: block; aspect-ratio: auto; }
.gallery-managed-empty, .gallery-managed-initialstatus { margin: 0; padding: 48px 25px; text-align: center; background: #e4e7cc; border-radius: 3px 35px 3px 3px; }
#photo-gallery .gallery-managed-video {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 13px; background: radial-gradient(ellipse at 30% 20%, #597a57, #173f37 80%);
  cursor: pointer; padding: 30px 20px;
}
.gallery-managed-play {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: #f3d45c; color: #183f35; font-size: 23px; padding-left: 3px;
}
.gallery-managed-video-label { max-width: 86%; font-family: var(--serif, Georgia, serif); font-size: clamp(20px, 2vw, 32px); line-height: 1.25; }
.gallery-managed-video-action { font-size: 11px; line-height: 1.5; opacity: .92; }
dialog.gallery-managed-dialog {
  width: min(1280px, 96vw); max-width: calc(100vw - 24px); max-height: 94svh;
  padding: 48px 54px 22px; background: #15382f; color: #fbf4e3; overflow: auto;
  border: 1px solid #f3e6c34d; border-radius: 3px 28px 3px 3px;
}
.gallery-managed-stage { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 180px; height: min(72svh, 840px); }
.gallery-managed-stage > img { display: block; width: 100%; height: 100%; max-height: 72svh; object-fit: contain; }
.gallery-managed-stage > iframe { display: block; border: 0; width: 100%; height: 100%; background: #071611; }
.gallery-managed-stage--video { aspect-ratio: 16 / 9; height: auto; max-height: 72svh; }
.gallery-managed-caption { margin: 18px 0 0; text-align: center; font-size: 12px; line-height: 1.6; color: #f2edda; }
.gallery-managed-dialog .gallery-managed-close {
  position: absolute; top: 8px; right: 10px; border: 1px solid #ffffff88; border-radius: 50%;
  width: 36px; height: 36px; padding: 0; background: #15382f; color: #fbf4e3; font-size: 28px; cursor: pointer; line-height: 1;
}
.gallery-managed-dialog-nav {
  position: absolute; top: 45%; width: 40px; height: 48px; border: 1px solid #ffffff66;
  border-radius: 20px; background: #15382fe6; color: #fff9e9; font-size: 23px; padding: 0; cursor: pointer;
}
.gallery-managed-dialog-prev { left: 7px; }
.gallery-managed-dialog-next { right: 7px; }
.gallery-managed-youtube-link { display: block; width: fit-content; margin: 10px auto 0; padding: 7px; color: #f3d45c; font-size: 12px; text-decoration: underline; }
.gallery-managed-youtube-link[hidden] { display: none; }
@media (max-width: 680px) {
  #photo-gallery.gallery-managed-grid, #photo-gallery.gallery-managed-grid[data-count] { aspect-ratio: auto; grid-template-columns: 1fr !important; grid-template-rows: auto; }
  #photo-gallery.gallery-managed-grid .gallery-managed-tile { height: auto; aspect-ratio: var(--photo-ratio, 1.333); grid-column: auto; grid-row: auto; }
  #photo-gallery.gallery-managed-grid .gallery-managed-video { min-height: 240px; }
  .gallery-managed-controls { justify-content: center; gap: 8px; margin-top: 16px; }
  .gallery-managed-status { flex-direction: column; gap: 10px; text-align: center; }
  .gallery-managed-controls .gallery-managed-pause { padding-inline: 13px; font-size: 11px; }
  dialog.gallery-managed-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); padding: 48px 34px 18px; }
  .gallery-managed-stage { height: 65svh; }
  .gallery-managed-stage > img { max-height: 65svh; }
  .gallery-managed-stage--video { height: 62svh; max-height: 62svh; }
  .gallery-managed-dialog-nav { width: 28px; height: 44px; font-size: 20px; }
  .gallery-managed-dialog-prev { left: 2px; }
  .gallery-managed-dialog-next { right: 2px; }
  .gallery-managed-caption { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #photo-gallery .gallery-managed-tile img { transition: none; }
}
