/* --- SLIDESHOW TEXT DETAILS & CAST (Extracted from _slideshow-media.css) --- */

.slideshow-description-container,
.slideshow-description-container * {
    color: #fff !important;
}

/* Text Shadows in Transparent Mode */
:root[data-ss-transparency="true"] .slideshow-description-container h2,
:root[data-ss-transparency="true"] .slideshow-description-container .slideshow-overview,
:root[data-ss-transparency="true"] .slideshow-description-container .media-runtime,
:root[data-ss-transparency="true"] .slideshow-description-container .ss-genre {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

.slideshow-description-container h2 {
    color: var(--primary-color) !important;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 10px;
}
.slideshow-description-container h2 .title-part-secondary {
    color: var(--lighter-primary-color) !important;
}

.slideshow-description-container p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 8px 0;
}

/* Desktop: add extra right padding between plotline text and main poster */
@media (min-width: 769px) {
  .slideshow-text-details {
    padding-right: 15px;
  }
}

.slideshow-overview {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slideshow-genres-list {
    display: flex;
    flex-wrap: nowrap;              /* Do not allow wrapping to multiple lines */
    justify-content: center;        /* Center categories on the line */
    gap: 10px;
    margin: 15px 0;
    padding-left: 0;                /* Remove left indent so centering is true */
    overflow: hidden;               /* Hide any tags that don’t fit on one line */
}

.ss-genre { 
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--lighter-primary-color) !important;
  padding: 0 5px;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--lighter-primary-color);
  white-space: nowrap;             /* Ensure each tag itself never wraps */
  text-transform: uppercase;
  flex-shrink: 0;                  /* Prevent shrinking so overflow cuts off cleanly */
}

.ss-release-inline { margin-left: 10px; color: var(--lighter-primary-color) !important; font-weight: 500; white-space: nowrap; }
.ss-vote { margin-left: 5px; color: #ffd700 !important; font-weight: 700; white-space: nowrap; }
.media-runtime { display: flex; align-items: center; gap: 5px; font-size: 1.1rem; }

/* Inline stats row under the title (runtime + MPA + rating); only visible in expanded view */
.ss-inline-stats {
    display: none;
    align-items: center;
    gap: 12px;
    margin: 4px 0 8px;
}

.ss-inline-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* When the poster is expanded (second view size), show inline stats under the title */
.slideshow-poster.expanded + .slideshow-text-details .ss-inline-stats {
    display: flex;
}

/* Cast & Crew */
.slideshow-person-icon { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; filter: invert(0); }
[data-theme^="light"] .slideshow-person-icon { filter: invert(1) grayscale(1) brightness(0.5); }
.field-icon-wrapper { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-right: 10px; flex-shrink: 0; }

/* Director/Producer Links */
.slideshow-description-container p:has(.field-icon-wrapper) {
    display: none !important;
}

/* New: Style for Director/Producer links when bio option is ON */
.person-link.linked-bio-name {
    padding: 3px 9px; /* Slightly reduced padding to keep size similar */
    border: 1px solid var(--primary-color) !important;
    border-radius: 3px !important;
    background: transparent !important;
    color: var(--primary-color) !important;
    font-weight: 500;
}
.person-link.linked-bio-name:hover {
    background: rgba(var(--primary-color-rgb), 0.15) !important;
}

.slideshow-cast-area {
    position: absolute; left: 30px; right: 30px; z-index: 2; margin-top: 0; opacity: 0; transition: opacity 0.5s ease;
}

/* Hide the cast title */
.slideshow-cast-area .ss-cast-title {
    display: none !important;
}

.slideshow-cast-list { display: flex; flex-direction: column; gap: 20px; justify-content: flex-start; overflow: visible; margin-top: 0; position: relative; z-index: 2; }
.cast-row { display: flex; justify-content: flex-start; gap: 10px; flex-wrap: nowrap; overflow: visible; }

.cast-card { 
    position: relative; width: 150px; display: flex; flex-direction: column; align-items: center; margin: 0 5px; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; 
}
.cast-card.visible { opacity: 1; transform: translateY(0); }
.cast-card.disappear { opacity: 0; transform: translateY(10px); }

.cast-image-wrapper { position: relative; width: 150px; height: 225px; border-radius: 8px; overflow: hidden; }
.cast-card img { width: 150px; height: 225px; object-fit: cover; border-radius: 8px; border: 2px solid var(--text-color); box-shadow: 0 4px 12px rgba(0,0,0,0.4); margin-top: 7px; margin-bottom: 7px; transition: transform 0.3s ease; }
.cast-card img:hover { animation: floatSlow 3s ease-in-out infinite; transform: none; }

.cast-name {
    position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5); color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    line-height: 1.2; text-align: center; white-space: normal; padding: 6px 8px; font-size: 0.8rem;
    transition: all 0.2s ease; /* Ensure transitions work */
}

/* Style for Cast Names when bio option is ON (acts as a link box) */
.cast-name.cast-name-bio-link {
    border: 1px solid var(--primary-color) !important;
    border-radius: 3px 3px 8px 8px !important; /* Preserve bottom corner radius of image wrapper */
    cursor: pointer;
}
.cast-name.cast-name-bio-link:hover {
    background: rgba(var(--primary-color-rgb), 0.65) !important; /* Darken background on hover */
}

.cast-char {
    color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.9); margin-bottom: 7px; font-size: 10pt;
    display: flex; align-items: flex-end; justify-content: center; text-align: center; line-height: 1.1; height: 2.4em;
    padding-top: 2px;
}
.cast-char-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }



/* Responsive Text Size */
@media (max-width: 768px) {
  .slideshow-description-container h2 { font-size: 16pt; }
  .slideshow-description-container p { font-size: calc(1.1rem - 4pt); }
  .ss-genre { font-size: calc(0.8rem - 2pt); }
  .slideshow-description-container .ss-release-inline { font-size: calc(1.1rem - 4pt); }
  .slideshow-description-container .ss-vote { font-size: calc(1.1rem - 4pt); }
  .media-runtime { font-size: calc(1.1rem - 4pt); gap: 0; }
  
  .cast-card, .cast-card img, .cast-image-wrapper { width: 100% !important; max-width: 110px; }
  .cast-card img, .cast-image-wrapper { height: auto !important; aspect-ratio: 2/3; }
  .cast-char { font-size: 9pt !important; height: 2.4em; padding-top: 2px; }
  .cast-name { font-size: 0.7rem !important; font-weight: normal; }
  
  .slideshow-cast-area { position: static; left: auto; right: auto; margin-top: 15px; }

  /* Mobile: show all cast in a 3-column grid within the main window */
  .cast-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 10px;
    justify-items: center;
    overflow: visible;
  }
}

@media (min-width: 769px) {
    .cast-row-second.cast-row-second-slider { max-width: calc(5 * 150px + 4 * 10px); overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scroll-snap-type: x mandatory; padding-bottom: 6px; }
    .cast-row-second.cast-row-second-slider .cast-card { scroll-snap-align: start; }
}


```