/*
    Theme Name: SWELL CHILD - Fortuna Family Office
    Theme URI: https://fortuna-group.co.jp/
    Description: FORTUNA GROUP Fortuna Family Office用 SWELLカスタム子テーマ
    Version: 1.0.2
    Template: swell
    Author: FORTUNA GROUP
    Author URI: https://fortuna-group.co.jp/
    Text Domain: swell-child-fortuna
    License: GNU General Public License
    License URI: http://www.gnu.org/licenses/gpl.html
*/

/* 会社概要・特定商取引法などの「項目名と内容」の2列の表：スマホで横スクロールさせず、画面幅に収める
   対象は SWELL の表ブロックで「スマホで横スクロール」を選び、見出しセルが無く2列だけの表に限る
   （:has() 非対応のブラウザでは従来どおり横スクロールのまま） */
@media not all and (min-width: 960px) {
  .post_content [data-table-scrollable="sp"]:not(:has(th, thead, td:nth-child(3))) {
    overflow-x: visible;
    padding-bottom: 0;
  }
  .post_content [data-table-scrollable="sp"]:not(:has(th, thead, td:nth-child(3))) table { --table-width: 100% !important; }
  /* :has() の入れ子は使えないため、案内は「2列の行がある表」の直前のものだけ隠す */
  .post_content .c-scrollHint.sp_:has(+ [data-table-scrollable="sp"] > table > tbody > tr > td:nth-child(2):last-child) { display: none; }
}

/* 600px 未満は項目名と内容を縦に並べる */
@media (max-width: 599px) {
  .post_content [data-table-scrollable="sp"]:not(:has(th, thead, td:nth-child(3))) :is(table, tbody, tr) { display: block; }
  .post_content [data-table-scrollable="sp"]:not(:has(th, thead, td:nth-child(3))) td { display: block; width: auto; }
  .post_content [data-table-scrollable="sp"]:not(:has(th, thead, td:nth-child(3))) td:first-child {
    padding-top: 0.45em;
    padding-bottom: 0.45em;
    font-weight: 600;
    text-align: left;
    background: var(--color_gray, #f7f7f7);
  }
}
