/* ============================================================
   トップページ(index.html)専用スタイル
   スマホ版デザイン案B「医療系ミニマル」
   (docs/スマホ案_2026-09-12/case_b.html 承認版の実装)

   - このファイルは index.html だけが読み込む(他ページに影響しない)
   - PC/タブレット(768px〜)の見た目は一切変えない:
     モバイル(〜767px)向けの上書きと、案B専用要素のPC非表示のみを書く
   ============================================================ */

/* ---------- 案B専用要素はPC/タブレットでは表示しない ---------- */
@media (min-width: 768px) {
  .hero__eyebrow,
  .hero__rule,
  .hero__photo,
  .section-eyebrow,
  .card__icon,
  .card__num,
  .cta-hours,
  .fixed-bar,
  .sp-break {
    display: none;
  }
}

/* ---------- スマホ(〜767px): 案B「医療系ミニマル」 ---------- */
@media (max-width: 767px) {

  /* 画面下部の固定バーの高さぶんを常に確保 */
  body {
    padding-bottom: 76px;
  }

  /* セクションの区切りは罫線でなく余白と背景交互で作る(案B) */
  section + section {
    border-top: none;
  }
  main section {
    padding: 48px 0;
  }

  /* 背景リズム: 白 → 淡青 → 白 → 淡青 → 白 → 淡青 → 白(案Bの並び) */
  .hero--home,
  .home-strengths,
  .home-area,
  .home-partner {
    background: var(--color-bg);
  }
  .home-status,
  .home-services,
  .home-flow {
    background: var(--color-primary-pale);
  }

  /* ヘッダー: ロゴ+ハンバーガーの1段のみ。
     電話は下部固定バーに集約する(FVの電話表示と二重にしない)。
     ※ js/main.js の切替式固定ヘッダー(is-stuck)の仕組みはそのまま。
       高さはJSが動的に測るため、この非表示化で挙動は壊れない */
  .site-header .header-contact {
    display: none;
  }

  /* --- 1. ファーストビュー: 白基調・眉小⇔h1大・写真は「置かれた主役」 --- */
  .hero--home {
    padding: 24px 0 40px;
  }
  .hero--home .hero__bg {
    display: none; /* 写真をオーバーレイで沈ませる旧作りをやめる */
  }
  .hero__eyebrow {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--color-primary);
    margin-bottom: 8px;
  }
  .hero--home h1 {
    font-size: 1.8rem;
    line-height: 1.45;
    letter-spacing: 0.01em;
    margin-bottom: 16px;
  }
  .hero__rule {
    display: block;
    width: 48px;
    height: 4px;
    background: var(--color-primary);
    border: none;
    margin: 0 0 20px;
  }
  .hero__photo {
    display: block;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    max-width: 480px; /* 600〜767pxの中間幅で巨大化しないよう上限 */
  }
  .hero__photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 20%;
  }
  /* 可読性グラデは写真下端のみ。写真自体は沈ませない */
  .hero__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 76, 128, 0) 68%, rgba(15, 76, 128, 0.55) 100%);
  }
  .hero__photo-caption {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 1;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.6;
    margin: 0;
  }
  .hero--home .section-heading__lead {
    margin: 20px 0 0;
    font-size: 0.95rem;
    color: var(--color-text);
  }
  .hero--home .section-heading__lead + .section-heading__lead {
    margin: 0.6em 0 0;
    color: var(--color-text-sub);
  }
  /* FVの電話・誘導ボタンは下部固定バーとセクション導線に集約 */
  .hero--home .cta-section__actions {
    display: none;
  }

  /* --- セクション見出しまわり(眉+見出し+リード) --- */
  .section-eyebrow {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--color-primary);
    margin-bottom: 4px;
  }
  .section-heading {
    font-size: 1.4rem;
    margin-bottom: 0.4em;
  }
  .section-heading__lead {
    font-size: 0.95rem;
  }

  /* --- 2. 受入状況(淡青セクション上の白カード) --- */
  .home-status {
    padding: 40px 0;
  }
  .home-status .status-table-wrap {
    border: 1px solid #b9cbdb;
    padding: 20px 12px;
    margin-bottom: 0;
  }
  .home-status .status-table__heading {
    font-size: 1.05rem;
    margin-bottom: 12px;
  }
  .home-status .status-table__scroll {
    margin-bottom: 0;
  }
  /* 表は縮小して1画面に収める(横スクロールのラッパーは残す) */
  .home-status .status-table {
    min-width: 0;
    font-size: 0.85rem;
  }
  .home-status .status-table th,
  .home-status .status-table td {
    padding: 6px 2px;
  }
  .home-status .status-table thead th,
  .home-status .status-table tbody th {
    font-size: 0.8rem;
  }
  .home-status .status-cell__symbol {
    font-size: 1.05rem;
  }
  .home-status .status-table__legend {
    gap: 4px 12px;
    margin: 12px 0 8px;
    font-size: 0.78rem;
  }
  .home-status .status-table__note {
    font-size: 0.78rem;
  }

  /* --- 3・4. 強み/サービス概要: 写真カードをやめてアイコン行に --- */
  .home-strengths .card-grid,
  .home-services .card-grid {
    display: block;
  }
  /* サービス概要は淡青の上なので白カードで包む */
  .home-services .card-grid {
    background: var(--color-bg);
    border: 1px solid #b9cbdb;
    border-radius: var(--radius);
    padding: 8px 20px;
  }
  .home-strengths .card,
  .home-services .card {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 16px;
    align-items: start;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px 0;
    height: auto;
  }
  .home-strengths .card + .card,
  .home-services .card + .card {
    border-top: 1px solid var(--color-border);
  }
  .home-strengths .card .card__photo {
    display: none;
  }
  .card__icon {
    display: flex;
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary-pale);
    align-items: center;
    justify-content: center;
  }
  .card__icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .home-strengths .card h3,
  .home-services .card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.3em;
  }
  .home-strengths .card p,
  .home-services .card p {
    margin: 0;
    font-size: 0.95rem;
  }

  /* --- 5. 対応エリア: 写真(16:10角丸)→本文→注記の順 --- */
  .home-area .media-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .home-area .media-row__photo {
    order: -1;
  }
  .home-area .media-row__photo img {
    border-radius: 16px;
  }
  .home-area .media-row__text p:last-child {
    margin: 0;
    font-size: 0.88rem;
    color: var(--color-text-sub);
  }

  /* --- 6. ご利用の流れ: 白カード内の番号バッジ+縦ライン --- */
  .home-flow .card-grid {
    display: block;
    background: var(--color-bg);
    border: 1px solid #b9cbdb;
    border-radius: var(--radius);
    padding: 24px 20px;
  }
  .home-flow .card {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 16px;
    align-items: start;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0 28px;
    height: auto;
  }
  .home-flow .card:last-child {
    padding-bottom: 0;
  }
  .home-flow .card::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
  }
  .home-flow .card:last-child::before {
    display: none;
  }
  .card__num {
    display: flex;
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
  }
  .home-flow .card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.3em;
  }
  .home-flow .card p {
    margin: 0;
    font-size: 0.95rem;
  }
  /* PC用の「STEP1 」などの文字はスマホでは番号バッジが担う */
  .card__step-label {
    display: none;
  }

  /* --- セクション末尾の誘導: ボタンをやめて矢印テキストリンクに --- */
  .section-more {
    margin-top: 20px;
    align-items: center;
  }
  .section-more .btn--outline {
    width: auto;
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 0;
    gap: 6px;
    margin: 0 auto;
  }
  .section-more .btn--outline::after {
    content: "→";
  }
  .section-more .btn--outline:hover,
  .section-more .btn--outline:focus-visible {
    background: transparent;
    text-decoration: underline;
  }

  /* --- 7. ケアマネ・医療機関バナー --- */
  .home-partner .section-heading {
    font-size: 1.15rem;
  }
  .home-partner .section-heading__lead {
    font-size: 0.92rem;
    margin-bottom: 0.75em;
  }
  .home-partner .cta-section__actions {
    margin-top: 0;
  }
  .home-partner .btn--primary {
    width: 100%;
    font-size: 0.92rem;
    padding: 14px 12px;
  }

  /* --- 下部CTA: 電話ボタンは固定バーが担うため情報中心に --- */
  .cta-section {
    padding: 48px 0;
  }
  .cta-section h2 {
    font-size: 1.3rem;
  }
  .cta-section p {
    font-size: 0.95rem;
    margin-bottom: 0;
  }
  .cta-section .cta-section__actions {
    display: none;
  }
  .cta-hours {
    display: block;
    font-size: 0.85rem;
    color: #cfe0ee;
    margin: 0.8em 0 0;
  }

  /* --- 画面下部固定の電話/問い合わせバー(モバイルのみ) --- */
  .fixed-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -1px 8px rgba(15, 76, 128, 0.10);
  }
  .fixed-bar__phone {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--color-accent);
    color: var(--color-text); /* 橙地に白文字はAA未達のため濃色文字 */
    border-radius: var(--radius);
    padding: 8px 6px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 52px;
  }
  .fixed-bar__phone:hover,
  .fixed-bar__phone:focus-visible {
    filter: brightness(1.08);
    text-decoration: none;
  }
  .fixed-bar__phone-number {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(0.95rem, 4.5vw, 1.1rem);
    white-space: nowrap;
  }
  .fixed-bar__phone-note {
    font-size: 0.68rem;
    font-weight: 600;
  }
  .fixed-bar__contact {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    border-radius: var(--radius);
    padding: 8px 6px;
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    line-height: 1.4;
    min-height: 52px;
  }
  .fixed-bar__contact:hover,
  .fixed-bar__contact:focus-visible {
    background: var(--color-primary-pale);
    text-decoration: none;
  }
}
