/* Story viewer (ST-2, 4.3): full-screen on phone; centred 9:16 frame on
   desktop. Background is the viewer token; UI text the viewer text token. */

.sg-sv {
  position: fixed; inset: 0; z-index: 100;
  background: var(--sg-viewer-bg);
  color: var(--sg-viewer-text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
@media (min-width: 780px) {
  .sg-sv { flex-direction: row; }
}

.sg-sv-frame {
  position: relative;
  width: 100vw; height: 100vh;
  background: var(--sg-viewer-bg);
}
@media (min-width: 780px) {
  .sg-sv-frame {
    width: auto; height: min(90vh, 960px);
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.5);
  }
}

.sg-sv-bars {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3;
  display: flex; gap: 4px;
}
.sg-sv-bar {
  flex: 1; height: 2px; border-radius: 1px;
  background: rgb(255 255 255 / 0.3);
  overflow: hidden;
}
.sg-sv-bar-fill { display: block; height: 100%; background: #fff; }

.sg-sv-head {
  position: absolute; top: 16px; left: 12px; right: 52px; z-index: 3;
  display: flex; align-items: baseline; gap: 8px;
}
.sg-sv-collection { font-weight: 600; font-size: 13px; }
.sg-sv-date { font-size: 12px; color: rgb(255 255 255 / 0.7); }

.sg-sv-close {
  position: absolute; top: 8px; right: 4px; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 0; color: var(--sg-viewer-text); cursor: pointer;
}

.sg-sv-photo {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.sg-sv-photo .sg-img, .sg-sv-photo img {
  width: 100%; height: 100%; object-fit: cover;
}
.sg-sv-photo .sg-img { background-color: var(--sg-viewer-bg); }
.sg-sv-photo .sg-img { aspect-ratio: auto !important; }

.sg-sv-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 24px 16px 16px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.55), transparent);
  font-size: 14px; line-height: 1.4;
}

/* Previous and next collections faded at the sides (desktop). */
.sg-sv-side { display: none; }
@media (min-width: 780px) {
  .sg-sv-side {
    display: flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; margin: 0 32px;
    border: 2px solid rgb(255 255 255 / 0.25); border-radius: 50%;
    padding: 3px; opacity: 0.5;
  }
  .sg-sv-side:hover { opacity: 0.9; }
  .sg-sv-side .sg-img { width: 100%; height: 100%; border-radius: 50%; }
  .sg-sv-side img { border-radius: 50%; object-fit: cover; }
}
