/*
 Theme Name: Shinagawa Child
 Template: twentytwentyfive
 Version: 1.2.0
 Author: 上條
 Description: 品川支部向け Twenty Twenty-Five 子テーマ
*/

/* =======================
   接骨院検索（[shinagawa_clinic_finder]ショートコード）
======================= */
.clinic-finder-status {
  padding: 1rem;
  background: #f5f5f7;
  border-radius: 8px;
  font-size: .92rem;
}

.clinic-finder-retry {
  margin-top: .6rem;
  padding: .5rem 1.2rem;
  border: 0;
  border-radius: 9999px;
  background: var(--wp--preset--color--primary);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
}

.clinic-finder-map {
  width: 100%;
  height: 320px;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid #ddd;
}

.clinic-finder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.clinic-finder-item {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.clinic-finder-item.is-open {
  border-color: var(--wp--preset--color--primary);
}

.clinic-finder-item-toggle {
  appearance: none;
  width: 100%;
  border: 0;
  background: none;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .9rem 1rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.clinic-finder-item-title {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 1rem;
}

.clinic-finder-item-distance {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: .82rem;
  color: var(--wp--preset--color--primary);
  white-space: nowrap;
}

.clinic-finder-item-caret {
  flex: 0 0 auto;
  font-size: .8rem;
  color: #999;
  transition: transform .2s ease;
}

.clinic-finder-item.is-open .clinic-finder-item-caret {
  transform: rotate(180deg);
}

.clinic-finder-item-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  transition: max-height .25s ease;
}

.clinic-finder-item.is-open .clinic-finder-item-body {
  padding-bottom: .9rem;
}

.clinic-finder-item-member {
  font-size: .8rem;
  color: #777;
}

.clinic-finder-item-address {
  margin-top: .3rem;
  font-size: .86rem;
  color: #555;
}

.clinic-finder-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .5rem;
}

.clinic-finder-item-address-hint {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
  font-size: .8rem;
}

.clinic-finder-item-phone {
  flex: 0 0 auto;
  font-size: .86rem;
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
}

.clinic-finder-locate-control {
  margin: 10px 0 0 10px !important;
}

.clinic-finder-locate-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  color: var(--wp--preset--color--primary);
  background: #fff;
  text-decoration: none;
}

.clinic-finder-locate-btn:hover {
  background: #f5f5f7;
}

/* =======================
   固定ページ本文
======================= */
body.page:not(.home) main {
  font-size: .88rem;
}

body.page:not(.home) main p,
body.page:not(.home) main li,
body.page:not(.home) main dt,
body.page:not(.home) main dd,
body.page:not(.home) main td,
body.page:not(.home) main th {
  font-size: .88rem;
  line-height: 1.9;
}

body.page:not(.home) main h2 {
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  line-height: 1.45;
}

body.page:not(.home) main h3 {
  font-size: clamp(1.2rem, 2.3vw, 1.4rem);
  line-height: 1.5;
}

/* =======================
   モバイル本文の左右余白（TOP以外、固定ページ・投稿とも32pxに統一）
   WPコアの has-global-padding は「alignfullの子要素が親のpaddingを
   負のマージンで打ち消してから自分のpaddingを付け直す」仕組みを持つため、
   --wp--style--root--padding-left/right をbody単位で設定するだけで、
   本文コンテナ(.wp-block-post-content)を含む入れ子全体に二重加算なく
   一意に反映される。margin/paddingの直接上書きは不要。
======================= */
@media (max-width: 768px) {
  body:not(.home) {
    --wp--style--root--padding-left: 32px;
    --wp--style--root--padding-right: 32px;
  }
}

/* =======================
   モバイル：日本語本文の不自然な改行を抑制
   例）「品川支部」が「品川支」「部」のように単語途中で改行される問題への対応。
   word-break: auto-phrase は対応ブラウザ(Chrome/Edge 119+)でのみ意味のある単語区切りで改行。
   未対応ブラウザ（Safari/Firefox 等）では無効な値として無視され、ブラウザ標準の改行に戻る。
   line-break/overflow-wrapは指定しない（strictは禁則対象を増やし早期改行の原因になり得るため削除。
   overflow-wrapは通常の日本語本文では不要なため削除）。
   PC表示（769px以上）には一切適用しない。
======================= */
@media (max-width: 768px) {
  .wp-block-post-content {
    word-break: auto-phrase;
  }
}

/* 親テーマ(twentytwentyfive) style.css の
   `h1,h2,h3,h4,h5,h6,blockquote,caption,figcaption,p { text-wrap: pretty; }` は
   対応ブラウザで段落全体のバランスを優先し、行を最大限まで詰めずに早めに
   改行することがある。モバイル本文(p/li)のみ標準のgreedy改行に戻す。
   見出し・PC表示・親テーマファイルには一切手を入れない。 */
@media (max-width: 768px) {
  .wp-block-post-content p,
  .wp-block-post-content li {
    text-wrap: wrap;
  }
}

/* =======================
   固定ページ・投稿共通（TOP以外専用。TOP独自の設定は「トップページ専用」セクションで管理）
======================= */

body:not(.home) :where(.wp-site-blocks, .is-layout-constrained) > .alignwide {
  margin-left: auto; margin-right: auto;
}

/* 画像・ギャラリーの左右端を本文に揃える
   （エディタの余白プリセット：XX-Largeはclamp(70px,10vw,140px)などモバイルで大きく出るため、
    ブロックごとに幅がばらついて見える原因になる） */
@media (max-width: 768px) {
  body:not(.home) .wp-block-post-content .wp-block-image,
  body:not(.home) .wp-block-post-content .wp-block-gallery {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
}

/* クラシック挿入（<p><img class="aligncenter"></p>）の中央揃え救済
   コアのレイアウトCSSは「.is-layout-constrained > .aligncenter」等、直下の子要素にしか
   margin:autoを適用しない。<p>に包まれたimg.aligncenterはこの対象外になり、
   imgの初期値（display:inline; margin:0）のまま左詰めで表示されてしまうため、
   ここで直接 img.aligncenter を中央揃えする。 */
img.aligncenter {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

/* モーダル/メニュー展開時のスクロールバー補正（ページ種別に依存しない共通処理） */
@media (max-width: 768px) {
  html.has-modal-open,
  body.has-modal-open,
  body.nav-open {
    padding-right: 0 !important;
    overflow: hidden;
  }
}


/* =======================
   固定ページ・投稿ページ：タイトルと本文の間隔（TOPはタイトル非表示のため対象外）
======================= */
body:not(.home) .wp-block-post-title + .wp-block-post-content {
  margin-top: calc(var(--wp--preset--spacing--50) * 1.5);
}

/* =======================
   トップページ専用
======================= */
body.home a {
  color: var(--wp--preset--color--primary);
}

body.home .wp-element-button,
body.home .wp-block-button__link {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  border-radius: 9999px;
}

body.home .wp-block-post-title {
  display: none !important;  /* ページタイトル非表示 */
}

/* page.htmlテンプレート（親テーマ）が <main> のmargin-topと、その内側の
   groupのpadding-topに、どちらもspacing--60（最大70px）をインラインstyleで
   指定しているため、非表示のタイトル分の余白と合わせてTOPだけ上余白が
   二重・三重に積み重なっていた。heroブロック自体が独自にヘッダー分の
   padding-topを持つため、TOPではこのテンプレート側の余白を打ち消す。 */
body.home main.wp-block-group {
  margin-top: 0 !important;
}
body.home main > .wp-block-group.alignfull {
  padding-top: 0 !important;
}

/* WordPress core（テーマ非依存）のブロック間隔が、非表示のタイトルの
   「次の兄弟要素」というだけで本文にmargin-top（約1.2rem）を自動で
   足してしまうため、TOPではこれも打ち消す。 */
body.home .wp-block-post-title + .wp-block-post-content {
  margin-top: 0 !important;
}

html body.home,
body.home { 
  overflow-x: hidden;        /* 横スクロール抑止 */ 
}

/* full幅ブロックの左右余白リセット（TT25） */
body.home .wp-site-blocks > .alignfull,
body.home .wp-site-blocks .wp-block-group.alignfull {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* alignwide を中央寄せ */
body.home :where(.wp-site-blocks, .is-layout-constrained) > .alignwide {
  margin-left: auto; 
  margin-right: auto;
}

/* モバイルの右寄り対策（root padding & modal補正） */
@media (max-width: 768px) {
  body.home .wp-site-blocks,
  body.home .wp-block-post-content,
  body.home .is-layout-constrained.wp-block-group {
    padding-left: 0rem !important;   /* ← 左右バランス */
    padding-right: 0rem !important;
    box-sizing: border-box;

    /* ★追加：中央揃え */
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100%;  /* 横はみ出し防止 */
  }

  body.home html.has-modal-open,
  body.home body.has-modal-open,
  body.home body.nav-open {
    padding-right: 0 !important;
    overflow: hidden;
  }

  /* TOPの横ブレ抑止。活動報告タイルは横スクロールを維持 */
  body.home .wp-site-blocks,
  body.home .site,
  body.home .site-main {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.home .wp-block-latest-posts.post-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.home .wp-block-latest-posts.post-scroll * {
    overflow-x: visible;
  }
}



















/* =======================
   固定ヘッダー
======================= */
.site-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  background: rgba(248, 248, 248, 0.80);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  border-bottom: 0;
}

html.apple-search-open .site-header,
body.apple-search-open .site-header,
html.apple-search-desktop-open .site-header,
body.apple-search-desktop-open .site-header,
.site-header.header-duty-open {
  background: #f8f8f8 !important;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 5%;
  padding-right: 5%;
  min-height: 60px;
  gap: 1rem;
  box-sizing: border-box;
}

.logo { flex: 0 0 auto; }
.logo img { max-height: 40px; width:auto; display:block; }
@media (max-width: 768px){
  .site-header-inner { min-height: 52px; }
}
@media (max-width:480px){
  .logo img { max-height: 32px; }
}

.header-duty {
  margin-top: 0;
  padding: .35rem .5rem;
  border-radius: 8px;
  background: transparent;
  max-width: min(48vw, 520px);
}

.header-duty.header-duty-below {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  margin: 0 !important;
  padding: .03rem 5% .07rem !important;
  width: 100% !important;
  max-width: none !important;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.header-duty-date,
.header-duty-members {
  margin: 0;
  line-height: 1.35;
}

.header-duty-date {
  font-size: .72rem;
  font-weight: 600;
}

.header-duty-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: .84rem;
  transition: opacity .2s ease;
}

.header-duty-toggle:hover {
  opacity: 0.7;
}

.header-duty-toggle:focus,
.header-duty-toggle:focus-visible,
.header-duty-name:focus,
.header-duty-name:focus-visible,
.header-duty-modal-close:focus,
.header-duty-modal-close:focus-visible,
.search-toggle:focus,
.search-toggle:focus-visible,
.apple-search-submit:focus,
.apple-search-submit:focus-visible,
.apple-search-cancel:focus,
.apple-search-cancel:focus-visible {
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.header-duty-toggle::after {
  content: '▾';
  flex: 0 0 auto;
  font-size: .74rem;
  transition: transform .24s ease;
}

.header-duty.is-expanded .header-duty-toggle::after {
  transform: rotate(180deg);
}

.header-duty-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .28s ease, opacity .2s ease;
}

.header-duty.is-expanded .header-duty-panel {
  opacity: 1;
}

.header-duty-members {
  margin-top: .24rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: .9rem;
  font-weight: 600;
  opacity: .96;
}

.header-duty-row {
  display: block;
  line-height: 1.45;
}

.header-duty-row + .header-duty-row {
  margin-top: .95rem;
}

.header-duty-district {
  display: inline-block;
  font-size: .94em;
  font-weight: 700;
  letter-spacing: .01em;
}

.header-duty-member-line {
  display: inline-block;
  margin-top: .08rem;
}

.header-duty-name {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: #1248b5;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 700;
  transition: opacity .2s ease;
}

.header-duty-name:hover {
  opacity: 0.7;
}

.header-duty-name.is-static {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

.header-duty-modal[hidden] {
  display: none;
}

.header-duty-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
}

.header-duty-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.16);
  z-index: 0;
}

html.duty-modal-open .apple-search-desktop-backdrop,
body.duty-modal-open .apple-search-desktop-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: block;
  background: rgba(248, 248, 248, 0.10);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  backdrop-filter: blur(6px) saturate(110%);
  opacity: 1;
  pointer-events: none;
  z-index: 11950;
}

.header-duty-modal-dialog {
  isolation: isolate;
  z-index: 1;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}

.header-duty-modal-dialog * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.header-duty-modal-dialog {
  position: relative;
  width: min(92vw, 460px);
  max-width: calc(100vw - 16px);
  margin: 12vh auto 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 20px 45px rgba(0, 0, 0, .25);
  padding: 1rem 1rem .9rem;
  box-sizing: border-box;
}

.header-duty-modal-close {
  position: absolute;
  right: .55rem;
  top: .45rem;
  appearance: none;
  border: 0;
  background: none;
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
}

.header-duty-modal-title {
  margin: 0 1.5rem .55rem 0;
  font-size: .96rem;
}

.header-duty-modal-list {
  margin: 0;
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  row-gap: .36rem;
  column-gap: .5rem;
}

.header-duty-modal-list dt {
  font-size: .82rem;
  opacity: .72;
}

.header-duty-modal-list dd {
  margin: 0;
  font-size: .9rem;
  word-break: break-word;
}

.header-duty-contact-link {
  color: #1248b5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header-duty-contact-link.is-disabled {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

@media (max-width: 768px) {
  .header-duty {
    max-width: 86vw;
  }

  .header-duty.header-duty-below {
    margin: 0 !important;
    padding: .03rem 5% .07rem !important;
    background: transparent !important;
    backdrop-filter: none !important;
    border-radius: 0;
  }

  .header-duty-date {
    font-size: .72rem;
  }

  .header-duty-members {
    font-size: .88rem;
  }

  .header-duty-modal-dialog {
    margin-top: 10vh;
    padding: .9rem .85rem .8rem;
  }

  .header-duty-modal-list {
    grid-template-columns: 5rem 1fr;
  }
}
/* ヘッダー右側（検索＋メニュー） */
.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;      /* ← 右端で潰れない */
}

/* =======================
   検索エリア
======================= */
/* --- ヘッダー右側を伸びる領域にする --- */
.header-actions{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex:1 1 auto;   /* ← ここ重要：右側を広げる */
  min-width:0;     /* ← 折り返し時の潰れ防止 */
}

/* --- 検索ラッパ：幅を持たせて基準化 --- */
.search-wrapper{
  position:relative;
  flex:1 1 auto;   /* ← アイコンだけの幅にならない */
  min-width:0;
  height: 2.5rem;  /* 好みで。フォーム高さの基準に */
}

/* 虫眼鏡は右端に固定（押されて動かない） */
.search-toggle{
  position:absolute;
  right:0;
  top:50%;
  transform:translateY(-50%);
  z-index:2;         /* ← フォームより手前で押せる */
  appearance:none;
  -webkit-appearance:none;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:.25rem;
  display:flex; align-items:center; justify-content:center;
}
.search-toggle svg{ width:24px; height:24px; }

.site-header button[aria-label="サイト内検索"],
.site-header [data-search-toggle],
.site-header .apple-search-submit,
.site-header .apple-search-cancel,
.site-header .header-duty-name,
.site-header .header-duty-modal-close {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* --- フォームは虫眼鏡の左で横に伸びる --- */
.header-search{
  position:absolute;
  top:50%;
  right: calc(24px + .5rem);   /* ← 虫眼鏡の幅＋余白ぶんを確保 */
  transform:translateY(-50%);
  width:0;                      /* 初期は隠す */
  opacity:0;
  overflow:hidden;
  pointer-events:none;
  transition: width .35s ease, opacity .25s ease;

  background:#fff;
  border:1px solid #ccc;
  border-radius:6px;
  padding:.25rem .5rem;
  z-index:1;                    /* アイコンより後ろでOK */
  box-sizing:border-box;
}

/* 表示時：ラッパ幅を基準に%でにゅっと */
.search-wrapper.active .header-search{
  /* 虫眼鏡分を引いた残り幅の中で最大値を取る */
  width: min(70%, calc(100% - (24px + .75rem)));
  opacity:1;
  pointer-events:auto;
}

/* モバイルは広めに */
@media (max-width:768px){
  .search-wrapper.active .header-search{
    width: calc(100% - (24px + .75rem));
  }
}

/* 中身は100%でフィット */
.header-search form{
  display:flex; align-items:center; gap:.4rem; width:100%;
}
.header-search input[type="search"]{
  flex:1 1 auto; min-width:0; width:100%;
  padding:.4rem .6rem; font-size:.9rem;
  border:1px solid #ccc; border-radius:4px; box-sizing:border-box;
}
.header-search .wp-element-button{
  flex:0 0 auto;
  padding:.3rem .8rem; font-size:.85rem; white-space:nowrap; line-height:1.2;
}

@media (max-width:480px){
  .header-search input[type="search"]{ font-size:.8rem; padding:.3rem .4rem; }
  .header-search .wp-element-button{ padding:.25rem .5rem; font-size:.7rem; }
}

/* =======================
   フルスクリーン検索オーバーレイ
======================= */
.apple-search-overlay[hidden] {
  display: none;
}

.apple-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #f8f8f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 18vh;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
}

.apple-search-desktop-backdrop {
  display: none;
}

@media (min-width: 769px) {
  .apple-search-overlay {
    position: static;
    inset: auto;
    z-index: auto;
    height: auto;
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    align-items: stretch;
    justify-content: flex-start;
    background: #f8f8f8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    box-shadow: none;
    transition: max-height .32s cubic-bezier(.22,.61,.36,1), opacity .18s ease;
  }

  .apple-search-overlay.is-opening,
  .apple-search-overlay.is-open {
    max-height: 28rem;
    opacity: 1;
    pointer-events: auto;
  }

  .apple-search-overlay.is-closing {
    max-height: 0;
    opacity: 1;
    pointer-events: none;
  }

  .apple-search-panel {
    position: relative;
    min-height: 64px;
    padding: 0 5%;
    align-items: center;
  }

  .apple-search-form {
    min-height: 64px;
  }

  .apple-search-form input[type="search"] {
    font-size: 1.2rem;
  }

  .apple-search-cancel {
    display: none;
  }

  .apple-search-quicklink-wrap {
    display: block;
    padding: .75rem 5% 1.1rem;
    margin-top: 0;
    position: relative;
    z-index: 2;
  }
}

.apple-search-overlay.is-opening,
.apple-search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.apple-search-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

/* 検索パネル */
.apple-search-panel {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 0 15%;
  flex-shrink: 0;
}

.apple-search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
}

.apple-search-submit {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: #bbb;
  flex-shrink: 0;
}

.apple-search-submit svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.apple-search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1.92rem;
  color: #1c1c1e;
  padding: 6px 0;
}

.apple-search-form input[type="search"]::placeholder {
  color: #bbb;
}

.apple-search-cancel {
  appearance: none;
  border: 0;
  background: transparent;
  position: absolute;
  top: 6vh;
  right: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  color: #bbb;
}

.apple-search-cancel svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.apple-search-quicklink-wrap {
  width: 100%;
  padding: 0 15%;
  box-sizing: border-box;
  margin-top: 3em;
}

.apple-search-quicklink-title {
  margin: 0 0 .6em;
  font-size: 1.1rem;
  font-weight: 600;
  color: #bbb;
  letter-spacing: .04em;
}

.apple-search-quicklink-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6em;
}

.apple-search-quicklink-list a,
.apple-search-quicklink-list a:visited,
.apple-search-quicklink-list a:active,
.apple-search-quicklink-list a:hover,
.apple-search-quicklink-list a:focus {
  color: #000 !important;
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 0;
  padding-bottom: 0;
}

.apple-search-quicklink-list a::before {
  content: "→　";
}

@media (min-width: 769px) {
  html.apple-search-open #mobile-menu,
  html.apple-search-open #mobileMenu,
  body.apple-search-open #mobile-menu,
  body.apple-search-open #mobileMenu {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  html.apple-search-open #mobile-menu a,
  html.apple-search-open #mobileMenu a,
  body.apple-search-open #mobile-menu a,
  body.apple-search-open #mobileMenu a {
    opacity: 1 !important;
    visibility: visible !important;
    color: #1c1c1e !important;
  }

  .apple-search-cancel {
    display: none !important;
  }

  .apple-search-panel {
    padding: 0 8% !important;
  }

  .apple-search-quicklink-wrap {
    padding: 1.5rem 8% 25vh !important;
    margin-top: 0;
    position: relative;
    z-index: 2;
  }

  .apple-search-desktop-backdrop {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--apple-search-desktop-blur-top, 170px);
    bottom: 0;
    display: block;
    background: rgba(248, 248, 248, 0.16);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    backdrop-filter: blur(12px) saturate(120%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 950;
  }

  html.apple-search-desktop-open .apple-search-desktop-backdrop,
  body.apple-search-desktop-open .apple-search-desktop-backdrop {
    opacity: 1;
  }
}





/* アイコンボタン */
.icon-btn {
  background: none;
  border: none;
  padding: .25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PC用フルメニュー（残しておくけど今は非表示） */
.header-nav[hidden] {
  display: none !important;
}

/* =======================
   ハンバーガーメニュー
======================= */


/* ハンバーガーは常に表示 */
.menu-toggle {
  display: inline-flex !important; /* ← スマホで潰されないよう強制 */
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  z-index: 2000; /* 他の要素より前に出す */
  position: relative;
}


/* モバイルメニュー（検索と同じオーバーレイ挙動） */
#mobile-menu,
#mobileMenu {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 19000;
  padding: 18vh 10% 10vh;
  box-sizing: border-box;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  transform: translateY(-8px);
  transition: opacity .24s ease, transform .24s ease, visibility 0s linear .24s;
}

#mobile-menu .nav-menu,
#mobileMenu .nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#mobile-menu .menu-item,
#mobileMenu .menu-item {
  list-style: none;
  position: relative;
}

#mobile-menu .sub-menu,
#mobileMenu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem;
  display: flex;
  flex-direction: column;
}

#mobile-menu .menu-item-has-children > a,
#mobileMenu .menu-item-has-children > a {
  font-weight: 700;
}

#mobile-menu .sub-menu a,
#mobileMenu .sub-menu a {
  font-size: .96rem;
  font-weight: 500;
  color: #4b5563;
  border-top: 0;
  padding: .7rem 0 .7rem .4rem;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 18999;
}

.mobile-menu-backdrop.is-open,
.mobile-menu-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

#mobile-menu.active,
#mobile-menu.is-open,
#mobileMenu.active,
#mobileMenu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.96);
}

#mobile-menu .mobile-menu-close,
#mobileMenu .mobile-menu-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #666;
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* メニューリンク */
#mobile-menu a,
#mobileMenu a {
  padding: 1rem 0;
  text-decoration: none;
  color: #1c1c1e;
  font-weight: 600;
  font-size: 1.08rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .24s ease, transform .24s ease;
}

#mobile-menu.active a,
#mobile-menu.is-open a,
#mobileMenu.active a,
#mobileMenu.is-open a {
  opacity: 1;
  transform: translateY(0);
}

#mobile-menu.active a:nth-of-type(1),
#mobile-menu.is-open a:nth-of-type(1),
#mobileMenu.active a:nth-of-type(1),
#mobileMenu.is-open a:nth-of-type(1) { transition-delay: .05s; }
#mobile-menu.active a:nth-of-type(2),
#mobile-menu.is-open a:nth-of-type(2),
#mobileMenu.active a:nth-of-type(2),
#mobileMenu.is-open a:nth-of-type(2) { transition-delay: .09s; }
#mobile-menu.active a:nth-of-type(3),
#mobile-menu.is-open a:nth-of-type(3),
#mobileMenu.active a:nth-of-type(3),
#mobileMenu.is-open a:nth-of-type(3) { transition-delay: .13s; }
#mobile-menu.active a:nth-of-type(4),
#mobile-menu.is-open a:nth-of-type(4),
#mobileMenu.active a:nth-of-type(4),
#mobileMenu.is-open a:nth-of-type(4) { transition-delay: .17s; }
#mobile-menu.active a:nth-of-type(5),
#mobile-menu.is-open a:nth-of-type(5),
#mobileMenu.active a:nth-of-type(5),
#mobileMenu.is-open a:nth-of-type(5) { transition-delay: .21s; }
#mobile-menu.active a:nth-of-type(6),
#mobile-menu.is-open a:nth-of-type(6),
#mobileMenu.active a:nth-of-type(6),
#mobileMenu.is-open a:nth-of-type(6) { transition-delay: .25s; }
#mobile-menu.active a:nth-of-type(7),
#mobile-menu.is-open a:nth-of-type(7),
#mobileMenu.active a:nth-of-type(7),
#mobileMenu.is-open a:nth-of-type(7) { transition-delay: .29s; }
#mobile-menu.active a:nth-of-type(8),
#mobile-menu.is-open a:nth-of-type(8),
#mobileMenu.active a:nth-of-type(8),
#mobileMenu.is-open a:nth-of-type(8) { transition-delay: .33s; }
#mobile-menu.active a:nth-of-type(9),
#mobile-menu.is-open a:nth-of-type(9),
#mobileMenu.active a:nth-of-type(9),
#mobileMenu.is-open a:nth-of-type(9) { transition-delay: .37s; }
#mobile-menu.active a:nth-of-type(10),
#mobile-menu.is-open a:nth-of-type(10),
#mobileMenu.active a:nth-of-type(10),
#mobileMenu.is-open a:nth-of-type(10) { transition-delay: .41s; }

#mobile-menu .mobile-menu-close,
#mobileMenu .mobile-menu-close {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}

#mobile-menu.active .mobile-menu-close,
#mobile-menu.is-open .mobile-menu-close,
#mobileMenu.active .mobile-menu-close,
#mobileMenu.is-open .mobile-menu-close {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 769px) {
  .site-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 1.4rem;
  }

  .site-header-inner .logo {
    justify-self: start;
  }

  .site-header-inner .header-actions {
    justify-self: end;
    flex: 0 0 auto;
    padding-left: 0;
    padding-right: 0;
  }

  #mobile-menu,
  #mobileMenu {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 1.25rem;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    overflow: visible !important;
    background: transparent !important;
    backdrop-filter: none !important;
    border: 0;
    justify-content: center;
  }

  #mobile-menu .nav-menu,
  #mobileMenu .nav-menu {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 1.25rem;
  }

  #mobile-menu .sub-menu,
  #mobileMenu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    padding: .8rem .85rem .55rem;
    display: flex !important;
    flex-direction: column !important;
    gap: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    z-index: 19100;
  }

  #mobile-menu .menu-item-has-children:hover > .sub-menu,
  #mobile-menu .menu-item-has-children:focus-within > .sub-menu,
  #mobileMenu .menu-item-has-children:hover > .sub-menu,
  #mobileMenu .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  #mobile-menu a,
  #mobileMenu a {
    padding: .25rem 0 !important;
    border-top: 0 !important;
    font-size: .95rem;
    font-weight: 500;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  #mobile-menu .sub-menu a,
  #mobileMenu .sub-menu a {
    display: block;
    padding: .5rem 0 !important;
    font-size: .88rem;
    font-weight: 500;
    white-space: nowrap;
  }

  #mobile-menu .mobile-menu-close,
  #mobileMenu .mobile-menu-close,
  .menu-toggle {
    display: none !important;
  }

  .mobile-menu-backdrop {
    display: none !important;
  }

  .header-duty.header-duty-below {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    z-index: auto !important;
    margin: 0 !important;
    padding: .03rem 5% .07rem !important;
    border-radius: 0;
    background: transparent !important;
    backdrop-filter: none !important;
  }
}

/* Mobile menu overlay hotfix: override legacy #mobile-menu.active rules */
@media (max-width: 768px) {
  #mobile-menu,
  #mobileMenu {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: none !important;
    height: 100dvh !important;
    overflow-y: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
    padding: 18vh 10% 10vh !important;
    background: #fff !important;
    backdrop-filter: none !important;
  }

  #mobile-menu .nav-menu,
  #mobileMenu .nav-menu {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  #mobile-menu .sub-menu,
  #mobileMenu .sub-menu {
    position: static;
    min-width: 0;
    width: 100%;
    padding: .15rem 0 0 .9rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  #mobile-menu.active .sub-menu,
  #mobile-menu.is-open .sub-menu,
  #mobileMenu.active .sub-menu,
  #mobileMenu.is-open .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #mobile-menu.active,
  #mobile-menu.is-open,
  #mobileMenu.active,
  #mobileMenu.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  #mobile-menu a,
  #mobileMenu a {
    display: block !important;
    width: 100% !important;
    padding: 1rem 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  }

  #mobile-menu .sub-menu a,
  #mobileMenu .sub-menu a {
    padding: .65rem 0 .65rem .35rem !important;
    border-top: 0 !important;
    font-size: .94rem;
  }
}




/* =======================
   Hero
======================= */
.hero.alignfull{
  min-height: 85svh; /* dvhだとアドレスバー出入りに追従して高さが変わり続け、
                         強くスクロールした瞬間に微振動の原因になるためsvh（最小ビューポート基準）に固定 */
  display:flex; justify-content:center; align-items:center;
  text-align:center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding-top: 0;
  box-sizing:border-box;
}
.hero-inner{
  max-width: 1200px; margin:0 auto;
  padding-inline: 1rem;
}
.hero h1{
  font-size:2rem; font-weight:700; line-height:1.3; margin-bottom:1rem;
}
.hero p{
  font-size:1rem; color: var(--wp--preset--color--accent); margin-bottom:2rem;
}
@media (min-width:768px){
  .hero h1{ font-size:3rem; max-width:900px; }
  .hero p { font-size:1.25rem; max-width:700px; }
}
@media (min-width:1200px){
  .hero h1{ font-size:3.5rem; }
}
.hero .wp-element-button{
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  padding:.8rem 2rem;
  border-radius:9999px; font-weight:600;
  text-decoration:none;
  transition: transform .2s ease, background .2s ease;
}
.hero .wp-element-button:hover{
  transform: scale(1.05);
  background:#002244;
}

/* =======================
   Feature（2パターン）
======================= */

/* A) グレーの箱：上=タイトル／中=リンク／下=画像（<picture> or <img>を最下段） */
.feature-box{
  background:#f5f5f7;
  padding: clamp(2.5rem, 6vw, 5rem) 1rem;
  box-sizing:border-box;
}
.feature-box .feature-inner{
  max-width:1100px; margin:0 auto; text-align:center;
  display:grid; gap:1rem;
}
.feature-box .feature-inner h2{
  font-size:2rem; font-weight:700;
}
.feature-box .feature-link{
  font-weight:600; text-decoration:none;
  color: var(--wp--preset--color--primary);
  border-bottom:1px solid var(--wp--preset--color--primary);
}
.feature-box .feature-link:hover{ opacity:.85; }
.feature-media{ margin-top:1rem; display:block; }
.feature-media img{ display:block; width:100%; height:auto; border-radius:8px; }
@media (min-width:768px){
  .feature-box .feature-inner{ gap:1.25rem; }
  .feature-box .feature-inner h2{ font-size:2.25rem; }
}


/* B) グレー背景に背景画像を“contain”で配置（上下に余白を必ず作る） */
.feature-section{
  position:relative; width:100%;
  background-color:#f5f5f7;
  display:flex; justify-content:center; align-items:center;
  text-align:center;
  padding: clamp(3rem, 6vw, 6rem) 1rem;
  box-sizing:border-box;
  min-height:60svh; /* dvhもアドレスバー出入りで値が変わり続け振動の原因になるためsvhに固定 */
}
.feature-section.with-image{
  background-color:#f5f5f7;
  background-image: var(--feature-image-mobile);  /* 例: inline style で指定不可のときはクラス分けを推奨 */
  background-position: center top;
  background-repeat: no-repeat;
  background-size: contain;
}
@media (min-width:768px){
  .feature-section.with-image{
    background-image: var(--feature-image-desktop);
  }
}
.feature-section .feature-inner{
  max-width:900px; margin:0 auto; text-align:center;
  padding:2rem 1rem; box-sizing:border-box;
  position:relative; z-index:1;
}
.feature-section h2{
  font-size:2rem; font-weight:700; margin-bottom:.75rem;
}
.feature-section .feature-link{
  font-size:1.1rem; font-weight:600; text-decoration:none;
  color: var(--wp--preset--color--primary);
  border-bottom:1px solid var(--wp--preset--color--primary);
}
.feature-section .feature-link:hover{ opacity:.8; }

/* 背景画像をCSS側で切替したい場合（HTMLに変数が入らないとき）はクラス別定義を使用）
   .feature--top1 { background-image:url('/wp-content/res/images/sp-top1.png'); }
   @media (min-width:768px){ .feature--top1 { background-image:url('/wp-content/res/images/pc-top1.png'); } }
*/
/* ヘッダーの高さ分だけ本文を下げる */
body {
  padding-top: 70px; /* ヘッダー高さに合わせる */
}
body.admin-bar {
  padding-top: calc(70px + 32px);
}
@media screen and (max-width: 782px) {
  body.admin-bar {
    padding-top: calc(70px + 46px);
  }
}



/* ログイン時の管理バーが出ているとき */
body.admin-bar .site-header {
  top: 32px;   /* 管理バーの高さ（PCは32px） */
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px; /* モバイルは管理バーが46pxになる */
  }
}

/* =======================
   投稿リスト横スクロール
======================= */

/* ラッパー */
.wp-block-latest-posts.post-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;           /* 横スクロール */
  scroll-snap-type: x proximity; /* mandatoryだと1枚ずつしか動けない。proximityで勢いよくスワイプでき、速度が緩んだ位置に近いカードへスナップする */
  padding: 0;
  margin: 0;
  list-style: none;
  -webkit-overflow-scrolling: touch; /* iOSスムーズ */
}

/* カード */
.wp-block-latest-posts.post-scroll li {
  flex: 0 0 280px;            /* PC: 280px幅のカード */
  scroll-snap-align: start;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* アイキャッチ画像 */
.wp-block-latest-posts.post-scroll img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

/* タイトル */
.wp-block-latest-posts.post-scroll a {
  display: block;
  padding: .6rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
  word-break: break-word;     /* 長い単語も折り返す */
}
.wp-block-latest-posts.post-scroll a:hover {
  opacity: .8;
}

/* ===== スマホ対応 ===== */
@media (max-width: 768px) {
  .wp-block-latest-posts.post-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity; /* mandatoryだと1枚ずつしか動けない。proximityで勢いよくスワイプでき、速度が緩んだ位置に近いカードへスナップする */
    justify-content: center;   /* ★中央寄せ */
    padding: 0 1rem;           /* 左右に余白 */
    -webkit-overflow-scrolling: touch;
  }

  .wp-block-latest-posts.post-scroll li {
    flex: 0 0 90%;             /* ほぼ全幅 */
    max-width: 90%;
    margin: 0 auto;            /* ★中央寄せ */
    scroll-snap-align: center; /* ★スナップで中央に止まる */
  }

  .wp-block-latest-posts.post-scroll img {
    width: 100%;
    height: 140px;             /* 画像を少し小さく */
    object-fit: cover;
  }

  .wp-block-latest-posts.post-scroll a {
    font-size: .9rem;
    padding: .5rem;
    display: block;
    text-align: center;        /* タイトルも中央寄せ */
  }
}

/* Mobile fix: keep alignfull sections from spilling horizontally */
@media (max-width: 782px) {
  body.home .wp-site-blocks > .alignfull {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.home,
  body.home .wp-site-blocks {
    overflow-x: hidden;
  }

  /* Feature image alignment: remove left shift and keep symmetric gutter */
  body.home .feature-box.alignfull {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.home .feature-box.alignfull .feature-inner,
  body.home .feature-box.alignfull .feature-media,
  body.home .feature-box.alignfull .feature-media img {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Keep mobile page from horizontal drifting while preserving full-width look */
@media (max-width: 782px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body.home .wp-site-blocks > .hero.alignfull,
  body.home .wp-site-blocks > .feature-box.alignfull,
  body.home .wp-site-blocks > .feature-section.alignfull {
    overflow-x: hidden;
  }
}

/* [shinagawa_next_holiday_duty] ショートコード：固定ページ埋め込み用の次回休日当番カード */
.next-holiday-duty {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  background: #f8faff;
}

.next-holiday-duty.is-empty {
  color: #666;
}

.next-holiday-duty-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin: 0 0 .5rem;
}

.next-holiday-duty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.next-holiday-duty-nearest-btn {
  appearance: none;
  border: 1px solid #1248b5;
  border-radius: 9999px;
  background: #fff;
  color: #1248b5;
  padding: .3rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.next-holiday-duty-nearest-btn:hover:not(:disabled) {
  background: #1248b5;
  color: #fff;
}

.next-holiday-duty-nearest-btn:disabled {
  opacity: .6;
  cursor: default;
}

.next-holiday-duty-nearest-btn[hidden] {
  display: none;
}

.next-holiday-duty-date {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1248b5;
}

.next-holiday-duty-holiday-name {
  margin-left: .25rem;
  font-size: .85rem;
  font-weight: 600;
  color: #666;
}

.next-holiday-duty-list {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.next-holiday-duty-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .85rem 1rem;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  background: #fff;
  transition: background-color .4s ease, border-color .4s ease;
}

.next-holiday-duty-item.is-nearest {
  background: #eaf3ff;
  border-color: #1248b5;
  animation: shinagawa-duty-nearest-pop .5s ease;
}

@keyframes shinagawa-duty-nearest-pop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(18, 72, 181, .35); }
  40% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(18, 72, 181, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(18, 72, 181, 0); }
}

.next-holiday-duty-distance {
  margin-top: .3rem;
  font-size: .8rem;
  font-weight: 700;
  color: #1248b5;
}

.next-holiday-duty-distance[hidden] {
  display: none;
}

.next-holiday-duty-district {
  font-size: .8rem;
  font-weight: 700;
  color: #666;
  letter-spacing: .02em;
}

.next-holiday-duty-clinic {
  font-size: 1.02rem;
  font-weight: 700;
}

.next-holiday-duty-address {
  font-size: .85rem;
  color: #555;
  text-decoration: underline;
  text-underline-offset: 2px;
  width: fit-content;
}

.next-holiday-duty-address:hover {
  opacity: .7;
}

.next-holiday-duty-phone {
  margin-top: .15rem;
  font-size: .9rem;
  font-weight: 600;
  color: #1248b5;
  text-decoration: underline;
  text-underline-offset: 2px;
  width: fit-content;
}

.next-holiday-duty-phone:hover {
  opacity: .7;
}

@media (max-width: 480px) {
  .next-holiday-duty {
    padding: 1rem;
  }

  .next-holiday-duty-list {
    grid-template-columns: 1fr;
  }
}

/* =======================
   フッター最下部：コピーライト表記
======================= */
.site-footer-copyright {
  padding: 12px 16px;
  text-align: center;
  font-size: 12px;
  color: #999;
}

/* =======================
   下部固定バー：当会最寄りの院はこちら
======================= */
body {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

.nearest-clinic-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  padding: 8px 5% calc(8px + env(safe-area-inset-bottom, 0px));
  /* backdrop-filterはスクロール中ずっと再計算され続け、iOSで画面下部のジャンク
     （小刻みな震え）の原因になりやすいため、半透明の単色背景に変更 */
  background: rgba(248, 248, 248, 0.98);
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.nearest-clinic-bar-btn {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 9999px;
  background: var(--wp--preset--color--primary, #1248b5);
  color: #fff;
  padding: .7rem 1rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  cursor: pointer;
  transition: opacity .2s ease;
}

.nearest-clinic-bar-btn:hover {
  opacity: .85;
}

.nearest-clinic-modal-body p {
  margin: 0 0 .75rem;
  font-size: .9rem;
}

.nearest-clinic-retry-btn {
  appearance: none;
  border: 0;
  border-radius: 9999px;
  background: var(--wp--preset--color--primary, #1248b5);
  color: #fff;
  padding: .45rem 1.1rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

.nearest-clinic-map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 1rem;
  padding: .6rem 1rem;
  border-radius: 9999px;
  background: var(--wp--preset--color--primary, #1248b5);
  color: #fff !important;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none !important;
}

.nearest-clinic-map-btn:hover {
  opacity: .85;
}

@media (max-width: 480px) {
  .nearest-clinic-bar-btn {
    font-size: .85rem;
  }
}

