/*
  file: header-nav.css
  scope: global header/nav
  purpose:
  - site header
  - logo
  - contact/tel
  - nav bars
*/

body.site-theme-conversion .tp-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1;
}

/* ヘッダー横長ロゴ（.tp-site-logo__img）は除外。小アイコンのみ 44px 固定 */
body.site-theme-conversion .tp-logo-icon,
body.site-theme-conversion .tp-logo-img:not(.tp-site-logo__img) {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 44px;
  display: inline-block;
}

body.site-theme-conversion .tp-site-header .tp-site-logo,
body.site-theme-conversion .tp-header .tp-site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.site-theme-conversion .tp-site-header .tp-site-logo .tp-logo-text,
body.site-theme-conversion .tp-header .tp-site-logo .tp-logo-text {
  display: inline-block;
  white-space: nowrap;
}

body.site-theme-conversion .tp-site-header .tp-site-logo__img,
body.site-theme-conversion .tp-site-header .tp-logo-img.tp-site-logo__img,
body.site-theme-conversion .tp-header .tp-site-logo__img,
body.site-theme-conversion .tp-header .tp-logo-img.tp-site-logo__img {
  display: block;
  width: auto;
  max-width: var(--site-logo-max-width, 210px);
  max-height: var(--site-logo-max-height, 80px);
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

body.site-theme-conversion .tp-logo-text {
  display: inline-block;
}

@media (max-width: 700px) {
  body.site-theme-conversion .tp-logo-wrap {
    gap: 8px;
  }

  body.site-theme-conversion .tp-logo-icon,
  body.site-theme-conversion .tp-logo-img:not(.tp-site-logo__img) {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  body.site-theme-conversion .tp-site-header .tp-site-logo__img,
  body.site-theme-conversion .tp-site-header .tp-logo-img.tp-site-logo__img,
  body.site-theme-conversion .tp-header .tp-site-logo__img,
  body.site-theme-conversion .tp-header .tp-logo-img.tp-site-logo__img {
    max-width: min(var(--site-logo-max-width, 210px), 160px);
    max-height: min(var(--site-logo-max-height, 80px), 60px);
  }
}

/* ----- 公開サイトヘッダー：横長ロゴの寸法固定（home/list-cards を統合・後読みでも確実に効く） ----- */
body.site-theme-conversion .tp-site-header img.tp-site-logo__img,
body.site-theme-conversion .tp-site-header .tp-site-logo__img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: var(--site-logo-max-width, 210px) !important;
  max-height: var(--site-logo-max-height, 80px) !important;
  object-fit: contain !important;
}

body.site-theme-conversion .tp-site-header .tp-logo-img:not(.tp-site-logo__img) {
  width: 44px !important;
  height: 44px !important;
}

@media (max-width: 700px) {
  body.site-theme-conversion .tp-site-header .tp-logo-img:not(.tp-site-logo__img) {
    width: 34px !important;
    height: 34px !important;
  }
}

/*
 * styles.css の body.site-theme-conversion .tp-logo { font-size: clamp(38px,…) } が、
 * 画像未取得時の alt および横並びの .tp-logo-text に継承され過大表示になるのを防ぐ。
 */
body.site-theme-conversion .tp-site-header a.tp-logo.tp-site-logo:has(img.tp-site-logo__img) {
  font-size: 0;
  line-height: 0;
  letter-spacing: 0;
}

body.site-theme-conversion .tp-site-header a.tp-logo.tp-site-logo img.tp-site-logo__img {
  font-size: clamp(12px, 2.5vw, 16px);
}

/* 横長ロゴ表示時は視覚的に img と重複するテキストを隠す（アクセシビリティ用 span は残す） */
body.site-theme-conversion .tp-site-header .tp-site-logo img.tp-site-logo__img ~ .tp-logo-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- 公開ヘッダーナビ：ドロップダウン整理（2026-06） ----- */
.tp-site-header__inner,
.tp-header-inner,
.tp-nav-bar,
.tp-nav.tp-nav--desktop {
  box-sizing: border-box;
}

.tp-nav-bar,
.tp-nav--desktop {
  overflow: visible;
}

.tp-nav-bar__mobile-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tp-nav-mobile-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d9f99d;
  background: #ffffff;
  color: #061735;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.tp-nav-mobile-top-link:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--tp-lime, #84cc16), var(--tp-lime-dark, #57b500));
  border-color: var(--tp-lime-dark, #57b500);
}

@media (min-width: 769px) {
  .tp-nav-mobile-top-link {
    display: none;
  }
}

.tp-nav-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.tp-nav-dropdown__summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #dfe8d4;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(20, 40, 0, 0.08);
  user-select: none;
}

.tp-nav-dropdown__summary::-webkit-details-marker {
  display: none;
}

.tp-nav-dropdown__caret {
  font-size: 10px;
  line-height: 1;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.tp-nav-dropdown[open] .tp-nav-dropdown__caret {
  transform: rotate(180deg);
}

.tp-nav-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 196px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  z-index: 300;
  flex-direction: column;
  gap: 6px;
}

.tp-nav-dropdown[open] .tp-nav-dropdown__menu {
  display: flex;
}

.tp-nav-dropdown__menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #dfe8d4;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(20, 40, 0, 0.06);
}

.tp-nav-dropdown__menu a:hover,
.tp-nav-dropdown__menu a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--tp-lime, #84cc16), var(--tp-lime-dark, #57b500));
  border-color: var(--tp-lime-dark, #57b500);
}

.tp-nav-dropdown__summary:hover,
.tp-nav-dropdown__summary.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--tp-lime, #84cc16), var(--tp-lime-dark, #57b500));
  border-color: var(--tp-lime-dark, #57b500);
}

body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__summary {
  padding: 10px 14px;
  border: 1px solid #d9f99d;
  background: #ffffff;
  color: #061735;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__summary:hover,
body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__summary.is-active {
  background: linear-gradient(135deg, #84cc16, #57b500);
  color: #ffffff;
  border-color: #57b500;
  box-shadow: 0 10px 24px rgba(87, 181, 0, 0.22);
}

body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__menu a {
  border: 1px solid #d9f99d;
  background: #ffffff;
  color: #061735;
  font-weight: 900;
}

body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__menu a:hover,
body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__menu a.is-active {
  background: linear-gradient(135deg, #84cc16, #57b500);
  color: #ffffff;
  border-color: #57b500;
}

@media (min-width: 1200px) {
  .tp-nav,
  .tp-nav--desktop,
  .tp-nav-bar,
  body.site-theme-conversion .tp-nav--desktop,
  body:has(.tp-home-hero) .tp-nav--desktop {
    overflow-x: visible;
    overflow-y: visible;
  }
}

@media (max-width: 1199px) and (min-width: 901px) {
  .tp-nav,
  .tp-nav--desktop,
  body.site-theme-conversion .tp-nav--desktop,
  body:has(.tp-home-hero) .tp-nav--desktop {
    overflow-x: visible;
    overflow-y: visible;
    justify-content: center;
    flex-wrap: nowrap;
  }

  body.site-theme-conversion .tp-nav--desktop a,
  body.site-theme-conversion .tp-nav--desktop .tp-nav-dropdown__summary {
    padding: 10px 12px;
    font-size: 12px;
  }
}

.tp-nav--mobile-drawer .tp-nav-dropdown {
  width: 100%;
}

.tp-nav--mobile-drawer .tp-nav-dropdown__summary {
  width: 100%;
  justify-content: center;
}

.tp-nav--mobile-drawer .tp-nav-dropdown__menu {
  position: static;
  transform: none;
  min-width: 0;
  width: 100%;
  margin-top: 6px;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 0 0 4px;
}

.tp-nav--mobile-drawer .tp-nav-dropdown__menu a {
  width: 100%;
}

body.site-theme-conversion .tp-nav--desktop a[href*="contact"] {
  flex-shrink: 0;
}
