/* Schedule ページ固有のスタイル。
   ヘッダー・フッター・配信カード（.stream-card）・タグ（.stream-tags）・白い縁取り（.text-outline）は
   共通の styles.css を使う。ページの枠（.page / .page-hero / .page-content）も共通。
   ここには一覧の見出し、NEXT STREAM、ARCHIVE のタイムラインだけを置く。 */


.schedule-list-section + .schedule-list-section {
  margin-top: 180px;
}

/* ===== 一覧の見出し（NEXT STREAM / UPCOMING / ARCHIVE） =====
   見出し本体は共通の .section-heading（右端の件数は .result-count）。その下に説明文を置く */
.list-heading {
  margin-bottom: 42px;
}

.list-heading .section-heading {
  margin-bottom: 0;
}

.list-heading > p {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .08em;
}

/* ===== NEXT STREAM ===== */
.next-stream-card {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .95);
  border: 8px solid var(--pink);
  border-radius: 26px;
  box-shadow: 10px 12px 0 var(--cyan-shadow);
}

/* 列幅を固定して 16:9 の高さを確保する。
   情報側に合わせて縦に伸びても横幅は広げず、画像全体を contain で収める。 */
.next-stream-thumb {
  position: relative;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #12040f;
}

.next-stream-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--thumb-hover-duration) ease;
}

/* マウスを乗せたとき写真を拡大する。拡大率は他のサムネイルと共通（styles.css の :root）。PC のみ */
@media (min-width: 1231px) and (hover: hover) {
  .next-stream-thumb:hover img {
    transform: scale(var(--thumb-hover-scale));
  }
}

.next-stream-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px 38px 36px;
}

/* 配信中の「ON AIR」の帯。日時の上に置く */
.next-stream-status {
  margin: 0 0 14px;
  padding: 8px 14px;
  color: #fff;
  background: #ffb95a;
  border-radius: 5px;
  font-family: "lexend-deca", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
}

/* 帯以外はカラム幅いっぱいに広げる */
.next-stream-info > :not(.next-stream-status) {
  align-self: stretch;
}

/* 日時は共通の .stream-time（42px）より大きくする。
   .stream-time の幅追従（cqi）は .stream-card 用なので、ここでは固定値で上書きする */
.next-stream-date .stream-time {
  font-size: 48px;
}

.next-stream-info h3 {
  margin: 25px 0 16px;
  color: var(--plum);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.45;
}

/* タグと「配信ページを見る」をまとめて下端へ寄せる */
.next-stream-foot {
  margin-top: auto;
}

.watch-button {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
  background: var(--pink);
  border-radius: 9px;
  font-size: 16px;
  font-weight: 700;
  transition: transform .2s ease, background .2s ease;
}

@media (min-width: 1231px) and (hover: hover) {
  .watch-button:hover {
    transform: translateY(-3px);
    background: var(--plum);
  }
}

/* ===== UPCOMING ===== */
/* 共通の .schedule-grid（auto-fit・最小420px）はPCで2列になるため、このページでは3列にする。
   ただし3列にするのはカードが3件以上あるときだけ（:has で3つ目の子を検出）。
   2件のときは共通の2列のまま並べ、右に空きができないようにする。
   幅1280pxではカード幅約405px。タブレット以下は共通の挙動（2列→1列）に任せる */
@media (min-width: 1051px) {
  .upcoming-section .schedule-grid:has(> :nth-child(3)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

/* UPCOMING が1件だけのときは NEXT STREAM と同じ大カード（.next-stream-card）を1枚だけ置くので、グリッドを解く */
.upcoming-section .schedule-grid.is-single {
  display: block;
}

/* ===== ARCHIVE（タイムライン） ===== */
.archive-timeline {
  position: relative;
  padding: 18px 0 4px;
}

/* 中央の縦線。月バッジの中央から始める */
.archive-timeline::before {
  content: "";
  position: absolute;
  top: 36px;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), #ab0078 76%, var(--plum));
  border-radius: 999px;
  box-shadow: 3px 0 0 rgba(0, 198, 220, .28);
  transform: translateX(-50%);
}

.archive-timeline.is-empty::before {
  display: none;
}

/* 月バッジ。月が変わる位置に schedule.js が挿入する（年は表示しない） */
.timeline-month {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin: 0 0 52px;
}

/* 2つ目以降の月バッジ（前月ぶん）は直前の配信との間隔を空ける */
.timeline-entry + .timeline-month {
  margin-top: 68px;
}

/* 見た目は共通部品 .badge-pill（styles.css）。ここでは幅だけ指定する */
.timeline-month span {
  min-width: 146px;
}

/* 1件分。サムネイル｜節（ノード）｜文章 の3列で、.is-reverse で左右を入れ替える */
.timeline-entry {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  align-items: center;
  min-height: 0;
}

.timeline-entry + .timeline-entry {
  margin-top: 68px;
}

.timeline-media {
  grid-column: 1;
  justify-self: end;
  width: 300px;
  display: block;
  overflow: hidden;
  border: 4px solid var(--pink);
  border-radius: 12px;
  box-shadow: 5px 6px 0 var(--cyan-shadow);
}

.timeline-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform var(--thumb-hover-duration) ease;
}

@media (min-width: 1231px) and (hover: hover) {
  .timeline-media:hover img {
    transform: scale(var(--thumb-hover-scale));
  }
}

.timeline-node {
  grid-column: 2;
  align-self: stretch;
  display: grid;
  place-items: center;
}

.timeline-node span {
  position: relative;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 5px solid var(--pink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--cyan-shadow);
}

/* 文章側。日付・タイトル・リンクには schedule.js が .text-outline を付ける */
.timeline-copy {
  grid-column: 3;
  width: min(100%, 340px);
  padding-left: 24px;
}

.timeline-time {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--pink);
  font-family: "din-2014", "Arial Narrow", Arial, sans-serif;
  line-height: 1;
}

.timeline-time strong {
  font-size: 32px;
  font-weight: 700;
}

.timeline-time span {
  font-size: 16px;
  font-weight: 700;
}

.timeline-copy h3 {
  margin: 12px 0 0;
  color: var(--plum);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.55;
}

/* 「配信を見る」は共通の下線リンク .text-link（styles.css） */

.timeline-entry.is-reverse .timeline-media {
  grid-column: 3;
  justify-self: start;
}

.timeline-entry.is-reverse .timeline-node {
  grid-column: 2;
  grid-row: 1;
}

.timeline-entry.is-reverse .timeline-copy {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  padding: 0 24px 0 0;
  text-align: right;
}

.timeline-entry.is-reverse .timeline-time,
.timeline-entry.is-reverse .stream-tags {
  justify-content: flex-end;
}

/* 横並びではカード幅に合わせて文字・余白・ボタンも縮める。
   最大内幅 1264px を基準にし、情報側だけが高くなるのを抑える。 */
@media (min-width: 1051px) {
  .next-stream-info {
    --next-unit: min(1px, .079113924cqw);
    min-width: 0;
    padding: calc(32 * var(--next-unit));
  }

  .next-stream-date .stream-time {
    font-size: calc(48 * var(--next-unit));
  }

  .next-stream-info h3 {
    margin: calc(20 * var(--next-unit)) 0 calc(12 * var(--next-unit));
    font-size: calc(24 * var(--next-unit));
    overflow-wrap: anywhere;
  }

  .next-stream-info .stream-tags {
    gap: calc(7 * var(--next-unit));
    margin-top: calc(12 * var(--next-unit));
  }

  .next-stream-info .stream-tags li {
    padding: calc(5 * var(--next-unit)) calc(9 * var(--next-unit)) calc(4 * var(--next-unit));
    font-size: calc(10 * var(--next-unit));
  }

  .next-stream-status {
    margin-bottom: calc(14 * var(--next-unit));
    padding: calc(8 * var(--next-unit)) calc(14 * var(--next-unit));
    font-size: calc(13 * var(--next-unit));
  }

  .watch-button {
    min-height: calc(54 * var(--next-unit));
    margin-top: calc(18 * var(--next-unit));
    gap: calc(16 * var(--next-unit));
    font-size: calc(16 * var(--next-unit));
  }
}

/* ===== タブレット ===== */
@media (max-width: 1050px) {
  .next-stream-card {
    grid-template-columns: 1fr;
  }
}

/* ===== スマートフォン ===== */
@media (max-width: 900px) {
  .schedule-list-section + .schedule-list-section {
    margin-top: 130px;
  }

  .list-heading {
    margin-bottom: 28px;
  }

  .list-heading > p {
    margin-top: 9px;
    font-size: 14px;
  }

  .next-stream-card {
    border-width: 5px;
    border-radius: 17px;
    box-shadow: 6px 7px 0 var(--cyan-shadow);
  }

  .next-stream-info {
    padding: 27px 22px 25px;
  }

  .next-stream-date .stream-time {
    font-size: min(12.5vw, 48px);
  }

  .next-stream-info h3 {
    margin-top: 20px;
    font-size: 19px;
  }

  .archive-timeline::before {
    top: 36px;
    left: 18px;
    width: 3px;
  }

  .timeline-month {
    justify-content: flex-start;
    margin: 0 0 40px;
  }

  .timeline-entry + .timeline-month {
    margin-top: 54px;
  }

  .timeline-month span {
    min-width: 128px;
    margin-left: 18px;
    transform: translateX(-18px);
  }

  /* 節｜内容 の2列にし、サムネイルの下に文章を置く */
  .timeline-entry,
  .timeline-entry.is-reverse {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    min-height: 0;
  }

  .timeline-entry + .timeline-entry {
    margin-top: 54px;
  }

  .timeline-node,
  .timeline-entry.is-reverse .timeline-node {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 24px;
  }

  .timeline-node span {
    width: 21px;
    height: 21px;
    border-width: 5px;
  }

  .timeline-media,
  .timeline-entry.is-reverse .timeline-media {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    width: min(260px, calc(100% - 6px));
    border-width: 4px;
    border-radius: 15px;
    box-shadow: 5px 6px 0 var(--cyan-shadow);
  }

  .timeline-copy,
  .timeline-entry.is-reverse .timeline-copy {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    width: 100%;
    padding: 18px 0 0;
    text-align: left;
  }

  .timeline-entry.is-reverse .timeline-time,
  .timeline-entry.is-reverse .stream-tags {
    justify-content: flex-start;
  }

  .timeline-time strong {
    font-size: 30px;
  }

  .timeline-time span {
    font-size: 15px;
  }

  .timeline-copy h3 {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .next-stream-info h3 {
    font-size: 17px;
  }
}
