/* =========================================================
   04 稽古時間 #schedule（和紙・黄帯）
   スマホ：稽古のある曜日だけを行で。
   720px〜：クラス × 曜日の一週間の表（元の時間表と同じ読み方）。
   ========================================================= */

.schedule {
  --sch-youth: var(--shu);
  --sch-ippan: var(--ink);
  --sch-godo: var(--gold);
}

/* ---------- 見出し＋凡例 ---------- */
.schedule__head {
  display: grid; gap: 28px;
  margin-bottom: clamp(32px, 6vw, 64px);
}

.schedule__legend { display: grid; gap: 0; border-top: 1px solid var(--line); }
.schedule__legend-item {
  display: grid; grid-template-columns: 1.1rem 6.2em minmax(0, 1fr); align-items: baseline; gap: 0 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.schedule__legend-item::before {
  content: ""; width: 10px; height: 10px; align-self: center;
  background: var(--sch-c, var(--ink)); border-radius: 50%;
}
.schedule__legend-item--youth { --sch-c: var(--sch-youth); }
.schedule__legend-item--ippan { --sch-c: var(--sch-ippan); }
.schedule__legend-item--godo  { --sch-c: var(--sch-godo); }
.schedule__legend dt { font-weight: 700; }
.schedule__legend dd { color: var(--ink-2); font-size: .95rem; }

@media (min-width: 600px) and (max-width: 959px) {
  .schedule__legend { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
  .schedule__legend-item { grid-template-columns: 1.1rem minmax(0, 1fr); border-bottom: 0; padding: 12px 0; }
  .schedule__legend dd { grid-column: 2; }
}
@media (min-width: 960px) {
  .schedule__head { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: end; gap: 56px; }
}

/* ---------- 道場タブ（5つ。320px でも一列に収める） ---------- */
.schedule__board { position: relative; }
.schedule__tablist {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: visible; border-bottom: 1px solid var(--ink);
}
.schedule__tab {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-width: 0; min-height: 60px; padding: 6px 0 8px;
  border-bottom-width: 3px; margin-bottom: -1px;
  letter-spacing: .04em; font-size: 1rem;
  position: relative;
}
.schedule__tab + .schedule__tab::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--line);
}
.schedule__tab-name { white-space: nowrap; line-height: 1.3; }
.schedule__tab-days {
  font-family: var(--font-gothic); font-weight: 500; font-size: .72rem; letter-spacing: .12em;
  color: var(--ink-2); line-height: 1.2; white-space: nowrap;
}
.schedule__tab[aria-selected="true"] .schedule__tab-days { color: var(--shu); }
.schedule__tab:hover { color: var(--ink); }
@media (min-width: 480px) {
  .schedule__tab { font-size: 1.1rem; letter-spacing: .1em; min-height: 66px; }
  .schedule__tab-days { font-size: .78rem; }
}
@media (min-width: 960px) {
  .schedule__tablist { grid-template-columns: repeat(5, minmax(0, 168px)); justify-content: start; }
}

/* ---------- パネル見出し ---------- */
.schedule__panel { padding-top: clamp(24px, 4vw, 36px); }
.schedule__panel:focus-visible { outline-offset: 6px; }
.schedule__panel-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
  margin-bottom: 18px;
}
.schedule__dojo { font-size: clamp(1.45rem, 4.4vw, 1.9rem); letter-spacing: .1em; line-height: 1.4; }
.schedule__dojo small {
  margin-left: .7em; font-family: var(--font-gothic); font-weight: 500; font-size: .875rem;
  letter-spacing: .06em; color: var(--ink-2);
}
.schedule__days { font-weight: 700; letter-spacing: .08em; }
.schedule__days span { font-weight: 400; color: var(--ink-2); }
.schedule__where {
  display: inline-flex; align-items: center; gap: .35em; min-height: 44px;
  margin-left: auto; font-size: .95rem; font-weight: 700; text-decoration: none;
  border-bottom: 1px solid transparent;
}
.schedule__where:hover { border-bottom-color: currentColor; }
.schedule__where .icon { width: 1.05em; height: 1.05em; color: var(--shu); transition: transform .25s var(--ease); }
.schedule__where:hover .icon { transform: translateX(3px); }
@media (max-width: 599px) {
  .schedule__where { margin-left: 0; flex-basis: 100%; }
}

/* ---------- 一週間（スマホ：曜日ごとの行） ---------- */
.schedule__week { border-top: 1px solid var(--ink); }
.schedule__band { display: none; }
.schedule__day {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.schedule__day--off { display: none; }
.schedule__dow {
  font-family: var(--font-mincho); font-size: 1.85rem; font-weight: 800; line-height: 1; letter-spacing: 0;
  padding-top: 4px;
}
.schedule__dow small { display: block; margin-top: 6px; font-family: var(--font-gothic); font-size: .7rem; font-weight: 500; letter-spacing: .2em; color: var(--ink-2); }
.schedule__slots { display: grid; gap: 12px; }
.schedule__slot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px;
  padding-left: 14px; border-left: 3px solid var(--sch-c, var(--ink));
}
.schedule__slot--youth { --sch-c: var(--sch-youth); --sch-row: 2; }
.schedule__slot--ippan { --sch-c: var(--sch-ippan); --sch-row: 3; }
.schedule__slot--godo  { --sch-c: var(--sch-godo);  --sch-row: 4; }
.schedule__time { font-size: 1.32rem; font-weight: 700; letter-spacing: .02em; line-height: 1.45; white-space: nowrap; }
.schedule__time > span { display: inline-block; }
.schedule__cls { order: -1; flex-basis: 100%; font-size: .875rem; font-weight: 700; color: var(--ink-2); letter-spacing: .08em; line-height: 1.6; }
.schedule__cls::after { content: "クラス"; }

/* 休止中（高崎の日曜） */
.schedule__day--paused .schedule__dow { color: var(--ink-2); }
.schedule__slot--paused { border-left-style: dashed; }
/* 時刻の span は inline-block。親の取り消し線は伝わらないので span ごとに引く */
.schedule__slot--paused .schedule__time { color: var(--ink-2); font-weight: 500; text-decoration: none; }
.schedule__slot--paused .schedule__time > span {
  text-decoration-line: line-through; text-decoration-color: var(--shu); text-decoration-thickness: 2px;
}
.schedule__paused {
  display: inline-flex; align-items: center; padding: 1px 8px;
  border: 1px solid var(--shu); color: var(--shu); border-radius: var(--radius-s);
  font-size: .8rem; font-weight: 700; letter-spacing: .1em; line-height: 1.6; white-space: nowrap;
}

.schedule__offdays { margin-top: 14px; font-size: .95rem; color: var(--ink-2); line-height: 1.8; }

/* ---------- 720px〜：クラス × 曜日の表 ---------- */
@media (min-width: 720px) {
  .schedule__week {
    --sch-cols: 8;
    display: grid;
    grid-template-columns: repeat(var(--sch-cols), minmax(0, 1fr));
    grid-template-rows: auto repeat(var(--rows, 2), minmax(96px, auto));
    border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink);
    /* 縦の罫線（各列の右端。最後の1本は外枠と重ならないよう隠す） */
    background-image: linear-gradient(to left, var(--line) 1px, transparent 1px);
    background-size: calc(100% / var(--sch-cols)) 100%;
    background-position: 0 0;
    background-repeat: repeat-x;
    clip-path: inset(0 1px 0 0);
  }
  .schedule__day, .schedule__day--off, .schedule__slots { display: contents; }
  .schedule__dow {
    grid-row: 1; grid-column: var(--col);
    display: flex; align-items: baseline; justify-content: center; gap: 2px;
    padding: 14px 0 12px; font-size: 1.35rem;
  }
  .schedule__dow small { display: none; }
  .schedule__day--off .schedule__dow { color: rgba(34, 32, 29, .35); }

  /* 行（クラス）。左端にクラス名、横の罫線 */
  .schedule__band {
    display: flex; align-items: center;
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
  .schedule__band--youth { grid-row: 2; border-top-color: var(--ink); }
  .schedule__band--ippan { grid-row: 3; }
  .schedule__band--godo  { grid-row: 4; }
  .schedule__band span {
    width: calc(100% / var(--sch-cols)); padding: 0 12px;
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: .95rem; letter-spacing: .1em; line-height: 1.5;
  }
  .schedule__band span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sch-c); flex: none; }
  .schedule__band--youth { --sch-c: var(--sch-youth); }
  .schedule__band--ippan { --sch-c: var(--sch-ippan); }
  .schedule__band--godo  { --sch-c: var(--sch-godo); }

  /* 時間のマス */
  .schedule__slot {
    grid-column: var(--col); grid-row: var(--sch-row);
    position: relative; z-index: 1;
    display: grid; align-content: center; justify-items: center; gap: 6px;
    margin: 8px 6px; padding: 12px 6px; border-left: 0;
    border-top: 3px solid var(--sch-c);
    background: rgba(255, 255, 255, .55);
    text-align: center;
  }
  .schedule__slot--godo { background: rgba(176, 141, 87, .12); }
  .schedule__time { font-size: clamp(1rem, 1.6vw, 1.22rem); white-space: normal; line-height: 1.35; }
  .schedule__time > span { white-space: nowrap; }
  .schedule__cls { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .schedule__slot--paused { background: transparent; border-top-style: dashed; }
  .schedule__paused { font-size: .78rem; padding: 0 6px; letter-spacing: .02em; }

  .schedule__offdays { display: none; }
  .schedule__panel--single .schedule__offdays { display: block; }
}
@media (min-width: 1100px) {
  .schedule__week { grid-template-rows: auto repeat(var(--rows, 2), minmax(104px, auto)); }
  .schedule__slot { margin: 10px 10px; }
}

/* ---------- 週1回だけの教室（玉村・ヨガ） ---------- */
.schedule__solo {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px clamp(18px, 4vw, 48px);
  padding-top: 22px; border-top: 1px solid var(--ink);
}
.schedule__solo-day {
  font-family: var(--font-mincho); font-weight: 800;
  font-size: clamp(3.6rem, 16vw, 7.5rem); line-height: .95; letter-spacing: 0;
  color: var(--ink);
}
.schedule__solo-body { display: grid; gap: 12px; align-content: start; min-width: 0; }
.schedule__solo-time { font-size: clamp(1.9rem, 7.4vw, 3rem); font-weight: 700; line-height: 1.15; letter-spacing: .02em; }
.schedule__solo-time span { display: inline-block; }
.schedule__solo-cls {
  display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--sch-c, var(--ink));
  font-weight: 700; letter-spacing: .08em;
}
.schedule__solo-cls small { font-weight: 400; font-size: .9rem; letter-spacing: .04em; color: var(--ink-2); }
.schedule__solo-cls--godo { --sch-c: var(--sch-godo); }
.schedule__solo-cls--yoga { --sch-c: var(--ink-2); }

.schedule__facts { display: grid; margin-top: 10px; border-top: 1px solid var(--line); }
.schedule__facts > div {
  display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 4px 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line); line-height: 1.85;
}
.schedule__facts dt { font-size: .875rem; font-weight: 700; color: var(--ink-2); padding-top: .2em; }
.schedule__facts a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; }
.schedule__solo-note { font-size: .95rem; color: var(--ink-2); }
@media (max-width: 419px) {
  .schedule__solo { grid-template-columns: minmax(0, 1fr); }
  .schedule__solo-day { font-size: 3.4rem; }
  .schedule__facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (min-width: 960px) {
  .schedule__solo-body { max-width: 640px; }
}

/* ---------- 注記 ---------- */
.schedule__notes {
  display: grid; gap: 8px; margin-top: clamp(28px, 4vw, 40px);
  font-size: .95rem; line-height: 1.85; color: var(--ink-2);
}
.schedule__notes li { display: grid; grid-template-columns: 1em minmax(0, 1fr); gap: 6px; }
.schedule__notes li::before { content: "※"; }
@media (min-width: 960px) {
  .schedule__notes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .schedule__where .icon { transition: none; }
}
