.detail-poster.is-zoomable { position: relative; cursor: zoom-in; }
.detail-poster.is-zoomable:focus-visible { outline: 2px solid #efc66f; outline-offset: 3px; }
.poster-zoom-hint {
  position: absolute; right: 8px; bottom: 8px; z-index: 1; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: #14170fcc; color: #f4e2b4; box-shadow: 0 0 0 1px #efc66f55, 0 6px 14px #0007;
  opacity: 0; transform: scale(.8); transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.detail-poster.is-zoomable:hover .poster-zoom-hint, .detail-poster.is-zoomable:focus-visible .poster-zoom-hint { opacity: 1; transform: none; }
@media (hover: none) { .poster-zoom-hint { opacity: .9; transform: none; } }

.poster-viewer {
  width: 100vw; height: 100dvh; max-width: none !important; max-height: none; margin: 0; padding: 20px;
  border: 0; background: transparent; box-shadow: none; overflow: hidden; cursor: zoom-out;
}
.poster-viewer[open] { display: grid; place-items: center; animation: poster-viewer-in .32s cubic-bezier(.2, .8, .2, 1) both; }
.poster-viewer::backdrop { background: #060904eb; backdrop-filter: blur(12px); }
.poster-viewer[open]::backdrop { animation: poster-viewer-fade .3s ease both; }
.poster-viewer.is-closing { animation: poster-viewer-out .18s ease forwards; }
.poster-viewer.is-closing::backdrop { animation: poster-viewer-fade .18s ease reverse forwards; }

.poster-viewer-frame { margin: 0; display: grid; justify-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.poster-viewer-img {
  display: block; max-width: min(100%, 1280px); max-height: calc(100dvh - 92px); width: auto; height: auto; object-fit: contain;
  border-radius: 14px; box-shadow: 0 30px 80px -20px #000d, 0 0 0 1px #efc66f40;
}
.poster-viewer-caption { color: #f2ead6; font-size: 15px; font-weight: 600; text-align: center; letter-spacing: .01em; text-shadow: 0 2px 10px #000a; max-width: 90vw; }

.poster-viewer-close {
  position: fixed; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid #efc66f55; background: #1b1e16d9; color: #f4e2b4; cursor: pointer;
  transition: background .2s, transform .2s;
}
.poster-viewer-close:hover { background: #2c3122; transform: scale(1.06); }
.poster-viewer-close:focus-visible { outline: 2px solid #efc66f; outline-offset: 2px; }

@keyframes poster-viewer-in { from { opacity: 0; transform: scale(.94); } }
@keyframes poster-viewer-out { to { opacity: 0; transform: scale(.96); } }
@keyframes poster-viewer-fade { from { opacity: 0; } }

html.night-mode .detail-poster.is-zoomable:focus-visible { outline-color: #b2c6fa; }
html.night-mode .poster-zoom-hint { background: #0f1522cc; color: #d6e0fb; box-shadow: 0 0 0 1px #b2c6fa55, 0 6px 14px #0007; }
html.night-mode .poster-viewer::backdrop { background: #05080feb; }
html.night-mode .poster-viewer-img { box-shadow: 0 30px 80px -20px #000d, 0 0 0 1px #b2c6fa40; }
html.night-mode .poster-viewer-caption { color: #dbe3f6; }
html.night-mode .poster-viewer-close { border-color: #b2c6fa55; background: #121827d9; color: #d6e0fb; }
html.night-mode .poster-viewer-close:hover { background: #1c2640; }
html.night-mode .poster-viewer-close:focus-visible { outline-color: #b2c6fa; }

@media (max-width: 640px) {
  .poster-viewer { padding: 12px; }
  .poster-viewer-img { max-height: calc(100dvh - 80px); border-radius: 10px; }
  .poster-viewer-close { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .poster-viewer[open], .poster-viewer[open]::backdrop, .poster-viewer.is-closing, .poster-viewer.is-closing::backdrop { animation: none; }
  .poster-zoom-hint, .poster-viewer-close { transition: none; }
}
