/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

body a {
    text-decoration: none;
  }

  body .content a,
  body .entry-content a,
  body .policy-content a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
  }

  body .header a,
  body .nav a,
  body .footer a,
  body .btn,
  body .topic-card,
  body .guide-card,
  body .article,
  body .side-article,
  body .side-link-btn,
  body .contact-line,
  body .contact-phone,
  body .contact-mail {
    text-decoration: none;
  }

body .btn-line,
  body .btn-line:hover,
  body .btn-line:focus,
  body .btn-line:focus-visible,
  body .contact-line,
  body .contact-line:hover,
  body .contact-line:focus,
  body .contact-line:focus-visible,
  body .side-cta-line,
  body .side-cta-line:hover,
  body .side-cta-line:focus,
  body .side-cta-line:focus-visible,
  body .cta-line-button,
  body .cta-line-button:hover,
  body .cta-line-button:focus,
  body .cta-line-button:focus-visible {
    color: #fff !important;
  }

  body .btn-line *,
  body .btn-line:hover *,
  body .contact-line *,
  body .contact-line:hover *,
  body .side-cta-line *,
  body .side-cta-line:hover *,
  body .cta-line-button *,
  body .cta-line-button:hover * {
    color: inherit !important;
  }

/* --- スマートフォン用スタイル --- */
@media (max-width: 767px) {
  body header.header .menu-toggle {
    display: block !important;
    position: relative !important;
    width: 44px !important;
    height: 44px !important;
    margin-left: auto !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    appearance: none !important;
    background:
      linear-gradient(#1A549F, #1A549F) 100% 12px / 32px 2px no-repeat,
      linear-gradient(#1A549F, #1A549F) 100% 21px / 32px 2px no-repeat,
      linear-gradient(#1A549F, #1A549F) 100% 30px / 32px 2px no-repeat !important;
  }

  body header.header .menu-toggle span {
    display: none !important;
  }

  /* 普段は非表示の「×」用の線を準備 */
  body header.header .menu-toggle::before,
  body header.header .menu-toggle::after {
    content: "" !important;
    display: none !important;
    position: absolute !important;
    right: -10px !important;
    top: 21px !important;
    width: 30px !important;
    height: 2px !important;
    border-radius: 999px !important;
    background: #1A549F !important;
    transform-origin: center !important;
  }

  /* メニューが開いたとき：3本線を消す */
  body:has(header.header .sp-menu.is-open) header.header .menu-toggle,
  body:has(header.header .sp-menu.active) header.header .menu-toggle,
  body:has(header.header .sp-menu.open) header.header .menu-toggle,
  body:has(header.header .sp-menu[aria-hidden="false"]) header.header .menu-toggle,
  body header.header .menu-toggle.is-open,
  body header.header .menu-toggle.active,
  body header.header .menu-toggle.open,
  body header.header .menu-toggle[aria-expanded="true"] {
    background: none !important;
  }

  /* メニューが開いたとき：擬似要素を表示して「×」の形に回転（右下がり） */
  body:has(header.header .sp-menu.is-open) header.header .menu-toggle::before,
  body:has(header.header .sp-menu.active) header.header .menu-toggle::before,
  body:has(header.header .sp-menu.open) header.header .menu-toggle::before,
  body:has(header.header .sp-menu[aria-hidden="false"]) header.header .menu-toggle::before,
  body header.header .menu-toggle.is-open::before,
  body header.header .menu-toggle.active::before,
  body header.header .menu-toggle.open::before,
  body header.header .menu-toggle[aria-expanded="true"]::before {
    display: block !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }

  /* メニューが開いたとき：擬似要素を表示して「×」の形に回転（右上がり） */
  body:has(header.header .sp-menu.is-open) header.header .menu-toggle::after,
  body:has(header.header .sp-menu.active) header.header .menu-toggle::after,
  body:has(header.header .sp-menu.open) header.header .menu-toggle::after,
  body:has(header.header .sp-menu[aria-hidden="false"]) header.header .menu-toggle::after,
  body header.header .menu-toggle.is-open::after,
  body header.header .menu-toggle.active::after,
  body header.header .menu-toggle.open::after,
  body header.header .menu-toggle[aria-expanded="true"]::after {
    display: block !important;
    transform: translateX(-50%) rotate(-45deg) !important;
  }
}

 /* WordPressブロックテーブル */
  body figure.wp-block-table {
    display: block !important;
    width: min(100%, 948px) !important;
    margin: 0 0 64px !important;
    overflow-x: auto !important;
  }

  body figure.wp-block-table table,
  body figure.wp-block-table table.has-fixed-layout {
    width: 100% !important;
    min-width: 560px !important;
    border-collapse: separate !important;
    border-spacing: 2px !important;
    table-layout: fixed !important;
    border: 0 !important;
  }

  body figure.wp-block-table th,
  body figure.wp-block-table td {
    padding: 16px !important;
    border: 0 !important;
    color: #5A6472 !important;
    background: #fff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    letter-spacing: .02em !important;
  }

  body figure.wp-block-table tbody tr:nth-child(even) td {
    background: #F1F7FF !important;
  }

  body figure.wp-block-table tbody tr:first-child td {
    background: #3A75BF !important;
    color: #fff !important;
    font-weight: 700 !important;
  }

  body figure.wp-block-table figcaption {
    margin-top: 8px !important;
    color: #8A95A0 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
  }

  @media (max-width: 767px) {
    body figure.wp-block-table {
      margin-bottom: 32px !important;
    }

    body figure.wp-block-table th,
    body figure.wp-block-table td {
      padding: 10px 12px !important;
      font-size: 14px !important;
    }
  }

/* ================================================================
   * グローバルナビゲーション ドロップダウン
   * ================================================================ */

  @media (min-width: 768px) {
    body .header .nav-row {
      overflow: visible;
    }

    body .header .nav,
    body .header .nav-menu,
    body .header .nav-menu > li {
      overflow: visible;
    }

    body .header .nav-menu > li {
      position: relative;
    }

    body .header .nav-menu > li > .sub-menu {
      position: absolute;
      top: calc(100% + 16px);
      left: 0;
      z-index: 9999;
      display: block;
      min-width: 240px;
      margin: 0;
      padding: 8px 0;
      list-style: none;
      background: #fff;
      border: 1px solid #D6E4F5;
      border-radius: 6px;
      box-shadow: 0 12px 28px rgba(20, 66, 125, 0.16);
      opacity: 0;
      visibility: hidden;
      transform: translateY(8px);
      pointer-events: none;
      transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    body .header .nav-menu > li:hover > .sub-menu,
    body .header .nav-menu > li:focus-within > .sub-menu {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
      pointer-events: auto;
    }

    body .header .nav-menu .sub-menu li {
      display: block;
      flex: none;
      width: 100%;
    }

    body .header .nav-menu .sub-menu a {
      display: block;
      min-height: 0;
      padding: 10px 18px;
      color: #14427D;
      font-size: 14px;
      font-weight: 500;
      line-height: 1.5;
      text-align: left;
      white-space: nowrap;
      background: #fff;
    }

    body .header .nav-menu .sub-menu a::after {
      content: none;
    }

    body .header .nav-menu .sub-menu a:hover,
    body .header .nav-menu .sub-menu a:focus-visible {
      background: #F1F7FF;
      color: #1A549F;
    }

    body .header .nav-menu > li.menu-item-has-children > a::before {
      content: "▼";
      margin-left: 6px;
      font-size: 10px;
      line-height: 1;
      order: 2;
    }
  }

/* ================================================================
   * SPハンバーガーメニュー 階層表示修正
   * ================================================================ */
  @media (max-width: 900px) {
    body header.header .sp-nav,
    body header.header .sp-nav-menu,
    body header.header .sp-nav-menu ul,
    body header.header .sp-nav-menu li {
      display: block !important;
      width: 100% !important;
      margin: 0 !important;
      padding: 0 !important;
      list-style: none !important;
    }

    body header.header .sp-nav-menu {
      border-top: 1px solid #D6E4F5 !important;
    }

    body header.header .sp-nav-menu li::before,
    body header.header .sp-nav-menu li::after {
      content: none !important;
    }

    body header.header .sp-nav-menu a {
      display: block !important;
      width: 100% !important;
      min-height: 0 !important;
      padding: 13px 16px !important;
      border-bottom: 1px solid #D6E4F5 !important;
      color: #14427D !important;
      background: #fff !important;
      font-size: 18px !important;
      font-weight: 800 !important;
      line-height: 1.45 !important;
      text-align: left !important;
      white-space: normal !important;
      text-decoration: none !important;
    }

    body header.header .sp-nav-menu > li > a {
      padding-left: 16px !important;
    }

    body header.header .sp-nav-menu .sub-menu {
      display: block !important;
      margin: 0 !important;
      padding: 0 !important;
      background: #F7FAFE !important;
    }

    body header.header .sp-nav-menu .sub-menu a {
      padding: 11px 16px 11px 36px !important;
      background: #F7FAFE !important;
      font-size: 16px !important;
      font-weight: 700 !important;
    }

    body header.header .sp-nav-menu .sub-menu .sub-menu a {
      padding-left: 52px !important;
      font-size: 15px !important;
    }

    body header.header .sp-nav-menu a:hover,
    body header.header .sp-nav-menu a:focus-visible {
      background: #EAF3FF !important;
      color: #1A549F !important;
    }
  }

  /* SPハンバーガーメニューをスクロール可能にする */
  @media (max-width: 900px) {
    body header.header .sp-menu {
      max-height: calc(100vh - 96px) !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
    }

    body header.header .sp-menu-inner {
      padding-bottom: 96px !important;
    }
  }

  @media (max-width: 900px) {
    body header.header .sp-menu {
      overscroll-behavior: contain !important;
    }
  }
 
/* 記事ページ 見出しサイズ調整（SPのみ） */
  @media (max-width: 640px) {
    body.single .page-hero h1 {
      font-size: 28px !important;
      line-height: 1.5 !important;
    }

    body.single .content h2 {
      font-size: 24px !important;
      line-height: 1.5 !important;
    }

    body.single .content h3 {
      font-size: 22px !important;
      line-height: 1.5 !important;
    }

    body.single .content h4 {
      font-size: 20px !important;
      line-height: 1.55 !important;
    }

    body.single .content h5 {
      font-size: 18px !important;
      line-height: 1.6 !important;
    }

    body.single .content h6 {
      font-size: 16px !important;
      line-height: 1.6 !important;
    }
  }