/* =========================================================
   Schedule page UI (nfu_match_list)
========================================================= */

.nfu-schedule {
  --nfu-primary: #1b2988;
  --nfu-text: #0b102a;
  --nfu-secondary: #f4f6ff;
  --nfu-border: rgba(215, 219, 240, 0.95);

  --nfu-card-bg: rgba(244, 246, 255, 0.96);
  --nfu-card-border: rgba(0, 0, 0, 0.08);

  --nfu-radius-lg: 16px;
  --nfu-radius-md: 12px;
  --nfu-radius-sm: 10px;

  --nfu-shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.06);
  --nfu-shadow-card: 0 10px 30px rgba(11, 16, 42, 0.18);

  --nfu-pad-cell-y: 12px;
  --nfu-pad-cell-x: 14px;

  max-width: var(--wp--style--global--content-size);
  margin: 0 auto;
}

.wp-block-post-title {
  display: none;
}

/* ===== Head / Controls ===== */

.nfu-schedule__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.nfu-schedule__tabs {
  display: inline-flex;
  gap: 8px;
  background: rgba(244, 246, 255, 0.6);
  border: 1px solid rgba(215, 219, 240, 0.9);
  border-radius: 999px;
  padding: 6px;
}

.nfu-schedule__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  color: var(--nfu-text);
  border: 1px solid transparent;
  line-height: 1;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.nfu-schedule__tab:hover {
  background: rgba(27, 41, 136, 0.08);
  border-color: rgba(27, 41, 136, 0.08);
  transform: translateY(-1px);
}
.nfu-schedule__tab.is-active {
  background: var(--nfu-primary);
  color: #fff;
}

.nfu-schedule__season {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nfu-schedule__seasonLabel {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
}

.nfu-schedule__seasonSelect {
  appearance: none;
  padding: 10px 38px 10px 12px;
  border-radius: var(--nfu-radius-sm);
  border: 1px solid rgba(215, 219, 240, 0.9);
  background: rgba(244, 246, 255, 0.95);
  font-weight: 800;
  color: var(--nfu-text);
}

.nfu-schedule__season::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(11, 16, 42, 0.65);
  pointer-events: none;
  font-size: 0.9rem;
}

.nfu-schedule__typeFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nfu-schedule__typeFilter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(244, 246, 255, 0.08);
  border: 1px solid rgba(215, 219, 240, 0.16);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.nfu-schedule__typeFilter:hover {
  background: rgba(244, 246, 255, 0.14);
  border-color: rgba(215, 219, 240, 0.24);
  transform: translateY(-1px);
}

.nfu-schedule__typeFilter.is-active {
  background: var(--nfu-primary);
  border-color: rgba(27, 41, 136, 0.9);
  color: #fff;
}

/* ===== Title / Empty ===== */

.nfu-schedule__title {
  font-size: clamp(1.25rem, 1.2rem + 0.6vw, 1.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  margin: 2.2rem 0 0.9rem;
}

.nfu-schedule__title + .nfu-matchlist {
  margin-bottom: 1.6rem;
}
.nfu-schedule__empty {
  color: rgba(255, 255, 255, 0.85);
  margin: 12px 0 0;
}

/* ===== Pagination ===== */

.nfu-schedule__pagination {
  margin: 16px 0 0;
}

.nfu-schedule__pagination ul {
  list-style: none;
  display: flex;
  gap: 8px;
  justify-content: end;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.nfu-schedule__pagination a,
.nfu-schedule__pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0px 10px;
  font-size: 14px;
  border-radius: var(--nfu-radius-sm);
  border: 1px solid rgba(215, 219, 240, 0.9);
  background: rgba(244, 246, 255, 0.95);
  text-decoration: none;
  font-weight: 800;
  color: var(--nfu-text);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.nfu-schedule__pagination a:hover {
  background: rgba(244, 246, 255, 0.95);
  border-color: rgba(215, 219, 240, 0.9);
  transform: translateY(-1px);
  text-decoration: underline;
  text-decoration-color: #1b2988;
  color: #1b2988;
}

.nfu-schedule__pagination .current {
  background: var(--nfu-primary);
  color: #fff;
  border-color: rgba(27, 41, 136, 0.9);
}

/* ===== Matchlist wrapper ===== */

.nfu-matchlist {
  border: 1px solid var(--nfu-card-border);
  border-radius: var(--nfu-radius-md);
  box-shadow: var(--nfu-shadow-soft);
  overflow: hidden;
}

.nfu-matchlist__cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Card (PC〜Tablet) ===== */

.nfu-matchCard {
  background: #fff;
  border: 1px solid var(--nfu-border);
  border-radius: var(--nfu-radius-lg);
  padding: 18px;
  box-shadow: var(--nfu-shadow-card);

  display: grid;
  grid-template-columns: 260px 1fr 220px;
  gap: 20px;
  align-items: center;
}

.nfu-matchCard__left,
.nfu-matchCard__center,
.nfu-matchCard__right {
  min-width: 0;
}

.nfu-matchCard__left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nfu-matchCard__type {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(27, 41, 136, 0.1);
  color: var(--nfu-primary);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: 12px;
}

.nfu-matchCard__date {
  font-weight: 900;
  color: var(--nfu-text);
  font-size: 20px;
  line-height: 1.2;
}

.nfu-matchCard__meta {
  display: grid;
  gap: 6px;
}

.nfu-matchCard__metaRow {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  align-items: baseline;
}

.nfu-matchCard__metaKey {
  color: rgba(11, 16, 42, 0.55);
  font-weight: 800;
  font-size: 12px;
}

.nfu-matchCard__metaVal {
  color: rgba(11, 16, 42, 0.85);
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* center */
.nfu-matchCard__center {
  border-left: 1px solid var(--nfu-border);
  padding-left: 18px;
  text-align: center;
}

.nfu-matchCard__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.nfu-matchCard__team {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.nfu-matchCard__team--home {
  justify-content: flex-end;
}
.nfu-matchCard__team--away {
  justify-content: flex-start;
}

.nfu-matchCard__teamName {
  font-weight: 900;
  color: var(--nfu-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.nfu-matchCard__teamScore {
  font-weight: 900;
  font-size: 34px;
  color: var(--nfu-primary);
  line-height: 1;
}

.nfu-matchCard__vs {
  color: rgba(11, 16, 42, 0.5);
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.nfu-matchCard__result {
  margin-top: 8px;
  color: rgba(11, 16, 42, 0.72);
  font-weight: 900;
  font-size: 13px;
  text-align: center;
}

/* right */
.nfu-matchCard__right {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.nfu-matchCard__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: var(--nfu-radius-sm);
  text-decoration: none;
  font-weight: 900;
  border: 1px solid var(--nfu-border);
  text-align: center;
  white-space: nowrap;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.nfu-matchCard__btn--primary {
  background: var(--nfu-primary);
  color: #fff;
}
.nfu-matchCard__btn--ghost {
  background: rgba(244, 246, 255, 0.85);
  color: var(--nfu-text);
}

.nfu-matchCard__btn--primary:hover {
  background: var(--nfu-primary);
  border-color: var(--nfu-primary);
  transform: translateY(-1px);
}

.nfu-matchCard__btn--ghost:hover {
  background: rgba(244, 246, 255, 0.85);
  border-color: var(--nfu-border);
  transform: translateY(-1px);
}

/* ===== Tablet (<=1024px) ===== */

@media (max-width: 1024px) {
  .nfu-matchCard {
    grid-template-columns: 240px 1fr 190px;
    gap: 16px;
  }

  .nfu-matchCard__teamScore {
    font-size: 26px;
  }
  .nfu-schedule__head {
    gap: 14px;
  }
}

/* =========================================================
   ✅ Mobile Fukudai-like (<=768px)
   - カード内部を「左：日付/会場」「右：スコア＆結果」「右下：ボタン」に再配置
   - 予定（noActions）は右下を出さず、2カラムで整える
========================================================= */

@media (max-width: 768px) {
  /* controls を福岡大っぽく「上：タブ」「下：シーズン右寄せ」 */
  .nfu-schedule__head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .nfu-schedule__typeFilters {
    width: 100%;
  }

  .nfu-schedule__season {
    width: 100%;
    justify-content: flex-start;
  }

  .nfu-schedule__tabs {
    width: fit-content;
    justify-content: flex-start;
  }

  /* card: 2カラム + 縦線（福岡大寄せ） */
  .nfu-matchCard {
    padding: 30px;
    gap: 16px;

    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "left  center"
      "left  right";
    align-items: center;
  }

  .nfu-matchCard__left {
    grid-area: left;
  }
  .nfu-matchCard__center {
    grid-area: center;
  }
  .nfu-matchCard__right {
    grid-area: right;
  }

  /* 左ブロックに縦線 */
  .nfu-matchCard__left {
    padding-right: 14px;
    border-right: 1px solid var(--nfu-border);
  }

  /* center 側は線不要（PCの border-left を消す） */
  .nfu-matchCard__center {
    border-left: 0;
    padding-left: 0;
    text-align: center;
  }

  /* スコア表示を「数字強め・名前小さめ」の福岡大寄せ */
  .nfu-matchlist--result .nfu-matchCard__teams {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
  }

  .nfu-matchlist--result .nfu-matchCard__team {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .nfu-matchlist--result .nfu-matchCard__teamName {
    font-size: 12px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .nfu-matchlist--result .nfu-matchCard__teamScore {
    font-size: 30px;
    line-height: 1;
  }

  .nfu-matchCard__result {
    margin-top: 6px;
    font-size: 12px;
  }

  /* 右下ボタン：2つ横並び（福岡大っぽい） */
  .nfu-matchCard__right {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
  }

  .nfu-matchCard__btn {
    flex: 1;
    padding: 12px 10px;
  }

  /* ✅ 予定：右側を空にする（noActions） */
  .nfu-matchCard--noActions {
    grid-template-areas: "left center";
  }

  .nfu-matchCard--noActions .nfu-matchCard__right {
    display: none;
  }

  /* pagination 押しやすく */
  .nfu-schedule__pagination a,
  .nfu-schedule__pagination span {
    min-width: fit-content;
    height: 20px;
    padding: 5px 10px;
  }
}

/* ===== Small Mobile (<=425px) : Fukudai-like stack ===== */
@media (max-width: 550px) {
  .nfu-schedule__tabs {
    width: fit-content; /* でかい帯にしない */
  }
  .nfu-schedule__seasonSelect {
    max-width: 180px; /* 425で詰まりすぎ防止 */
  }

  /* card：2カラムをやめて“縦積み”に切り替え */
  .nfu-matchCard {
    padding: 16px;
    gap: 14px;

    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    align-items: stretch;
  }

  .nfu-matchlist__cards {
    gap: 30px;
  }

  .nfu-matchCard__left {
    grid-area: left;
  }
  .nfu-matchCard__center {
    grid-area: center;
  }
  .nfu-matchCard__right {
    grid-area: right;
  }

  /* 768pxで入れた縦線は425では邪魔なので撤去 */
  .nfu-matchCard__left {
    padding-right: 0;
    border-right: 0;
  }

  /* 左→中央の区切り線を“横線”に変更（福岡大っぽい） */
  .nfu-matchCard__center {
    border-top: 1px solid var(--nfu-border);
    padding-top: 12px;
    text-align: center;
  }

  /* スコア周り：数字強め、名前は下で小さめ */
  .nfu-matchlist--result .nfu-matchCard__teams {
    gap: 12px;
  }
  .nfu-matchlist--result .nfu-matchCard__team {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .nfu-matchlist--result .nfu-matchCard__teamScore {
    font-size: 32px;
    line-height: 1;
  }
  .nfu-matchlist--result .nfu-matchCard__teamName {
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
  .nfu-matchCard__result {
    margin-top: 6px;
    font-size: 12px;
  }

  /* ボタン：下に2つ横並び（1個なら勝手に伸びる） */
  .nfu-matchCard__right {
    display: flex;
    gap: 10px;
    justify-content: stretch;
    align-items: stretch;
  }
  .nfu-matchCard__btn {
    flex: 1;
    padding: 12px 10px;
  }

  /* ✅ 予定（右が空）のときはボタン行ごと消す（PHPいじらずOK） */
  .nfu-matchCard__right:empty {
    display: none;
  }

  /* 日付を少しだけ締める */
  .nfu-matchCard__date {
    font-size: 18px;
  }
}
