/* =========================================
   common site header
   - 全ページ共通で使うヘッダー
   - ローカルヘッダーより白く・軽く・上品に
========================================= */

.site-common-header {
  position: relative;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 108, 189, 0.08);
  box-shadow: 0 6px 18px rgba(15, 108, 189, 0.06);
}

.site-common-header__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-common-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
  text-decoration: none;
}

.site-common-header__logo-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15,108,189,0.08), rgba(26,53,125,0.08));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.site-common-header__logo-wrap.is-text-only {
  display: none;
}

.site-common-header__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-common-header__brand-text {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f6cbd;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-common-header__nav {
  flex: 1;
  min-width: 0;
}

.site-common-header__nav-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.site-common-header__nav-item {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.site-common-header__nav-link {
  position: relative;
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #223047;
  text-decoration: none;
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.site-common-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: #0f6cbd;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.site-common-header__nav-link:hover {
  color: #0f6cbd;
}

.site-common-header__nav-link:hover::after {
  transform: scaleX(1);
}

.site-common-header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e2a12f 0%, #d9901f 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(217, 144, 31, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.site-common-header__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217, 144, 31, 0.26);
  opacity: 1;
}

/* =========================================
   SWELL標準ヘッダーを LP系ページでは隠す
========================================= */

.home .l-header,
.home #fix_header,
.home .p-breadcrumb,
.page-template-page-segment-personal .l-header,
.page-template-page-segment-personal #fix_header,
.page-template-page-segment-personal .p-breadcrumb,
.page-template-page-excelai .l-header,
.page-template-page-excelai #fix_header,
.page-template-page-excelai .p-breadcrumb,
.page-template-page-segment-corporate .l-header,
.page-template-page-segment-corporate #fix_header,
.page-template-page-segment-corporate .p-breadcrumb {
  display: none !important;
}

/* =========================================
   local header
   - ページ専用ヘッダー
   - 共通ヘッダーより濃色・細身で差別化
========================================= */

.local-header {
  position: relative;
  z-index: 900;
  background: linear-gradient(180deg, #0b2f55 0%, #123d6b 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.local-header__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.local-header__link {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.94;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.local-header__link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* =========================================
   tablet
========================================= */

@media screen and (max-width: 1180px) {
  .site-common-header__inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .site-common-header__brand {
    width: 100%;
    justify-content: center;
  }

  .site-common-header__nav {
    width: 100%;
    order: 3;
  }

  .site-common-header__nav-list {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .site-common-header__cta {
    min-height: 42px;
    padding: 0 20px;
  }
}

/* =========================================
   mobile
========================================= */

@media screen and (max-width: 767px) {
  .site-common-header__inner {
    padding: 12px 16px;
    gap: 14px;
  }

  .site-common-header__brand {
    width: 100%;
    justify-content: center;
  }

  .site-common-header__brand-text {
    font-size: 16px;
  }

  .site-common-header__logo-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .site-common-header__nav {
    width: 100%;
  }

  .site-common-header__nav-list {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .site-common-header__nav-link {
    font-size: 13px;
    line-height: 1.3;
  }

  .site-common-header__cta {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  .local-header__inner {
    gap: 10px 14px;
    padding: 10px 16px;
  }

  .local-header__link {
    font-size: 13px;
  }
}

/* =========================================
   sticky settings
   共通ヘッダー + ローカルヘッダー
========================================= */

/* 高さの基準値 */
:root {
  --wp-adminbar-height-desktop: 32px;
  --wp-adminbar-height-mobile: 46px;

  --site-common-header-height-desktop: 72px;
  --site-common-header-height-mobile: 112px;

  --local-header-height-desktop: 52px;
  --local-header-height-mobile: 48px;
}

/* 共通ヘッダー */
.site-common-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 108, 189, 0.08);
  box-shadow: 0 6px 18px rgba(15, 108, 189, 0.06);
}

/* 管理バーが出ている時は下げる */
body.admin-bar .site-common-header {
  top: var(--wp-adminbar-height-desktop);
}

/* ローカルヘッダー */
.local-header {
  position: sticky;
  top: var(--site-common-header-height-desktop);
  z-index: 1090;
  background: linear-gradient(180deg, #0b2f55 0%, #123d6b 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* 管理バーが出ている時は、共通ヘッダーのさらに下 */
body.admin-bar .local-header {
  top: calc(var(--wp-adminbar-height-desktop) + var(--site-common-header-height-desktop));
}

/* sticky時に本文が潜り込みすぎないようにしたい場合の微調整用 */
.top-lp,
.lp-personal,
.lp-excelai,
.lp-corporate {
  position: relative;
  z-index: 1;
}

/* =========================================
   desktop / tablet 共通ヘッダー見た目
========================================= */

.site-common-header__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  min-height: var(--site-common-header-height-desktop);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-common-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
  text-decoration: none;
}

.site-common-header__logo-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15,108,189,0.08), rgba(26,53,125,0.08));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.site-common-header__logo-wrap.is-text-only {
  display: none;
}

.site-common-header__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-common-header__brand-text {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f6cbd;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-common-header__nav {
  flex: 1;
  min-width: 0;
}

.site-common-header__nav-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.site-common-header__nav-item {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.site-common-header__nav-link {
  position: relative;
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #223047;
  text-decoration: none;
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.site-common-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: #0f6cbd;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.site-common-header__nav-link:hover {
  color: #0f6cbd;
}

.site-common-header__nav-link:hover::after {
  transform: scaleX(1);
}

.site-common-header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e2a12f 0%, #d9901f 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(217, 144, 31, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.site-common-header__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217, 144, 31, 0.26);
  opacity: 1;
}

/* ローカルヘッダー見た目 */
.local-header__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  min-height: var(--local-header-height-desktop);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.local-header__link {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.94;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.local-header__link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* =========================================
   SWELL標準ヘッダーを LP系ページでは隠す
========================================= */

.home .l-header,
.home #fix_header,
.home .p-breadcrumb,
.page-template-page-segment-personal .l-header,
.page-template-page-segment-personal #fix_header,
.page-template-page-segment-personal .p-breadcrumb,
.page-template-page-excelai .l-header,
.page-template-page-excelai #fix_header,
.page-template-page-excelai .p-breadcrumb,
.page-template-page-segment-corporate .l-header,
.page-template-page-segment-corporate #fix_header,
.page-template-page-segment-corporate .p-breadcrumb {
  display: none !important;
}

/* =========================================
   tablet
========================================= */

@media screen and (max-width: 1180px) {
  :root {
    --site-common-header-height-desktop: 112px;
  }

  .site-common-header__inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .site-common-header__brand {
    width: 100%;
    justify-content: center;
  }

  .site-common-header__nav {
    width: 100%;
    order: 3;
  }

  .site-common-header__nav-list {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .site-common-header__cta {
    min-height: 42px;
    padding: 0 20px;
  }
}

/* =========================================
   mobile
========================================= */

@media screen and (max-width: 782px) {
  body.admin-bar .site-common-header {
    top: var(--wp-adminbar-height-mobile);
  }

  body.admin-bar .local-header {
    top: calc(var(--wp-adminbar-height-mobile) + var(--site-common-header-height-mobile));
  }
}

@media screen and (max-width: 767px) {
  :root {
    --site-common-header-height-mobile: 112px;
    --local-header-height-mobile: 48px;
  }

  .site-common-header__inner {
    padding: 12px 16px;
    min-height: var(--site-common-header-height-mobile);
    gap: 14px;
  }

  .site-common-header__brand {
    width: 100%;
    justify-content: center;
  }

  .site-common-header__brand-text {
    font-size: 16px;
  }

  .site-common-header__logo-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .site-common-header__nav {
    width: 100%;
  }

  .site-common-header__nav-list {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .site-common-header__nav-link {
    font-size: 13px;
    line-height: 1.3;
  }

  .site-common-header__cta {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  .local-header {
    top: var(--site-common-header-height-mobile);
  }

  .local-header__inner {
    min-height: var(--local-header-height-mobile);
    gap: 10px 14px;
    padding: 10px 16px;
  }

  .local-header__link {
    font-size: 13px;
  }
}