/* 夜tax 本体（xwrite）ページ内の移動と PC の固定ナビ（2026-10-29・nav.js と組）。mu-plugin nighttax-nav-20261029.php が全ページの head で読む */

/* PC の固定ナビ：テーマは body.fix-nav に上の余白 46px を足していた（ナビの実際の高さ 38〜61px と合わない）。
   nav.js が動いているとき（.nt-nav-on）は、nav の直前の場所取り（.nt-nav-slot）がナビの元の高さを取るので、46px は足さない */
body.fix-nav.nt-nav-on { padding-top: 0 !important; }
.nt-nav-slot { display: block; height: 0; margin: 0; padding: 0; }
@media screen and (max-width: 640px) { .nt-nav-slot { display: none; } }

/* 中間の幅（641〜1279px）のヘッダー：テーマの横並び（ロゴ｜連絡先｜ボタン）ではロゴの枠が字より狭く、ロゴの字が「営業時間…」に重なっていた（768px で実測）。
   1 段目＝ロゴ（字の幅のまま）とボタン、2 段目＝営業時間・電話番号に分ける。ナビの項目は字を折り返さず、項目ごと次の行へ。字の大きさは変えない。
   640px 以下（白地のメニュー）と 1280px 以上は今のまま */
@media screen and (min-width: 641px) and (max-width: 1279px) {
  header.header .header-inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "brand actions" "info info";
    align-items: center;
    column-gap: 20px; row-gap: 10px;
    height: auto !important;
  }
  header.header .header-inner > .logo { grid-area: brand; width: auto !important; min-width: max-content; margin: 0 !important; }
  header.header .header-inner > .logo .nt-logo__name,
  header.header .header-inner > .logo .nt-logo__sub { white-space: nowrap; }
  header.header .header-inner > .wrap-contact { display: contents !important; }
  header.header .header-inner .service-info {
    grid-area: info;
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.5em; row-gap: 2px;
    width: auto !important; margin: 0 !important;
  }
  header.header .header-inner .service-info p { margin: 0 !important; }
  header.header .header-inner .group-btn { grid-area: actions; display: flex; justify-content: flex-end; gap: 12px; width: 100% !important; min-width: 0; margin: 0 !important; }
  header.header .header-inner .group-btn > a { flex: 0 1 173px; width: auto !important; min-width: 0; margin: 0 !important; } /* 173px＝1280px 以上のボタンの幅。狭い幅ではロゴの残りに合わせて縮む */
  header.header .header-inner .group-btn > a > img { display: block; width: 100% !important; height: auto !important; }
  header.header .header-inner > .hamb_btn { display: none !important; }
  header.header .header-nav > ul { flex-wrap: wrap; justify-content: center; height: auto !important; }
  header.header .header-nav > ul > li { flex: 0 0 auto; width: auto !important; }
  header.header .header-nav > ul > li > a:not(.open_menu) { white-space: nowrap; height: auto !important; padding-left: 12px; padding-right: 12px; }
}

/* PC（641px 以上）のサブメニュー：テーマは top:46px 固定＝ナビの高さ（38〜61px）と合わず、隙間でマウスが外れて閉じる・ナビに重なることがあった。
   親の項目の真下（top:100%）につなぐ。キーボードの Tab で子へ入れるよう、記事・カテゴリでも :focus-within で開く（トップは nt-site.css に同じ規則がある）。
   右端からはみ出す分は nav.js が左へずらす */
@media screen and (min-width: 641px) {
  header.header .header-nav > ul > li:hover > ul.sub_menu,
  header.header .header-nav > ul > li:focus-within > ul.sub_menu { top: 100%; max-height: 330px; opacity: 1; display: block; z-index: 30; }
  header.header .header-nav > ul > li > ul.sub_menu { max-width: calc(100vw - 16px); }
}

/* トップのスマホ（640px 以下）：本文の上の余白の最初の値（テーマ style-custom.css は 71px・あとから JS がヘッダーの高さ 105.58px に直す＝最初の表示から
   約 35px 下へずれていた）を、ヘッダーの実際の高さ（上の帯 30px + 本体 75.58px・320〜640px で同じ）にそろえる。JS の追従（site-menu.js）はそのまま */
@media screen and (max-width: 640px) { body .wrap-page { padding-top: 105.578px; } }

/* トップのフォーム：連絡方法を選んだあとの案内（#nt-method-hint）は hidden を付けても display:block が勝って残っていた＝hidden のときだけ消す */
#nt-method-hint[hidden] { display: none !important; }

/* 記事の目次の開閉ボタン（toc.js が「[ open / close ]」を包む）。見た目は今のまま（ボタンの既定の枠・余白・背景・文字を消す）、フォーカスだけ見える */
.toc__caption .nt-toc-toggle {
  -webkit-appearance: none; appearance: none;
  background: none; border: 0; border-radius: 2px; margin: 0; padding: 0;
  font: inherit; color: inherit; letter-spacing: inherit; line-height: inherit; text-align: inherit; text-transform: none;
  cursor: pointer;
}
.toc__caption .nt-toc-toggle:focus { outline: none; }
.toc__caption .nt-toc-toggle:focus-visible { outline: 2px solid #A7446B; outline-offset: 2px; }
