/* Click-only content detail sheet. Loaded after the legacy ranking modal rules. */
:is(.home, .ranking-page) .content-detail-modal {
  padding: 20px;
  background: rgba(10, 16, 27, .76);
}

:is(.home, .ranking-page) .content-detail-dialog {
  width: min(760px, 100%);
  max-height: min(920px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 28px;
  background: #fff;
}

:is(.home, .ranking-page) .content-sheet-head {
  position: absolute;
  z-index: 12;
  inset: 0 0 auto;
  height: 0;
  pointer-events: none;
}

:is(.home, .ranking-page) .content-sheet-head > i,
:is(.home, .ranking-page) .content-sheet-head > span {
  display: none;
}

:is(.home, .ranking-page) .content-sheet-head .content-detail-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(20, 30, 45, .08);
  background: rgba(255, 255, 255, .92);
  color: #263244;
  font-size: 25px;
  line-height: 1;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(10, 20, 35, .15);
  backdrop-filter: blur(8px);
}

:is(.home, .ranking-page) #content-detail-body {
  max-height: min(920px, calc(100vh - 40px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

:is(.home, .ranking-page) .content-detail-hero {
  display: block;
  padding: 0;
}

:is(.home, .ranking-page) .content-detail-cover {
  position: relative;
  height: clamp(300px, 44vw, 405px);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(140deg, #dbe8f3, #758da5);
  box-shadow: none;
}

:is(.home, .ranking-page) .content-detail-cover::after {
  position: absolute;
  z-index: 1;
  inset: 30% 0 0;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 12, 22, .12) 30%, rgba(5, 12, 22, .86) 100%);
  content: "";
  pointer-events: none;
}

:is(.home, .ranking-page) .content-detail-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(.home, .ranking-page) .content-detail-cover figcaption {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 24px;
  left: 28px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-shadow: 0 2px 9px rgba(0, 0, 0, .25);
}

:is(.home, .ranking-page) .content-detail-info {
  padding: 30px 32px 34px;
}

:is(.home, .ranking-page) .content-detail-service {
  color: #6d49ed;
  font-size: 13px;
}

:is(.home, .ranking-page) .content-detail-service img {
  width: 25px;
  height: 25px;
  border-radius: 7px;
}

:is(.home, .ranking-page) .content-detail-hero h2 {
  margin: 11px 0 5px;
  color: #141c29;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.065em;
}

:is(.home, .ranking-page) .content-detail-original-title {
  display: block;
  color: #8a95a5;
  font-size: 13px;
  line-height: 1.4;
}

:is(.home, .ranking-page) .content-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

:is(.home, .ranking-page) .content-detail-tags span {
  padding: 8px 11px;
  border-radius: 10px;
  background: #f3f1f8;
  color: #6f657f;
  font-size: 12px;
  font-weight: 800;
}

:is(.home, .ranking-page) .content-detail-synopsis {
  margin-top: 24px;
}

:is(.home, .ranking-page) .content-detail-synopsis p {
  margin: 0;
  color: #626b7a;
  font-size: 15px;
  line-height: 1.78;
  white-space: pre-line;
}

:is(.home, .ranking-page) .content-detail-synopsis p.is-collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

:is(.home, .ranking-page) .content-detail-synopsis button {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6748e8;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

:is(.home, .ranking-page) .content-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

:is(.home, .ranking-page) .content-detail-facts > div {
  min-width: 0;
  padding: 15px 17px;
  border-radius: 15px;
  background: #f7f6fa;
}

:is(.home, .ranking-page) .content-detail-facts > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

:is(.home, .ranking-page) .content-detail-facts small,
:is(.home, .ranking-page) .content-detail-facts b {
  display: block;
}

:is(.home, .ranking-page) .content-detail-facts small {
  margin-bottom: 6px;
  color: #9299a5;
  font-size: 11px;
  font-weight: 700;
}

:is(.home, .ranking-page) .content-detail-facts b {
  overflow: hidden;
  color: #3a3e49;
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.home, .ranking-page) .content-detail-actions {
  margin-top: 24px;
}

:is(.home, .ranking-page) .content-detail-actions button[data-content-favorite] {
  border-color: #e2dff1;
  color: #6d49ed;
}

:is(.home, .ranking-page) .content-detail-actions button[data-content-detail-close] {
  color: #697386;
}

:is(.home, .ranking-page) .content-detail-sections {
  gap: 14px;
  padding: 0 32px 32px;
  background: #fff;
}

:is(.home, .ranking-page) .content-detail-section {
  padding: 23px;
  border: 1px solid #eceaf1;
  border-radius: 17px;
  background: #fff;
}

:is(.home, .ranking-page) .content-section-heading h3 {
  margin: 0 0 16px;
  font-size: 19px;
}

:is(.home, .ranking-page) .content-cast-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 0;
}

:is(.home, .ranking-page) .content-cast-list > span {
  min-width: 0;
  padding: 12px 13px;
  border-radius: 11px;
  background: #f7f6fa;
}

:is(.home, .ranking-page) .content-cast-list > span::after {
  display: none;
}

:is(.home, .ranking-page) .content-cast-list b,
:is(.home, .ranking-page) .content-cast-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.home, .ranking-page) .content-cast-list b { color: #353b48; font-size: 13px; }
:is(.home, .ranking-page) .content-cast-list small { margin-top: 3px; color: #8c94a2; font-size: 11px; }

:is(.home, .ranking-page) .content-watch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

:is(.home, .ranking-page) .content-watch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid #e6e3ed;
  border-radius: 13px;
  background: #fff;
}

:is(.home, .ranking-page) .content-watch-service {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

:is(.home, .ranking-page) .content-watch-service img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
}

:is(.home, .ranking-page) .content-watch-service b {
  overflow: hidden;
  color: #343b4b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(.home, .ranking-page) .content-watch-card > strong {
  color: #6748e8;
  font-size: 16px;
}

:is(.home, .ranking-page) .content-watch-card > small {
  color: #9299a5;
  font-size: 10px;
}

:is(.home, .ranking-page) .content-watch-card > a {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: #f2efff;
  color: #6748e8;
  font-size: 12px;
  font-weight: 900;
  line-height: 34px;
  text-align: center;
}

:is(.home, .ranking-page) .content-trailer-section .content-trailer-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #111a29;
}

:is(.home, .ranking-page) .content-trailer-section iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

:is(.home, .ranking-page) .content-detail-loading {
  display: grid;
  min-height: 430px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #758196;
}

:is(.home, .ranking-page) .content-detail-loading i {
  width: 34px;
  height: 34px;
  border: 3px solid #e5e1f7;
  border-top-color: #6d49ed;
  border-radius: 50%;
  animation: content-detail-spin .8s linear infinite;
}

:is(.home, .ranking-page) .content-detail-loading b { color: #454c5b; font-size: 14px; }
:is(.home, .ranking-page) .content-detail-loading span { font-size: 12px; }

@keyframes content-detail-spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  :is(.home, .ranking-page) .content-detail-modal {
    padding: 0;
    align-items: flex-end;
  }

  :is(.home, .ranking-page) .content-detail-dialog {
    width: 100%;
    height: min(94dvh, 900px);
    max-height: 94dvh;
    border-radius: 25px 25px 0 0;
    transform: translate3d(0, 102%, 0);
  }

  :is(.home, .ranking-page) .content-detail-modal.open .content-detail-dialog {
    transform: translate3d(0, 0, 0);
  }

  :is(.home, .ranking-page) #content-detail-body {
    max-height: 94dvh;
  }

  :is(.home, .ranking-page) .content-sheet-head .content-detail-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  :is(.home, .ranking-page) .content-sheet-head {
    height: 54px;
    pointer-events: auto;
  }

  :is(.home, .ranking-page) .content-detail-cover {
    height: clamp(270px, 66vw, 390px);
  }

  :is(.home, .ranking-page) .content-detail-cover figcaption {
    right: 20px;
    bottom: 19px;
    left: 20px;
    font-size: 13px;
  }

  :is(.home, .ranking-page) .content-detail-info {
    padding: 24px 20px 27px;
  }

  :is(.home, .ranking-page) .content-detail-hero h2 {
    font-size: 32px;
  }

  :is(.home, .ranking-page) .content-detail-sections {
    padding: 0 20px max(24px, env(safe-area-inset-bottom));
  }

  :is(.home, .ranking-page) .content-detail-section {
    padding: 19px;
  }

  :is(.home, .ranking-page) .content-cast-list,
  :is(.home, .ranking-page) .content-watch-list {
    grid-template-columns: 1fr;
  }

  :is(.home, .ranking-page) .content-detail-loading {
    min-height: 340px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.home, .ranking-page) .content-detail-loading i { animation: none; }
}
