/* =========================================================
   スマホ版（縦スクロール）
   スライドにしない画面（幅 1024px 未満、または縦長の画面）だけに効く。PC のスライドには一切効かない。
   条件は stage.js と main.js の SPQ と同じ式。style.css の後に読み込み、同じ強さのセレクタで上書きする。
   基準：本文 15px、補足 13px、見出し 24〜28px。ボタンは押せる高さ 44px 以上。1列に並べる
   ========================================================= */
@media not all and (min-width: 1024px) and (orientation: landscape) {

  :root {
    --sp-edge: max(20px, env(safe-area-inset-left, 0px));   /* 文章の左右の余白 */
    --sp-card: max(14px, env(safe-area-inset-left, 0px));   /* カード（白い面）の左右の余白 */
    --gutter-l: var(--sp-edge); --gutter-r: var(--sp-edge);
  }
  body { font-size: .9375rem; line-height: 1.8; }
  /* ページの上端・下端を引っぱったときに見える色は、ヘッダーとフッターと同じティールにする（地色のミントは、body の中だけ） */
  html { background: var(--line); scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
  body::before { display: none; }   /* ノッチの部分は、ヘッダー自身が塗る */

  /* ---------- ヘッダー：画面幅いっぱいの1行のバー（ロゴと3本線）。画面の上に固定 ---------- */
  .site-header { position: sticky; top: 0; z-index: 50; padding: env(safe-area-inset-top, 0px) 0 0; background: var(--line); }
  .site-header__inner { max-width: none; padding: 6px 8px 6px var(--sp-edge); gap: 12px; align-items: center; border-radius: 0; background: var(--line); backdrop-filter: none; }
  .site-header__logo img { width: 112px; }
  .gnav { display: flex; align-items: center; }
  /* メニューを開いている間は、後ろのページを動かさない。×ボタンは、画面の右上に固定する（少しスクロールした所から開いても、閉じられるように） */
  html:has(.gnav__toggle[aria-expanded="true"]) { overflow: hidden; }
  .gnav__toggle[aria-expanded="true"] { position: fixed; top: calc(6px + env(safe-area-inset-top, 0px)); right: 8px; z-index: 101; }
  .gnav__toggle { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; gap: 0; border: 0; background: none; font-size: 0; line-height: 0; color: transparent; cursor: pointer; }
  .gnav__toggle span { position: relative; display: block; width: 22px; height: 2px; background: var(--paper); box-shadow: 0 7px 0 var(--paper), 0 -7px 0 var(--paper); }
  /* 開いたら×に変える */
  .gnav__toggle[aria-expanded="true"] span { background: transparent; box-shadow: none; }
  .gnav__toggle[aria-expanded="true"] span::before, .gnav__toggle[aria-expanded="true"] span::after { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 2px; background: var(--paper); transform: rotate(45deg); }
  .gnav__toggle[aria-expanded="true"] span::after { transform: rotate(-45deg); }
  /* メニュー：右から出てくる、画面いっぱいのティールの面。開閉はボタンの aria-expanded で決める */
  .gnav ul, .gnav ul[hidden] {
    display: flex !important; flex-direction: column; justify-content: center; gap: 0;
    position: fixed; inset: 0; z-index: 100; margin: 0; padding: 64px 36px env(safe-area-inset-bottom, 0px);
    background: var(--line); border: 0; border-radius: 0;
    transform: translateX(100%); visibility: hidden;
    transition: transform .35s cubic-bezier(.65, 0, .35, 1), visibility 0s .35s;
  }
  .gnav__toggle[aria-expanded="true"] + ul, .gnav__toggle[aria-expanded="true"] + ul[hidden] {
    transform: translateX(0); visibility: visible; transition: transform .35s cubic-bezier(.65, 0, .35, 1), visibility 0s;
  }
  .gnav li + li { border-top: 1px dashed color-mix(in srgb, var(--paper) 40%, transparent); }
  .gnav li.gnav__brand + li { border-top: 0; }
  .gnav__brand { display: block; }
  .gnav__logo { display: block; width: 150px; margin: 0 0 28px; filter: brightness(0) invert(1); }
  .gnav a { padding: 16px 0; font-size: 1.125rem; letter-spacing: .12em; color: var(--paper); border-radius: 0; background: none; }
  .gnav a:hover { background: none; }
  .gnav a[aria-current="page"] { background: none; color: var(--paper); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .3em; text-underline-offset: .25em; }

  /* ---------- 共通の部品 ---------- */
  .stop { padding-block: 44px; }
  .sec-head { gap: 6px; margin-bottom: 20px; }
  .sec-head h2 { font-size: 1.75rem; line-height: 1.35; }
  .sec-head p { font-size: .875rem; line-height: 1.75; }
  .btn-row { margin-top: 20px; gap: 10px; flex-wrap: nowrap; }
  .btn-row .btn { flex: 1 1 0; justify-content: center; min-height: 48px; padding: 12px 14px; font-size: .9375rem; letter-spacing: .06em; }

  /* ---------- トップ（ここから下は、トップの縦スクロールだけ） ---------- */
  .flow-on .stop__inner, .flow-on .newsband__inner, .flow-on .site-footer__inner { max-width: 680px; }
  /* 枠ごとに地色を交互にして、区切りを見せる（PC の「1枚ずつ」の代わり） */
  .flow-on .deck > .stop:nth-of-type(even) { background: var(--ground-2); }
  .flow-on .strip--people { display: none; }   /* スマホ版は道なし。人物の帯も出さない */

  /* ヒーロー：旗、第4回、ロゴ、テーマ、日付、会場、ボタン、イラストの順に、縦に積む */
  .hero { min-height: 0; padding: 12px var(--sp-card) 0; }
  .hero__panel {
    --crop: 0; --lead: 0px;
    display: flex; flex-direction: column; align-items: stretch; gap: 22px;
    height: auto; min-height: 0; container-type: normal;
    max-width: 680px; margin-inline: auto;
    padding: 46px 18px 18px; border-radius: 28px;
  }
  .hero__bunting { left: 50%; transform: translateX(-50%); width: 210px; }
  .hero__text { --cq: 6px; --logo-w: min(300px, 100%); align-self: stretch; margin-top: 0; }
  .hero__edition { font-size: .875rem; padding: 2px 16px 0; margin-bottom: 12px; }
  .hero__copy { margin-top: 12px; }
  .hero .when { margin-top: 18px; padding-top: 16px; gap: 12px; }
  .when__rows { column-gap: 8px; row-gap: 6px; }
  .when__year { font-size: .75rem; }
  .when__date { font-size: 2rem; }
  .when .dow { font-size: .8125rem; }
  .when__time { margin-left: 6px; font-size: 1.125rem; white-space: nowrap; }
  .when__place { font-size: 1.1875rem; gap: 0; white-space: nowrap; }
  .when__place span { font-size: .8125rem; white-space: normal; }
  .hero .btn-row { margin-top: 20px; gap: 10px; }
  .hero .btn { padding: 12px 8px; font-size: .875rem; letter-spacing: .04em; }
  .hero__illust { width: 100%; overflow: visible; }
  .hero__illust img { width: 100%; margin-left: 0; }

  /* お知らせ：最新3件。パンフレットと Instagram は、その下に1列 */
  .newsband { padding: 20px 0 0; }
  .newsband__inner { padding-inline: var(--sp-card); gap: 12px; }
  .newsband__main { grid-template-columns: 1fr; gap: 6px; padding: 22px 20px 18px; border-radius: 26px; }
  .newsband__person { display: none; }
  .newsband__main > h2, .newsband__list { grid-column: 1; grid-row: auto; justify-self: start; }
  .newsband h2 { font-size: 1.5rem; }
  .newsband .news li:nth-child(n+4) { display: none; }
  .newsband .news a, .newsband .news .news__plain { grid-template-columns: 1fr; gap: 2px; padding-block: 12px; }
  .news time { font-size: .8125rem; }
  .news span { font-size: .9375rem; line-height: 1.65; }
  .newsband__more { margin-top: 10px; font-size: .875rem; }
  .newsband__side { grid-template-columns: 1fr; gap: 12px; }
  .pamphlet { column-gap: 14px; padding: 18px 20px; border-radius: 26px; }
  .pamphlet__label { font-size: 1.125rem; }
  .pamphlet__text { font-size: .8125rem; line-height: 1.6; }
  .pamphlet__go { padding: 8px 16px; font-size: .8125rem; }
  .insta { padding: 14px 20px; border-radius: 26px; gap: 12px; }
  .insta__text b { font-size: 1.125rem; }
  .insta__text small { font-size: .8125rem; }

  /* 開催概要：説明、数字、開催の情報、会場でできること の順に1列 */
  .about--merged { grid-template-columns: 1fr; gap: 28px; }
  .about__logo, .about--merged .about__logo { width: 100%; max-width: 340px; margin-bottom: 16px; }
  .about__lead { font-size: 1rem; line-height: 1.95; }
  .about__nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 22px; }
  .about__nums dd { font-size: 2.25rem; }
  .about__nums dt { font-size: .75rem; line-height: 1.5; }
  .facts > div { grid-template-columns: 4.2em minmax(0, 1fr); gap: 2px 12px; padding-block: 12px; font-size: .9375rem; }
  .facts dd small { font-size: .8125rem; }
  .about--merged .ways { grid-template-columns: 1fr; gap: 10px; }
  .about--merged .ways li { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 12px 16px 12px 12px; border-radius: 18px; background: var(--paper); }
  .about--merged .ways img { width: 56px; height: 56px; }
  .ways h3 { font-size: 1.0625rem; line-height: 1.4; }
  .ways p { font-size: .8125rem; line-height: 1.7; }

  /* 出展団体：合計と内訳、Pickup は PC と同じ 2列×2段 */
  .ex-sum { grid-template-columns: 1fr; gap: 28px; }
  .ex-sum__left { gap: 12px; }
  .ex-sum__total b { font-size: 4rem; }
  .ex-sum__total span { font-size: 1.375rem; }
  .cat-list { columns: 2; column-gap: 20px; }
  .cat-list li { padding-block: 8px; font-size: .875rem; }
  .cat-list .n { font-size: 1.125rem; }
  .ex-pick__title { font-size: 1.125rem; justify-content: flex-start; margin-bottom: 10px; }
  .ex-pick__list { gap: 10px; }
  .ex-pick__card { grid-template-columns: minmax(0, 1fr); padding: 8px 8px 12px; border-radius: 18px; }
  .ex-pick__photo { height: clamp(84px, 26vw, 140px); border-radius: 12px; }
  .ex-pick__cat { padding: 0 8px; font-size: .6875rem; }
  .ex-pick__name { font-size: .875rem; overflow-wrap: anywhere; }

  /* ステージ */
  .tabs { margin-bottom: 16px; }
  .tabs button { padding: 8px 16px; }
  .tabs button .d { font-size: 1.125rem; }
  .flow-on .stage-soon { grid-template-columns: 1fr; gap: 10px; }
  .flow-on .stage-soon__msg { grid-column: auto; }
  .stage-soon__day { padding: 12px 20px; gap: 8px; }
  .stage-soon__day .d { font-size: 1.5rem; }
  .stage-soon__day small { font-size: .8125rem; }
  .stage-soon__msg { padding: 16px 18px; font-size: .875rem; border-radius: 20px; }
  .stage-soon__msg b { font-size: 1.0625rem; }
  .timetable li { grid-template-columns: 4.8rem minmax(0, 1fr); gap: 2px 12px; padding-block: 12px; }
  .timetable time { font-size: 1rem; grid-row: span 2; }
  .timetable h3 { font-size: 1rem; line-height: 1.45; }
  .timetable p { font-size: .8125rem; grid-column: 2; }

  /* アクセス：会場と行き方、ボタン、地図の順 */
  .access { grid-template-columns: 1fr; gap: 20px; }
  .access__venue { font-size: 1.375rem; }
  .access ul { margin-top: 12px; font-size: .875rem; }
  .access li { margin-bottom: 4px; }
  .access__map { border-radius: 20px; }

  /* 私たちについて（トップの紹介）：人物、見出し、文、ボタン */
  .teaser { grid-template-columns: 1fr; gap: 16px; }
  .teaser__img { order: -1; justify-content: center; }
  .teaser__img img { height: 110px; }
  .teaser__text h2 { font-size: 1.5rem; }
  .teaser__text p { font-size: .9375rem; }

  /* 協賛ロゴ：2列。「Coming Soon」の枠は、9枠目より後ろを出さない（ロゴは全部出す） */
  .sponsors { margin-top: 36px; }
  .sponsors__title { font-size: 1.125rem; line-height: 1.5; }
  .sponsors__lead { font-size: .8125rem; line-height: 1.7; margin-bottom: 12px; }
  .sponsors__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sponsors__grid li { height: 60px; border-radius: 14px; }
  .sponsors__grid li.has-logo img { padding: 8px 14px; }
  .sponsors__grid li:not(.has-logo):nth-child(n+9) { display: none; }
  .sponsors__grid span { font-size: .75rem; }

  /* ---------- フッター（全ページ） ---------- */
  .site-footer__inner { grid-template-columns: 1fr; gap: 28px; padding: 40px var(--sp-edge) calc(32px + env(safe-area-inset-bottom, 0px)); }
  .site-footer h2 { font-size: 1.125rem; margin-bottom: 8px; }
  .contact__org { font-size: 1.25rem; margin-bottom: 12px; }
  .contact { font-size: .9375rem; gap: 8px; }
  .contact div { gap: 2px 16px; }
  .contact dt { width: 5.6em; }
  .credits { gap: 16px; font-size: .8125rem; line-height: 1.85; }
  .site-footer__bottom { padding-top: 18px; }
  .site-footer__bottom img { width: 104px; }

  /* ---------- 下層ページ ---------- */
  .page-head__inner { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 1.625rem; line-height: 1.3; }   /* 「学×地フェスタ実行委員会」が1行に収まる大きさ */
  .page-head__lead { margin-top: 12px; font-size: .9375rem; }
  .page-head__img img { height: 100px; }
  .page-main { padding-bottom: 48px; }
  .page-main--flush { padding-bottom: 0; }
  .stats li { padding: 18px 20px; grid-template-columns: 72px minmax(0, 1fr); border-radius: 22px; }
  .stats img { width: 72px; height: 72px; }
  .stats b { font-size: 1.875rem; }
  .stats span { font-size: .875rem; }
  .mission b { font-size: 1.5rem; }
  .mission span { font-size: .9375rem; }
  .chair { grid-template-columns: 1fr; justify-items: start; gap: 18px; }
  .chair__photo { max-width: 200px; }
  .chair__name { font-size: 1.75rem; }
  .chair__msg { font-size: 1rem; line-height: 1.9; }
  .pillars, .pillars.pillars--4 { grid-template-columns: 1fr; gap: 20px; }
  .pillars li, .pillars.pillars--4 li { grid-template-rows: auto; grid-template-columns: 88px minmax(0, 1fr); column-gap: 16px; }
  .pillars img { height: 96px; grid-row: span 2; }
  .pillars h3 { font-size: 1.125rem; }
  .pillars p { font-size: .875rem; line-height: 1.8; }
  .history { grid-template-columns: 1fr 1fr; }
  .history .ed { font-size: 1.375rem; }
  .join { grid-template-columns: 1fr; gap: 12px; }
  .join > div { padding: 18px 20px; }
  .join h3 { font-size: 1.125rem; }
  .join p { font-size: .875rem; }
  .ex-list { columns: 1; }
  .ex-group__head h2 { font-size: 1.5rem; }
  .article__title { font-size: 1.5rem; }
}
