@charset "utf-8";

/* 共通レイアウト幅 */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5rem;
}

/*共通クラス*/

.history_sec {
  width: 100%;
  max-width: 144rem;
  padding: 0 8%;
  margin: 0 auto;
  margin-bottom: 5rem;
}

.history_inner {
  display: flex;
  margin-top: 100px;
}

.history_head {
  flex: 0 0 26%;
  display: flex;
  justify-content: center;
}

.h_head {
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.16em;
  padding: 2.4rem 1rem 0 0;
  writing-mode: vertical-rl;
  position: relative;
}

.h_head::before {
  content: "";
  display: block;
  position: absolute;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  top: 0.9rem;
  left: 0.6rem;
  background-color: #e94709;
}

.history_image {
  width: calc(50vw + 32.8%);
  overflow: hidden;
}

.history_image img {
  object-fit: cover;
}

/*ご祭神*/

.deity {
  margin-top: 15rem;
}

.deity_body {
  width: 74%;
}

.deity_list {
  margin-top: 5rem;
}

.deity_line {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.deity_cel {
  padding: 2rem 2.5rem;
  border-right: 1px dashed #595857;
  border-bottom: 1px dashed #595857;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.deity_cel h4 span {
  font-size: 20px;
  line-height: 1.6;
}

.deity_cel p {
  letter-spacing: 0.04em;
  line-height: 1.6;
  margin-top: 1.2rem;
}

.deity_cel:nth-child(2n + 1) {
  border-left: 1px dashed #595857;
}

.deity_cel::before,
.deity_cel::after {
  content: "";
  position: absolute;
  width: 10px;
  /* ← 角だけ覆う */
  height: 10px;
  background-color: #f7f7f7;
  z-index: 1;
}

.deity_cel::before {
  bottom: -1px;
  left: -1px;
}

.deity_cel::after {
  bottom: -1px;
  right: -1px;
}

.deity_cel span::before,
.deity_cel span::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f7f7f7;
  z-index: 1;
}

.deity_cel span::before {
  top: -1px;
  left: -1px;
}

.deity_cel span::after {
  top: -1px;
  right: -1px;
}

.deity_cel::before,
.deity_cel::after {
  border-radius: 2px;
}

.deity_cel--no-border {
  border-bottom: none;
}

hr {
  height: 2px;
  background-color: #595857;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border: none;
}

/*ご由緒*/

.history {
  margin-top: 15rem;
}

.history_body {
  width: 74%;
}

.history_sentence {
  margin-top: 2rem;
}

.history_text {
  line-height: 2.4;
}

/*歳時記*/

.fes {
  margin-top: 15rem;
}

.fes_body {
  width: 74%;
}

.fes_list {
  margin-top: 5rem;
}

.fes h4 {
  font-size: 1.6rem;
  margin-bottom: 1em;
}

.fes_line {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 6rem;
}

.fes_line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  border-left: 1px dashed #595857;
  z-index: 0;
}

.fes_line_item {
  position: relative;
  padding-bottom: 2.5rem;
  margin-bottom: 4rem;
}

.fes_line_item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-bottom: 1px dashed #595857;
  z-index: 2;
}

/* 左カラム */

.fes_cel:nth-child(odd) {
  grid-column: 1;
}

/* 右カラム */
.fes_cel:nth-child(even) {
  grid-column: 2;
}

/* 左カラム：右端で縦線を消す */
.fes_cel:nth-child(odd) .fes_line_item::before {
  content: "";
  position: absolute;
  right: -3rem;
  bottom: -7px;
  width: 20px;
  height: 14px;
  background: #f7f7f7;
  z-index: 3;
  pointer-events: none;
}

/* 右カラム：左端で縦線を消す */
.fes_cel:nth-child(even) .fes_line_item::before {
  content: "";
  position: absolute;
  left: -4rem;
  bottom: -7px;
  width: 20px;
  height: 14px;
  background: #f7f7f7;
  z-index: 3;
  pointer-events: none;
}

.fes_text {
  margin-top: 1rem;
}

.fes_text_item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.fes_cel {
  display: flex;
  flex-direction: column;
}

/* 左カラム */
.fes_cel:nth-child(odd) {
  margin-top: 0;
}

/* 右カラム */
.fes_cel:nth-child(even) {
  margin-top: 6rem;
}

/* 左カラム（奇数） */
.fes_monthly:nth-child(odd) .fes_line_item::before {
  content: "";
  position: absolute;
  right: -3rem;
  /* 縦線の位置 */
  top: calc(100% - 7px);
  /* 横線位置 */
  width: 20px;
  height: 10vh;
  /* 下方向すべて */
  background: #f7f7f7;
  z-index: 3;
  pointer-events: none;
}

/* 右カラム（偶数） */
.fes_monthly:nth-child(even) .fes_line_item::before {
  content: "";
  position: absolute;
  left: -4rem;
  top: calc(100% - 7px);
  width: 20px;
  height: 10vh;
  background: #f7f7f7;
  z-index: 3;
  pointer-events: none;
}

/*行事説明*/

.tradition {
  display: flex;
  flex-direction: column;
  gap: 7rem;
  margin-left: 15rem;
  margin-top: 5rem;
}

.tradition h4 {
  font-size: 1.6rem;
  margin-bottom: 1em;
}

.tradition p {
  line-height: 1.8;
}

.tradition_simple .tradition_inner {
  display: block;
}

.tradition_1 {
  position: relative;
  padding-left: 15%;
}

.tradition_1_text {
  margin-left: auto;
  width: 65%;
}

.tradition_1_image {
  position: absolute;
  left: 0;
  top: -1rem;
  width: 40%;
}

.tradition_1_image_2 {
  position: absolute;
  top: 14rem;
  left: 20rem;
  width: 45%;
}

.tradition_2--offset {
  margin-top: 25rem;
}

.tradition_2.tradition_simple {
  position: relative;
}

.tradition_3 {
  position: relative;
}

.tradition_3_text {
  margin-right: auto;
  width: 55%;
}

.tradition_3_image1 {
  position: absolute;
  top: 1rem;
  right: 4rem;
  width: 35%;
}

.tradition_3_image2 {
  position: absolute;
  top: 16rem;
  left: -2rem;
  width: 65%;
}

.tradition_3_image3 {
  position: absolute;
  right: 3rem;
  top: 21rem;
  width: 30%;
}

.tradition_3--offset {
  margin-top: 25rem;
}

.tradition_4 {
  position: relative;
}

.tradition_4 .tradition_inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: auto auto 1fr;
  column-gap: 3rem;
  row-gap: 2rem;
  align-items: start;
}

.tradition_4_head {
  grid-column: 1 / -1;
}

.tradition_4_image1 {
  grid-column: 1;
  grid-row: 2 / span 2;
  z-index: 1;
  position: relative;
  left: -2rem;
}

.tradition_4_image1 img {
  width: 70%;
  display: block;
}

.tradition_4_image2 {
  grid-column: 2;
  grid-row: 2;
  margin-top: -3rem;
  width: 120%;
  position: relative;
  left: -60%;
}

.tradition_4_image2 img {
  width: 100%;
  display: block;
  position: relative;
  top: -3rem;
}

.tradition_4_text {
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
  position: relative;
  left: -9rem;
  top: -4rem;
}

/*JS用*/

/*画像１*/

.history_image_inner {
  position: relative;
  overflow: hidden;
}

/* スライドマスク */
.history_image_inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #f7f7f7;
  /* ページ背景色 */
  transform: translateX(0);
  /* 左端にマスク */
  transition: transform 1.6s ease;
  z-index: 2;
}

/* 画像 */
.history_image_inner img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1.05);
  /* 少し拡大させる */
  transition: transform 1.6s ease;
}

/* スクロールで表示 */
.history_image_inner.is-active::before {
  transform: translateX(100%);
  /* マスクが右にスライドして消える */
}

.history_image_inner.is-active img {
  transform: scale(1);
  /* 画像を元の大きさに戻す */
}

.js-slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.js-slide-left.is-show {
  opacity: 1;
  transform: translateX(0);
}

/*タイトル*/

/* 初期：ぼやけ＋少し下 */
.h_head {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(12px);
  transition:
    opacity 1.1s ease,
    filter 1.1s ease,
    transform 1.1s ease;
}

/* 表示 */
.h_head.is-show {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}


/*画像２*/

.tradition img {
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.08);
  transition:
    opacity 1.2s ease,
    filter 1.2s ease,
    transform 1.2s ease;
}

/* 表示状態 */
.tradition img.is-show {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}


/*===========レスポンシブ==========*/

@media screen and (max-width: 800px) {

  /* 共通レイアウト幅 */
  .section-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
  }

  /*ご祭神*/

  .history_sec {
    padding: 0 5%;
  }

  .history_inner {
    flex-direction: column;
    margin-top: 60px;
  }

  .history_head {
    flex: none;
    justify-content: flex-start;
    margin-bottom: 2rem;
  }

  .h_head {
    writing-mode: horizontal-tb;
    font-size: 1.6rem;
    padding: 0;
  }

  .h_head::before {
    top: 50%;
    left: -1.2rem;
    transform: translateY(-50%);
  }

  .history_body {
    width: 100%;
  }

  .history_image {
    width: 100%;
  }

  .history_image img {
    width: 100%;
    height: auto;
  }

  .deity_body {
    width: 100%;
  }

  .deity_line {
    grid-template-columns: 1fr;
  }

  .deity_cel {
    border-left: 1px dashed #595857;
    border-right: 1px dashed #595857;
  }

  .deity_cel h4 span:empty {
    display: none;
  }

  .deity_cel h4 span:empty+.deity_name {
    border-bottom: none;
  }

  .deity_cel:has(h4 span:empty) {
    border-bottom: none;
  }

  .deity_list .deity_cel:first-of-type {
    border-bottom: 1px dashed #595857;
  }

  /*歳時記*/

  .fes_body {
    width: 100%;
  }

  .fes_line {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .fes_cel:nth-child(odd),
  .fes_cel:nth-child(even) {
    grid-column: 1;
    margin-top: 0;
  }

  .fes_line::before {
    display: none;
  }

  .fes_line_item::before {
    display: none;
  }

  .fes_cel {
    margin-top: 0 !important;
  }

  .fes_line_item::after {
    border-bottom: 1px dashed #595857;
  }

  /*歳時記説明*/

  .tradition {
    margin-left: 0;
  }

  .tradition_1 {
    padding-left: 0;
  }

  .tradition_1_text {
    margin: 0 auto;
    width: 100%;
  }

  .tradition_1_image,
  .tradition_1_image_2,
  .tradition_3_image1,
  .tradition_3_image2,
  .tradition_3_image3,
  .tradition_4_image1,
  .tradition_4_image2 {
    position: static !important;
    width: 100%;
    margin-top: 1.5rem;
    left: auto;
    right: auto;
    top: auto;
  }

  .tradition_4 .tradition_inner {
    display: block;
  }

  .tradition_4_head,
  .tradition_4_text,
  .tradition_4_image1,
  .tradition_4_image2 {
    grid-column: auto;
    grid-row: auto;
    position: static;
    left: auto;
    top: auto;
    margin-top: 1.5rem;
    width: 100%;
  }

  .tradition_4_image1+.tradition_4_image2 {
    margin-top: 4rem;
  }

  .tradition_2--offset,
  .tradition_3--offset {
    margin-top: 0;
  }

  .tradition_3_text {
    width: 100%;
  }

  .tradition_inner {
    display: block;
  }

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

  /*JS用*/
  .tradition img {
    filter: blur(6px);
    transform: scale(1.04);
    transition-duration: 0.8s;
  }
}