@charset "utf-8";

/*ローディング*/

#loading {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: grid;
  place-items: center;
  transition: opacity 0.8s ease;
}

#loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  position: relative;
  width: 80px;
  inset: 0;
  margin: auto;
  z-index: 2;
  animation: logoFade 1.8s ease-in-out infinite;
}

.loading-logo img {
  width: 100%;
  position: relative;
  z-index: 2;
  transition:
    transform 0.8s ease,
    opacity 0.6s ease;
  transform-origin: center;
}

.ripple {
  position: absolute;
  inset: 0;
  margin: auto;
  border: 2px solid #e94709;
  border-radius: 50%;
  animation: ripple 1.8s ease-out infinite;
  z-index: 1;
}

.ripple2 {
  animation-delay: 1.2s;
  opacity: 0.6;
}

#loading.is-hidden {
  opacity: 0;
  transition: opacity 0.6s ease;
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes logoFade {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

/*ファーストビュー*/

.fv-wrap {
  height: 180vh; /* ← ここで“霞が晴れる時間”を決める */
}

.first_view {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.first_view_back {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.first_view_back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.first_view_logo {
  position: absolute;
  width: 8rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.fv-mist {
  position: absolute;
  inset: 0;
  z-index: 2;
  filter: blur(50px);
  pointer-events: none;
  display: block;
}

/*キャッチコピー*/

.copy_inner {
  margin-top: 30rem;
  display: flex;
  gap: 5rem;
  position: relative;
  max-height: 80vh;
}

.copy_image {
  width: 40%;
  max-height: 70vh;
}

.copy_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.copy_catch {
  writing-mode: vertical-rl;
  line-height: 2.5em;
  letter-spacing: 0.2em;
  margin: 0 4em 0 auto;
  z-index: 1;
  font-size: 1.7rem;
}

.copy_back {
  position: absolute;
  right: 8%;
  bottom: 0%;
  width: 45%;
  opacity: 0.3;
}

/*ご由緒*/

.history_inner {
  margin-top: 25rem;
  position: relative;
}

.history_image {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history_image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url(../images/index/history.jpg);
  background-position: center;
  background-size: cover;

  opacity: 0.5;
  clip-path: inset(0 50% 0 50%);
  transform: scale(1.05);

  transition:
    clip-path 1.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 1.8s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;

  z-index: 0;
}


.history_image > * {
  position: relative;
  z-index: 1;
}

.history_image:has(.history_button:hover)::before {
  opacity: 1;
}

.history_button {
  position: relative;
  transform: none;
  display: flex;
  align-items: center;
}

.button_p {
  writing-mode: vertical-rl;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.4em;
  padding: 40px 85px;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.5);
  margin-left: 30px;
}

.button_more {
  display: inline-flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.15em;
  padding: 2px 15px;
  border: 1px solid #595857;
  border-radius: 15px;
  position: relative;
  margin-left: -20%;
  background-image: linear-gradient(#595857, #595857);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0% 100%;
  color: #333;
  background-origin: border-box;
  background-clip: padding-box;
}

.button_more_arrow {
  position: absolute;
  left: 100%;
  top: 50%;
  width: 45px;
  height: 2px;
  background-color: #595857;
  transform: translateY(-50%);
  margin-left: -7px;
}

.button_more_arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 2px solid #595857;
  border-right: 2px solid #595857;

  transform: translateY(-50%) rotate(45deg);
}

.history_button a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.history_button:hover .button_more {
  background-size: 100% 100%;
  color: #fff;
  border-color: #595857;
}

.history_button:hover .button_more_arrow {
  background-color: #fff;
}

.history_button:hover .button_more_arrow::after {
  border-color: #fff;
}

.button_more,
.button_more_arrow,
.button_more_arrow::after {
  transition:
    background-size 0.35s ease,
    background-color 0.3s ease,
    color 0.35s ease,
    border-color 0.35s ease;
}

.history_catch {
  position: absolute;
  bottom: -15rem;
  left: 8rem;
  writing-mode: vertical-rl;
  line-height: 2.2em;
  letter-spacing: 0.2em;
  font-size: 1.5rem;
  text-shadow: 0px 0px 10px rgba(255, 255, 255, 1);
}

/*境内のご案内*/

.precincts_inner {
  margin-top: 25rem;
  position: relative;
}

.precincts_image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60vh;
  min-height: 400px;
}

.precincts_image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url(../images/index/precincts.jpg);
  background-position: center;
  background-size: cover;

  opacity: 0.5;
  clip-path: inset(0 50% 0 50%);
  transform: scale(1.05);

  transition:
    clip-path 1.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 1.8s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;

  z-index: 0;
}


.precincts_image > * {
  position: relative;
  z-index: 1;
}

.precincts_image:has(.precincts_button:hover)::before {
  opacity: 1;
}

.precincts_button {
  position: relative;
  transform: none;
  display: flex;
  align-items: center;
}

.precincts_button_p {
  writing-mode: vertical-rl;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.2em;
  padding: 1px 90px;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.5);
  margin-left: 30px;
}

.button_more {
  display: inline-flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.15em;
  padding: 2px 15px;
  border: 1px solid #333;
  border-radius: 15px;
  position: relative;
  margin-left: -20%;
  background-image: linear-gradient(#595857, #595857);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0% 100%;
  color: #333;
  background-origin: border-box;
  background-clip: padding-box;
}

.button_more_arrow {
  position: absolute;
  left: 100%;
  top: 50%;
  width: 45px;
  height: 2px;
  background-color: #595857;
  transform: translateY(-50%);
  margin-left: -7px;
}

.button_more_arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 2px solid #595857;
  border-right: 2px solid #595857;

  transform: translateY(-50%) rotate(45deg);
}

.precincts_button a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.precincts_button:hover .button_more {
  background-size: 100% 100%;
  color: #fff;
  border-color: #595857;
}

.precincts_button:hover .button_more_arrow {
  background-color: #fff;
}

.precincts_button:hover .button_more_arrow::after {
  border-color: #fff;
}

.button_more,
.button_more_arrow,
.button_more_arrow::after {
  transition:
    background-size 0.35s ease,
    background-color 0.3s ease,
    color 0.35s ease,
    border-color 0.35s ease;
}

.precincts_catch {
  position: absolute;
  bottom: -15rem;
  left: 8rem;
  writing-mode: vertical-rl;
  line-height: 2.2em;
  letter-spacing: 0.2em;
  font-size: 1.5rem;
  text-shadow: 0px 0px 10px rgba(255, 255, 255, 1);
}

/* 共通アイコン */

.index_icon {
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-left: 6rem;
  margin-right: 2rem;
}

.index_icon img {
  width: 80px;
}

.index_icon h4 {
  font-size: 1.2rem;
  white-space: nowrap;
  margin-top: 1.3rem;
  letter-spacing: 0.1em;
}

/*きまちゃんの紹介*/

.character_inner {
  margin-top: 30rem;
  display: flex;
  position: relative;
  justify-content: center;
  gap: 3rem;
}

.index_icon,
.character_sentence {
  max-width: 70%;
}

.character_sentence {
  font-size: 20px;
  max-width: 60%;
}

.character_sentence_border {
  border-bottom: 1px dashed;
  padding-bottom: 1em;
}

.character_link {
  margin-top: 2em;
  display: flex;
  gap: 3rem;
  justify-content: center;
  font-size: 16px;
}

.character_link p {
  padding: 10px 16px;
  border: 1px solid #595857;
  border-radius: 30px;
  background-color: transparent;
  color: #131314;
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: color 0.2s ease;
}

.character_link p::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: #595857;
  z-index: -1;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.character_link p:hover::before {
  width: 100%;
}

.character_link p:hover {
  color: #fff;
  transition-delay: 0.18s;
  /* ← 背景が少し進んでから文字反転 */
}

.character_image {
  width: 15%;
  position: relative;
  transform: translateY(-120px);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.character_image.is-show {
  opacity: 1;
  transform: translateY(0);
}

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

/*お知らせ*/

.news_inner {
  margin-top: 15rem;
  display: flex;
  position: relative;
  justify-content: center;
  gap: 4rem;
}

.news_list {
  margin: 0;
  width: 100%;
}

.news_list_item {
  padding: 20px 0;
  border-bottom: 1px dashed;
}

.news_list_item:first-child {
  border-top: 1px dashed;
}

.news_list_item a {
  position: relative;
  display: flex;
  padding-right: 30px;
}

.news_list_date {
  font-size: 16px;
  display: flex;
  margin-right: 15px;
  align-items: center;
}

.news_list_item p {
  font-size: 16px;
  font-style: normal;
}

.news_item {
  background: #f6c6a2;
  border-radius: 14px;
  width: 6em;
  text-align: center;
  margin-left: 20px;
}

.news_more {
  position: absolute;
  right: 5rem;
  bottom: -40px;
  text-align: right;
}

/*参拝者へのおねがい*/

.guidelines_inner {
  margin-top: 15rem;
  display: flex;
  position: relative;
  justify-content: center;
  gap: 4rem;
}

.guidelines_catch {
  font-size: 20px;
  border-bottom: 1px dashed;
  padding-bottom: 10px;
  font-weight: bold;
  line-height: 1.5;
}

.guidelines_list {
  margin-top: 20px;
  margin-left: 20px;
}

.guidelines_list li {
  list-style: disc;
  margin: 0.5em;
  font-size: 16px;
  font-weight: normal;
}

.guidelines_icon {
  display: flex;
  justify-content: left;
  gap: 1rem;
  margin-top: 30px;
}

.guidelines_icon img {
  width: 100px;
}

/*画像挿入*/

.last-image {
  width: 100%;
  margin-top: 400px;
}

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

@media screen and (max-width: 800px) {
  /*ファーストビュー*/
  .first_view_back {
    display: none;
  }

  .first_view {
    background-image: url(../images/index/top_main.jpg);
    background-position: center;
    background-size: cover;
  }

  .first_view_logo {
    position: absolute;
    width: 6rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  /*キャッチコピー*/

  .copy_inner {
    margin-top: 200px;
    display: flex;
    gap: 1rem;
    position: relative;
  }

  .copy_image {
    width: 60%;
  }

  .copy_catch {
    writing-mode: vertical-rl;
    line-height: 1.5em;
    letter-spacing: 0.2em;
    margin: 0 2em 0 auto;
    z-index: 1;
    font-size: 18px;
  }

  .copy_back {
    position: absolute;
    right: 15%;
    bottom: 0%;
    width: 55%;
    opacity: 0.3;
  }

  /*ご由緒*/
  .history_inner {
    margin-top: 100px;
  }

  .history_image {
    height: 40vh;
    min-height: 300px;
  }

  .history_image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 100px;
    background-color: #595857;
    transform: translateX(-50%);
  }

  .history_image::before {
    opacity: 1;
  }

  .button_p {
    font-size: 18px;
    letter-spacing: 0.2em;
    padding: 8px 32px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    margin-left: 0;
  }

  .history_more_wrap {
    display: flex;
    justify-content: center;
    position: relative;
    margin-top: 30px;
  }

  .button_more {
    position: relative;
    margin-left: 0;
    font-size: 16px;
    font-weight: bold;
    padding: 1px 7px;
  }

  .history_more_wrap::before {
    content: "";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 30px;
    background-color: #595857;
  }

  .button_more_arrow {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(8px, -50%);
    margin-left: -12px;
    width: 25px;
  }

  .button_more_arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-top: 2px solid #595857;
    border-right: 2px solid #595857;

    transform: translateY(-50%) rotate(45deg);
  }

  .history_button a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .button_more,
  .button_more_arrow,
  .button_more_arrow::after {
    transition:
      background-size 0.35s ease,
      background-color 0.3s ease,
      color 0.35s ease,
      border-color 0.35s ease;
  }

  .history_catch {
    position: absolute;
    bottom: -22rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    line-height: 2em;
    letter-spacing: 0.2em;
    font-size: 18px;
  }

  /*境内のご案内*/
  .precincts_inner {
    margin-top: 400px;
  }

  .precincts_image {
    height: 40vh;
    min-height: 300px;
  }

  .precincts_image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 100px;
    background-color: #595857;
    transform: translateX(-50%);
  }

  .precincts_image::before {
    opacity: 1;
  }

  .precincts_button_p {
    font-size: 14px;
    letter-spacing: 0em;
    padding: 1px 35px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    margin-left: 0;
  }

  .precincts_more_wrap {
    display: flex;
    justify-content: center;
    position: relative;
    margin-top: 30px;
  }

  .button_more {
    position: relative;
    margin-left: 0;
    font-size: 16px;
    font-weight: bold;
    padding: 1px 7px;
  }

  .precincts_more_wrap::before {
    content: "";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 30px;
    background-color: #595857;
  }

  .button_more_arrow {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(8px, -50%);
    margin-left: -12px;
    width: 25px;
  }

  .button_more_arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-top: 2px solid #595857;
    border-right: 2px solid #595857;

    transform: translateY(-50%) rotate(45deg);
  }

  .precincts_button a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .button_more,
  .button_more_arrow,
  .button_more_arrow::after {
    transition:
      background-size 0.35s ease,
      background-color 0.3s ease,
      color 0.35s ease,
      border-color 0.35s ease;
  }

  .precincts_catch {
    position: absolute;
    bottom: -25rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    line-height: 2em;
    letter-spacing: 0.2em;
    font-size: 18px;
  }

  /*きまちゃんの紹介*/

  .section-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px;
  }

  .character_inner {
    margin-top: 500px;
    flex-direction: column;
    align-items: center;
  }

  .index_icon {
    order: 1;
    margin: 0;
  }

  .character_sentence {
    order: 2;
    max-width: 100%;
    font-size: 16px;
  }

  .character_link {
    order: 3;
  }

  .character_btn {
    font-size: 15px;
  }

  .character_image {
    order: 4;
    width: 40%;
    transform: none;
    margin-top: -1rem;
  }

  /*お知らせ*/

  .news_inner {
    margin-top: 200px;
    flex-direction: column;
    align-items: center;
  }

  .news_list {
    order: 2;
    width: 100%;
    max-width: 90%;
  }

  .news_list_item a {
    flex-direction: column;
    padding-right: 0;
  }

  .news_list_item p {
    font-size: 16px;
  }

  .news_list_date {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .news_more {
    order: 3;
    position: static;
    text-align: center;
  }

  /*ご参拝の方へのお願い*/

  .guidelines_inner {
    margin-top: 200px;
    flex-direction: column;
    align-items: center;
  }

  .guidelines_section {
    order: 2;
  }

  .guidelines_catch {
    font-size: 16px;
  }

  .guidelines_list li {
    font-size: 16px;
  }

  .guidelines_icon {
    width: 100%;
    margin-top: 20px;
    justify-content: center;
  }

  .guidelines_icon img {
    width: 50px;
  }

  /*画像挿入*/
  .last-image {
    margin-top: 100px;
  }
}

/* JS用 */
.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.char.is-show {
  opacity: 1;
  transform: translateY(0);
}

.history_image.is-active::before,
.precincts_image.is-active::before {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

.history_image::after,
.precincts_image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15); /* ← 初期の薄さ */
  opacity: 1;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.history_image:has(.history_button:hover)::after,
.precincts_image:has(.precincts_button:hover)::after {
  opacity: 0; /* ← hoverで画像がくっきり */
}

.history_image,
.precincts_image {
  position: relative;
  overflow: hidden;
}

.history_image > *,
.precincts_image > * {
  position: relative;
  z-index: 2;
}
