/* PhimHDC Home V3.4 — matching the uploaded HotPhimVN module screenshots.
   Scoped to the homepage. Keeps all PHP routes/data, player and admin unchanged. */

/* A single left-side glass gradient behind BOTH the logo and the menu.
   Unlike v3.3 (sidebar starts at y=65), the shade now begins at the very top. */
@media (min-width: 801px) {
  .phdc-sidebar,
  .phdc-sidebar.is-solid {
    top: 0;
    padding-top: var(--phdc-header);
    background: linear-gradient(270deg,
      rgba(20,20,20,0) 1%,
      rgba(20,20,20,.25) 26%,
      rgba(20,20,20,.55) 64%,
      rgba(20,20,20,.78) 100%);
  }
}

/* On the reference, only the CURRENT page can have a turquoise icon.
   Merely hovering a different menu item shows its normal WHITE SVG and a white arrow. */
.phdc-nav-link:not(.is-current):hover .phdc-nav-icon-default,
.phdc-nav-link:not(.is-current):focus-visible .phdc-nav-icon-default { display: block !important; }
.phdc-nav-link:not(.is-current):hover .phdc-nav-icon-selected,
.phdc-nav-link:not(.is-current):focus-visible .phdc-nav-icon-selected { display: none !important; }
.phdc-nav-link:not(.is-current):hover .phdc-nav-icon,
.phdc-nav-link:not(.is-current):focus-visible .phdc-nav-icon { color:#fff !important; }

/* Reference: roomy heading, outlined yellow 'Xem thêm' pill with right arrow. */
.phdc-section { margin-top: 11px; margin-bottom: 15px; }
.phdc-section-heading { min-height: 58px; padding: 9px 2px 8px 0; }
.phdc-section-heading h2 { font: 600 1.8rem/1.6 sans-serif; letter-spacing: 0; }
.phdc-section-heading>a {
  color: #ffde8a !important;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 25px;
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 400;
  gap: 8px;
  min-height: 26px;
}
.phdc-section-heading>a svg { width: 20px; height: 20px; stroke-width: 1.75; }
.phdc-section-heading>a:hover { color: #fff5c0 !important; border-color: #ffde8a; }

/* Poster shelves: at the reference screenshot width there are EIGHT tall posters,
   not ten narrow cards. Each image is ~200x280 with a title centered beneath. */
.phdc-track:not(.phdc-track-landscape):not(.phdc-rank-track) {
  grid-auto-columns: calc((100% - 7 * 10px) / 8);
  gap: 10px;
  padding-bottom: 8px;
}
.phdc-movie-card:not(.phdc-movie-landscape) .phdc-movie-art {
  aspect-ratio: 5/7;
  border-radius: 9px;
}
.phdc-movie-card:not(.phdc-movie-landscape) .phdc-movie-title {
  text-align: center;
  font: 400 16px/1.6 sans-serif;
  margin-top: 11px;
  color: #e1e3e5;
}
.phdc-movie-art>img { transition: transform .28s ease, filter .28s ease; }
.phdc-movie-card:hover .phdc-movie-art>img,
.phdc-movie-card:focus-visible .phdc-movie-art>img { transform: scale(1.035); filter: brightness(.95); }
.phdc-movie-hover { display: none; }

/* Actual PhimHDC data is IMDb + the current episode. Do not mislabel it as
   thuyet-minh / phu-de counts (these aren't stored as two simple film fields). */
.phdc-poster-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
  white-space: nowrap;
}
.phdc-poster-meta-grey,
.phdc-poster-meta-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  max-width: 70%;
  padding: 4px 7px;
  font: 500 11px/1.3 sans-serif;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 5px rgba(0,0,0,.25);
}
.phdc-poster-meta-grey { background: #5e6070; border-radius: 5px 0 0 0; }
.phdc-poster-meta-green { background: #228b4d; border-radius: 0 5px 0 0; }
.phdc-poster-meta-green:only-child { border-radius: 5px 5px 0 0; }

/* The ranking row is deliberately DIFFERENT from standard movie shelves.
   Six large posters, alternating slanted top edges, gold/cream rank numbers,
   and a thin gold frame on hover as shown in screenshots 110707/110717. */
.phdc-ranking { margin-top: 1px; }
.phdc-rank-track {
  grid-auto-columns: calc((100% - 5 * 12px) / 6);
  gap: 12px;
  padding-top: 2px;
  padding-bottom: 8px;
}
.phdc-rank-item { min-width: 0; }
.phdc-rank-art {
  display: block;
  position: relative;
  aspect-ratio: 5/7;
  background: #292a35;
  overflow: hidden;
  border: 4px solid transparent;
  border-radius: 13px;
  transition: border-color .25s ease;
}
/* Slightly irregular slope replicating the alternating top 10 shape. */
.phdc-rank-item:nth-child(odd) .phdc-rank-art {
  clip-path: polygon(0 0, 93% 6%, 100% 9%, 100% 100%, 0 100%);
}
.phdc-rank-item:nth-child(even) .phdc-rank-art {
  clip-path: polygon(0 9%, 7% 6%, 100% 0, 100% 100%, 0 100%);
}
.phdc-rank-art>img { width:100%; height:100%; object-fit: cover; transition: transform .28s ease; }
.phdc-rank-item:hover .phdc-rank-art,
.phdc-rank-item:focus-visible .phdc-rank-art { border-color: #ffde8a; }
.phdc-rank-item:hover .phdc-rank-art>img,
.phdc-rank-item:focus-visible .phdc-rank-art>img { transform: scale(.985); }
.phdc-rank-bottom { min-height: 91px; display:flex; align-items:center; gap:5px; }
.phdc-rank-number {
  flex: 0 0 80px;
  display: block;
  text-align: center;
  font-family: sans-serif;
  font-size: 67px;
  font-weight: 800;
  line-height: 1.5;
  font-style: italic;
  letter-spacing: -2px;
  background: linear-gradient(39deg,#fecf59,#fff1cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffdf96;
}
.phdc-rank-info { gap: 3px; min-width: 0; }
.phdc-rank-info strong,
.phdc-rank-info small { display: block; text-overflow: ellipsis; overflow:hidden; white-space:nowrap; }
.phdc-rank-info strong { font: 500 16px/1.5 sans-serif; color:#fff; }
.phdc-rank-info small { font: 400 16px/1.5 sans-serif; color:#aaa; }
.phdc-rank-art .phdc-poster-meta { bottom: 0; }

@media (min-width:801px) and (max-width:1500px) {
  .phdc-track:not(.phdc-track-landscape):not(.phdc-rank-track) { grid-auto-columns:calc((100% - 7 * 9px)/8); gap:9px; }
  .phdc-section-heading h2 { font-size: 27px; }
  .phdc-rank-number { flex-basis:64px; font-size:60px; }
  .phdc-rank-bottom { min-height: 77px; }
  .phdc-rank-info strong,.phdc-rank-info small { font-size: 13px; }
}
@media (min-width:801px) and (max-width:1100px) {
  .phdc-track:not(.phdc-track-landscape):not(.phdc-rank-track) { grid-auto-columns:calc((100% - 5 * 10px)/6); }
  .phdc-rank-track { grid-auto-columns:calc((100% - 3 * 10px)/4); }
  .phdc-movie-card:not(.phdc-movie-landscape) .phdc-movie-title { font-size:13px; }
}
@media (max-width:800px) {
  .phdc-section-heading h2 { font-size: 24px; }
  .phdc-sidebar { top:57px; } /* keep working mobile drawer layout */
  .phdc-track:not(.phdc-track-landscape):not(.phdc-rank-track) { grid-auto-columns:calc((100% - 4 * 10px)/5); }
  .phdc-rank-track { grid-auto-columns:calc((100% - 2 * 10px)/3); }
  .phdc-rank-number { flex-basis:52px; font-size:48px; }
  .phdc-rank-info strong,.phdc-rank-info small { font-size:12px; }
  .phdc-rank-bottom { min-height:70px; }
  .phdc-poster-meta-grey,.phdc-poster-meta-green { font-size:9px; min-height:22px; padding:3px 4px; }
  .phdc-movie-card:not(.phdc-movie-landscape) .phdc-movie-title { font-size:13px; }
}
@media (max-width:520px) {
  .phdc-section-heading h2 { font-size: 20px; }
  .phdc-section-heading>a { font-size: 11px; padding:1px 7px; }
  .phdc-track:not(.phdc-track-landscape):not(.phdc-rank-track) { grid-auto-columns:calc((100% - 2 * 9px)/3); gap:9px; }
  .phdc-rank-track { grid-auto-columns:calc((100% - 1 * 10px)/2); gap:10px; }
  .phdc-movie-card:not(.phdc-movie-landscape) .phdc-movie-title { font-size:12px; }
  .phdc-rank-number { font-size:40px; flex-basis:43px; }
  .phdc-rank-info strong,.phdc-rank-info small { font-size:11px; }
  .phdc-poster-meta-grey,.phdc-poster-meta-green { font-size:8px; min-height:20px; padding:2px 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .phdc-rank-art,.phdc-rank-art>img,.phdc-movie-art>img { transition:none !important; }
}
