/* The viewer (viewer.js): a full-screen overlay for a mock campaign's deck, or its microsite in a frame */

.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: 16px clamp(16px, 4vw, 48px) 20px; background: rgba(12, 9, 14, .985); color: var(--cream);
  opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s;
}
.overlay.is-open { opacity: 1; visibility: visible; transition: opacity .45s ease; }
html.has-overlay, html.has-overlay body { overflow: hidden; }
.overlay .btn { color: var(--cream); }

.overlay-top { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.overlay-title { font-family: var(--serif); font-style: italic; font-size: 28px; }
.overlay-count { font: 500 13px/1 var(--sans); opacity: .65; font-variant-numeric: tabular-nums; }
.overlay-newtab { display: none; }
.overlay-close { margin-left: auto; }
.overlay.is-frame .overlay-newtab { display: inline-block; margin-left: auto; }
.overlay.is-frame .overlay-close { margin-left: 0; }

/* a deck: the slides in a column, one per scroll */
.overlay-stage { position: relative; min-height: 0; margin: 12px 0; }
.overlay-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory;
  scrollbar-width: none; }
.overlay-scroll::-webkit-scrollbar { display: none; }
/* (flex, so the slide shrinks to fit the space's height as well as its width: the whole slide always shows) */
.overlay-slide { height: 100%; padding: 6px 0; display: flex; align-items: center; justify-content: center;
  scroll-snap-align: start; scroll-snap-stop: always; }
.overlay-slide img { min-width: 0; min-height: 0; max-width: min(100%, 1180px); max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.overlay-hint { position: absolute; left: 50%; bottom: 18px; padding: 10px 16px; border-radius: 999px; transform: translateX(-50%);
  background: rgba(255, 255, 255, .92); color: var(--ink); font: 600 13px/1 var(--sans); pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: opacity .4s ease; animation: prompt 2.4s ease-in-out infinite; }
.overlay-hint::before { content: "↓"; margin-right: 8px; color: var(--mauve); }
.overlay-stage.has-scrolled .overlay-hint { opacity: 0; }
/* a microsite */
.overlay-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; background: #0c0505; }

/* arrows and caption, then thumbnails */
.overlay-nav { display: flex; justify-content: center; align-items: center; gap: 14px; }
.overlay-caption { min-width: 240px; text-align: center; font: 400 14px/1.4 var(--sans); opacity: .85; }
.overlay-nav .btn { min-width: 52px; font-size: 16px; background: rgba(255, 255, 255, .08); }
.overlay-nav .btn:hover { background: rgba(255, 255, 255, .18); }
.overlay-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 4px 4px; scrollbar-width: none; }
.overlay-thumbs::-webkit-scrollbar { display: none; }
.overlay-thumbs button { flex: none; width: 92px; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  cursor: pointer; background: #222; opacity: .4; outline: 2px solid transparent; outline-offset: 2px; transition: opacity .3s, outline-color .3s; }
.overlay-thumbs button:first-child { margin-left: auto; }
.overlay-thumbs button:last-child { margin-right: auto; }
.overlay-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.overlay-thumbs button:hover { opacity: .8; }
.overlay-thumbs button[aria-current="true"] { opacity: 1; outline-color: var(--cream); }
.overlay.is-frame .overlay-nav, .overlay.is-frame .overlay-thumbs { display: none; }

@media (max-width: 900px) {
  .overlay { padding: 10px 12px 14px; }
  .overlay-title { font-size: 22px; }
  .overlay-caption { min-width: 0; flex: 1; }
  .overlay-thumbs button { width: 64px; }
}
