/* ============================================================
   スマホ専用の構成と文字の大きさ（2026-11-14 KT-327・B案「探すを先に、読むところは短く」）
   780px 以下だけに効く。PC の見た目は変えない
   - 文字の大きさは :root の --sp-* にまとめた（本文15・補足13・ラベル12が下限・見出し24・ボタン16）
   - TOP は FV を短くし、掲載企業→数字→とは→アンバサダー→ガイド→企業様向け→想い の順。説明は「続きを読む」でたたむ
   - 「あなたにおすすめ」と下の固定ボタンは assets/js/sp.js が足す
   比べた案と経緯は obsidean の 業務/タスク/ KT-327 のメモ
   ============================================================ */

/* sp.js が足す部品は PC では出さない（780px 以下で display を戻す） */
.sp-filterbtn, .sp-more, .sp-fixbar { display: none; }
@media (max-width: 780px) {
  .sp-fixbar { display: block; }
}
:root {
  --sp-body: 15px;     /* 本文 */
  --sp-small: 13px;    /* 補足・住所・日付 */
  --sp-label: 12px;    /* ラベル・タグ（これより小さくしない） */
  --sp-h1: 36px;       /* FV の見出し・企業名 */
  --sp-h2: 24px;       /* セクションの見出し */
  --sp-h3: 17px;       /* カードの社名・小見出し */
  --sp-btn: 16px;      /* ボタン */
  --sp-lh: 1.8;        /* 本文の行間 */
  --sp-sec: 64px;      /* セクションの上下の余白 */
  --sp-side: 20px;     /* 左右の余白 */
}

@media (max-width: 780px) {
  body { font-size: var(--sp-body); line-height: var(--sp-lh); }
  .wrap, .aboutx__wrap, .statsx__wrap, .ambx__wrap, .blogx__wrap, .seo-box__wrap { padding-left: var(--sp-side) !important; padding-right: var(--sp-side) !important; }

  /* --- 共通の部品 --- */
  .sec-eyebrow, .topsec__title__en, .toprow__en, .git__eyebrow, .pagehead__en { font-size: var(--sp-label) !important; letter-spacing: 0.14em; }
  .pill-btn { font-size: var(--sp-btn); min-height: 52px; }
  .pill-btn--frost, .hero__subcta, .git__btn--sub { font-size: calc(var(--sp-btn) - 1px); }
  .section-title { font-size: var(--sp-h2); }
  .section-title small { font-size: var(--sp-small); }
  .logo__text { font-size: 16px; }
  .breadcrumb { font-size: var(--sp-label); }

  /* --- TOP --- */
  .hero__eyebrow { font-size: var(--sp-label); letter-spacing: 0.12em; }
  .hero__title--jp { font-size: var(--sp-h1); line-height: 1.3; }
  .hero__tag { font-size: var(--sp-body); line-height: 1.7; }
  .hero__lead { font-size: var(--sp-small); }
  .hero__amb__label { font-size: var(--sp-label); }
  .hero__amb__name { font-size: var(--sp-small); }
  .hero__notice__eyebrow, .hero__notice__date { font-size: var(--sp-label); }
  .hero__notice__title { font-size: var(--sp-small); line-height: 1.6; }

  .topsec__title { font-size: var(--sp-h2); }
  .topsearch__field input { font-size: 16px; } /* 16px 未満だと iPhone で入力時に拡大される */
  .topsearch__label { font-size: var(--sp-small); }
  .topsearch__label small { font-size: var(--sp-label); }
  .fpill, .fselect select { font-size: var(--sp-small); min-height: 40px; }
  .toprow__title { font-size: var(--sp-h3); }
  .rcard__name { font-size: var(--sp-body); line-height: 1.5; }
  .rcard__meta { font-size: var(--sp-label); line-height: 1.6; }
  .rcard__vcount { font-size: var(--sp-label); }

  .aboutx__title--jp { font-size: var(--sp-h2); line-height: 1.45; }
  .aboutx__lead { font-size: var(--sp-body); line-height: var(--sp-lh); }
  .statsx__label { font-size: var(--sp-small); }
  .statsx__note { font-size: var(--sp-label); line-height: 1.7; }
  .ambx__title, .blogx__title { font-size: var(--sp-h2); }
  .ambx__name { font-size: calc(var(--sp-h2) - 2px); }
  .ambx__name small, .ambx__role, .ambx__sign { font-size: var(--sp-small); }
  .ambx__msghead { font-size: var(--sp-h3); }
  .ambx__message { font-size: var(--sp-body); line-height: var(--sp-lh); }
  .blogx__badge { font-size: var(--sp-label); }
  .blogx__date { font-size: var(--sp-label); }
  .blogx__name { font-size: var(--sp-body); line-height: 1.6; }
  .git__copy { font-size: var(--sp-body); line-height: 1.9; }
  .git__btn { font-size: var(--sp-btn); }
  .seo-box__title { font-size: calc(var(--sp-h2) - 4px); }
  .seo-box p:not(.sec-eyebrow) { font-size: var(--sp-small); font-weight: 500; line-height: 1.9; }
  .footer__info, .footer__nav a { font-size: var(--sp-small); }
  .footer__copy { font-size: var(--sp-label); }

  /* --- 企業一覧 --- */
  .pagehead__title { font-size: calc(var(--sp-h1) + 4px); }
  .pagehead__sub { font-size: var(--sp-body); }
  .pagehead__badge { font-size: var(--sp-small); }
  .filterbar__label { font-size: var(--sp-small); }
  .filterbar__label small { font-size: var(--sp-label); }
  .ccard__tag { font-size: var(--sp-label); }
  .ccard__name { font-size: var(--sp-h3); }
  .ccard__copy { font-size: var(--sp-small); line-height: 1.7; }
  .ccard__pref, .ccard__work, .ccard__vcount { font-size: var(--sp-label); }

  /* --- 企業ページ --- */
  .pagehead__name { font-size: calc(var(--sp-h1) - 6px) !important; line-height: 1.35; }
  .pagehead__catch { font-size: var(--sp-body); line-height: 1.7; }
  .pagehead__meta dt { font-size: var(--sp-label); }
  .pagehead__meta dd { font-size: var(--sp-small); }
  .tab { font-size: var(--sp-body); }
  .subtab { font-size: var(--sp-small); }
  .reqblock__title { font-size: var(--sp-h3); }
  .spec th, .spec td, .richtext table th, .richtext table td { font-size: var(--sp-small) !important; line-height: 1.7; }
  .richtext { font-size: var(--sp-body); line-height: var(--sp-lh); }
  .richtext h3 { font-size: var(--sp-h3); }
  .richtext ul li, .envlist li { font-size: var(--sp-body); }
  .applyblock p { font-size: var(--sp-small); }
  .others .section-title { font-size: var(--sp-h2); }
}

/* 企業一覧・企業ページの上の余白（今は見出しの下に空きが大きい） */
@media (max-width: 780px) {
  .pagehead { padding: 100px 0 48px !important; }
  .listbody { padding-top: 28px !important; }
  /* 企業ページ：本体は見出しに 56px 重なるので、見出しの下は重なり＋24px 空ける */
  .pagehead:has(+ .detailbody) { padding-bottom: 84px !important; }
  .detailbody { padding-top: 36px !important; }
  /* 動画・3分で知るが無い企業でも空の行の隙間が残らないように */
  .detail { row-gap: 0 !important; }
  .detail__summary, .detail__video { margin-bottom: 28px; }
  .tabs { margin-top: 0 !important; }
}

/* 11/14 晃輝さんFB：企業ページの下の「応募の流れを見る」が右に寄って見え、文字も左寄り → 幅を枠の中に収めて文字を真ん中に */
@media (max-width: 780px) {
  .spbar { padding-left: var(--sp-side); padding-right: var(--sp-side); }
  .spbar .pill-btn, .sp-fixbar .pill-btn { box-sizing: border-box; display: flex; width: 100%; justify-content: center; padding: 14px 20px; }
}

@media (max-width: 780px) {
  .page--top main { display: flex; flex-direction: column; }
  .hero { order: 1; }
  .jimoto-select { order: 2; }
  .statsx { order: 3; }
  .aboutx { order: 4; }
  .ambx { order: 5; }
  .blogx { order: 6; }
  .git { order: 7; }
  .seo-box { order: 8; }

  /* --- FV：短く。英字の飾りとサブボタンは外す --- */
  .hero { padding: 0; }
  .hero__frame { min-height: 0; height: auto; border-radius: 0; }
  .hero__bg, .hero__shade { bottom: auto; height: 64svh; }
  .hero__inner { min-height: 0; height: 64svh; justify-content: flex-end; padding: 0 var(--sp-side) 32px; }
  .hero__eyebrow, .hero__subcta { display: none !important; }
  .hero__amb { margin-bottom: 14px; }
  .hero__actions { margin-top: 20px; width: 100%; }
  .hero__actions .pill-btn:first-child { width: 100%; justify-content: center; }
  /* お知らせは FV の上に重ねず、すぐ下に1行で */
  .hero__notice { position: static; width: auto; max-width: none; min-width: 0; margin: 0; border-radius: 0; border-left: 0; border-right: 0; padding: 12px var(--sp-side); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
  .hero__notice__title { flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero__notice__date { order: -1; }

  /* --- 掲載企業：検索欄だけ出し、エリア・業種はボタンで開く --- */
  .jimoto-select { padding: 44px 0 var(--sp-sec); }
  .topsec__title { text-align: left; margin-bottom: 18px; }
  .topsearch { padding: 0; background: none; border: 0; }
  .topsearch__row { display: none !important; }
  .topsearch.is-open .topsearch__row { display: flex !important; }
  .sp-filterbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-2); color: var(--ink); font: 700 var(--sp-small) var(--font-jp); }
  .topsearch.is-open .sp-filterbtn { margin-bottom: 14px; }
  .toprow { margin-top: 30px; }
  .rcard { width: 82vw; }
  /* 行は新着と業種の4つまで（都道府県の行は絞り込みと重なるので外す） */
  .toprows > .toprow:nth-child(n+5) { display: none; }
  .toprows.has-reco > .toprow:nth-child(5) { display: block; }
  .toprows.has-reco > .toprow:nth-child(n+6) { display: none; }

  /* --- 数字：横に3つ、エンブレムは外す --- */
  .statsx { padding: 40px 0; background: var(--panel); }
  .statsx__emblem, .dotfield--stats { display: none; }
  .statsx__grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .statsx__item { text-align: center; }
  .statsx__num { font-size: 38px !important; }
  .statsx__num small { font-size: 12px !important; margin-left: 2px; }
  .statsx__line { display: none !important; }
  .statsx__label { margin-top: 6px; line-height: 1.5; }
  .statsx__note { margin-top: 22px !important; }

  /* --- とは：最初の段落だけ --- */
  .aboutx { padding: var(--sp-sec) 0; }
  .aboutx__lead--gap { display: none; }
  .aboutx__lead br { display: none; }
  .aboutx__intro { justify-items: start; text-align: left; }

  /* --- アンバサダー：写真を上、メッセージは最初だけ --- */
  .ambx { padding: var(--sp-sec) 0 0; }
  .ambx__wrap { display: flex !important; flex-direction: column-reverse; }
  .ambx__photo { position: relative !important; height: 320px; overflow: hidden; margin: 0 0 20px; }
  .ambx__photo img { width: 175%; max-width: none; height: auto; max-height: none !important; margin: 0 0 0 -72% !important; object-fit: initial; }
  .ambx__message:not(.is-open) p:not(:first-child), .ambx__message:not(.is-open) .ambx__sign { display: none; }

  /* --- ガイド：3件まで --- */
  .blogx { padding: var(--sp-sec) 0; }
  .blogx__row:nth-child(n+4) { display: none; }

  /* --- 想い・コラム：たたむ --- */
  .seo-box { padding: var(--sp-sec) 0 120px; }
  .seo-box__wrap:not(.is-open) p:not(.sec-eyebrow):not(:nth-of-type(2)) { display: none; }
  .seo-box__wrap:not(.is-open) p:nth-of-type(2) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

  .sp-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 10px 0; background: none; border: 0; color: var(--accent-strong); font: 700 var(--sp-small) var(--font-jp); }

  /* --- 下に固定のボタン --- */
  .sp-fixbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; padding: 10px var(--sp-side) calc(10px + env(safe-area-inset-bottom)); background: rgba(12, 14, 19, 0.92); backdrop-filter: blur(10px); box-shadow: 0 -1px 0 var(--line); transform: translateY(110%); transition: transform .3s ease; }
  .sp-fixbar.is-shown { transform: none; }
  .sp-fixbar .pill-btn { width: 100%; justify-content: center; }

  /* --- 企業一覧：絞り込みはボタンで開く --- */
  .filterbar .filterbar__row { display: none; }
  .filterbar.is-open .filterbar__row { display: flex; }

  /* --- 企業ページ：タブを上に貼り付け、下の固定ボタンを暗い色に --- */
  .tabs { position: sticky; top: 60px; z-index: 50; background: var(--paper); }
  .spbar { background: rgba(12, 14, 19, 0.92); box-shadow: 0 -1px 0 var(--line); }
  .spec th { width: 92px; }
}

/* 11/14 晃輝さんFB：アンバサダーのバッジが宮本さんの顔にかかる → 見出しと文の下（ボタンの上）へ。エンブレムは外して幅を詰める */
@media (max-width: 780px) {
  .hero__amb { order: 3; margin: 20px 0 0; }
  .hero__amb__mark { display: none; }
  .hero__actions { order: 4; }

  /* あなたにおすすめの行 */
  .sp-reco .toprow__title { display: flex; align-items: baseline; gap: 10px; }
  .sp-reco .rcard__badge { position: absolute; left: 8px; top: 8px; z-index: 2; padding: 3px 9px; border-radius: 999px; background: var(--cta); border: 1px solid var(--cta-border); color: #fff; font: 700 var(--sp-label)/1.4 var(--font-jp); }
}

/* 企業ページの A案＋備考2（0.27.0）で増えた部品の小さい字（KT-327 で 12px を下限にした） */
@media (max-width: 780px) {
  .pagehead__tag, .vfeature__dur, .vcard__dur, .vcard__ep, .vrow__title small, .fact__k, .fact__s, .chip, .ccard__vcount { font-size: var(--sp-label); }
}
