/* SITE 81 — レスポンシブ
   調整順（MASTER §7）: カラム減少 → 縦積み → 余白 → 写真比率 → 折畳み → 表カード化 → 最後に見出し
   本文・料金・時刻・住所・フォームラベルは 16px、注記は 14px を下回らせない。
   ドロワー切替と固定CTA表示のブレークポイントは 1023px で一致させる
   （CANON: 1024〜1279px帯で「ドロワーなのに固定CTAなし」を作らない）。 */

/* ============ 1440px 以上 ============ */
@media (min-width: 1440px) {
  .container { padding-inline: var(--sp-6); }
}

/* ============ 1279px 以下: ヘッダーを詰める / 4列 → 2列 ============ */
@media (max-width: 1279px) {
  .header-actions .btn--tel .btn__label { display: none; }
  .header-actions .btn--tel { width: var(--tap); padding-inline: 0; }
  .global-nav__list { gap: 12px; }

  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__grid { gap: var(--sp-5); }
}

/* ============ 1119px 以下: ヒーロー・初回セクションを縦積み ============ */
@media (max-width: 1119px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .first-layout { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ 1023px 以下: ドロワー・固定CTA ============ */
@media (max-width: 1023px) {
  :root { --h-header: 60px; --h-anchor: 46px; }

  /* 固定CTAの実高 = 項目の min-height（--h-cta）+ 上辺の 1px ボーダー */
  body { padding-bottom: calc(var(--h-cta) + 1px + env(safe-area-inset-bottom, 0px)); }

  .global-nav { display: none; }
  .drawer-toggle { display: flex; }
  .header-actions { margin-left: auto; }
  /* 電話はドロワー・固定CTA・フッターから到達できるため、ヘッダーからは外す */
  .header-actions .btn--tel { display: none; }
  .mobile-cta { display: block; }

  .brand__sub { display: none; }

  /* アンカーナビは「ページ上部へ戻る」を出し、横スクロールで全項目へ到達させる */
  .anchor-nav__label { display: none; }
  .anchor-nav__top { display: flex; }

  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }

  .split, .split--wide-left, .access-layout { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .role-grid, .link-cards { grid-template-columns: minmax(0, 1fr); }

  .section { padding-block: var(--sp-7); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ 767px 以下: 完全1カラム / 表のカード化 ============ */
@media (max-width: 767px) {
  .container { padding-inline: var(--sp-4); }

  .hero { padding-block: var(--sp-5) var(--sp-6); }
  .hero__actions .btn { flex: 1 1 100%; }

  /* 3項目は縦積みにせず、初回料金だけ全幅＋残り2件を2列で維持（PCの情報をSPで消さない） */
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-grid > :first-child { grid-column: 1 / -1; }

  .example-grid, .plan-grid { grid-template-columns: minmax(0, 1fr); }

  /* 人物カードは 2列を維持（MASTER §7: 情報量により2列可） */
  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .person-card__body { padding: var(--sp-3); gap: 6px; }

  /* 流れは「時間」を上へ回して2段に */
  .flow__item { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .flow__time { justify-self: start; padding-inline: 12px; }

  /* 定義リストの表をカード化 */
  .def-list__row { grid-template-columns: minmax(0, 1fr); }
  .def-list__key { border-right: 0; border-bottom: 1px solid var(--c-line); }
  .confirm-list__row { grid-template-columns: minmax(0, 1fr); }
  .confirm-list__key { border-bottom: 1px solid var(--c-line); }
  .hero__venue-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .section { padding-block: var(--sp-6); }
  .section-head { margin-bottom: var(--sp-5); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }

  .cta-band { padding: var(--sp-4); }
  .cta-band__actions { width: 100%; }
  .cta-band__actions .btn { flex: 1 1 100%; }

  .modal__foot { justify-content: stretch; }
  .modal__foot .btn { flex: 1 1 140px; }

  .schedule-row { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "thumb name" "thumb time"; gap: 4px var(--sp-3); }
  .schedule-row__thumb { grid-area: thumb; width: 48px; align-self: center; }
  .schedule-row__info { grid-area: name; }
  .schedule-row__time { grid-area: time; text-align: left; }

  .person-modal__top { grid-template-columns: 108px minmax(0, 1fr); gap: var(--sp-3); }

  .filter-bar { padding: var(--sp-3); }
  .sort-control { width: 100%; }
  .sort-control .select { flex: 1; min-width: 0; }
}

/* ============ 479px 以下: 390px を正 ============ */
@media (max-width: 479px) {
  .container { padding-inline: 14px; }
  /* 390pxではタグを2件までに抑える（続きは簡易HOSTモーダルで全件表示） */
  .person-card__tags li:nth-child(n+3) { display: none; }
  .plan-card, .role-card { padding: var(--sp-4); }
  .page-head { padding-block: var(--sp-6) var(--sp-5); }
  .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .first-price-card__num { font-size: 38px; }
  .fact-card__value { font-size: 24px; }
}

/* ============ 360px 以下の保険（320pxまで破綻させない） ============ */
@media (max-width: 360px) {
  .container { padding-inline: 12px; }
  .week-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact-card__value { font-size: 22px; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__name { font-size: 15px; }
  /* 固定CTAのラベルは 14px を下回らせない（MASTER §0: 14px未満禁止） */
  .mobile-cta__item { font-size: var(--fs-note); padding-inline: 2px; }
  .header-actions .btn--reserve { padding-inline: 12px; }
}
