/* =========================================================
   Souganji Renewal - front page
========================================================= */

.sg-front-page-content { margin: 0; }

.sg-container {
  width: min(calc(100% - 48px), var(--sg-container));
  margin: 0 auto;
}

.sg-main { background: var(--sg-bg); }

.sg-image-space {
  position: relative;
  overflow: hidden;
}

.sg-image-space > img,
.sg-image-space > span > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sg-image-space::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(80,66,42,.10) 45%, rgba(34,28,20,.22) 100%);
  pointer-events: none;
}

.sg-image-space > img + span { display: none; }

.sg-image-space span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  font-family: var(--sg-sans);
  font-size: 13px;
  letter-spacing: .08em;
  text-align: center;
}

/* Hero */
.sg-hero {
  position: relative;
  height: min(52vw, 620px);
  min-height: 480px;
  overflow: hidden;
  background: #f7f3eb;
}

.sg-hero__image { position: absolute; inset: 0; }

.sg-hero__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.76) 30%, rgba(255,255,255,.16) 52%, rgba(255,255,255,0) 72%),
    radial-gradient(circle at 24% 42%, rgba(255,255,255,.96) 0%, rgba(255,255,255,.72) 28%, rgba(255,255,255,0) 48%);
  pointer-events: none;
}

.sg-hero__mist {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 45%, rgba(255,255,255,.96), rgba(255,255,255,.42) 35%, rgba(255,255,255,0) 66%),
    linear-gradient(90deg, rgba(255,255,255,.28), rgba(255,255,255,0));
  pointer-events: none;
}

.sg-hero__content {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 54px), 1280px);
  height: 100%;
  margin: 50px auto;
}

.sg-hero__message {
  position: absolute;
  left: 88px;
  top: 82px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 34px;
  color: #4d4a44;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 38px);
  font-style: normal;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: .18em;
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
}

.sg-hero__message span {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
}

.sg-hero__temple {
  position: absolute;
  left: 84px;
  bottom: 64px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--sg-ink);
}

.sg-hero__seal {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.sg-hero__small {
  margin: 0 0 2px;
  color: var(--sg-muted);
  font-size: 13px;
  line-height: 1.4;
}

.sg-hero__name {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: .08em;
}

/* Shared front-page sections */
.sg-section { padding: 28px 0; }

.sg-center-heading {
  margin-bottom: 36px;
  text-align: center;
}

.sg-center-heading h2 {
  margin: 0;
  color: var(--sg-ink);
  font-size: 31px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .16em;
}

.sg-center-heading p {
  margin: 8px 0 0;
  color: var(--sg-muted);
  font-size: 14px;
  line-height: 1.8;
}

.sg-heading-mark {
  display: block;
  margin-bottom: 8px;
  color: var(--sg-gold);
  font-size: 20px;
  line-height: 1;
}

.sg-center-heading--line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.sg-center-heading--line::before,
.sg-center-heading--line::after {
  content: "";
  width: min(28vw, 310px);
  height: 1px;
  background: var(--sg-line);
}

.sg-outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-width: 146px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid #cdbb97;
  background: rgba(255,255,255,.66);
  color: var(--sg-brown);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.sg-outline-btn:hover {
  background: var(--sg-brown);
  border-color: var(--sg-brown);
  color: #fff;
}

.sg-outline-btn--wide { min-width: 260px; }
.sg-outline-btn--large { min-width: 288px; }

/* News */
.sg-news-section {
  padding-top: 52px;
  padding-bottom: 46px;
  background: #fff;
}

.sg-news-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 54px;
  align-items: center;
}

.sg-section-side { text-align: center; }

.sg-side-title {
  margin: 0 0 24px;
  color: var(--sg-ink);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: .14em;
}

.sg-side-flower {
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  opacity: .18;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 30%, var(--sg-gold-soft) 31%, var(--sg-gold-soft) 34%, transparent 35%),
    repeating-conic-gradient(from 0deg, var(--sg-gold-soft) 0deg 18deg, transparent 18deg 36deg);
}

.sg-news-list { border-top: 1px solid var(--sg-line); }

.sg-news-row {
  display: grid;
  grid-template-columns: 118px 86px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--sg-line);
}

.sg-news-row__date {
  color: #746d61;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 600;
}

.sg-news-row__cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 10px;
  background: var(--sg-gold);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
}

.sg-news-row:nth-child(even) .sg-news-row__cat { background: var(--sg-green); }

.sg-news-row__title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
}

.sg-news-row__title a {
  color: var(--sg-ink);
  text-decoration: none;
}

.sg-news-row__title a:hover { color: var(--sg-gold); }

/* Events */
.sg-events-section {
  background: #fff;
  border-top: 1px solid rgba(222,214,200,.72);
}

.sg-event-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.sg-event-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--sg-line);
  box-shadow: 0 8px 22px rgba(83,71,50,.05);
}

.sg-event-card.is-hidden-by-month { display: none; }
.sg-event-card__image { height: 128px; }

.sg-event-card__body {
  position: relative;
  min-height: 155px;
  padding: 32px 22px 46px;
}

.sg-season-badge {
  position: absolute;
  left: 18px;
  top: -31px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sg-line);
  border-radius: 50%;
  background: #fff;
  color: var(--sg-ink);
  font-size: 22px;
  line-height: 1;
}

.sg-event-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.sg-event-card__date {
  margin: 0 0 12px;
  color: var(--sg-brown);
  font-size: 14px;
}

.sg-event-card p {
  color: var(--sg-text);
  font-size: 14px;
  line-height: 1.8;
}

.sg-event-card a {
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: var(--sg-brown);
  font-size: 18px;
  text-decoration: none;
}

.sg-center-button {
  margin-top: 32px;
  text-align: center;
}

/* About */
.sg-about-section {
  position: relative;
  padding: 70px 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 4% 88%, rgba(185,155,98,.11), transparent 22%),
    radial-gradient(circle at 96% 82%, rgba(185,155,98,.12), transparent 22%),
    linear-gradient(90deg, #f3eee4, #fbfaf6);
}

.sg-about-layout {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 72px;
  align-items: center;
}

.sg-about-text h2 {
  margin: 0;
  color: var(--sg-ink);
  font-size: 31px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .14em;
}

.sg-title-line {
  display: block;
  width: 42px;
  height: 2px;
  margin: 20px 0 28px;
  background: var(--sg-gold);
}

.sg-about-text p {
  color: var(--sg-text);
  font-size: 15px;
  line-height: 2.05;
}

.sg-about-text .sg-outline-btn { margin-top: 16px; }
.sg-about-image { height: 305px; }

/* Access preview */
.sg-access-section { background: #fff; }

.sg-access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 42px;
  align-items: start;
}

.sg-access-info dl { margin: 0 0 26px; }

.sg-access-info dl div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(222,214,200,.78);
}

.sg-access-info dt {
  color: var(--sg-ink);
  font-size: 14px;
  font-weight: 600;
}

.sg-access-info dd {
  margin: 0;
  color: var(--sg-text);
  font-size: 14px;
  line-height: 1.8;
}

.sg-access-info a,
.sg-access-map a { color: var(--sg-brown); }

.sg-access-photo { height: 210px; }

.sg-access-map .sg-image-space {
  height: 150px;
  margin-bottom: 24px;
}

.sg-access-map { text-align: center; }

@media screen and (max-width: 1100px) {
  .sg-event-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-access-grid { grid-template-columns: 1fr; }
  .sg-access-photo { height: 260px; }
  .sg-access-map .sg-image-space { height: 220px; }
}

@media screen and (max-width: 820px) {
  .sg-container { width: min(calc(100% - 28px), var(--sg-container)); }

  .sg-hero {
    height: 520px;
    min-height: 520px;
  }

  .sg-hero__content { width: min(calc(100% - 28px), 1280px); }

  .sg-hero__message {
    left: 28px;
    top: 58px;
    gap: 18px;
    font-size: 25px;
  }

  .sg-hero__temple {
    left: 26px;
    bottom: 46px;
  }

  .sg-hero__name { font-size: 19px; }

  .sg-news-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .sg-news-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 0;
  }

  .sg-news-row__cat { width: fit-content; }
  .sg-event-grid { grid-template-columns: 1fr; }
  .sg-event-card__image { height: 170px; }

  .sg-about-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .sg-about-image { height: 230px; }
  .sg-center-heading--line { gap: 14px; }

  .sg-center-heading--line::before,
  .sg-center-heading--line::after { width: 16vw; }

  .sg-access-info dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .sg-outline-btn--large,
  .sg-outline-btn--wide {
    width: 100%;
    min-width: 0;
  }
}

@media screen and (max-width: 640px) {
  .sg-hero {
    height: clamp(540px, 145vw, 620px);
    min-height: 540px;
    aspect-ratio: auto;
  }

  .sg-hero__message {
    top: 28px;
    left: 32%;
    width: max-content;
    gap: 18px;
    transform: translateX(-50%);
    font-size: clamp(24px, 7.2vw, 28px);
    line-height: 1.2;
    letter-spacing: .1em;
  }

  .sg-hero__temple {
    left: 18px;
    right: 18px;
    bottom: 70px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(220,210,190,.9);
    box-shadow: 0 6px 18px rgba(40,32,24,.1);
    color: var(--sg-ink);
    text-shadow: none;
    backdrop-filter: blur(4px);
  }

  .sg-hero__temple img {
    width: 42px;
    height: auto;
    flex: 0 0 42px;
  }

  .sg-hero__image img { object-position: 62% center; }
}

@media screen and (max-width: 360px) {
  .sg-hero {
    height: 500px;
    min-height: 500px;
  }

  .sg-hero__message {
    top: 24px;
    gap: 14px;
    font-size: 24px;
    letter-spacing: .07em;
  }
}
