/* トップページ: サムネイルの列を横スクロールにする(Netflix/Prime Video風)
   - 各 .grid の <ul> を .hrow > .hrow-strip で包み、折り返さずに1行で横スクロールする
   - 矢印は既存の .slick-arrow(ショート動画帯と同じ見た目)。端に着いた側は .slick-disabled で消える
   - 右端に「まだ続きがある」ことを示すグラデーションを重ねる(端に着いたら .at-end で消える)
   - 元に戻すには、この CSS の読み込みと templates/home/index.html の変更を戻す */
.hrow {
  --hrow-bg: #111111;
  position: relative;
}
.gone .hrow { --hrow-bg: #353535; }

.grid .hrow-strip,
.hrow-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.hrow-strip::-webkit-scrollbar { display: none; }

/* style.css の .grid li (flex-basis: 24% など) と、780px/1080px のしきい値に合わせて上書きする */
.grid .hrow-strip li {
  flex: 0 0 23.5%;
  max-width: 23.5%;
  scroll-snap-align: start;
}
.grid.odd .hrow-strip li {
  flex: 0 0 15.6%;
  max-width: 15.6%;
}
@media only screen and (max-width: 1080px) {
  .grid .hrow-strip li { flex-basis: 31%; max-width: 31%; }
  .grid.odd .hrow-strip li { flex-basis: 22%; max-width: 22%; }
}
@media only screen and (max-width: 780px) {
  .grid .hrow-strip li { flex-basis: 46%; max-width: 46%; }
  .grid.odd .hrow-strip li { flex-basis: 36%; max-width: 36%; }
}
@media only screen and (max-width: 480px) {
  .grid .hrow-strip li { flex-basis: 62%; max-width: 62%; }
}

/* 矢印: 列の内側に収める(外に出すと画面からはみ出す) */
.hrow .slick-prev { left: 4px; }
.hrow .slick-next { right: 4px; }
.hrow .slick-arrow { top: 42%; }

/* 右端のグラデーション */
.hrow::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56px;
  background: linear-gradient(90deg, rgba(17, 17, 17, 0), var(--hrow-bg));
  pointer-events: none;
  z-index: 3;
  transition: opacity .2s;
}
.hrow.at-end::after { opacity: 0; }

/* タッチ端末は指でスクロールするので、矢印は出さない */
@media (hover: none) {
  .hrow .slick-arrow { display: none; }
}

/* ランキング: 順位の数字を、サムネイルの左横に大きく出す(Netflix/Prime Video風)。サムネイルは他の列と同じ大きさ
   - li の幅 = サムネイルの幅(他の列と同じ割合) + 数字が使う幅。数字の右端は、サムネイルの下に少し潜る */
.popular .hrow-strip {
  counter-reset: rank;
  --thumb: 23.5%;
  --nfs: 150px;
}
.popular .hrow-strip li {
  counter-increment: rank;
  display: flex;
  align-items: flex-end;
  flex-basis: calc(var(--thumb) + var(--nfs) * .58);
  max-width: calc(var(--thumb) + var(--nfs) * .58);
}
.popular .hrow-strip li:nth-child(n+10) {
  flex-basis: calc(var(--thumb) + var(--nfs) * 1.22);
  max-width: calc(var(--thumb) + var(--nfs) * 1.22);
}
.popular .hrow-strip li a {
  flex: 1 1 0;
  min-width: 0;
}
.popular .hrow-strip li::before {
  content: counter(rank);
  flex: 0 0 auto;
  width: calc(var(--nfs) * .66);
  margin-right: calc(var(--nfs) * -.08);
  color: transparent;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--nfs);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.06em;
  text-align: right;
  -webkit-text-stroke: 3px rgba(255, 255, 255, .55);
}
.popular .hrow-strip li:nth-child(n+10)::before { width: calc(var(--nfs) * 1.3); }
@media only screen and (max-width: 1080px) {
  .popular .hrow-strip { --thumb: 31%; }
}
@media only screen and (max-width: 780px) {
  .popular .hrow-strip { --thumb: 46%; --nfs: 120px; }
}
@media only screen and (max-width: 480px) {
  .popular .hrow-strip { --thumb: 62%; --nfs: 96px; }
}

/* 近日中に公開される作品: サムネイルの下に小さく公開日。未公開なのでリンクは付けない */
.soon.grid {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .028) 0 2px, transparent 2px 16px),
    #0f1628;
  border-top: 1px solid rgba(120, 160, 255, .35);
  border-bottom: 1px solid rgba(120, 160, 255, .35);
}
.soon .hrow { --hrow-bg: #0f1628; }
#contents .soon .hrow-head h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}
#contents .soon .hrow-head h3::before {
  content: "COMING SOON";
  flex: 0 0 auto;
  padding: 3px 10px;
  border: 1px solid rgba(120, 160, 255, .75);
  border-radius: 3px;
  background: rgba(120, 160, 255, .14);
  color: #b9ccff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.4;
}
@media only screen and (max-width: 480px) {
  #contents .soon .hrow-head h3 { gap: 8px; font-size: 118%; white-space: nowrap; }
  #contents .soon .hrow-head h3::before { padding: 2px 6px; font-size: 10px; letter-spacing: .1em; }
}
.soon .hrow-strip li { cursor: default; }
.soon .soon-date {
  margin-top: 8px;
  color: #aebcdf;
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .hrow-strip { scroll-behavior: auto; }
}

/* 見出しの横の「もっと見る」(Netflix風)
   - 各列の下にあった「もっと見る」ボタン(.morebtn)をやめて、見出しと同じ行の右端に置く
   - ボタンの上下の余白(約70px)がなくなるので、列の上下の余白も少し詰める */
.hrow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
#contents .hrow-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
#contents .hrow-head a.hrow-more,
.hrow-more {
  flex: 0 0 auto;
  display: inline-block;
  padding: 5px 16px;
  border: 1px solid #fff;
  border-radius: 18px;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.hrow-more::after { content: " \203A"; }
#contents .hrow-head a.hrow-more:hover,
#contents .hrow-head a.hrow-more:focus,
.hrow-more:hover,
.hrow-more:focus {
  background: #fff;
  color: #000;
}
.grid:has(> .hrow-head),
.shortshome:has(> .hrow-head) {
  padding-top: 3%;
  padding-bottom: 3%;
}
@media only screen and (max-width: 480px) {
  .hrow-more { padding: 4px 12px; font-size: 12px; }
  .hrow-head { margin-bottom: 12px; }
}
