:root {
  --ink: #2e2a24;
  --text: #1f2b38;
  --red: #e85b55;
  --green: #4d9a4e;
  --yellow: #f0c937;
  --blue: #3d72b8;
  --purple: #8d68aa;
  --orange: #ee902f;
  --panel: rgba(255, 255, 255, 0.7);
  --paper: rgba(255, 253, 245, 0.72);
  --note: rgba(255, 243, 153, 0.42);
  --hand-font: "Hachi Maru Pop", "Yomogi", "Klee One", "Yuji Boku", "Tsukushi A Round Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "YuGothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: 84px;
  color: var(--ink);
  font-family: Hannotate SC, "tsukushimarugothic", "Yu Gothic", "YuGothic", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  mix-blend-mode: multiply;
  background: url("../img/common/background_full.jpg") top center / 100% auto repeat-y;
  opacity: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h2,
h3,
p {
  overflow-wrap: anywhere;
}

h2,
h3 {
  text-align: center;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(8px);
}

.logo {
  display: inline-block;
}

.site-logo-text {
  display: block;
  color: var(--blue);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav a {
  padding: 5px 13px;
  border: 3px solid var(--blue);
  border-radius: 999px 850px 980px 780px / 780px 990px 720px 960px;
  background: var(--paper);
  box-shadow: 1px 2px 0 rgba(61, 114, 184, 0.15);
  color: #334056;
  font-size: 13px;
  font-weight: 700;
}

.nav a:nth-child(2n) {
  border-color: var(--green);
}

.nav a:nth-child(3n) {
  border-color: var(--orange);
}

.nav a:nth-child(4n) {
  border-color: var(--purple);
}

.menu-button {
  display: none;
}

section {
  scroll-margin-top: 120px;
}

#about {
  padding: clamp(24px, 4vw, 44px);
}

.hero {
  display: grid;
  place-items: center;
  min-height: min(64vw, 400px);
  padding: clamp(18px, 4vw, 42px);
}

.hero-logo {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.home-hero {
  padding: 0 0 16px;
}

.home-hero .hero-logo {
  width: 100%;
}

.page-logo {
  display: block;
  width: fit-content;
  margin: 0 0 0 32px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.25;
}

.page-logo-iwakura {
  color: var(--orange);
}

.page-logo-sanshuji {
  color: var(--green);
}

.page-logo-profile {
  color: var(--purple);
}

.profile-title-bar {
  padding: clamp(18px, 4vw, 34px) clamp(18px, 5vw, 64px) 0;
}

.profile-title-bar .page-logo {
  margin: 0;
}

.room-hero {
  position: relative;
  height: 100px;
  overflow: hidden;
}

.room-hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.42);
  content: "";
}

.room-hero .page-logo {
  position: absolute;
  top: 50%;
  left: clamp(18px, 5vw, 64px);
  z-index: 2;
  width: fit-content;
  margin: 0;
  transform: translateY(-50%);
  filter: drop-shadow(0 3px 8px rgba(255, 255, 255, 0.72));
  font-size: clamp(30px, 4vw, 46px);
  white-space: nowrap;
  paint-order: stroke;
  -webkit-text-stroke: 10px white;
}

.page-hero-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.room-hero .page-hero-image {
  height: 100%;
}

.room-hero + #guide {
  margin-top: 0;
  margin-top:30px;
}

h2 {
  width: fit-content;
  margin: 8px auto;
  padding: 8px 20px 0;
  border: 4px solid rgba(238, 144, 47, 0.78);
  border-radius: 9px;
  background: var(--panel);
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.65;
  letter-spacing: 0.16em;
}

#about div,
.info-card,
.items,
#profile {
  color: var(--text);
  font-family: var(--hand-font);
  font-weight: 700;
}

#guide,
#about,
.items,
#gallery,
#profile,
.temple-profile,
.access-section,
.carousel-section,
.room-links,
.placeholder-page {
  width: 100%;
  width:90%;
  margin: 70px 0;
  margin:70px 5%;
  padding: clamp(28px, 5vw, 58px) clamp(18px, 5vw, 64px);
  background: var(--panel);
}

#guide,
.items,
#gallery,
.temple-profile,
.access-section,
.carousel-section,
.room-links,
.placeholder-page {
  text-align: center;
}

#profile > div,
.temple-copy,
.access-info,
.placeholder-box {
  background: var(--note);
  border-radius: 20px;
}

#about div {
  width: min(100%, 980px);
  max-width: none;
  margin: clamp(22px, 4vw, 36px) auto 0;
  padding: clamp(22px, 4vw, 40px) clamp(20px, 5vw, 58px);
  background: rgba(255, 243, 153, 0.48);
  border-radius: 20px;
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 2.05;
  text-align: left;
  letter-spacing: 0.03em;
}

#about p {
  margin: 0 0 0.95em;
}

#about p:nth-of-type(3),
#about p:nth-of-type(5),
#about p:nth-of-type(7) {
  margin-top: 1.45em;
}

#about p:last-child {
  margin-bottom: 0;
  text-align: right;
}

#guide {
  padding-inline: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 4vw, 48px);
  align-items: start;
  margin-top: clamp(28px, 5vw, 54px);
}

.info-card {
  border-radius: 20px;
  line-height: 1.9;
}

.info-card h3 {
  display: grid;
  place-items: center;
  width: clamp(120px, 14vw, 170px);
  aspect-ratio: 1;
  margin: 0 auto clamp(22px, 4vw, 38px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: #111;
  font-size: clamp(18px, 2.9vw, 24px);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.info-card.green h3 {
  background-image: url("../img/common/background_dot_pink.png");
}

.info-card.yellow h3 {
  background-image: url("../img/common/background_dot_yellow.png");
}

.info-card.red h3 {
  background-image: url("../img/common/background_dot_green.png");
}

.info-card.blue h3 {
  background-image: url("../img/common/background_dot_blue.png");
}

.info-card p,
.info-card small,
.memo {
  color: var(--text);
  text-align: center;
}

.info-card p {
  margin: 0 auto 8px;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.9;
}

.info-card-body {
  display: contents;
}

.info-card small {
  display: block;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.9;
}

.memo {
  max-width: 820px;
  margin: clamp(30px, 5vw, 54px) auto 0;
  font-weight: 700;
  line-height: 2;
}

.items ul {
  display: grid;
  gap: 16px;
  max-width: 820px;
  margin: clamp(28px, 5vw, 48px) auto 0;
  padding: 0;
  list-style: none;
}

.items li {
  position: relative;
  padding: 14px 20px 14px 48px;
  border-radius: 20px;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.9;
  text-align: left;
}

.items li::before {
  position: absolute;
  top: 1.1em;
  left: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(240, 201, 55, 0.22);
  content: "";
}

.items img {
  width: min(100%, 720px);
  margin: clamp(30px, 5vw, 54px) auto 0;
  border-radius: 20px;
  filter: drop-shadow(0 12px 20px rgba(84, 62, 28, 0.14));
}

.gallery-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-auto-rows: clamp(74px, 9vw, 122px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 2.4vw, 22px);
  max-width: 1040px;
  margin: clamp(28px, 5vw, 48px) auto 0;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.gallery-grid-nine img {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-grid-nine img:nth-child(1),
.gallery-grid-nine img:nth-child(5),
.gallery-grid-nine img:nth-child(9) {
  grid-row: span 3;
}

.gallery-grid-nine img:nth-child(4),
.gallery-grid-nine img:nth-child(8) {
  grid-column: span 3;
  grid-row: span 2;
}

.gallery-grid-five {
  max-width: 960px;
}

.gallery-grid-five img {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-grid-five img:nth-child(4),
.gallery-grid-five img:nth-child(5) {
  grid-column: span 3;
}

.photo-carousel {
  max-width: 1100px;
  margin: clamp(28px, 5vw, 48px) auto 0;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scrollbar-width: none;
  scroll-behavior: auto;
  touch-action: pan-x;
  user-select: none;
}

.photo-carousel::-webkit-scrollbar {
  display: none;
}

.photo-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.photo-carousel-track {
  display: flex;
  width: max-content;
  gap: clamp(12px, 2.4vw, 22px);
  padding: 0 0 18px;
}

.photo-carousel img {
  width: clamp(220px, 32vw, 360px);
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  border: 8px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 20px rgba(84, 62, 28, 0.14);
  pointer-events: none;
}

.photo-carousel:focus-visible {
  outline: 4px solid rgba(61, 114, 184, 0.45);
  outline-offset: 6px;
}

.room-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 520px));
  justify-content: center;
  gap: clamp(16px, 4vw, 36px);
}

.room-link {
  display: grid;
  grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
  align-items: stretch;
  min-height: 210px;
  padding: 0;
  overflow: hidden;
  border: 4px solid currentColor;
  border-radius: 22px;
  background: var(--paper);
  color: var(--text);
  font-family: var(--hand-font);
  font-weight: 700;
  text-align: left;
  box-shadow: 6px 8px 0 rgba(84, 62, 28, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.room-link:hover {
  transform: translateY(-4px);
  box-shadow: 8px 12px 0 rgba(84, 62, 28, 0.12);
}

.room-link img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.room-link-body {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
  padding: clamp(20px, 3vw, 34px);
}

.room-link-label {
  color: currentColor;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
}

.room-link-text {
  color: var(--text);
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.8;
}

.room-link-action {
  justify-self: start;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.room-link-action::after {
  margin-left: 8px;
  content: ">";
}

.room-link.green {
  color: var(--green);
}

.room-link.blue {
  color: var(--orange);
}

#profile {
  display: block;
  max-width: none;
  font-size: clamp(14px, 1.45vw, 17px);
  line-height: 1.95;
}

#profile h2 {
  grid-column: 1 / -1;
}

#profile img {
  float: left;
  width: min(34%, 300px);
  min-width: 220px;
  margin: 0 clamp(18px, 4vw, 38px) 18px 0;
  aspect-ratio: 4 / 5;
  border: 10px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 12px 20px rgba(84, 62, 28, 0.14);
}

#profile > div {
  max-width: 940px;
  min-height: 320px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px);
  overflow: auto;
  text-align: left;
}

#profile h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.55;
  text-align: left;
  letter-spacing: 0.05em;
}

#profile p {
  color: var(--text);
  font-size: inherit;
  line-height: inherit;
}

#profile p {
  margin: 0 0 10px;
}

#profile p:last-child {
  margin-bottom: 0;
}

.temple-profile {
  color: var(--text);
  font-family: var(--hand-font);
  font-weight: 700;
}

.temple-intro {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
}

.temple-copy {
  overflow: auto;
  padding: clamp(20px, 3.4vw, 36px);
  text-align: left;
}

.temple-copy h2 {
  margin: 0 0 16px;
}

.temple-copy h3 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.7;
  text-align: left;
  letter-spacing: 0.08em;
}

.temple-copy p {
  margin: 0 0 10px;
  color: var(--text);
  font-size: clamp(14px, 1.45vw, 17px);
  line-height: 1.95;
  text-align: left;
}

.temple-copy p:last-child {
  margin-bottom: 0;
}

.temple-main-visual {
  float: right;
  width: min(50%, 420px);
  min-width: 280px;
  margin: 0 0 clamp(16px, 3vw, 28px) clamp(18px, 4vw, 38px);
  aspect-ratio: 4 / 3;
  border: 10px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 12px 20px rgba(84, 62, 28, 0.14);
}

.temple-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.4vw, 22px);
  max-width: 1120px;
  margin: clamp(30px, 5vw, 54px) auto 0;
}

.temple-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 6px solid rgba(255, 255, 255, 0.76);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 18px rgba(84, 62, 28, 0.12);
}

.access-section {
  color: var(--text);
  font-family: var(--hand-font);
  font-weight: 700;
}

.access-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: stretch;
  max-width: 1120px;
  margin: clamp(28px, 5vw, 48px) auto 0;
}

.access-info {
  display: grid;
  align-content: center;
  padding: clamp(22px, 4vw, 38px);
  text-align: left;
}

.access-info h3 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.5;
  text-align: left;
  letter-spacing: 0.08em;
}

.access-info p {
  margin: 0;
  color: var(--text);
  font-size: clamp(15px, 2vw, 19px);
  line-height: 2;
  text-align: left;
}

.access-map {
  width: 100%;
  min-height: 340px;
  border: 10px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  box-shadow: 0 12px 20px rgba(84, 62, 28, 0.14);
}

.tel-obfuscate span + span::before {
  content: "-";
}

.mail-domain::before {
  content: "@";
}

.site-footer {
  width: 100%;
  min-height: 100px;
  margin: 70px 0 0;
  padding: 12px clamp(18px, 4vw, 48px);
  background: var(--panel);
  color: var(--text);
  font-family: var(--hand-font);
  font-weight: 700;
  text-align: center;
}

.site-footer .contact-box {
  display: grid;
  gap: 6px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  text-align: center;
}

.site-footer .contact-box p {
  margin: 0;
  font-size: clamp(12px, 1.4vw, 14px);
  line-height: 1.55;
}

.footer-contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 24px;
}

.site-footer .contact-box strong {
  display: inline-block;
  min-width: auto;
  margin-right: 6px;
  color: var(--red);
  letter-spacing: 0.08em;
}

.footer-address,
.footer-message {
  text-align: center;
}

.placeholder-box {
  max-width: 820px;
  margin: clamp(28px, 5vw, 48px) auto 0;
  padding: clamp(22px, 4vw, 40px);
  text-align: center;
}

@media (max-width: 860px) {
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .access-card {
    grid-template-columns: 1fr;
  }

  #profile img {
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 360px;
    margin: 0 auto 20px;
    margin-inline: auto;
  }

  .temple-main-visual {
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 560px;
    margin: 0 auto 24px;
  }
}

@media (max-width: 560px) {
  body {
    padding-top: 66px;
  }

  .header {
    min-height: 66px;
    padding: 10px 14px;
    gap: 12px;
  }

  .site-logo-text {
    max-width: calc(100vw - 86px);
    font-size: 18px;
    white-space: normal;
  }

  .menu-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 3px solid var(--blue);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 1px 2px 0 rgba(61, 114, 184, 0.15);
  }

  .menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .header.is-open .menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .header.is-open .menu-button span:nth-child(2) {
    opacity: 0;
  }

  .header.is-open .menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav {
    position: absolute;
    top: calc(100% - 2px);
    right: 14px;
    display: none;
    grid-template-columns: 1fr;
    width: min(260px, calc(100vw - 28px));
    padding: 12px;
    border-radius: 0 0 18px 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(84, 62, 28, 0.14);
  }

  .header.is-open .nav {
    display: grid;
  }

  .nav a {
    text-align: center;
  }

  .page-logo {
    width: fit-content;
    margin: 14px 0 0 18px;
    font-size: 32px;
  }

  #about,
  .items,
    #gallery,
    #profile,
    .temple-profile,
    .access-section,
    .carousel-section,
    .room-links,
    .placeholder-page {
    width: min(100% - 18px, 1060px);
    margin-block: 42px;
    margin-inline: auto;
    padding: 30px 16px;
  }

  #about {
    letter-spacing: 0.02em;
  }

  #home .home-hero {
    min-height: 0;
    padding-bottom: 0;
  }

  #home .home-hero + #about {
    margin-top: 4px;
  }

  .room-hero + #profile {
    margin-top: 8px;
  }

  #about p {
    line-height: 2;
  }

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

  .info-card {
    display: grid;
    grid-template-columns: minmax(92px, 34%) 1fr;
    column-gap: 14px;
    align-items: center;
    text-align: left;
  }

  .info-card h3 {
    width: min(100%, 112px);
    margin: 0;
    justify-self: center;
    font-size: 18px;
  }

  .info-card-body {
    grid-column: 2;
    display: block;
    text-align: left;
  }

  .info-card p,
  .info-card small {
    text-align: inherit;
  }

  .info-card p {
    margin: 0 0 4px;
    font-size: 17px;
  }

  .info-card.red p,
  .info-card.red small {
    line-height: 1.45;
  }

  .items li {
    padding: 13px 16px 13px 42px;
  }

  .items li::before {
    left: 18px;
  }

  #gallery {
    padding-inline: 10px;
  }

  .gallery-grid {
    grid-auto-rows: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .gallery-grid img,
  .gallery-grid-nine img,
  .gallery-grid-five img,
  .gallery-grid-nine img:nth-child(4),
  .gallery-grid-nine img:nth-child(8),
  .gallery-grid-five img:nth-child(4),
  .gallery-grid-five img:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .gallery-grid-nine img:nth-child(1),
  .gallery-grid-nine img:nth-child(5),
  .gallery-grid-nine img:nth-child(9),
  .gallery-grid-five img:nth-child(5) {
    grid-column: 1 / -1;
  }

  .gallery-grid-nine img:nth-child(1),
  .gallery-grid-nine img:nth-child(5),
  .gallery-grid-nine img:nth-child(9) {
    aspect-ratio: 3 / 2;
  }

  .temple-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .access-map {
    min-height: 280px;
  }

  .photo-carousel {
    max-width: 100%;
  }

  .photo-carousel img {
    width: min(78vw, 320px);
  }

  .room-links {
    grid-template-columns: 1fr;
  }

  .room-link {
    grid-template-columns: 1fr;
  }

  .room-link img {
    height: 180px;
    min-height: 0;
  }

  .site-footer {
    width: 100%;
    min-height: 100px;
    margin: 42px 0 0;
    padding: 12px 14px;
  }

  .site-footer .contact-box {
    padding: 0;
  }

  .footer-contact-row {
    gap: 2px 16px;
  }

  .site-footer .contact-box strong {
    display: block;
    margin: 0 0 2px;
  }
}
