/* --- SLIDESHOW LAYOUT & POSTER (Extracted from _slideshow-media.css) --- */

.slideshow-poster {
    float: right;
    width: var(--ss-desktop-main-w, 500px); 
    aspect-ratio: 2 / 3; 
    border-radius: 8px;
    overflow: visible !important; 
    cursor: default;
    box-shadow: none; 
    border: 1px solid var(--primary-color);
    flex-shrink: 0;
    z-index: 1; 
    transition: box-shadow 0.3s ease, transform 0.3s ease; 
    transform: translateY(0); 
    position: relative;
    background: transparent;
}

.slideshow-poster::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--ss-curr-poster);
    background-size: cover;
    background-position: center;
    border-radius: inherit;
    filter: blur(5px) saturate(1.25) brightness(1.1);
    opacity: 0.35;
    transform: scale(1.015);
}

.slideshow-poster:hover::before {
    animation: sideGlowPulse 10s ease-in-out infinite;
}

/* Fullscreen Mode Styles */
.slideshow-overlay.fs-mode .slideshow-poster {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh !important;
    aspect-ratio: 2 / 3 !important; /* Force 1:1.5 ratio */
    width: auto !important; /* Width derived from height + aspect-ratio */
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 0 !important; /* Place behind everything */
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
    float: none !important;
    box-shadow: none !important;
    background: transparent !important;
    pointer-events: none; /* Allow clicks to pass if needed */
}

.slideshow-overlay.fs-mode .slideshow-poster img {
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Fill container completely */
    object-position: center !important;
    display: block !important;
    pointer-events: auto; /* Re-enable pointer events on image for toggling */
}

/* FS Mode Poster Animations */
@keyframes fsPosterZoomOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0); opacity: 0; }
}

@keyframes fsPosterWobbleIn {
    0% { transform: scale(0); opacity: 0; }
    40% { transform: scale(1.1) rotate(2deg); opacity: 1; }
    60% { transform: scale(0.95) rotate(-2deg); opacity: 1; }
    80% { transform: scale(1.02) rotate(1deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* NEW: FS Mode slide-out to the right for the current poster */
@keyframes fsPosterSlideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100vw); opacity: 0; }
}

/* NEW: FS Mode fast slide / zoom-in from the right for the next poster */
@keyframes fsPosterSlideInRightFast {
    0%   { transform: translateX(100vw) scale(0.9); opacity: 0; }
    60%  { transform: translateX(0) scale(1.05); opacity: 1; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

.slideshow-overlay.fs-mode .slideshow-poster.fs-exit {
    animation: fsPosterZoomOut 0.5s ease-in forwards;
}

.slideshow-overlay.fs-mode .slideshow-poster.fs-enter {
    animation: fsPosterWobbleIn 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* NEW: class hooks for the new right-side animations */
.slideshow-overlay.fs-mode .slideshow-poster.fs-exit-right {
    animation: fsPosterSlideOutRight 0.45s ease-in forwards;
}

.slideshow-overlay.fs-mode .slideshow-poster.fs-enter-fast {
    animation: fsPosterSlideInRightFast 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Hide mobile actions in FS mode */
.slideshow-overlay.fs-mode .ss-mobile-actions {
    display: none !important;
}

/* Ensure controls stay above the fullscreen poster and fixed to right */
.slideshow-overlay.fs-mode .slideshow-controls-container {
    z-index: 30010 !important;
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 20px !important;
    left: auto !important;
}

/* Ensure cast area stays above the fullscreen poster */
.slideshow-overlay.fs-mode .slideshow-cast-area {
    z-index: 30006 !important;
}

.slideshow-poster.paused-long {
    animation: pulseImage 3s ease-in-out infinite;
    transition: none;
}

.slideshow-poster img {
    width: 100%;
    height: 100%; 
    display: block;
    object-fit: cover;
    transition: opacity 0.5s ease; 
    border-radius: 8px;
}

/* Mobile Actions */
.ss-mobile-actions {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    left: 100%;          
    bottom: 0;           
    top: auto;
    transform: none;
    padding-left: 10px;  
    gap: 10px;           
    align-items: center;
    z-index: 10;
}

.ss-mobile-btn {
    width: 100px;
    height: 37px;
    cursor: pointer;
    display: block;
    transition: transform 0.2s ease;
}
.ss-mobile-btn:hover {
    transform: scale(1.05);
}
.ss-mobile-btn.preview-mobile { order: 2; }
.ss-mobile-btn.listen-mobile { order: 1; }

@media (min-width: 769px) {
    .slideshow-poster {
        margin-top: 100px;
        width: 500px !important;
        height: 750px !important;
        aspect-ratio: auto;
    }
}

@media (max-width: 768px) {
  .slideshow-poster {
      width: 150px;
      height: 225px;
      float: none; 
      margin: 0 auto 15px auto; 
      transform: translateX(-80px);
      overflow: visible;
      position: relative; 
      border-radius: 5px;
  }
  .slideshow-poster img { border-radius: 5px; }
  
  .slideshow-poster.expanded {
      width: 100vw !important;    
      height: auto !important;    
      max-height: 80vh;
      margin: 0 auto 15px auto;
      transform: translateX(0);   
  }
}


```