:root {
  --ink: #33302c;
  --ink-soft: #6b655e;
  --line: #e2ddd5;
  --bg: #fbf9f6;
  --bg-card: #ffffff;
  --accent: #8a7a62;
  --accent-soft: #f3efe8;
  --err: #a5443a;
  --serif-ja: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --serif-en: "Cormorant Garamond", serif;
  --maxw: 640px;
}

* { box-sizing: border-box; }

/* display を指定した要素でも hidden 属性を効かせる */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

/* ---------- language switch ---------- */
.lang-switch {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

.lang-switch button {
  font-family: var(--serif-en);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  line-height: 1;
}

.lang-switch button[data-lang="ja"] { font-family: var(--serif-ja); font-size: 11.5px; }

.lang-switch button.is-active {
  color: #fff;
  background: var(--accent);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-ja);
  font-size: 16px;
  line-height: 2;
  -webkit-text-size-adjust: 100%;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  background: linear-gradient(160deg, #efe9e0 0%, #f7f3ee 45%, #e8e3da 100%);
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, .55);
  pointer-events: none;
}

/* 写真を敷く場合は、顔に文字が重ならないよう下寄せにする */
.hero.has-image {
  color: #fff;
  align-items: flex-end;
  padding-bottom: 96px;
  background-position: center 22%;
}
.hero.has-image .hero-inner { text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }
.hero.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(40, 34, 28, .32);
}

.hero-inner { position: relative; z-index: 1; }

.hero-en {
  font-family: var(--serif-en);
  font-size: clamp(30px, 9vw, 52px);
  font-weight: 300;
  letter-spacing: .06em;
  margin: 0 0 18px;
  line-height: 1.3;
}

.hero-sub {
  font-family: var(--serif-en);
  font-size: 12px;
  letter-spacing: .34em;
  margin: 0 0 28px;
  opacity: .8;
}

.hero-date {
  font-family: var(--serif-en);
  font-size: clamp(16px, 4.5vw, 20px);
  letter-spacing: .14em;
  margin: 0;
}

.countdown {
  margin-top: 22px;
  font-size: 13px;
  letter-spacing: .12em;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 1px;
  height: 46px;
  background: currentColor;
  opacity: .35;
  animation: cue 2.4s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: .15; }
  50% { transform: translateY(8px); opacity: .5; }
}

/* ---------- sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 20px;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type { border-bottom: none; }

.section-title {
  text-align: center;
  margin: 0 0 36px;
  font-weight: 500;
}

.section-title .ja {
  display: block;
  font-size: 17px;
  letter-spacing: .18em;
}

.section-title .en {
  display: block;
  font-family: var(--serif-en);
  font-size: 11px;
  letter-spacing: .28em;
  color: var(--accent);
  margin-top: 6px;
  text-transform: uppercase;
}

/* ---------- greeting ---------- */
.greeting-body {
  text-align: center;
  font-size: 14.5px;
  line-height: 2.3;
  /* 日本語を文節で折り返す（対応ブラウザのみ。非対応でも表示は崩れない） */
  word-break: auto-phrase;
  line-break: strict;
}

.greeting-body p { margin: 0 0 4px; }

/* ---------- profiles ---------- */
.profiles {
  display: grid;
  gap: 20px;
}

@media (min-width: 560px) {
  .profiles { grid-template-columns: 1fr 1fr; }
}

.profile {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 26px 20px;
  text-align: center;
}

.profile .role {
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--accent);
}

.profile .name {
  font-size: 19px;
  margin: 8px 0 2px;
  letter-spacing: .08em;
}

.profile .name-en {
  font-family: var(--serif-en);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--ink-soft);
}

.profile .desc {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 14px 0 0;
}

/* ---------- gallery ---------- */
/* 6分割のグリッドで、枚数に応じて2枚目以降の幅を変える */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

/* 1枚目は横幅いっぱいに大きく見せる */
.gallery .gallery-item {
  grid-column: span 3;
}

.gallery .gallery-item:first-child {
  grid-column: span 6;
}

.gallery .gallery-item:first-child img { aspect-ratio: 3 / 2; }

/* 2枚 → 2枚目も横幅いっぱい */
.gallery[data-count="2"] .gallery-item:nth-child(2) { grid-column: span 6; }
.gallery[data-count="2"] .gallery-item:nth-child(2) img { aspect-ratio: 3 / 2; }

/* 3枚 → 2枚目以降は半分ずつ */
.gallery[data-count="3"] .gallery-item:nth-child(n + 2) img { aspect-ratio: 1 / 1; }

/* 4枚 → 2枚目以降は3枚を横並び */
.gallery[data-count="4"] .gallery-item:nth-child(n + 2) { grid-column: span 2; }
.gallery[data-count="4"] .gallery-item:nth-child(n + 2) img { aspect-ratio: 3 / 4; }

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--accent-soft);
  cursor: zoom-in;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.gallery-item:hover img { transform: scale(1.03); }

.gallery-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 8px;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(24, 20, 16, .92);
  cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  cursor: default;
}

.lightbox-caption {
  margin: 0;
  color: #f2ece4;
  font-size: 13px;
  letter-spacing: .06em;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

/* ---------- schedule ---------- */
.schedule-date {
  text-align: center;
  font-family: var(--serif-en);
  letter-spacing: .1em;
  margin: 0 0 24px;
}

.schedule {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 380px;
}

.schedule li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 14px 4px;
  border-bottom: 1px dotted var(--line);
}

.schedule li:last-child { border-bottom: none; }

.schedule .t {
  font-family: var(--serif-en);
  font-size: 17px;
  letter-spacing: .06em;
  color: var(--accent);
  min-width: 78px;
  flex-shrink: 0;
}

.schedule .l { font-size: 15px; }

/* ---------- venue ---------- */
.venue { text-align: center; }

.venue .v-name {
  font-size: 18px;
  letter-spacing: .1em;
  margin: 0 0 10px;
}

.venue .v-addr,
.venue .v-line {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 4px;
  line-height: 1.9;
}

.venue .v-tel a { color: var(--ink-soft); }

.venue .v-park {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 14px 0 0;
  background: var(--accent-soft);
  padding: 12px 14px;
  text-align: left;
  line-height: 1.8;
}

.map-wrap {
  margin-top: 24px;
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-link {
  text-align: center;
  font-size: 13px;
  margin: 14px 0 0;
}

a { color: var(--accent); }

/* ---------- notes ---------- */
.notes {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 420px;
  margin-inline: auto;
}

.notes li {
  font-size: 14px;
  padding: 8px 0 8px 20px;
  position: relative;
  line-height: 1.9;
}

.notes li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- rsvp ---------- */
.rsvp { background: var(--accent-soft); }

.deadline {
  text-align: center;
  font-size: 14px;
  line-height: 2;
  margin: 0 0 32px;
}

.field { margin-bottom: 24px; border: 0; padding: 0; }

.field label,
.field legend {
  display: block;
  font-size: 14px;
  letter-spacing: .04em;
  margin-bottom: 8px;
  padding: 0;
}

.req {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .1em;
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: 2px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; }

.choices { display: flex; gap: 12px; }

.choice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px 10px;
  cursor: pointer;
  margin: 0;
  font-size: 15px;
}

.choice input { accent-color: var(--accent); margin: 0; }

.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 0 0;
  line-height: 1.7;
}

.err {
  font-size: 12.5px;
  color: var(--err);
  margin: 6px 0 0;
  min-height: 0;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#submit-btn {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: .16em;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  padding: 16px;
  cursor: pointer;
  transition: opacity .2s;
}

#submit-btn:hover { opacity: .88; }
#submit-btn:disabled { opacity: .5; cursor: default; }

.form-status {
  text-align: center;
  font-size: 13.5px;
  margin: 14px 0 0;
  line-height: 1.8;
  min-height: 1em;
}

.form-status.is-error { color: var(--err); }

.thanks { text-align: center; padding: 20px 0; }

.thanks-mark {
  font-size: 34px;
  color: var(--accent);
  margin: 0;
  line-height: 1;
}

.thanks-title {
  font-size: 17px;
  letter-spacing: .1em;
  margin: 16px 0 8px;
}

.thanks-body {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.9;
}

/* ---------- contact ---------- */
.contact-lead {
  text-align: center;
  font-size: 14px;
  margin: 0 0 20px;
}

.contacts {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 340px;
}

.contacts li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px dotted var(--line);
  font-size: 15px;
}

.contacts li:last-child { border-bottom: none; }

.contacts a {
  font-family: var(--serif-en);
  letter-spacing: .06em;
  text-decoration: none;
}

/* ---------- footer ---------- */
.footer {
  text-align: center;
  padding: 48px 20px 56px;
  background: #efeae2;
}

.footer p {
  margin: 0;
  font-family: var(--serif-en);
  letter-spacing: .14em;
}

#footer-names { font-size: 20px; font-weight: 300; }

.footer-date {
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--ink-soft);
  margin-top: 8px !important;
}

/* ---------- 英語表示のときの調整 ---------- */
/* 見出しの日本語行と英語の添え字が重複するため、添え字を隠す */
body[data-lang="en"] .section-title .en { display: none; }

body[data-lang="en"] .section-title .t-ja {
  font-family: var(--serif-en);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--accent);
}

body[data-lang="en"] {
  font-family: var(--serif-en), Georgia, serif;
  font-size: 17px;
  line-height: 1.85;
}

body[data-lang="en"] .greeting-body {
  font-size: 17px;
  line-height: 2;
  word-break: normal;
}

body[data-lang="en"] .profile .name { font-size: 20px; }
body[data-lang="en"] .profile .desc { font-size: 15px; }
body[data-lang="en"] .schedule .l { font-size: 16px; }
body[data-lang="en"] .venue .v-name { font-size: 20px; }
body[data-lang="en"] .venue .v-addr,
body[data-lang="en"] .venue .v-line { font-size: 15px; }
body[data-lang="en"] .notes li,
body[data-lang="en"] .deadline,
body[data-lang="en"] .contact-lead { font-size: 15.5px; }
body[data-lang="en"] .hint { font-size: 13px; }

/* 入力欄は言語に関係なく 16px を保つ（iOS の自動ズーム防止） */
body[data-lang="en"] input[type="text"],
body[data-lang="en"] textarea,
body[data-lang="en"] select { font-size: 16px; }

body[data-lang="en"] .req { letter-spacing: .04em; }

/* ---------- motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
}
