/* スマホ対応（既存の base.css / base_under.css の上に重ねる）
   PC表示（961px以上）は既存デザインのまま。960px以下で1カラムに組み替える。 */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ハンバーガーはPCでは出さない */
.sp-menu-btn, .sp-nav { display: none; }

@media (max-width: 960px) {
  html, body { overflow-x: hidden; }
  body { min-width: 0 !important; }
  img { max-width: 100%; height: auto; }

  /* 固定幅をすべて解除 */
  #header #gnavi, #header #subnavi, #header #topcover, #header #breadmenu,
  #carousel, #article #contents, #footer #etcbox, #footer #copyright,
  #article #contents #mainarea, #article #contents #sidemenu,
  #article #contents #leftcol, #article #contents #centercol, #article #contents #rightcol,
  #article #contents #mainarea h2, #article #contents #mainarea p.explain,
  .width100, .width200, .width210, .width216, .width400, .width420, .width435 {
    width: auto !important;
    max-width: 100%;
    float: none;
    box-sizing: border-box;
  }

  /* ---------- ヘッダー ---------- */
  #header { height: auto; position: relative; }
  #header #mv { background-size: auto 100%; }
  /* 縦書きの紹介パネル(306x359)を読める大きさで左に置き、背景の写真帯はそのまま流す */
  #carousel { height: 240px; background-position: 12px top; background-size: auto 100%; }
  /* 既存のPCナビはスマホではハンバーガー内に置き換える */
  #header #gnavi, #header #subnavi, #header #topcover .txtR { display: none; }

  #header #topcover { height: auto; padding: 8px 56px 8px 12px; }
  #header #topcover .boxL { float: none; }
  #header #topcover img { width: 160px; height: auto; }
  #header #breadmenu { height: auto; padding: 8px 12px; line-height: 1.5; }

  .sp-menu-btn {
    display: block;
    position: absolute; top: 8px; right: 8px; z-index: 1001;
    width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 4px;
    background: #504D41; cursor: pointer;
  }
  .sp-menu-btn span, .sp-menu-btn span::before, .sp-menu-btn span::after {
    content: ""; position: absolute; left: 11px; width: 22px; height: 2px; background: #fff;
    transition: transform .2s, opacity .2s;
  }
  .sp-menu-btn span { top: 21px; }
  .sp-menu-btn span::before { left: 0; top: -7px; }
  .sp-menu-btn span::after { left: 0; top: 7px; }
  .sp-open .sp-menu-btn span { background: transparent; }
  .sp-open .sp-menu-btn span::before { transform: translateY(7px) rotate(45deg); }
  .sp-open .sp-menu-btn span::after { transform: translateY(-7px) rotate(-45deg); }

  .sp-nav {
    position: fixed; inset: 0; z-index: 1000;
    padding: 64px 0 24px; overflow-y: auto;
    background: rgba(80, 77, 65, .97);
  }
  .sp-open .sp-nav { display: block; }
  .sp-open { overflow: hidden; }
  .sp-nav ul { margin: 0 16px 16px; }
  .sp-nav li a, .sp-nav li span {
    display: block; padding: 14px 8px;
    border-bottom: 1px solid rgba(255,255,255,.2);
    color: #fff !important; font-size: 15px; text-decoration: none;
  }
  .sp-nav li span { color: #64CA37 !important; font-size: 13px; padding-bottom: 6px; border: 0; }
  .sp-nav li.child a { padding-left: 24px; }

  /* ---------- トップページ ---------- */
  #article #contents { padding: 24px 16px 32px; }
  #article #contents #leftcol, #article #contents #centercol { margin-right: 0; }
  #article #contents .section { height: auto !important; padding-bottom: 28px; }
  #article #contents dl { display: flex; gap: 12px; }
  #article #contents dt { float: none; width: auto; flex: 0 0 64px; font-size: 13px; }
  #article #contents dd { float: none; width: auto; flex: 1; padding-right: 0; font-size: 14px; }
  #article #contents #rightcol ul { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  #article #contents #rightcol li { margin: 0; }
  #article #contents #rightcol img { width: 100%; height: auto; }

  /* ---------- 下層ページ ---------- */
  body.is-under #article #contents {
    display: flex; flex-direction: column; padding: 0 0 24px; background: none;
  }
  #article #contents #mainarea {
    order: 1; padding: 16px 0 24px; background: #fff; font-size: 15px; min-height: 0;
  }
  #article #contents #mainarea p { padding-left: 16px; padding-right: 16px; }
  #article #contents #mainarea h1 img, #article #contents #mainarea img { height: auto; }
  #article #contents #mainarea h2 { margin: 20px 16px 12px; }
  #article #contents #mainarea p.explain { margin: 0 16px 12px; }
  #article #contents #mainarea .boxL, #article #contents #mainarea .boxR {
    float: none; padding: 0 16px 20px; font-size: 14px;
  }
  #article #contents #mainarea table { width: 100% !important; }
  #article #contents #mainarea table th, #article #contents #mainarea table td {
    display: block; width: auto !important; box-sizing: border-box;
  }
  #article #contents #mainarea iframe, #article #contents #mainarea video { max-width: 100%; }
  .mailmagazine-form input[type="text"] { width: 100%; box-sizing: border-box; font-size: 16px; }
  .mailmagazine-form-box { padding-left: 16px; padding-right: 16px; }

  /* 飲食部門の画像内リンク（座標指定）を幅に合わせて縮める */
  #article #contents #mainarea #cmap {
    width: 100% !important; height: auto; aspect-ratio: 705 / 2767; background-size: 100% auto;
  }
  dd.citem1 { left: 31.06%; top: 19.26%; width: 30.64%; }
  dd.citem2 { left: 34.04%; top: 20.02%; width: 30.92%; }
  dd.citem1, dd.citem2 { height: .62%; }
  dd.citem1 a, dd.citem2 a { width: 100%; height: 100%; }

  #article #contents #sidemenu { order: 2; padding: 0 16px; background: none; min-height: 0; }
  #article #contents #sidemenu #titlearea, #article #contents #sidemenu #menuarea { display: none; }
  #article #contents #sidemenu dl { display: flex; gap: 12px; }
  #article #contents #sidemenu dt { float: none; width: auto; flex: 0 0 64px; font-size: 13px; }
  #article #contents #sidemenu dd { float: none; width: auto; flex: 1; font-size: 14px; }
  #article #contents #sidemenu p img { width: 100%; height: auto; }
  #article #contents p.totop { position: fixed; right: 12px; bottom: 12px; z-index: 900; }
  #article #contents p.totop img { width: 36px !important; height: auto !important; opacity: .85; }

  /* ---------- フッター ---------- */
  #footer { height: auto; background-size: auto 100%; padding-bottom: 16px; }
  #footer #etcbox { height: auto; padding: 0 16px; }
  #footer #etcbox .boxL { float: none; padding-left: 0; font-size: 14px; }
  #footer #etcbox .boxL h3, #footer #etcbox .boxL h4 { padding-bottom: 12px; }
  #footer #etcbox .section { float: none; width: auto; height: auto; }
  #footer #etcbox .boxL.clearfix { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  #footer #etcbox .boxL h2 { grid-column: 1 / -1; }
  #footer #etcbox .boxR { float: none; }
  #footer #etcbox .boxR ul { padding-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
  #footer #etcbox .boxR li { float: none; height: auto; padding: 0; }
  #footer #copyright { height: auto; padding: 12px 16px; font-size: 11px; }
  #footer #copyright li { float: none; display: inline-block; padding-left: 0; }
}

/* ---------- フォーム（GAS送信） ---------- */
.js-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.js-gas-form input[type="text"], .js-gas-form input[type="email"], .js-gas-form textarea, .js-gas-form select {
  padding: 6px; border: 1px solid #ccc; border-radius: 3px; font-size: 14px; box-sizing: border-box; max-width: 100%;
}
.js-gas-form textarea { width: 400px; }
.js-gas-form label { cursor: pointer; }
.js-gas-form .gas-submit {
  padding: 10px 40px; border: 0; border-radius: 4px; background: #5BBE26; color: #fff;
  font-size: 15px; font-weight: bold; cursor: pointer;
}
.js-gas-form .gas-submit:disabled { opacity: .6; cursor: wait; }
.js-form-note { margin-top: 14px; font-weight: bold; color: #3d7a1b; line-height: 1.6; }
.js-form-note[data-state="error"] { color: #c00; }
.mailmag-form { padding: 20px 31px; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; margin: 20px 0; }
.mailmag-form input[type="email"] { width: 300px; margin: 8px 0; }
.mailmag-form p { padding: 0 !important; margin-bottom: 8px; }
@media (max-width: 960px) {
  .js-gas-form input[type="text"], .js-gas-form input[type="email"], .js-gas-form textarea, .js-gas-form select { font-size: 16px; }
  .js-gas-form .width100 { width: 4.5em !important; }
  .js-gas-form .width200, .js-gas-form .width400, .js-gas-form textarea, .mailmag-form input[type="email"] { width: 100% !important; }
  table#inquiry th { border-bottom: 0; }
  .mailmag-form { padding: 16px; }
}
@media (max-width: 960px) {
  body.is-under #article #contents #mainarea table#inquiry { margin: 0 16px 24px !important; width: calc(100% - 32px) !important; table-layout: fixed; }
  body.is-under #article #contents #mainarea table#inquiry td { padding: 10px 0; }
}
