@charset "UTF-8";
/* ==========================================================================
   sp.css  スマートフォン・タブレット縦向き用スタイル
   - 各ページで main.css の直後に media 指定付きで読み込む
       <link rel="stylesheet" type="text/css" href="sp.css" media="screen and (max-width: 840px)">
   - 画面幅 840px 以下のときだけ効く。PC 表示には一切影響しない
   - 既存 HTML（テーブルレイアウト）には手を入れず、CSS だけで 1 カラム化する
   ========================================================================== */

@media screen and (max-width: 840px) {

  /* ---- 基本 ------------------------------------------------------------ */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.6;
  }
  img { max-width: 100%; height: auto !important; }
  a { overflow-wrap: anywhere; }
  input[type="text" i], input[type="email" i], input[type="tel" i], textarea { width: 100% !important; }
  iframe, input[type="text"], textarea, select { max-width: 100% !important; box-sizing: border-box; }
  center, div[align] { width: auto !important; }

  /* ---- レイアウト用テーブル（中にテーブルを含むもの）を縦積みにする ------- */
  table:has(table) {
    display: block;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    background-image: none !important;
  }
  table:has(table) > tbody,
  table:has(table) > thead,
  table:has(table) > tfoot { display: block; }
  table:has(table) > tbody > tr,
  table:has(table) > tr {
    display: flex;
    flex-wrap: wrap;
    width: auto !important;
    height: auto !important;
  }
  table:has(table) > tbody > tr > td,
  table:has(table) > tr > td {
    display: block;
    flex: 1 1 100%;
    min-width: 0;
    width: auto !important;
    height: auto !important;
    box-sizing: border-box;
  }
  /* 中身のない飾りセル（枠の左右パーツ・字下げ用の空セル）は消す */
  table:has(table) > tbody > tr > td:empty,
  table:has(table) > tr > td:empty { display: none; }

  /* ---- 内容用テーブル（入れ子のない末端のテーブル）は表のまま幅だけ合わせる -- */
  table:not(:has(table)) {
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    table-layout: auto;
  }
  /* 幅指定のある表は画面幅いっぱいに。文字だけの表は左右に少し余白 */
  table:not(:has(table))[width] { width: 100% !important; }
  table:not(:has(table)):not(:has(img)) { margin-left: 8px !important; margin-right: 8px !important; }
  table:not(:has(table))[width]:not(:has(img)) { width: calc(100% - 16px) !important; }
  table:not(:has(table))[width]:has(img) { width: auto !important; }
  table:not(:has(table)) td,
  table:not(:has(table)) th {
    width: auto !important;
    height: auto !important;
    white-space: normal !important;
  }

  /* ---- 枠の飾り画像（左右の縁・角）を非表示 ----------------------------- */
  img[src*="r_01.jpg"], img[src*="r_02.jpg"],
  img[src*="r_hidari"], img[src*="r_migi"],
  img[src*="w1_hidari"], img[src*="w1_migi"],
  img[src*="event_migi"], img[src*="b_0.jpg"], img[src*="b0_2.jpg"],
  img[src*="spacer.gif"] { display: none !important; }
  td:has(> img[src*="r_01.jpg"]), td:has(> img[src*="r_02.jpg"]),
  td:has(> img[src*="r_hidari"]), td:has(> img[src*="r_migi"]),
  td:has(> img[src*="event_migi"]),
  td:has(> img[src*="b_0.jpg"]), td:has(> img[src*="b0_2.jpg"]) { display: none !important; }

  /* ---- トップページ ------------------------------------------------- */
  /* イベント欄（iframe）は縦に長く */
  iframe[src*="event.html"] { width: 100% !important; height: 420px !important; }
  /* 「支援サポート策」「会員コーナー」「イベント」枠の上下パーツを幅いっぱいに */
  img[src*="w1_ue"], img[src*="w2_ue"], img[src*="w1_sita"], img[src*="w2_sita"],
  img[src*="event_ue"], img[src*="event_sita"], img[src*="obi01"], img[src*="obi02"], img[src*="obi03_1"] { width: 100% !important; }
  td[background*="event_01back"] { background-image: none !important; }

  /* ---- 「大阪卸商連合会とは」系ページ ------------------------------------ */
  /* 上部の飾り帯と「現在地」ボタンを省いて、残りのボタンを押しやすい大きさに */
  img[src*="misc/obi02"], img[src*="misc/botan01_3"] { display: none !important; }
  td:has(> img[src*="misc/obi02"]), td:has(> img[src*="misc/botan01_3"]) { display: none !important; }
  /* 左メニューは 2 列のボタン並びに */
  table:has(img[src*="img/01/botan"]):not(:has(table)) { display: block; width: auto !important; margin: 0 6px 8px !important; }
  table:has(img[src*="img/01/botan"]):not(:has(table)) > tbody { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  table:has(img[src*="img/01/botan"]):not(:has(table)) tr { display: contents; }
  table:has(img[src*="img/01/botan"]):not(:has(table)) td { display: block; }
  table:has(img[src*="img/01/botan"]):not(:has(table)) tr:first-child td { grid-column: 1 / -1; text-align: center; }
  table:has(img[src*="img/01/botan"]):not(:has(table)) img[src*="botan"] { width: 100% !important; }

  /* ---- 背景画像の上に文字を重ねた古い表は、背景を外して文字を読めるように -- */
  table:not(:has(table))[background] { background-image: none !important; }

  /* ---- 文字が画面端に付かないよう余白 ---------------------------------- */
  .kaiin_info, .support, .link, .txt_nomal, .Tittle_1, .info_tittle, .info_sub_tittle { padding-left: 10px !important; padding-right: 10px !important; }

  /* 「　　　…過去一覧は”こちら”です」のように全角スペースを並べて右寄せしている行を折り返せるように */
  .support, td:has(> a[href*="kako"]) { line-break: anywhere; }

  /* ---- 文字を少し読みやすく -------------------------------------------- */
  .support, .topic2, .txt_nomal, .info_txt, .info_tittle2, .day { font-size: 14px !important; line-height: 1.7 !important; }
  .topic { font-size: 15px !important; }
  .head { padding: 4px 8px; }
  .footer { letter-spacing: 2px !important; }
}
