/* =========================
   Base
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background: #f7f3ec;
  color: #15110c;
  font-family:
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "YuGothic",
    sans-serif;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* =========================
   Header
========================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  padding: 14px 18px;
  pointer-events: none;
}

.site-header__inner {
  width: min(1180px, 100%);
  min-height: 66px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid rgba(70, 50, 25, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: 0 18px 44px rgba(45, 30, 12, 0.10);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

/* logo */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #14110d;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #b72d28;
  color: #fffaf2;
  font-family:
    "Yu Mincho",
    "YuMincho",
    "Hiragino Mincho ProN",
    serif;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(183, 45, 40, 0.22);
}

.site-logo__text {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.site-logo__text strong {
  font-family:
    "Yu Mincho",
    "YuMincho",
    "Hiragino Mincho ProN",
    serif;
  font-size: 17px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.site-logo__text small {
  color: rgba(20, 17, 13, 0.58);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

/* nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: rgba(20, 17, 13, 0.78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: #b72d28;
}

.site-nav__contact {
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #13233b;
  color: #fff !important;
}

/* menu button */
.site-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #13233b;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.site-menu-btn span {
  position: absolute;
  left: 13px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transition:
    transform 0.25s ease,
    top 0.25s ease;
}

.site-menu-btn span:first-child {
  top: 17px;
}

.site-menu-btn span:last-child {
  top: 27px;
}

body.is-menu-open .site-menu-btn span:first-child {
  top: 22px;
  transform: rotate(45deg);
}

body.is-menu-open .site-menu-btn span:last-child {
  top: 22px;
  transform: rotate(-45deg);
}

/* =========================
   Header Mobile
========================= */

@media (max-width: 768px) {
  html {
    scroll-padding-top: 86px;
  }

  .site-header {
    padding: 10px;
  }

  .site-header__inner {
    min-height: 58px;
    padding: 0 8px 0 12px;
    border-radius: 22px;
  }

  .site-logo {
    gap: 10px;
  }

  .site-logo__mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .site-logo__text strong {
    font-size: 14px;
  }

  .site-logo__text small {
    font-size: 9px;
  }

  .site-menu-btn {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 10px;
    right: 10px;
    display: grid;
    gap: 0;
    padding: 10px;
    border: 1px solid rgba(70, 50, 25, 0.12);
    border-radius: 24px;
    background: rgba(255, 250, 242, 0.96);
    box-shadow: 0 20px 48px rgba(45, 30, 12, 0.14);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.25s ease,
      visibility 0.25s ease,
      transform 0.25s ease;
  }

  body.is-menu-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    font-size: 14px;
  }

  .site-nav a + a {
    border-top: 1px solid rgba(70, 50, 25, 0.08);
  }

  .site-nav__contact {
    margin-top: 8px;
    min-height: 48px;
  }
}

/* =========================
   TOPだけ：ヘッダー透明 → スクロールで通常色
========================= */

.site-header{
  transition:
    background .35s ease,
    box-shadow .35s ease,
    border-color .35s ease,
    backdrop-filter .35s ease;
}

/* TOPページの初期状態だけ透明 */
body.is-top:not(.is-scrolled) .site-header{
  background: transparent;
  box-shadow: none;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

/* TOPページでスクロール後は通常ヘッダー */
body.is-top.is-scrolled .site-header{
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  border-bottom-color: rgba(255,255,255,.35);
}

/* 透明時に文字が見えにくい場合 */
body.is-top:not(.is-scrolled) .site-nav a,
body.is-top:not(.is-scrolled) .site-logo__text,
body.is-top:not(.is-scrolled) .site-logo__text strong,
body.is-top:not(.is-scrolled) .site-logo__text small{
  color: #fff;
}

/* 透明時のロゴ丸 */
body.is-top:not(.is-scrolled) .site-logo__mark{
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.35);
}

/* 透明時のお問い合わせボタン */
body.is-top:not(.is-scrolled) .site-nav__contact{
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.35);
}

/* スクロール後は元の色に戻す */
body.is-top.is-scrolled .site-nav a,
body.is-top.is-scrolled .site-logo__text,
body.is-top.is-scrolled .site-logo__text strong,
body.is-top.is-scrolled .site-logo__text small{
  color: inherit;
}

/* =========================
   TOPだけ：最初はヘッダー完全透明
========================= */

/* 変化をなめらかに */
.site-header,
.site-header__inner{
  transition:
    background .35s ease,
    box-shadow .35s ease,
    border-color .35s ease,
    backdrop-filter .35s ease;
}

/* TOPページ・スクロール前：外側も内側も透明 */
body.is-top:not(.is-scrolled) .site-header{
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
}

body.is-top:not(.is-scrolled) .site-header__inner{
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
}

/* TOPページ・スクロール後：今のアイボリーに戻す */
body.is-top.is-scrolled .site-header__inner{
  background: rgba(235, 228, 216, .92);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
}

/* 透明時の文字色 */
body.is-top:not(.is-scrolled) .site-logo__text strong,
body.is-top:not(.is-scrolled) .site-logo__text small,
body.is-top:not(.is-scrolled) .site-nav a{
  color: #fff !important;
}

/* 透明時のロゴ丸 */
body.is-top:not(.is-scrolled) .site-logo__mark{
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35) !important;
}

/* 透明時のお問い合わせボタン */
body.is-top:not(.is-scrolled) .site-nav__contact{
  background: rgba(255,255,255,.16) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.32) !important;
}

/* =========================
   Header 白背景を消す
========================= */

/* 外側の白背景を消す */
body.is-top.is-scrolled .site-header{
  background: transparent !important;
  box-shadow: none !important;
  border-bottom-color: transparent !important;
}

/* 内側のアイボリーだけ残す */
body.is-top.is-scrolled .site-header__inner{
  background: rgba(235, 228, 216, .92) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.12) !important;
  backdrop-filter: blur(18px) !important;
}

/* TOP以外の記事ページなども外側は透明 */
body:not(.is-top) .site-header{
  background: transparent !important;
  box-shadow: none !important;
}

/* TOP以外は内側だけアイボリー */
body:not(.is-top) .site-header__inner{
  background: rgba(235, 228, 216, .92) !important;
}

/* =========================
   Hamburger Menu Fix
========================= */

.site-header{
  pointer-events: auto;
}

.site-header__inner{
  position: relative;
}

.site-menu-btn{
  position: relative;
  z-index: 1002;
}

@media (max-width: 768px){
  .site-nav{
    z-index: 1001;
    pointer-events: none;
  }

  body.is-menu-open .site-nav{
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
}

/* =========================
   TOP透明時でもメニュー内は見えるようにする
========================= */

@media (max-width: 768px){

  /* メニューを開いた時の背景 */
  body.is-top:not(.is-scrolled).is-menu-open .site-nav,
  body.is-top:not(.is-scrolled) .site-header.is-open .site-nav{
    background: rgba(255, 250, 242, 0.98) !important;
    border: 1px solid rgba(70, 50, 25, 0.12) !important;
    box-shadow: 0 20px 48px rgba(45, 30, 12, 0.14) !important;
    backdrop-filter: blur(14px) !important;
  }

  /* メニュー内の通常リンクは黒に戻す */
  body.is-top:not(.is-scrolled).is-menu-open .site-nav a,
  body.is-top:not(.is-scrolled) .site-header.is-open .site-nav a{
    color: #15110c !important;
  }

  /* お問い合わせボタンだけ白文字のまま */
  body.is-top:not(.is-scrolled).is-menu-open .site-nav__contact,
  body.is-top:not(.is-scrolled) .site-header.is-open .site-nav__contact{
    background: #13233b !important;
    color: #fff !important;
    border-color: transparent !important;
  }
}