/* Header */
.header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1000;
  width: 100%;
  color: #fff;
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 400;

  @media screen and (min-width: 1024px) {
    position: fixed;
    transition: background-color 0.2s ease;

    &.is-scrolled {
      background-color: rgba(0, 0, 0, 0.55);
    }
  }

  /* H1 非表示（視覚的に非表示、読み上げ対象は維持） */
  .h1-dn {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

.header__inner {
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 80px;
  margin-inline: auto;
  padding: 20px 16px;

  @media screen and (min-width: 769px) {
    gap: 20px;
    min-height: 96px;
    padding: 24px;
  }

  @media screen and (min-width: 1024px) {
    gap: 24px;
    min-height: 112px;
    padding: 43px clamp(24px, 2.2vw, 40px);
  }
}

/* ロゴ */
.header__logo {
  position: relative;
  z-index: 101;
  flex-shrink: 0;
  width: 164px;

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

  @media screen and (min-width: 769px) {
    width: clamp(164px, 18vw, 200px);
  }

  @media screen and (min-width: 1024px) {
    width: clamp(160px, 17.4vw, 350px);
  }
}

/* PCナビ：1024px以上で表示 */
.header__nav {
  display: none;

  @media screen and (min-width: 1024px) {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(8px, 1vw, 20px);
    min-width: 0;
  }
}

.header__nav-item {
  flex-shrink: 0;
  width: auto;
  margin: 0;
  padding: 0;
}

.header__nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;

  @media (hover: hover) {
    &:hover { opacity: 0.7; }
  }

  &:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
  }
}

.header__nav-text {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.04em;
  white-space: nowrap;

  @media screen and (min-width: 1024px) {
    font-size: clamp(10px, 0.85vw, 14px);
  }
}

/* ハンバーガー：SP・タブレットで表示 */
.header__hamburger {
  position: fixed;
  top: 18px;
  right: 16px;
  z-index: 101;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 54px;
  height: 44px;
  padding: 13px 12px;
  border-radius: 4px;
  background-color: #665f53;
  cursor: pointer;

  &.is-open .header__hamburger-line:nth-child(1) {
    transform: translateY(8.39px) rotate(45deg);
  }

  &.is-open .header__hamburger-line:nth-child(2) {
    opacity: 0;
  }

  &.is-open .header__hamburger-line:nth-child(3) {
    transform: translateY(-8.39px) rotate(-45deg);
  }

  &:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
  }

  @media screen and (min-width: 769px) {
    top: 26px;
    right: 24px;
  }

  @media screen and (min-width: 1024px) {
    display: none;
  }
}

.header__hamburger-line {
  display: block;
  width: 100%;
  height: 1.22px;
  background-color: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
/* ========================================
   SP・タブレットナビ
======================================== */

.header__sp-nav {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100dvh;
  padding: 100px 20px 40px;
  overflow-y: auto;
  background-color: #665f53;

  /* 初期状態は非表示 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ハンバーガーメニューを開いたとき */
.header__sp-nav.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* PCでは非表示 */
@media screen and (min-width: 1024px) {
  .header__sp-nav {
    display: none;
  }
}

/* ナビ一覧 */
.header__sp-nav-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin-block: auto;
}

/* 各ナビ項目 */
.header__sp-nav-item {
  width: 100%;
  text-align: center;
}

/* ナビリンク */
.header__sp-nav-link {
  display: block;
  width: 100%;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .header__sp-nav-link:hover {
    opacity: 0.7;
  }
}

.header__sp-nav-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* ナビテキスト */
.header__sp-nav-text {
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: "Shippori Mincho", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-align: center;
}

/* ========================================
   Floating Buttons
======================================== */
.floating {
  position: relative;
  z-index: 900;
}

.floating__link {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  text-decoration: none;

  &::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 25px;
    height: 25px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;

    @media screen and (min-width: 1024px) {
      width: 30px;
      height: 30px;
    }
  }

  &:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
  }

  @media (hover: hover) {
    transition: opacity 0.3s ease;
    &:hover { opacity: 0.8; }
  }
}

/* PC追従ボタンの文字 */
.floating__pc .floating__text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  letter-spacing: 0.05em;
 
}
/* アイコン */
.floating__pc-item--line .floating__link::before,
.floating__sp-item--line .floating__link::before {
  background-image: url("/system_panel/uploads/images/icon_line.png");
}

.floating__pc-item--reserve .floating__link::before,
.floating__sp-item--reserve .floating__link::before {
  background-image: url("/system_panel/uploads/images/icon_calendar.png");
}

.floating__sp-item--tel .floating__link::before {
  background-image: url("/system_panel/uploads/images/icon_tel.png");
}
/* ========================================
   PC追従バナー
======================================== */

.floating__pc {
  display: none;
}

@media screen and (min-width: 1024px) {
  .floating__pc {
    position: fixed;
    top: var(--floating-pc-top, 870px);
    right: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 90px;
    transform: none;
  }

  .floating__pc-item {
    flex: 0 0 260px;
    width: 90px;
    height: 260px;
    overflow: hidden;
    border-radius: 10px 0 0 10px;
  }
}

.floating__pc-item--line {
  background-color: #665f53;
}

.floating__pc-item--reserve {
  background-color: #b58b9a;
}

.floating__pc .floating__link {
  flex-direction: column;
  gap: 16px;
  padding: 20px 10px;
}
/* PC追従ボタンの文字 */
.floating__pc .floating__text {
  margin: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
}


/* SP・タブレットフローティング：基本スタイル */
.floating__sp {
  box-sizing: border-box;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  height: calc(70px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);

  @media screen and (min-width: 1024px) {
    display: none;
  }
}

.floating__sp-item {
  min-width: 0;
  height: 100%;
}

.floating__sp-item--line {
  background-color: #665f53;
}

.floating__sp-item--reserve {
  background-color: #b58b9a;
}

.floating__sp-item--tel {
  background-color: #f2f0ef;

  .floating__link,
  .floating__text { color: #665f53; }
}

.floating__sp .floating__link {
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
}

.floating__sp .floating__text {
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

/* 電話リンクの文字色を白文字指定より優先 */
.floating__sp-item--tel .floating__text {
  color: #665f53;
}

/* 下部固定ボタンにコンテンツが隠れないようにする */
body {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));

  @media screen and (min-width: 769px) {
    /* タブレットも下部固定ボタンのため余白を維持 */
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  @media screen and (min-width: 1024px) {
    padding-bottom: 0;
  }
}

/* 固定ボタン用の余白はフッター内で確保する */
@media screen and (max-width: 1023px) {
  body:has(.footer) {
    padding-bottom: 0;
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .header__hamburger-line,
  .header__nav-link,
  .header__sp-nav,
  .header__sp-nav-link,
  .floating__link {
    transition: none;
  }
}
/* ========================================
   PC中間幅：追従ボタンを縮小
======================================== */

@media screen and (min-width: 1024px) and (max-width: 1199px) {
  .floating__pc {
    width: 65px;
  }

  .floating__pc-item {
    width: 65px;
    height: 210px;
    flex-basis: 210px;
  }

  .floating__pc .floating__text {
    font-size: 14px;
  }

  .floating__pc .floating__link::before {
    width: 24px;
    height: 24px;
  }
}
