/**
 * トップページ（index.html）と同系のヘッダー・フッター
 * 下層ページで body に .page-shell-sub を付与して読み込む
 */

/* --- リセット（シェル範囲のみ干渉） --- */
body.page-shell-sub {
  font-family: "Noto Sans JP", sans-serif;
  color: #393939;
  /* ページ地はトップと同じ白。グレーは .article-header-full-width--shell の帯のみ */
  background-color: #fff;
  /* ヘッダー（.header-main-inner / .header-sub）と同じコンテナ幅 */
  --shell-max: 1360px;
  --shell-pad: 40px;
}

body.page-shell-sub .header a {
  color: inherit;
  text-decoration: none;
}

/* --- ヘッダー --- */
body.page-shell-sub .header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  margin-bottom: 0;
}

body.page-shell-sub .header.scrolled .header-sub-wrapper {
  height: 0;
  opacity: 0;
}

body.page-shell-sub .header-inner {
  width: 100%;
}

body.page-shell-sub .header-sub-wrapper {
  height: 28px;
  background-color: #f0f0f0;
  overflow: hidden;
  transition: height 0.2s ease-out, opacity 0.2s ease-out;
  opacity: 1;
}

body.page-shell-sub .header-sub {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
}

body.page-shell-sub .header-sub-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1em;
  font-size: 12px;
  color: #393939;
  font-weight: 500;
}

body.page-shell-sub .header-tagline {
  font-size: 12px;
  color: #393939;
  letter-spacing: 0.04em;
  margin-right: auto;
  padding-bottom: 2px;
}

body.page-shell-sub .header-sub a {
  color: #393939;
  text-decoration: underline;
}

body.page-shell-sub .header-sub a:hover {
  text-decoration: none;
}

body.page-shell-sub .header-main {
  height: 72px;
  background-color: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(57, 57, 57, 0.1);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-shell-sub .header-main-inner {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 3em;
}

body.page-shell-sub .header-logo {
  padding-bottom: 4px;
}

body.page-shell-sub .header-logo img {
  height: 20px;
  width: auto;
  display: block;
}

/*
 * テーマ先頭の emanon リセットに nav { display:block } があり、
 * 詳細度・読み込み順によっては .header-nav 内の flex が効かず、
 * トップ（index 専用CSS）と CTA の位置がズレる。トップと同じ見え方に固定する。
 */
body.page-shell-sub .header-main-inner > nav.header-nav {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  justify-content: flex-start !important;
}

body.page-shell-sub .header-nav-links {
  display: flex;
  align-items: center;
  gap: 2em;
  flex-shrink: 0;
}

body.page-shell-sub .header-nav-links a {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.3s;
  color: #393939;
}

body.page-shell-sub .header-nav-links a:hover {
  opacity: 0.7;
}

/*
 * テーマ共通CSSに .header-cta { position:absolute; right:0 } があり、
 * カスタムヘッダー内の「お問い合わせ」が flex から外れて位置が狂うため打ち消す。
 */
body.page-shell-sub .header-nav .header-cta {
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 120px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 1px;
  margin-left: auto !important;
  flex-shrink: 0;
  background-color: #3c37a0;
  color: #fff !important;
  border: 1px solid #3c37a0;
  border-radius: 0;
  font-weight: 600 !important;
  font-size: 12px;
  transition: all 0.3s;
}

body.page-shell-sub .header-nav .header-cta:hover {
  opacity: 0.9;
}

body.page-shell-sub .hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* トップは button に style="display:none" あり。デスクトップで第3子が残ると flex 幅が変わる */
@media (min-width: 960px) {
  body.page-shell-sub .header-main-inner .hamburger-btn {
    display: none !important;
  }
}

body.page-shell-sub .hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #393939;
  margin: 3px 0;
  transition: all 0.3s;
}

/* --- フッター --- */
body.page-shell-sub .footer.shell-footer {
  background-color: #393939;
  color: #fff;
  padding: 80px 0 0;
}

body.page-shell-sub .footer.shell-footer .footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

body.page-shell-sub .footer.shell-footer .footer-main {
  display: flex;
  gap: 120px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  align-items: flex-end;
  justify-content: space-between;
}

body.page-shell-sub .footer.shell-footer .footer-brand {
  width: 320px;
  flex-shrink: 0;
  text-align: right;
}

body.page-shell-sub .footer.shell-footer .footer-logo {
  height: 18px;
  margin-bottom: 0;
}

body.page-shell-sub .footer.shell-footer .footer-nav {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

body.page-shell-sub .footer.shell-footer .footer-nav-section {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 20px;
}

body.page-shell-sub .footer.shell-footer .footer-nav-title {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}

body.page-shell-sub .footer.shell-footer .footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.page-shell-sub .footer.shell-footer .footer-nav-list a {
  font-size: 12px;
  line-height: 1.4;
  color: #fff;
  opacity: 0.8;
  text-decoration: none;
  letter-spacing: 0.04em;
}

body.page-shell-sub .footer.shell-footer .footer-nav-list a:hover {
  color: #fff;
  opacity: 1;
}

body.page-shell-sub .footer.shell-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0;
}

body.page-shell-sub .footer.shell-footer .footer-copyright {
  font-size: 11px;
  color: #fff;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

body.page-shell-sub .footer.shell-footer .footer-links {
  display: flex;
  gap: 24px;
}

body.page-shell-sub .footer.shell-footer .footer-links a {
  font-size: 11px;
  color: #fff;
  opacity: 0.8;
  text-decoration: none;
  letter-spacing: 0.04em;
}

body.page-shell-sub .footer.shell-footer .footer-links a:hover {
  opacity: 1;
}

/* --- ページ見出し帯：このブロックだけ背景 #f0f0f0（ページ地・本文は #fff）
   wp-custom-css の .article-header-full-width__inner { transform: translate(-50%,100%) } は
   サムネイル無しだとタイトルが帯の外に落ちるため、シェルでは通常フローに戻す。 --- */
body.page-shell-sub #contents .article-header-full-width.article-header-full-width--shell {
  height: auto !important;
  background: #f0f0f0 !important;
  margin: 0;
  position: relative;
  overflow: visible;
  display: flex !important;
  flex-direction: column !important;
  /* 縦：中身のブロックを帯の「上〜下パディング上」エリアの中央に置く（flex:1 子だと上寄りになりやすい） */
  justify-content: center !important;
  align-items: stretch !important;
  min-height: 268px !important;
  /* 下部の英字スラッグ（::before / 高さ約80px）用 */
  padding-bottom: 96px !important;
  box-sizing: border-box !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .u-background-cover::after,
body.page-shell-sub #contents .article-header-full-width--shell .article-header-full-width__thumbnail {
  display: none !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .article-header-full-width__inner {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--shell-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  z-index: 100;
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  padding: 0 var(--shell-pad) !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .article-header-full-width__inner .l-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .article-title {
  justify-content: flex-start !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .article-title::before {
  width: auto !important;
  margin-right: 0.35em !important;
}

/* パンくず：ヘッダーと同じ左右位置 */
body.page-shell-sub #contents > .breadcrumb {
  box-sizing: border-box;
  max-width: var(--shell-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 16px !important;
  margin-bottom: 16px !important;
  padding-left: var(--shell-pad) !important;
  padding-right: var(--shell-pad) !important;
}

/* パンくず：ホームアイコン用 span を非表示（Top テキストのみ・左詰め） */
body.page-shell-sub #contents .breadcrumb .breadcrumb__item:first-child a > span:first-of-type {
  display: none !important;
}

body.page-shell-sub #contents .breadcrumb .breadcrumb-home {
  margin-left: 0 !important;
}

/* メインカラム：.l-content の calc(100% - 40px) 等をやめてヘッダーと揃える */
body.page-shell-sub #contents > .l-content {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: var(--shell-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--shell-pad) !important;
  padding-right: var(--shell-pad) !important;
}

body.page-shell-sub #contents > .l-content .l-content__inner {
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: none !important;
}

/* EPB 内の本文幅をコンテナ内いっぱいに（1180 だとだけ細く見える） */
@media screen and (min-width: 1200px) {
  body.page-shell-sub #contents .epb-background {
    --epb-content-width: 1280px;
  }

  /* テーマの ::before { right: 0 } だとスラッグがビューポート右端に寄り、本文とズレる */
  body.page-shell-sub #contents .article-header-full-width--shell::before {
    right: max(var(--shell-pad), calc((100% - var(--shell-max)) / 2 + var(--shell-pad))) !important;
    transform: none !important;
  }
}

/* タイトル：帯と同色 + wp の巨大 padding を打ち消し */
body.page-shell-sub #contents .article-header-full-width--shell .article-title-area {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: block !important;
  width: 100% !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .article-title,
body.page-shell-sub #contents .article-header-full-width--shell .article-title::before,
body.page-shell-sub #contents .article-header-full-width--shell .article-title span {
  color: #393939 !important;
}

body.page-shell-sub #contents .article-header-full-width--shell .article-title span {
  background-color: transparent !important;
  border: 1px solid rgba(57, 57, 57, 0.22);
  font-weight: 500;
}

/* --- レスポンシブ --- */
@media (max-width: 959px) {
  body.page-shell-sub {
    --shell-pad: 16px;
  }

  body.page-shell-sub .header-sub-wrapper {
    display: none !important;
  }

  body.page-shell-sub .header-main {
    height: 60px !important;
  }

  body.page-shell-sub .header-main-inner {
    padding: 0 16px !important;
    gap: 0 !important;
    justify-content: space-between;
  }

  body.page-shell-sub .header-logo img {
    height: 18px !important;
  }

  body.page-shell-sub .header-nav {
    display: none !important;
  }

  body.page-shell-sub .hamburger-btn {
    display: flex !important;
  }

  body.page-shell-sub .footer.shell-footer .footer-container {
    padding: 0 20px;
  }

  body.page-shell-sub .footer.shell-footer .footer-main {
    flex-direction: column;
    gap: 32px;
    padding: 40px 0 32px;
    align-items: flex-start;
  }

  body.page-shell-sub .footer.shell-footer .footer-brand {
    width: 100%;
    text-align: left;
    order: 2;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  body.page-shell-sub .footer.shell-footer .footer-nav {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 24px;
    order: 1;
  }

  body.page-shell-sub .footer.shell-footer .footer-nav-section {
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 0;
    padding-bottom: 16px;
  }

  body.page-shell-sub .footer.shell-footer .footer-nav-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  body.page-shell-sub .footer.shell-footer .footer-bottom {
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    text-align: center;
  }

  body.page-shell-sub .footer.shell-footer .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  body.page-shell-sub #contents .article-header-full-width.article-header-full-width--shell {
    min-height: 240px !important;
    padding-bottom: 88px !important;
  }

  body.page-shell-sub #contents .article-header-full-width--shell .article-header-full-width__inner {
    padding: 0 var(--shell-pad) !important;
  }
}

@media (max-width: 768px) {
  body.page-shell-sub {
    --shell-pad: 20px;
  }

  body.page-shell-sub .header-main-inner {
    padding: 0 20px !important;
  }
}
