/* 復学ケース: 一覧ページのBEFORE色 */
.case-archive,
.case-single {
  --case-before-color: #7c7c7c;
}

/* 復学ケース一覧: レイアウト幅を中央寄せに広げる */
.case-archive .page-article__inner {
  width: min(900px, 100%);
  margin: 0 auto;
}

/* 復学ケース一覧: 本文エリアは中央寄せ */
.case-archive .page-article__body {
  display: grid;
  justify-items: center;
}

/* 復学ケース一覧: フィルター全体 */
.case-filter {
  width: min(520px, 100%);
  margin-bottom: 32px;
}

/* 復学ケース一覧: フィルター見出し */
.case-filter__label {
  margin: 0 0 16px;
  text-align: center;
  font-size: 16px;
  font-weight: var(--weight-gothic-medium);
}

/* 復学ケース一覧: ボタン群 */
.case-filter__list {
  display: grid;
  width: min(320px, 100%);
  grid-template-columns: repeat(2, 154px);
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
}

/* 復学ケース一覧: フィルターボタン */
.case-filter__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand-gray);
  color: var(--brand-black);
  font-size: 15px;
  font-weight: var(--weight-gothic-medium);
}

/* 復学ケース一覧: 選択中のフィルターボタン */
.case-filter__link.is-active {
  border-color: var(--brand-orange);
  background: var(--brand-white);
}

/* 復学ケース: カード一覧 */
.case-list {
  display: grid;
  gap: 18px;
  width: 100%;
  justify-items: center;
}

/* 復学ケース: 空表示 */
.case-empty {
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--brand-white);
  max-width: 768px;
}

/* 復学ケース一覧: フィルター後の空表示 */
.case-archive .case-empty {
  max-width: 520px;
}

/* 復学ケース: 個別カード */
.case-card {
  --case-change-border-color: #bdbdbd;
  background: var(--brand-white);
  color: var(--color-text);
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  margin: 0 auto;
  width: min(320px, 100%);
  max-width: 320px;
}

/* 復学ケース一覧: 一覧カードの内側余白 */
.case-archive .case-card {
  padding: 20px 18px 18px;
}

/* 復学ケース: 開いたときは下余白を増やす */
.case-card.is-open {
  padding: 20px 16px 32px;
}

/* 復学ケース一覧: 展開時の余白 */
.case-archive .case-card.is-open {
  padding: 20px 16px 32px;
}

/* 復学ケース: 見出し */
.case-card h4 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 16px;
  font-weight: var(--weight-gothic-medium);
}

/* 復学ケース一覧: タイトル前の装飾 */
.case-archive .case-card h4::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 8px;
  background: var(--brand-orange);
  vertical-align: middle;
}

/* 復学ケース: 原因ラベルの区切り線 */
.case-divider {
  border-top: 1px solid var(--color-muted);
  width: 260px;
  margin: 10px auto;
}

/* 復学ケース: 補足情報 */
.case-meta {
  text-align: center;
  font-size: 15px;
  color: var(--color-muted);
}

.case-card > .case-meta:first-of-type {
  font-weight: var(--weight-gothic-medium);
}

/* 復学ケース: 開閉ボタン */
.case-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-width: 215px;
  height: 44px;
  padding: 0 18px 0 20px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--brand-orange);
  color: var(--brand-orange);
  background: transparent;
  font-family: var(--font-gothic);
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

/* 復学ケース一覧: 一覧ボタンは少しコンパクトにする */
.case-archive .case-btn {
  min-width: 146px;
  height: 38px;
  padding: 0 14px 0 18px;
}

/* 復学ケース: ボタン文言 */
.case-btn-label {
  display: inline-flex;
  align-items: center;
  color: var(--brand-black);
  font-size: 15px;
  line-height: 1;
}

/* 復学ケース一覧: 一覧ボタンの文字サイズ */
.case-archive .case-btn-label {
  font-size: 13px;
}

/* 復学ケース: 閉じる文言は初期非表示 */
.case-btn-label-close {
  display: none;
}

/* 復学ケース: プラスアイコン */
.case-btn-plus {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

/* 復学ケース一覧: 一覧ボタンのアイコンサイズ */
.case-archive .case-btn-plus {
  width: 18px;
  height: 18px;
}

/* 復学ケース: ボタンの右端アイコン領域 */
.case-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 復学ケース: 閉じる用の上矢印 */
.case-btn-icon-close {
  display: none;
  width: 14px;
  height: 8px;
  background: var(--brand-orange);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M1 7L7 1l6 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M1 7L7 1l6 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* 復学ケース: ボタン配置 */
.case-btn-wrap {
  display: grid;
  place-items: center;
  margin-top: 10px;
  margin-bottom: 0;
  transition: margin-bottom 0.4s ease;
}

/* 復学ケース: 開いたときのトグル見た目 */
.case-card.is-open .case-btn-wrap {
  margin-bottom: 24px;
}

.case-card.is-open .case-btn-label-open,
.case-card.is-open .case-btn-icon-open {
  display: none;
}

.case-card.is-open .case-btn-label-close,
.case-card.is-open .case-btn-icon-close {
  display: inline-flex;
}

/* 復学ケース: 開閉パネル */
.case-panel {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    grid-template-rows 0.4s ease,
    margin-top 0.4s ease,
    opacity 0.25s ease,
    visibility 0s linear 0.4s;
}

.case-card.is-open .case-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    grid-template-rows 0.4s ease,
    opacity 0.25s ease;
}

.case-panel-inner {
  min-height: 0;
  overflow: hidden;
}

/* 復学ケース: 子と親の変化ブロック */
.case-change-block {
  display: grid;
  width: min(640px, 100%);
  margin: 0 auto;
  justify-items: center;
  gap: 24px;
  padding: 24px 18px 28px;
  border: 1px solid var(--case-change-border-color);
  border-radius: 6px;
}

/* 復学ケース: セクションラベル */
.case-section-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  height: 44px;
  padding: 0 20px 0 48px;
  border-radius: 999px;
  background: var(--brand-gray-dark);
  color: var(--brand-white);
  font-size: 15px;
  line-height: 1;
}

/* 復学ケース: ラベル内アイコン */
.case-section-badge::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* 復学ケース: お子さんアイコン */
.case-section-badge-child::before {
  background-image: url("../../pages/front-page/features/image/child-change-icon.svg");
}

/* 復学ケース: 親御さんアイコン */
.case-section-badge-parent::before {
  background-image: url("../../pages/front-page/features/image/parent-change-icon.svg");
}

/* 復学ケース: BEFORE / AFTER ブロック */
.case-stage {
  width: 100%;
}

/* 復学ケース: BEFORE / AFTER 見出し */
.case-stage-title {
  margin: 0;
  text-align: center;
  font-size: 30px;
  line-height: 1.2;
  color: var(--case-before-color, var(--color-muted));
  font-weight: var(--weight-gothic-medium);
}

/* 復学ケース: AFTER 見出し */
.case-stage-after .case-stage-title {
  color: var(--brand-orange);
}

/* 復学ケース: 見出し下の補足 */
.case-stage-subtitle {
  margin: 10px 0 0;
  text-align: center;
  font-size: 15px;
  font-weight: var(--weight-gothic-regular);
}

/* 復学ケース: 箇条書き */
.case-stage-list {
  width: min(620px, 100%);
  margin: 18px auto 0;
  padding-left: 1.2em;
  font-size: 15px;
  font-weight: var(--weight-gothic-regular);
  line-height: 1.75;
}

.case-stage-list li + li {
  margin-top: 2px;
}

/* 復学ケース: BEFORE と AFTER の間の矢印 */
.case-stage-arrow {
  position: relative;
  width: 18px;
  height: 20px;
}

.case-stage-arrow::before,
.case-stage-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 15px;
  height: 15px;
  border-right: 2px solid var(--brand-orange);
  border-bottom: 2px solid var(--brand-orange);
  transform: translateX(-50%) rotate(45deg);
}

.case-stage-arrow::before {
  top: 0;
}

.case-stage-arrow::after {
  top: 6px;
}

/* 復学ケース: 子と親の変化の区切り線 */
.case-panel-divider {
  width: 100%;
  height: 28px;
  margin: 0;
  border: 0;
}

.case-questionnaire {
  width: min(640px, 100%);
  margin: 36px auto 0;
  display: grid;
  justify-items: center;
  gap: 20px;
}

.case-questionnaire__image {
  display: block;
  width: min(100%, 420px);
}

.case-questionnaire__image img {
  display: block;
  width: 100%;
  height: auto;
}

.case-questionnaire__actions {
  display: grid;
  gap: 12px;
  width: min(100%, 420px);
}

.case-questionnaire__button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: var(--weight-gothic-medium);
  line-height: 1.5;
  text-align: center;
}

.case-questionnaire__button--primary {
  background: var(--brand-gray-dark);
  color: var(--brand-white);
}

.case-questionnaire__button--secondary {
  border: 1px solid var(--color-border);
  background: var(--brand-white);
  color: var(--color-text);
}

.case-questionnaire__button-note {
  display: block;
  font-size: 12px;
  font-weight: var(--weight-gothic-demilight);
  line-height: 1.4;
}

.case-questionnaire__button-label {
  display: block;
}

/* 復学ケース: 下部の閉じるボタン */
.case-close-wrap {
  margin-top: 36px;
  text-align: center;
}

.case-close-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 182px;
  height: 44px;
  box-sizing: border-box;
  padding: 0 40px 0 22px;
  border-radius: 999px;
  border: 1px solid var(--brand-orange);
  background: transparent;
  color: var(--brand-black);
  font-size: 15px;
  font-family: var(--font-gothic);
  line-height: 1;
  cursor: pointer;
}

.case-close-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 14px;
  height: 8px;
  background: var(--brand-orange);
  transform: translateY(-50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M1 7L7 1l6 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 8'%3E%3Cpath d='M1 7L7 1l6 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

@media (min-width: 768px) {
  /* 復学ケース一覧: 共通PC境界では横余白を少し広げる */
  .case-archive .container-wide {
    padding: 0 5%;
  }

  /* 復学ケース詳細: カードが最大800pxで収まる幅にする */
  .case-single .page-article__inner {
    width: min(800px, 90vw);
  }

  .case-filter {
    width: min(680px, 100%);
    margin-bottom: 44px;
  }

  .case-filter__label {
    margin-bottom: 18px;
    font-size: 19px;
  }

  .case-filter__list {
    grid-template-columns: repeat(2, 190px);
    justify-content: center;
    gap: 10px;
  }

  .case-filter__link {
    width: 190px;
    min-height: 50px;
    font-size: 15px;
  }

  .case-archive .case-card {
    padding: 18px 20px 16px;
  }

  .case-archive .case-card.is-open {
    padding: 20px 24px 60px;
  }

  .case-card.is-open {
    padding: 20px 24px 60px;
  }

  /* 復学ケース: PC境界ではカード幅を最大800pxに揃える */
  .case-card,
  .case-card.is-open,
  .case-archive .case-card,
  .case-archive .case-card.is-open {
    width: 100%;
    max-width: 800px;
  }

  /* 復学ケース: PCでは見出しサイズを上げる */
  .case-card h4 {
    font-size: 19px;
  }

  .case-card.is-open .case-btn-wrap {
    margin-bottom: 40px;
  }

  .case-change-block {
    gap: 28px;
    padding: 30px 28px 34px;
  }

  .case-stage-title {
    font-size: 40px;
  }

  .case-stage-list {
    margin-top: 28px;
  }

  .case-panel-divider {
    height: 40px;
  }

  .case-questionnaire {
    margin-top: 44px;
    gap: 24px;
  }

  .case-questionnaire__image {
    width: min(360px, 100%);
  }

  .case-questionnaire__actions {
    grid-template-columns: repeat(2, auto);
    gap: 14px;
    width: auto;
  }

  .case-questionnaire__button--primary {
    min-width: 180px;
  }

  .case-questionnaire__button--secondary {
    min-width: 236px;
  }

  .case-close-wrap {
    margin-top: 60px;
  }
}
@media (min-width: 1024px) {
  .case-filter {
    width: min(790px, 100%);
  }

  .case-filter__list {
    grid-template-columns: repeat(4, 190px);
  }
}
