/*
 * 2026年デザイン用 WordPress調整スタイル
 * 親テーマ（theme.json）のグローバルスタイルを打ち消し、coding2026 の見た目に揃える
 */
body {
  font-size: 16px;
  letter-spacing: normal;
}
h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  font-weight: 700;
}
button, input, select, textarea {
  font-family: inherit;
}

/* 管理バー表示時に固定ヘッダーが隠れないようにする */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* ===================== フォームのエラー表示 ===================== */
.form-error {
  background: #fdecea;
  border: 1px solid #f5c2bd;
  border-radius: var(--card-radius);
  color: var(--btn-danger);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.7;
  padding: 14px 16px;
}

/* ===================== Select2（チーム選択）を .team-select の見た目に揃える ===================== */
.open-field .select2-container,
.team-form .select2-container { width: 100% !important; }
.open-field .select2-container--default .select2-selection--single,
.team-form .select2-container--default .select2-selection--single {
  height: auto;
  padding: 11px 36px 11px 14px;
  border: 1.5px solid #d5dbe5;
  border-radius: 10px;
  background: #fff;
}
.open-field .select2-container--default .select2-selection--single .select2-selection__rendered,
.team-form .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.open-field .select2-container--default .select2-selection--single .select2-selection__arrow,
.team-form .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

/* ===================== テキストページ（ブロックエディターの本文を .terms-content の見た目に揃える） ===================== */
.terms-content h2:not(.terms-heading) {
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-700);
  margin: 28px 0 10px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
}
.terms-content > h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.terms-content h3:not(.terms-subheading) { font-size: 13.5px; font-weight: 800; color: var(--ink); margin: 18px 0 8px; }
.terms-content ul, .terms-content ol { margin: 0 0 10px; padding-left: 1.5em; }
.terms-content ul { list-style: disc; }
.terms-content ol { list-style: decimal; }
.terms-content a { color: var(--blue-700); text-decoration: underline; }
.terms-content .wp-block-table { overflow-x: auto; margin: 12px 0 16px; }
.terms-content table:not(.terms-table) { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.terms-content table:not(.terms-table) td,
.terms-content table:not(.terms-table) th { border: 1px solid #e0e0e0; padding: 8px 10px; vertical-align: top; text-align: left; }
.terms-content table:not(.terms-table) th,
.terms-content table:not(.terms-table) td:first-child { background: #f7f9fc; font-weight: 700; }
.terms-content .wp-block-image { margin: 4px 0 8px; }
.terms-content .wp-block-image img { height: auto; border: 1px solid #e3e9f5; border-radius: 10px; }

/* ===================== アプリ画面ヘッダー：ユーザーメニュー ===================== */
.header-user-wrap { position: relative; }
.header-user-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.header-user-caret {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(45deg);
  margin: -3px 0 0 2px;
  transition: transform .15s ease;
}
.header-user-toggle[aria-expanded="true"] .header-user-caret { transform: rotate(-135deg); margin-top: 3px; }
.header-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 200;
  min-width: 200px;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: 0 8px 24px rgba(11, 32, 79, .18);
  padding: 6px 0;
}
.header-user-menu[hidden] { display: none; }
.header-user-menu-list { list-style: none; margin: 0; padding: 0; }
.header-user-menu-list a {
  display: block;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.header-user-menu-list li + li a { border-top: 1px solid #eef1f6; }
.header-user-menu-list .current-menu-item > a { color: var(--blue-700); }
@media (hover: hover) {
  .header-user-menu-list a:hover { background: var(--blue-100); }
}

/* ===================== スコアカード ===================== */
/* スコアカード本体と、その下のメモ欄（共有者の場合はタブ）の間隔 */
#practice-league-scorecard .scorecard-card + *,
#practice-1on1-scorecard .scorecard-card + *,
#practice-casual1on1-scorecard .scorecard-card + *,
#practice-history-scorecard .scorecard-card + * { margin-top: 30px; }
/* 共有者メモのタブ（.entry-tab を button で使うためのリセット） */
button.entry-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
}
button.entry-tab.is-active { border-bottom-color: var(--blue-700); }
.scorecard-memo-pane { display: flex; flex-direction: column; gap: 16px; }
.scorecard-memo-pane[hidden] { display: none; }
/* 他の人のメモ（読み取り専用） */
.note-textarea[readonly] { background: #f4f6fa; color: #6b7b93; resize: none; }

/* ===================== お手軽申し込み試合 ===================== */
/* .casual-scorecard-btn を送信ボタン（button）で使うためのリセット */
button.casual-scorecard-btn { border: none; font-family: inherit; cursor: pointer; }
#practice-1on1-casual { display: flex; flex-direction: column; gap: 14px; }

/* ===================== マイページ：所属チームの設定・変更 ===================== */
#mypage-teams-form { display: flex; flex-direction: column; gap: 14px; }
/* チーム選択の「×」（選択をクリア）ボタン：右端の矢印と重ならない位置に表示 */
.team-form .select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  margin: 0;
  height: auto;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #9aa9c2;
}
.team-form .select2-container--default .select2-selection--single .select2-selection__clear:hover { color: var(--ink); }
#mypage-teams-form .team-form .select2-container--default .select2-selection--single { padding-right: 52px; } /* 「×」ボタン分の余白 */
.team-form .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--ink); }

/* ===================== 日付・時刻の入力欄（type="date" / "time"） ===================== */
/* iOS Safari で高さ・幅が崩れないように揃える */
.casual-input[type="date"],
.casual-input[type="time"] {
  display: block;
  min-height: 44px;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  font-family: inherit;
}
.casual-input[type="date"]::-webkit-date-and-time-value,
.casual-input[type="time"]::-webkit-date-and-time-value { text-align: left; }

/* ===================== 完了メッセージ（.form-error の成功版） ===================== */
.form-success {
  background: #e8f6ee;
  border: 1px solid #b7e2c8;
  border-radius: var(--card-radius);
  color: var(--cal-green);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.7;
  padding: 14px 16px;
}

/* ===================== 大会申込状況：受付状況バッジ（受付済み以外） ===================== */
.start-status-badge--pending { background: #8b96ab; }
.start-status-badge--cancel,
.start-status-badge--retire,
.start-status-badge--retire-mid { background: var(--cal-red); }
/* 大会情報カード内の「変更」「更新」ボタン */
button.appl-list-link { border: none; cursor: pointer; font-family: inherit; }
/* 表の中の選択欄（受付状況） */
.start-table .start-table-select { min-width: 110px; padding: 6px 28px 6px 10px; font-size: 11px; background-position: right 8px center; background-size: 13px; }

/* ===================== 受付（参加する・棄権する） ===================== */
.entry-register-actions { display: flex; flex-direction: column; gap: 14px; }

/* ===================== 卓球ノート（カレンダー） ===================== */
/* 日付セルはリンク（その日の卓球ノートへ） */
a.cal-cell { color: inherit; }
@media (hover: hover) {
  a.cal-cell:hover { background: var(--blue-100); }
}
.cal-cell.is-today .cal-date { background: var(--blue-700); color: #fff !important; border-radius: 999px; padding: 0 6px; }
/* 大会予定（コーディングの「メモ」枠を使用） */
.cal-recent-icon--memo { color: var(--cal-red); }

/* ===================== 卓球ノート（記録する） ===================== */
/* 入力項目（.note-field）はフォームで囲んでいるため、項目どうしの間隔をフォーム内に設ける */
#menu-list-form { display: flex; flex-direction: column; gap: 15px; }
/* 「リセット」ボタン：オレンジ色（--orange-600：#f2994a）で表示する */
.form-btn.note-reset-btn { background: var(--orange-600); color: #fff; }
/* メニュー名：タップで入力欄に切り替え */
.practice-menu-name .view-text { cursor: text; }
.practice-menu-name .edit-input { margin-top: 0; padding: 6px 8px; font-size: 12.5px; }
.practice-menu-name [hidden] { display: none !important; }
/* 並べ替え中の行の置き場所 */
.practice-menu-table .ui-state-highlight { height: 44px; background: var(--blue-100); border: 1px dashed var(--blue-700); border-radius: 8px; }
/* 「メニューを追加」ボタン：ロゴカラー（--blue-700：#236db3）で表示する */
.practice-menu-add-btn { background: var(--blue-700); color: #fff; }

/* ===================== サイトヘッダー（ハンバーガーメニュー） ===================== */
/* メニューは 外観 > メニュー から出力（ul > li > a）するため、リストの体裁を打ち消して縦並びにする */
.site-menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.site-menu-list a { display: block; }
.site-menu-list .current-menu-item > a { color: var(--blue-700); }

/* ===================== 更新ボタン（ページの再読み込み） ===================== */
/* ロゴカラー（--blue-700：#236db3）で表示する */
.form-btn.btn-reload { background: var(--blue-700); color: #fff; }

/* ===================== 大会・グループレッスン・講習会を探す（検索するボタン） ===================== */
/* ロゴカラー（--blue-700：#236db3）で表示する */
.events-search-btn { background: var(--blue-700); color: #fff; }
/* 絞り込み項目と検索ボタンは開閉用の枠（#events-filter）でまとめているため、カードと同じ間隔を枠内にも設ける */
#events-filter { display: flex; flex-direction: column; gap: 14px; }
#events-filter[hidden] { display: none; }

/* ===================== 卓球ノート（共有者用メモ） ===================== */
.share-memo-item { display: flex; flex-direction: column; gap: 4px; }
.share-memo-item + .share-memo-item, .share-memo-item + .note-textarea-wrap { margin-top: 10px; }
.share-memo-author { font-size: 12px; font-weight: 700; color: #516080; }
.share-memo-date { margin-left: 8px; font-weight: 400; color: #8b96ab; }

/* ===================== 卓球ノート（共有者への開示スイッチ） ===================== */
.note-switch-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; cursor: pointer; }
.note-switch { position: relative; flex: none; width: 44px; height: 24px; }
.note-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.note-switch-slider { position: absolute; inset: 0; background: #c9d2e0; border-radius: 999px; transition: background .2s ease; pointer-events: none; }
.note-switch-slider::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease; }
.note-switch input:checked ~ .note-switch-slider { background: var(--blue-700); }
.note-switch input:checked ~ .note-switch-slider::before { transform: translateX(20px); }
.note-switch input:focus-visible ~ .note-switch-slider { outline: 2px solid var(--blue-700); outline-offset: 2px; }
.note-switch-label { font-size: 13px; font-weight: 700; color: var(--ink); }
