.deck-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.deck-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 20px;
}

.deck-header h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
}

.deck-header__lead {
  margin: 0;
  color: var(--muted, #5a6b7c);
}

.deck-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-viewer {
  border: 1px solid var(--border, #dde5ec);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 44, 72, 0.08);
  overflow: hidden;
}

.deck-stage {
  position: relative;
  background: #0f1b24;
}

.deck-slide {
  margin: 0;
}

.deck-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0f1b24;
}

.deck-slide figcaption {
  padding: 10px 56px;
  text-align: center;
  color: #e6eef5;
  font-size: 0.9rem;
  background: rgba(15, 27, 36, 0.96);
}

.deck-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  transform: translateY(-50%);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(15, 27, 36, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.deck-nav:hover,
.deck-nav:focus-visible {
  background: rgba(15, 27, 36, 0.85);
}

.deck-nav[disabled] {
  opacity: 0.35;
  cursor: default;
}

.deck-nav--previous {
  inset-inline-start: 12px;
}

.deck-nav--next {
  inset-inline-end: 12px;
}

/* Chevrons point at the reading direction, not the writing direction. */
[dir="rtl"] .deck-nav span {
  display: inline-block;
  transform: scaleX(-1);
}

.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border, #dde5ec);
}

.deck-counter {
  margin: 0;
  color: var(--muted, #5a6b7c);
  font-size: 0.9rem;
}

.deck-thumbs {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--border, #dde5ec);
  background: #f7fafc;
}

.deck-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 132px;
  padding: 0;
  cursor: pointer;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.deck-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.deck-thumb.is-active {
  border-color: var(--primary, #0b7ec8);
}

.deck-thumb__number {
  position: absolute;
  inset-block-end: 4px;
  inset-inline-end: 4px;
  padding: 1px 6px;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.5;
  background: rgba(15, 27, 36, 0.75);
  border-radius: 999px;
}

.deck-back {
  display: inline-block;
  margin-top: 20px;
}

.deck-viewer:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #0f1b24;
}

.deck-viewer:fullscreen .deck-slide img {
  max-height: 84vh;
}

.deck-viewer:fullscreen .deck-thumbs {
  display: none;
}

@media (max-width: 640px) {
  .deck-slide figcaption {
    padding: 10px 14px;
  }

  .deck-nav {
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
  }
}
