/* Extracted bio overlay styles from _modal.css for maintainability */

/* --- BIO POPUPS/OVERLAY --- */
.bio-popup { 
    position:absolute; 
    z-index:20003; 
    background: rgba(0,0,0,0.95); 
    color:#fff; 
    border:1px solid var(--primary-color); 
    border-radius:8px; 
    padding:10px; 
    max-width:280px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}
.bio-popup .bio-name { font-weight:700; margin-bottom:6px; color: var(--primary-color); }
.bio-popup .bio-line { font-size:0.9rem; margin:2px 0; }
.bio-popup .bio-full-btn { margin-top:8px; padding:6px 10px; border-radius:16px; background: var(--primary-color); color: var(--text-color); border:none; cursor:pointer; }

/* Slideshow specific bio popup positioning */
.slideshow-bio-popup {
    position: absolute; 
    z-index: 30005; 
    transform: translateX(0);
    pointer-events: auto;
}

/* --- Credits table overlay for actors --- */
.credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 36000;
  background-color: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.credits-content {
  width: 90%;
  max-width: 1100px;
  max-height: 90vh;
  padding: 24px 24px 18px 24px;
  border-radius: 12px;
  background-color: rgba(20, 20, 20, 0.9);
  border: 1px solid var(--primary-color);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  overflow: hidden;
  position: relative;
  color: #ffffff !important;
}

.credits-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: #000000 !important;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.credits-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding-right: 40px;
}

.credits-photo-wrapper {
  flex-shrink: 0;
}

.credits-photo {
  width: 120px;
  height: 180px;
  border-radius: 8px;
  border: 1px solid var(--primary-color);
  object-fit: cover;
}

.credits-header-text h1 {
  margin: 0 0 6px 0;
  font-size: 1.8rem;
  color: var(--primary-color) !important;
}

.credits-info-line {
  margin: 2px 0;
  font-size: 0.95rem;
  color: var(--lighter-primary-color) !important;
}

.credits-table-wrapper {
  max-height: 60vh;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.4);
}

/* Hide internal scrollbars in WebKit */
.credits-table-wrapper::-webkit-scrollbar {
  width: 6px;
}
.credits-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}

.credits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.credits-table thead {
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1;
}

.credits-table th,
.credits-table td {
  padding: 8px 10px;
  text-align: left;
}

.credits-table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.credits-table tbody tr:nth-child(even) {
  background-color: rgba(255,255,255,0.02);
}

.credits-table tbody tr:hover {
  background-color: rgba(255,255,255,0.08);
}

.credits-title-link {
  color: #ffffff !important;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.5);
}

.credits-title-link:hover {
  color: var(--lighter-primary-color) !important;
  border-bottom-color: var(--lighter-primary-color);
}

.credits-poster-preview {
  position: fixed;
  width: 200px;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--primary-color);
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
  background: #000;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 36001;
}

.credits-poster-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .credits-content {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    padding: 18px 14px 14px 14px;
  }
  .credits-header {
    align-items: flex-start;
  }
  .credits-photo {
    width: 90px;
    height: 135px;
  }
  .credits-table-wrapper {
    max-height: calc(100vh - 170px);
  }
  .credits-poster-preview {
    display: none !important; /* avoid covering too much on small screens */
  }
}

.bio-overlay { 
  position: fixed; 
  inset: 0; 
  z-index: 35000; 
  background-color: rgba(var(--primary-color-rgb), 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.bio-content { 
  max-width: 1200px;
  width: 90%;
  margin: 4vh auto;
  padding: 30px;
  border-radius: 12px;
  background-color: rgba(20, 20, 20, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--primary-color);
  color: #fff !important;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.bio-content::-webkit-scrollbar { display: none; }

.bio-close { 
  position: fixed; 
  right: 20px; 
  width: 56px; height: 56px; 
  border-radius: 50%; 
  /* 3D glass look to match other round controls */
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.28),
    rgba(255,255,255,0.08) 40%,
    rgba(0,0,0,0.20) 100%
  );
  color: #000 !important; 
  font-size: 2rem; 
  border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 30010;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.35);
  position: fixed;
  overflow: hidden;
}

/* Reflection for bio close button */
.bio-close::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 0%,
    rgba(255,255,255,0.9) 0%,
    rgba(255,255,255,0.4) 35%,
    rgba(255,255,255,0.0) 65%
  );
  opacity: 0.9;
  pointer-events: none;
}
.bio-close.top { top: 20px; }
.bio-close.bottom { bottom: 20px; }

.bio-header { display:flex; gap:20px; align-items:flex-start; }

/* Wrapper to allow positioning overlays on top of the main bio image */
.bio-photo-wrapper {
    position: relative;
    display: inline-block;
}

/* Main bio image */
.bio-photo { width:260px; height:auto; border-radius:12px; border:1px solid var(--primary-color); }

/* Floating camera icon overlay for extra images */
.bio-photo-camera-icon {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: 0.5;
    pointer-events: none;
    animation: bioCameraFloat 3s ease-in-out infinite;
}

/* Small 3px travel float animation */
@keyframes bioCameraFloat {
    0%   { transform: translateY(1.5px); }
    50%  { transform: translateY(-1.5px); }
    100% { transform: translateY(1.5px); }
}
.bio-title { flex-grow: 1; }
.bio-title h1 { 
    font-size:2.2rem; 
    margin:0 0 6px 0; 
    color: var(--primary-color); 
    text-transform: uppercase;
}
.bio-title .bio-name-field { text-transform: uppercase; }
.bio-title .bio-info { 
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--lighter-primary-color) !important;
}

.bio-card-title {
    /* Ensure titles never exceed 2 visual lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Cross‑browser fallback: cap visible height to ~2 lines */
    line-height: 1.2;
    max-height: 2.4em;

    padding-bottom: 10px;
}

.bio-title .bio-info.bio-birth-info,
.bio-title .bio-info.bio-birth-date,
.bio-title .bio-info.bio-birth-place {
    color: #fff !important;
}

.bio-title .bio-info.bio-birth-date { margin-bottom: 2px; }
.bio-title .bio-info.bio-birth-place { margin-top: 0; }

.bio-text { font-size:1.1rem; line-height:1.6; margin:15px 0; }

.bio-content .bio-section-title {
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.bio-coactors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.co-card {
    position: relative;
    width: var(--bio-coactor-w, 150px);
    height: var(--bio-coactor-h, 225px);
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.2s;
    cursor: pointer;
}

.co-card:hover { transform: scale(1.05); }

.co-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.co-card .co-count {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--primary-color);
    color: #fff !important;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10;
}

.co-card .co-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px;
    background: rgba(0,0,0,0.7);
    color: #fff !important;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.bio-grid { 
  display:grid; 
  grid-template-columns: repeat(auto-fit, var(--bio-knownfor-w, 150px)); 
  gap: 18px;
  row-gap: 25px;
  column-gap: 18px;
  padding-bottom: 10px;
}

.bio-text .bio-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--bio-clamp, 4);
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.bio-text .bio-readmore,
.bio-text .bio-readless {
  color: var(--primary-color) !important;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  display: inline;
}

/* Credits table button inside bio header */
.bio-credits-btn {
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color) !important;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bio-credits-btn:hover {
  background: var(--primary-color);
  color: #000000 !important;
}

.bio-media-details-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bio-media-details .media-backdrop-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--primary-color);
}

.bio-media-details .media-backdrop-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bio-media-details .media-info-block { padding: 0 10px; }
.bio-media-details .media-info-title {
    color: var(--primary-color) !important;
    font-size: 2rem;
    margin-bottom: 10px;
}
.bio-media-details .media-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 1rem;
    color: var(--lighter-primary-color) !important;
}
.bio-media-details .media-stats p { margin: 0; }
.bio-media-details .media-overview {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 15px;
}

/* Ensure "Known For" title in full bio uses the active theme color
   and reduce its size by ~4pt from the default heading size */
.bio-content h2 {
    color: var(--primary-color) !important;
    font-size: calc(1.3rem - 2pt);
}

@media (max-width: 768px) {
  .bio-close { width: 28px; height: 28px; font-size: 1.25rem; }
  .bio-close.top { top: 10px; right: 10px; }
  .bio-close.bottom { bottom: 10px; right: 10px; }

  .bio-header { 
    flex-direction: column; 
    align-items: center; 
    gap: 15px;
  }

  .bio-credits-btn {
    margin-top: 6px;
  }
  
  .bio-photo { 
    width: 150px;
    height: 225px;
  }
  
  .bio-title { text-align: center; width: 100%; }
  .bio-title h1 { font-size: 20pt; text-transform: uppercase; }
  .bio-title .bio-name-field { text-transform: uppercase; }
  .bio-title .bio-info { font-size: 10pt; line-height: 1.3; }
  .bio-title .bio-aka { font-size: 10pt; line-height: 1.3; }
  .bio-title .bio-info.bio-birth-info,
  .bio-title .bio-info.bio-birth-date,
  .bio-title .bio-info.bio-birth-place {
      font-size: 10pt;
      line-height: 1.3;
  }
  .bio-content .bio-section-title { font-size: 12pt; }
  .bio-title h2 { font-size: 14pt; }
  .bio-text { font-size: 10pt; line-height: 1.35; }

  .bio-coactors { justify-content: center; }
  
  .co-card {
      width: var(--bio-coactor-w-m, 75px);
      height: var(--bio-coactor-h-m, 113px);
  }

  .bio-card {
      width: 75px !important;
      height: 113px !important;
  }
  .bio-card img {
      width: 75px !important;
      height: 113px !important;
      object-fit: cover !important;
  }

  .co-card .co-count,
  .co-card .co-name,
  .bio-card-title {
      font-size: calc(0.65rem - 2pt);
  }
  
  .bio-media-details .media-info-block { padding: 0; }
  .bio-media-details .media-info-title { font-size: 1.5rem; }
  .bio-media-details .media-stats { font-size: 0.85rem; gap: 10px; }
  .bio-media-details .media-overview { font-size: 0.8rem; }
}

@media (max-width: 768px) {
  .bio-photo.bio-photo-expanded {
      width: 100% !important;
      height: auto !important;
      max-height: 80vh;
      display: block;
      margin: 0 auto 10px;
      object-fit: contain;
  }
}

@media (min-width: 769px) {
    .bio-title h1 {
        font-size: 28pt;
        text-transform: uppercase;
    }
    .bio-photo {
        width: var(--bio-main-w-d, 300px);
        height: var(--bio-main-h-d, 450px);
    }

    .bio-credits-btn {
        margin-left: 0;
        margin-top: 4px;
    }
    /* Desktop-only sizing for the upper-right back circle */
    .bio-close.top {
        width: 84px;
        height: 84px;
    }
}

@media (min-width: 769px) {
  :root { 
    --bio-knownfor-w: var(--bio-knownfor-w-d, 150px);
    --bio-knownfor-h: var(--bio-knownfor-h-d, 225px);
    --bio-coactor-w: var(--bio-coactor-w-d, 150px);
    --bio-coactor-h: var(--bio-coactor-h-d, 225px);
  }
}

@media (max-width: 768px) {
  :root { 
    --bio-knownfor-w: var(--bio-knownfor-w-m, 75px);
    --bio-knownfor-h: var(--bio-knownfor-h-m, 113px);
    --bio-coactor-w: var(--bio-coactor-w-m, 75px);
    --bio-coactor-h: var(--bio-coactor-h-m, 113px);
  }
}

:root[data-ss-transparency="true"] .bio-content,
:root[data-ss-transparency="true"] .bio-content * {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

@media (min-width: 769px) {
    .bio-grid {
        grid-template-columns: repeat(auto-fit, 100px) !important;
    }
    .bio-card {
        width: 100px !important;
        height: 150px !important;
    }
    .bio-card img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}


```