/* 貴船神社を参考：写真を画面いっぱいに、ゆっくり拡大しながら切り替え */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-slideshow {
  width: 100%;
  margin: 0;
  background: var(--gray-2, #d9d9d6);
}

.hero-viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.hero-slide-fill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 0.4rem;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: cover;
  color: #333;
  text-align: center;
  transform: scale(1);
  transition: transform 5s linear;
}

/* 写真の全面に薄い黒の網掛け。社名・キャプションは上に載せる */
.hero-slide-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.hero-slide-fill.is-zoom {
  transform: scale(1.03);
}

/* 写真差し込み前の仮色：グレー基調＋緑み */
.hero-slide:nth-child(1) .hero-slide-fill {
  background-color: var(--gg-2, #d4dbd3);
}

.hero-slide:nth-child(2) .hero-slide-fill {
  background-color: var(--gray-2, #d9d9d6);
}

.hero-slide:nth-child(3) .hero-slide-fill {
  background-color: var(--gg-3, #a7b3a6);
}

.hero-slide:nth-child(4) .hero-slide-fill {
  background-color: var(--gray-3, #a8a8a4);
}


.hero-line {
  position: absolute;
  right: 40px;
  top: 62%;
  z-index: 2;
  width: 1px;
  height: 0;
  background: #fff;
  pointer-events: none;
  transition: height 5s linear;
}

.hero-line.is-grown {
  height: 160px;
}

.hero-caption {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  margin: 0;
  color: #fff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px #000;
}

.hero-controls {
  position: absolute;
  right: 28px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.hero-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-shadow: 0 0 8px #000;
}

.hero-dots {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hero-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid #fff;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
}

.hero-dot.is-active {
  background: #fff;
}

/* トップ：ヘッダーを写真の上に重ね、スクロール後も右上に残す */
body.is-home #site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  width: 100%;
}

body.is-home .site-header {
  color: #fff;
  /* 社名は非表示のため、言語切替とハンバーガーを右端へ */
  justify-content: flex-end;
  gap: 0.4rem;
}

/* トップではヘッダーの神社名（ロゴ）は出さない */
body.is-home .site-brand {
  display: none;
}

/* スライドショーに重ねるロゴ。神紋は上、社名揮毫の左右に縦書きナビ */
.hero-logo {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.275rem;
  margin: 0;
  padding: 0;
  border: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* 社名揮毫の表示高さ。ナビの「薩」位置合わせにも使う */
  --hero-name-height: clamp(21rem, 63vh, 33rem);
}

/* 左3項目・社名・右3項目。クリックはナビのみ有効 */
.hero-brand-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 72px;
}

.hero-side-nav {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 72px;
  margin: 0;
  /* 揮毫画像の「薩」上端（299/5368）に項目の頭を合わせる */
  padding: calc(var(--hero-name-height) * 299 / 5368) 0 0;
  list-style: none;
  pointer-events: auto;
}

.hero-side-nav li {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 0.7;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.hero-side-nav a {
  display: inline-block;
  position: relative;
  padding: 0;
  line-height: inherit;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  transform-origin: center center;
  transition: transform 0.35s ease;
}

/* ホバー中：項目の上下に赤みのある金の線が伸びる */
.hero-side-nav a::before,
.hero-side-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 0;
  background: var(--gold-warm);
  transform: translateX(-50%);
  pointer-events: none;
  transition: height 0.35s ease;
}

.hero-side-nav a::before {
  bottom: calc(100% + 0.45rem);
}

.hero-side-nav a::after {
  top: calc(100% + 0.45rem);
}

.hero-side-nav a:hover,
.hero-side-nav a:focus-visible {
  transform: scale(1.08);
}

.hero-side-nav a:hover::before,
.hero-side-nav a:hover::after,
.hero-side-nav a:focus-visible::before,
.hero-side-nav a:focus-visible::after {
  height: 2.75rem;
}

/* 英語は単語を横向きのまま縦に流す。字間は和文より詰める */
html[lang="en"] .hero-side-nav li {
  letter-spacing: 0.06em;
}

.hero-logo-crest {
  display: block;
  /* 従来の 4.75rem を 1.5 倍 */
  width: 7.125rem;
  height: auto;
  /* 墨の重心が画像中心より約 5.3px 左 → 見た目の中心を軸に合わせる */
  transform: translateX(calc(5.27 / 768 * 100%));
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.35));
}

.hero-logo-name {
  margin: 0;
}

.hero-logo-name-img {
  display: block;
  width: auto;
  /* 従来の clamp(14rem, 42vh, 22rem) を 1.5 倍 */
  height: var(--hero-name-height);
  /* 文字（墨）の重心が画像中心より約 18.7px 左 → 文字の中心線で神紋と揃える */
  transform: translateX(calc(18.7 / 1181 * 100%));
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
}

/* ヘッダー右の言語切替は黒塗り。メニュー内の切替には当てない */
body.is-home .site-header-tools > .lang-switch {
  color: #fff;
  background: rgba(26, 26, 26, 0.9);
  border: 0;
  text-shadow: none;
}

body.is-home .hero-slideshow {
  height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide-fill,
  .hero-line,
  .hero-side-nav a,
  .hero-side-nav a::before,
  .hero-side-nav a::after {
    transition: none;
  }

  .hero-side-nav a:hover,
  .hero-side-nav a:focus-visible {
    transform: none;
  }

  .hero-slide-fill.is-zoom {
    transform: none;
  }
}

@media (max-width: 800px) {
  .hero-viewport {
    height: 78vh;
    min-height: 420px;
  }

  body.is-home .hero-slideshow {
    height: auto;
  }

  /* 中央寄せだと神紋がヘッダーに食われるので、上端をヘッダーの下から始める */
  .hero-logo {
    top: 5.5rem;
    transform: translateX(-50%);
    gap: 1.05rem;
    --hero-name-height: clamp(15rem, 46vh, 23rem);
  }

  /* スマホは項目をハンバーガーへ移すので、揮毫の左右ナビは出さない */
  .hero-side-nav {
    display: none;
  }

  .hero-brand-row {
    gap: 0;
  }

  .hero-logo-crest {
    /* 従来の 3.75rem を 1.5 倍 */
    width: 5.625rem;
  }
}
