/* 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;
    /* Glassy full bio button */
    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: var(--text-color); border:none; cursor:pointer;
    position: relative;
    overflow: hidden;
}

/* Glass reflection for full bio button */
.bio-popup .bio-full-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    height: 55%;
    top: 0;
    left: 0;
    background: radial-gradient(
      circle at 50% -20%,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.35) 35%,
      rgba(255, 255, 255, 0.0) 70%
    );
    opacity: 0.9;
    pointer-events: none;
}

/* Ensure any generic bio buttons (e.g., inline "B" icons) also get the glass style */
.bio-button {
    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%
    );
    position: relative;
    overflow: hidden;
}

.bio-button::before {
    content: "";
    position: absolute;
    inset: 0;
    height: 55%;
    top: 0;
    left: 0;
    background: radial-gradient(
      circle at 50% -20%,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.35) 35%,
      rgba(255, 255, 255, 0.0) 70%
    );
    opacity: 0.9;
    pointer-events: none;
}

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

.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: 100px; height: 100px; 
  border-radius: 50%; 
  background: var(--primary-color); 
  color: #000 !important; 
  font-size: 2rem; 
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 30010;
}
.bio-close.top { top: 20px; }
.bio-close.bottom { bottom: 20px; }

.bio-header { display:flex; gap:15px; align-items:flex-start; }
.bio-photo { 
  width:260px; 
  height:auto; 
  border-radius:12px; 
  border:1px solid var(--primary-color); 
  /* Offset small profile image so it sits ~40px from the left window edge on desktop */
  margin-left: 10px;
}
.bio-title { flex-grow: 1; }
.bio-title h1 { 
    font-size:3.5rem; 
    margin:0 0 6px 0; 
    color: var(--primary-color); 
    text-transform: uppercase;
    font-weight: 700;
}
.bio-title h2 {
    color: var(--primary-color) !important;
}
.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-title .bio-info.bio-birth-info,
.bio-title .bio-info.bio-birth-date,
.bio-title .bio-info.bio-birth-place {
    color: #fff !important;
    font-size: 0.95rem; /* Reduced ~2pt for desktop */
}

.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: 13px;
    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;
  justify-content: center; /* Center the grid items */
}

/* Since we are switching to JS segmentation for dimming, remove CSS clamping */
.bio-text .bio-desc {
  /* Use P element solely for line measurement */
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  text-overflow: unset;
  margin: 0;
  line-height: 1.6; /* Default line height for text measurement */
}

/* New classes for segmented text display */
/* Apply general text styles to segments */
.bio-text .bio-desc-segment { 
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 8px 0;
}

.bio-desc-segment {
    display: block;
    white-space: pre-wrap; /* Preserve newlines */
    transition: opacity 0.3s ease;
    color: #fff !important; /* Ensure visibility */
}

.bio-desc-segment.dimmed-segment {
    opacity: 0.3; /* Grayed out text (made lighter for better contrast) */
}

.bio-desc-segment.active-segment {
    opacity: 1; /* Bright text */
}

.bio-text .bio-readmore,
.bio-text .bio-readless {
  color: var(--primary-color) !important;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  display: inline;
  font-size: 1.1rem; /* Match bio-desc-segment desktop size (1.1rem) */
}

.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: 0 auto 20px auto;
    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;
}

@media (max-width: 768px) {
  .bio-close { width: 50px; height: 50px; 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-photo { 
    width: 150px;
    height: 225px;
    margin-left: 0; /* Centered on mobile; no extra left offset */
  }
  
  .bio-title { text-align: center; width: 100%; }
  .bio-title h1 { font-size: 24pt; 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-info.bio-birth-info,
  .bio-title .bio-info.bio-birth-date,
  .bio-title .bio-info.bio-birth-place {
      font-size: 8pt;
      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 {
  }
  .bio-content .bio-section-title { font-size: 12pt; }
  .bio-title h2 { font-size: 14pt; }
  .bio-text .bio-desc-segment { 
    font-size: 10pt; 
    line-height: 1.35; 
    margin: 4px 0; 
  }

  .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-text .bio-readmore,
  .bio-text .bio-readless {
      font-size: 10pt; /* Match bio-desc-segment mobile size (10pt) */
  }

  .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: 36pt;
        text-transform: uppercase;
        font-weight: 700;
    }
    .bio-photo {
        width: var(--bio-main-w-d, 300px);
        height: var(--bio-main-h-d, 450px);
        margin-left: 10px; /* Ensure ~40px from left window edge (30px padding + 10px) on desktop */
    }
    /* Desktop-only sizing for the upper-right back circle */
    .bio-close.top {
        width: 150px;
        height: 125px;
    }
}

@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;
    }
}


```