/* =========================================================
   Family and Friends Audio Library
   فقط برای صفحه audio-family-and-friends.html
   ========================================================= */

.family-audio-page{
  background:
    radial-gradient(circle at 12% 8%, rgba(126,227,237,.12), transparent 31%),
    linear-gradient(180deg, #ffffff 0%, #f6fbfd 50%, #ffffff 100%);
}

.family-intro{
  width:min(100%,850px);
  margin:0 auto 22px;
  text-align:center;
}

.family-kicker{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 16px;
  margin-bottom:12px;
  border-radius:999px;
  color:#123f61;
  background:rgba(237,248,252,.96);
  border:1px solid rgba(200,229,239,.96);
  font-size:13px;
  font-weight:950;
  direction:ltr;
}

.family-intro h2{
  margin:0 0 10px;
  color:#0f2740;
  font-size:clamp(26px,3vw,42px);
  line-height:1.45;
  font-weight:950;
  letter-spacing:-.035em;
}

.family-intro p{
  margin:0 auto;
  color:#5f758b;
  font-size:15.5px;
  line-height:2.05;
  font-weight:650;
}

.family-command-panel{
  position:sticky;
  top:82px;
  z-index:18;
  width:min(100%,1120px);
  margin:0 auto 18px;
  padding:14px;
  border-radius:28px;
  background:linear-gradient(135deg,rgba(255,255,255,.93),rgba(245,251,254,.89));
  border:1px solid rgba(190,226,238,.86);
  box-shadow:0 18px 48px rgba(8,34,58,.10),inset 0 1px 0 rgba(255,255,255,.96);
  backdrop-filter:blur(16px);
}

.family-search-box{
  display:grid;
  gap:8px;
}

.family-search-box label{
  color:#123f61;
  font-size:13px;
  font-weight:950;
}

.family-search-field{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:52px;
  padding:6px 12px 6px 6px;
  border-radius:20px;
  background:#ffffff;
  border:1px solid rgba(190,226,238,.95);
}

.family-search-field::before{
  content:"⌕";
  width:34px;
  height:34px;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  color:#123f61;
  background:rgba(237,248,252,.96);
  font-size:20px;
  font-weight:900;
}

.family-search-field input{
  width:100%;
  min-width:0;
  border:0;
  outline:0;
  color:#0f2740;
  background:transparent;
  font-family:inherit;
  font-size:15px;
  font-weight:750;
}

.family-search-field input::placeholder{
  color:rgba(95,117,139,.78);
  font-weight:650;
}

.family-search-field button{
  width:34px;
  height:34px;
  flex:0 0 auto;
  border:0;
  border-radius:999px;
  color:#5f758b;
  background:rgba(15,39,64,.07);
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

.family-search-field button:hover,
.family-search-field button:focus-visible{
  color:#ffffff;
  background:#123f61;
}

.family-filter-row{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:12px 0 4px;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
}

.family-book-tab{
  min-width:150px;
  flex:0 0 auto;
  display:grid;
  gap:4px;
  padding:12px 14px;
  border:1px solid rgba(190,226,238,.95);
  border-radius:20px;
  color:#123f61;
  background:#ffffff;
  font-family:inherit;
  text-align:right;
  cursor:pointer;
  scroll-snap-align:start;
  box-shadow:0 10px 28px rgba(8,34,58,.06);
}

.family-book-tab strong{
  font-size:13.5px;
  line-height:1.45;
  font-weight:950;
  direction:ltr;
}

.family-book-tab span{
  color:#5f758b;
  font-size:12px;
  font-weight:800;
}

.family-book-tab[aria-pressed="true"]{
  color:#ffffff;
  background:
    radial-gradient(circle at 0 0, rgba(126,227,237,.34), transparent 36%),
    linear-gradient(135deg,#123f61,#061626);
  border-color:rgba(18,63,97,.42);
  box-shadow:0 16px 38px rgba(18,63,97,.22);
}

.family-book-tab[aria-pressed="true"] span{
  color:rgba(255,255,255,.76);
}

.family-status,
.family-empty-state{
  width:min(100%,1120px);
  margin:0 auto 16px;
  padding:14px 18px;
  border-radius:20px;
  color:#123f61;
  background:rgba(237,248,252,.96);
  border:1px solid rgba(200,229,239,.96);
  font-size:14px;
  font-weight:900;
  text-align:center;
}

.family-status.is-error{
  color:#7a1e1e;
  background:rgba(255,238,238,.95);
  border-color:rgba(255,190,190,.9);
}

.family-sticky-nav{
  position:sticky;
  top:244px;
  z-index:15;
  display:flex;
  flex-wrap:nowrap;
  gap:8px;
  width:min(100%,1120px);
  margin:0 auto 22px;
  padding:10px;
  overflow-x:auto;
  border-radius:22px;
  background:rgba(255,255,255,.89);
  border:1px solid rgba(190,226,238,.76);
  backdrop-filter:blur(14px);
  box-shadow:0 12px 32px rgba(8,34,58,.08);
  scrollbar-width:thin;
}

.family-sticky-nav a{
  flex:0 0 auto;
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 14px;
  border-radius:999px;
  color:#123f61;
  background:rgba(237,248,252,.96);
  border:1px solid rgba(190,226,238,.92);
  font-size:12.5px;
  font-weight:950;
  text-decoration:none;
  direction:ltr;
}

.family-sticky-nav a[aria-current="true"],
.family-sticky-nav a:hover,
.family-sticky-nav a:focus-visible{
  color:#ffffff;
  background:#123f61;
  border-color:#123f61;
}

.family-mount{
  width:min(100%,1120px);
  margin:0 auto;
}

.family-book-panel{
  scroll-margin-top:310px;
  margin:0 0 18px;
  padding:0;
  overflow:hidden;
  border-radius:28px;
  background:
    radial-gradient(circle at 0 0, rgba(126,227,237,.15), transparent 34%),
    linear-gradient(145deg,rgba(255,255,255,.99),rgba(246,252,255,.95));
  border:1px solid rgba(190,226,238,.92);
  box-shadow:0 18px 48px rgba(8,34,58,.08),inset 0 1px 0 rgba(255,255,255,.95);
}

.family-book-toggle,
.family-unit-toggle{
  width:100%;
  border:0;
  font-family:inherit;
  cursor:pointer;
  text-align:right;
}

.family-book-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px;
  color:#0f2740;
  background:transparent;
}

.family-book-toggle::after,
.family-unit-toggle::after{
  content:"⌄";
  width:34px;
  height:34px;
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  color:#123f61;
  background:rgba(237,248,252,.96);
  border:1px solid rgba(190,226,238,.86);
  transition:transform .18s ease,background .18s ease,color .18s ease;
}

.family-book-toggle[aria-expanded="true"]::after,
.family-unit-toggle[aria-expanded="true"]::after{
  transform:rotate(180deg);
  color:#ffffff;
  background:#123f61;
}

.family-book-title{
  display:grid;
  gap:5px;
}

.family-book-title span{
  width:fit-content;
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  color:#315000;
  background:rgba(183,214,11,.13);
  border:1px solid rgba(183,214,11,.30);
  font-size:12px;
  font-weight:950;
  direction:ltr;
}

.family-book-title strong{
  color:#0f2740;
  font-size:clamp(18px,2vw,24px);
  line-height:1.45;
  font-weight:950;
  direction:ltr;
}

.family-book-content{
  padding:0 18px 18px;
}

.family-level-empty{
  padding:24px 18px;
  border-radius:22px;
  text-align:center;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(190,226,238,.70);
}

.family-level-empty strong{
  display:block;
  color:#0f2740;
  font-size:18px;
  font-weight:950;
  direction:ltr;
}

.family-level-empty p{
  margin:8px 0 0;
  color:#5f758b;
  font-size:14px;
  line-height:1.9;
  font-weight:700;
}

.family-unit{
  margin-top:12px;
  padding:0;
  overflow:hidden;
  border-radius:22px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(190,226,238,.70);
}

.family-unit-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 14px;
  color:#0f2740;
  background:linear-gradient(180deg,rgba(255,255,255,.89),rgba(246,252,255,.83));
}

.family-unit-toggle span{
  display:grid;
  gap:3px;
}

.family-unit-toggle strong{
  color:#0f2740;
  font-size:16px;
  line-height:1.4;
  font-weight:950;
  direction:ltr;
}

.family-unit-toggle small{
  color:#5f758b;
  font-size:12px;
  font-weight:800;
  direction:ltr;
}

.family-unit-content{
  padding:12px;
}

.family-track-grid{
  display:grid;
  gap:12px;
}

.family-track-card{
  grid-template-columns:minmax(170px,.78fr) minmax(280px,1.25fr) auto;
  gap:12px;
  align-items:center;
  padding:13px;
  border-radius:20px;
}

.family-track-info{
  display:grid;
  gap:4px;
}

.family-track-info strong{
  direction:ltr;
}

.family-track-info small{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.family-track-player{
  min-width:0;
}

.family-download{
  min-height:38px;
  padding:0 14px;
  white-space:nowrap;
}

@media (max-width:980px){
  .family-command-panel{
    top:72px;
    border-radius:24px;
  }

  .family-sticky-nav{
    top:232px;
  }

  .family-track-card{
    grid-template-columns:1fr;
  }

  .family-track-info{
    text-align:center;
  }

  .family-download{
    width:100%;
  }
}

@media (max-width:680px){
  .family-command-panel{
    position:relative;
    top:auto;
    padding:12px;
    border-radius:22px;
  }

  .family-sticky-nav{
    position:relative;
    top:auto;
    margin-bottom:16px;
    border-radius:20px;
  }

  .family-intro{
    margin-bottom:18px;
  }

  .family-intro p{
    font-size:14.5px;
    line-height:2;
  }

  .family-book-tab{
    min-width:142px;
  }

  .family-book-panel{
    border-radius:23px;
  }

  .family-book-toggle{
    padding:15px;
  }

  .family-book-content{
    padding:0 12px 12px;
  }

  .family-unit{
    border-radius:18px;
  }

  .family-unit-toggle{
    padding:12px;
  }

  .family-unit-content{
    padding:9px;
  }

  .family-track-card{
    padding:11px;
    border-radius:17px;
  }

  .family-track-player audio{
    width:100%;
  }
}

@media (max-width:430px){
  .family-search-field{
    min-height:48px;
  }

  .family-search-field input{
    font-size:14px;
  }

  .family-book-tab{
    min-width:132px;
    padding:11px 12px;
  }

  .family-book-title strong{
    font-size:18px;
  }
}

@media (prefers-reduced-motion:reduce){
  .family-book-toggle::after,
  .family-unit-toggle::after{
    transition:none;
  }
}


/* CD structure and performance refinements */
.family-unit-toggle strong{
  letter-spacing:.02em;
}

.family-unit-content[hidden],
.family-book-content[hidden]{
  display:none !important;
}

.family-track-card{
  content-visibility:auto;
  contain-intrinsic-size:90px;
}

@media (max-width:680px){
  .family-track-card{
    content-visibility:auto;
    contain-intrinsic-size:190px;
  }
}
