/* =====================================================
   相談ナビ（よくある質問）ウィジェット — 今成歯科医院
   v3 ミニマル和モダン（参考：yohaku）
   白 × 墨 × くすみゴールド／明朝×字間／ヘアライン
   ===================================================== */

.faqnav-btn,
.faqnav-overlay,
.faqnav-panel {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", YuGothic, Meiryo, sans-serif;
  box-sizing: border-box;
}
.faqnav-btn *,
.faqnav-panel * { box-sizing: border-box; }

/* ---------- 起動ボタン ---------- */
.faqnav-btn {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 100001;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #1c1c1c;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 16px rgba(28, 28, 28, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s ease, transform 0.3s ease;
}
.faqnav-btn:hover {
  background: #3a3a3a;
  transform: translateY(-2px);
}
.faqnav-btn:focus-visible {
  outline: 2px solid #1c1c1c;
  outline-offset: 3px;
}
.faqnav-btn__icon { display: none; }
.faqnav-btn__label {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Shippori Mincho B1", serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-align: center;
  display: block;
  white-space: nowrap;
}
.faqnav-btn__label small {
  display: block;
  font-family: "Century Gothic", "Inter", Helvetica, sans-serif;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.28em;
  margin-top: 3px;
  opacity: 0.65;
}

/* ---------- オーバーレイ ---------- */
.faqnav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 28, 0.40);
  z-index: 100002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.faqnav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- パネル ---------- */
.faqnav-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100003;
  width: min(430px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px) - env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(28, 28, 28, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.faqnav-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- パネルヘッダー ---------- */
.faqnav-head {
  background: #ffffff;
  color: #1c1c1c;
  padding: 22px 22px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid #1c1c1c;
}
.faqnav-head__title {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Shippori Mincho B1", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.28em;
  margin: 0;
  display: block;
  white-space: nowrap;
  color: #1c1c1c;
}
.faqnav-head__sub {
  display: block;
  font-family: "Century Gothic", "Inter", Helvetica, sans-serif;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.32em;
  color: #888888;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100vw - 120px);
}
.faqnav-close {
  background: transparent;
  border: none;
  color: #1c1c1c;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease;
}
.faqnav-close:hover { opacity: 0.5; }
.faqnav-close:focus-visible {
  outline: 1px solid #1c1c1c;
  outline-offset: 2px;
}

/* ---------- 本文スクロール領域 ---------- */
.faqnav-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 22px 26px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #d8d8d8 transparent;
}
.faqnav-body::-webkit-scrollbar { width: 4px; }
.faqnav-body::-webkit-scrollbar-thumb {
  background: #d8d8d8;
  border-radius: 2px;
}

/* あいさつ・注意書き */
.faqnav-greet {
  font-size: 15px;
  line-height: 2.0;
  color: #1c1c1c;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  word-break: normal;
  overflow-wrap: break-word;
}
.faqnav-note {
  font-size: 12px;
  line-height: 1.8;
  color: #888888;
  letter-spacing: 0.04em;
  margin: 0 0 22px;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ---------- 質問アイテム（ヘアライン区切りのリスト） ---------- */
.faqnav-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid #e5e1d8;
  border-radius: 0;
  margin: 0;
  overflow: hidden;
  transition: background 0.3s ease;
}
.faqnav-item:first-of-type {
  border-top: 1px solid #e5e1d8;
}
.faqnav-item.is-open {
  background: #faf9f5;
  border-bottom-color: #1c1c1c;
}

.faqnav-q {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 16px 4px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.faqnav-q:focus-visible {
  outline: 1px solid #1c1c1c;
  outline-offset: -1px;
}
.faqnav-q__badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #1c1c1c;
  color: #1c1c1c;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background 0.3s ease, color 0.3s ease;
}
.faqnav-item.is-open .faqnav-q__badge {
  background: #1c1c1c;
  color: #ffffff;
}
.faqnav-q__text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: 0.05em;
  color: #1c1c1c;
  word-break: normal;
  overflow-wrap: break-word;
}
.faqnav-q__mark {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 300;
  color: #888888;
  line-height: 1.6;
  transition: transform 0.35s ease, color 0.3s ease;
}
.faqnav-item.is-open .faqnav-q__mark {
  color: #1c1c1c;
  transform: rotate(180deg);
}

/* ---------- 回答（なめらかに開閉） ---------- */
.faqnav-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.faqnav-item.is-open .faqnav-a {
  grid-template-rows: 1fr;
}
.faqnav-a__wrap {
  overflow: hidden;
  min-height: 0;
}
.faqnav-a__inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 4px 20px;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s;
}
.faqnav-item.is-open .faqnav-a__inner {
  opacity: 1;
}
.faqnav-a__badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #c5b98f;
  color: #ffffff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.faqnav-a__text {
  flex: 1;
  font-size: 16px;
  line-height: 2.0;
  letter-spacing: 0.04em;
  color: #1c1c1c;
  word-break: normal;
  overflow-wrap: break-word;
}
.faqnav-a__link {
  display: block;
  margin-top: 14px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #1c1c1c;
  text-decoration: none;
  text-align: center;
  padding: 11px 18px;
  background: #ffffff;
  border: 1px solid #1c1c1c;
  border-radius: 1px;
  transition: background 0.3s ease, color 0.3s ease;
}
.faqnav-a__link:hover {
  background: #1c1c1c;
  color: #ffffff;
}

/* ---------- スマホ調整 ---------- */
@media (max-width: 480px) {
  .faqnav-btn {
    right: 16px;
    bottom: 92px;
    width: 80px;
    height: 80px;
  }
  .faqnav-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
  }
  .faqnav-head { padding: 18px 18px 14px; }
  .faqnav-body { padding: 16px 18px 22px; }
}
