/* ───── 色・フォント ───── */
:root {
  --bg: #faf6ef;
  --bg-soft: #f3ece0;
  --card: #fffdf9;
  --text: #4d443a;
  --text-soft: #8a7e70;
  --line: #e6dccb;
  --sage: #8ea888;
  --sage-deep: #6c8a67;
  --rose: #d9a295;
  --rose-soft: #f4e1da;
  --sage-soft: #e3ebdf;

  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --font-hand: "Klee One", "Zen Maru Gothic", serif;

  --radius: 20px;
  --shadow: 0 6px 24px rgba(120, 98, 70, 0.08);
  --gutter: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  overflow-x: hidden;
  word-break: auto-phrase; /* 対応ブラウザでは文節で改行 */
  -webkit-tap-highlight-color: transparent;
  --pager-h: 64px;
  padding-bottom: calc(var(--pager-h) + env(safe-area-inset-bottom));
}

/* ホームではページ送りのバーを出さない */
body.is-home {
  padding-bottom: env(safe-area-inset-bottom);
}

.is-home .pager {
  display: none;
}

[hidden] {
  display: none !important;
}

/* ページ切り替え時のフェード */
.page:not([hidden]) {
  animation: page-in 0.5s ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

h1, h2, h3, p, ol, ul, dl, dd, figure {
  margin: 0;
  padding: 0;
}

ol, ul {
  list-style: none;
}

p, dd {
  white-space: pre-line;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ───── 写真(共通)───── */
.photo {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo.is-empty {
  background:
    radial-gradient(circle at 30% 30%, var(--rose-soft), transparent 60%),
    radial-gradient(circle at 70% 70%, var(--sage-soft), transparent 60%),
    var(--bg-soft);
}

.photo-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-soft);
  text-align: center;
  padding: 8px;
}

.photo-ph-icon {
  font-size: 1.6rem;
  color: var(--sage);
  line-height: 1;
}

.photo-ph small {
  font-size: 0.7rem;
  word-break: break-all;
  line-height: 1.4;
}

/* ───── ホーム(表紙+メニュー)───── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 0 32px;
}

.hero-en {
  font-family: var(--font-hand);
  color: var(--sage-deep);
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.hero-photo {
  width: min(68vw, 300px, 28vh);
  width: min(68vw, 300px, 28svh);
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 24px 24px;
  box-shadow: var(--shadow);
  outline: 1px solid var(--line);
  outline-offset: 8px;
}

.hero-names {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(2rem, 9vw, 2.8rem);
  margin-top: 24px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.4em;
  letter-spacing: 0.12em;
}

.hero-names .amp {
  color: var(--rose);
  font-size: 0.7em;
}

.hero-date {
  margin-top: 12px;
  font-size: 1rem;
}

.hero-place {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.hero-greeting {
  margin-top: 16px;
  font-size: 0.88rem;
  line-height: 1.9;
}

.menu {
  width: 100%;
  max-width: 640px;
  margin-top: 36px;
}

.menu-head {
  font-family: var(--font-hand);
  color: var(--sage-deep);
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.menu-list {
  display: grid;
  gap: 10px;
  text-align: left;
}

@media (min-width: 600px) {
  .menu-list {
    grid-template-columns: 1fr 1fr;
  }
}

.menu-item {
  display: grid;
  grid-template-columns: 36px 1fr 12px;
  grid-template-areas:
    "no en    arrow"
    "no title arrow"
    "no desc  arrow";
  column-gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 16px;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.menu-item:active {
  transform: scale(0.98);
}

.menu-item::after {
  content: "";
  grid-area: arrow;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--text-soft);
  border-right: 2px solid var(--text-soft);
  transform: rotate(45deg);
}

.menu-no {
  grid-area: no;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hand);
  font-weight: 600;
  line-height: 1;
}

.menu-en {
  grid-area: en;
  font-family: var(--font-hand);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--sage-deep);
  line-height: 1.4;
}

.menu-title {
  grid-area: title;
  font-weight: 700;
  line-height: 1.5;
}

.menu-desc {
  grid-area: desc;
  font-size: 0.75rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ───── セクション共通 ───── */
.section {
  padding: 36px 0 40px;
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}

.section-head .en {
  font-family: var(--font-hand);
  color: var(--sage-deep);
  letter-spacing: 0.25em;
  font-size: 0.8rem;
}

.section-head h2 {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.25rem, 5.6vw, 1.45rem);
  letter-spacing: 0.1em;
  line-height: 1.6;
  margin-top: 4px;
  white-space: pre-line;
}

.divider {
  color: var(--sage);
  margin: 12px auto 0;
  width: 120px;
  height: 20px;
}

.divider svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
}

.pair {
  display: grid;
  gap: 20px;
}

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

.is-a { --accent: var(--sage); --accent-soft: var(--sage-soft); }
.is-b { --accent: var(--rose); --accent-soft: var(--rose-soft); }

.hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-top: 12px;
}

/* ふわっと表示 */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .page:not([hidden]) { animation: none; }
}

/* ───── 本日の流れ ───── */
.schedule {
  max-width: 520px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 22px;
}

.schedule li {
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

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

.schedule time {
  font-family: var(--font-hand);
  color: var(--sage-deep);
  font-weight: 600;
}

.schedule-title {
  font-weight: 500;
}

.schedule-note {
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ───── ふたりの紹介 ───── */
.profile {
  text-align: center;
  border-top: 4px solid var(--accent);
}

.profile-photo {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid var(--accent-soft);
}

.profile-name {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.15em;
}

.profile-kana {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.profile-list {
  margin-top: 20px;
  text-align: left;
}

.profile-list div {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}

.profile-list dt {
  color: var(--text-soft);
  font-size: 0.8rem;
  padding-top: 2px;
}

.profile-message {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: 14px;
  font-size: 0.88rem;
  text-align: left;
  line-height: 1.8;
}

/* ───── 家族紹介 ───── */
.family {
  border-top: 4px solid var(--accent);
}

.family-name {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 0.2em;
}

.family-of {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.member {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.member:last-child {
  border-bottom: none;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.avatar-text {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--text);
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.member-role {
  display: inline-block;
  font-size: 0.7rem;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0 8px;
  margin-right: 8px;
  vertical-align: 2px;
  letter-spacing: 0.1em;
}

.member-name {
  font-weight: 500;
}

.member-comment {
  font-size: 0.83rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-top: 2px;
}

/* ───── 年表 ───── */
.timeline {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(var(--sage) 0 6px, transparent 6px 12px);
  opacity: 0.6;
}

.timeline li {
  position: relative;
  padding-bottom: 36px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--sage);
}

.timeline li:last-child::before {
  background: var(--rose);
  border-color: var(--rose);
}

.timeline-date {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--sage-deep);
  font-weight: 600;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-text {
  font-size: 0.9rem;
}

.timeline-photo {
  margin-top: 12px;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* ───── エピソード ───── */
.episodes {
  display: grid;
  gap: 24px;
}

@media (min-width: 720px) {
  .episodes {
    grid-template-columns: repeat(2, 1fr);
  }
}

.episode {
  padding: 0;
  overflow: hidden;
}

.episode-photo {
  aspect-ratio: 4 / 3;
}

.episode-body {
  padding: 20px 22px 24px;
}

.episode-date {
  font-family: var(--font-hand);
  font-size: 0.8rem;
  color: var(--sage-deep);
  font-weight: 600;
}

.episode-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.episode-text {
  font-size: 0.9rem;
}

.comments {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.comment {
  position: relative;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.7;
}

.comment-who {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.1em;
}

.comment.is-b {
  margin-left: 20px;
}

.comment.is-a {
  margin-right: 20px;
}

/* ───── 好きなところ ───── */
.likes {
  border-top: 4px solid var(--accent);
}

.likes-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.likes-arrow {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.likes-list {
  counter-reset: like;
}

.likes-list li {
  counter-increment: like;
  position: relative;
  padding: 12px 0 12px 44px;
  border-bottom: 1px dashed var(--line);
  line-height: 1.75;
}

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

.likes-list li::before {
  content: counter(like);
  position: absolute;
  left: 0;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text);
  font-family: var(--font-hand);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ───── ギャラリー ───── */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 720px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

.gallery-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow);
}

.gallery-photo {
  aspect-ratio: 1;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-photo {
  transform: scale(1.04);
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 6px;
  font-size: 0.72rem;
  color: #fff;
  text-align: left;
  line-height: 1.5;
  background: linear-gradient(transparent, rgba(60, 48, 36, 0.55));
}

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

/* 拡大表示 */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: rgba(40, 34, 28, 0.92);
  color: #fff;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: transparent;
}

.lb-figure {
  max-width: calc(100vw - 32px);
  text-align: center;
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  max-height: 78dvh;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.lb-caption {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.lightbox button {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ───── 結び ───── */
.closing {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background:
    radial-gradient(circle at 0% 0%, var(--sage-soft), transparent 45%),
    radial-gradient(circle at 100% 100%, var(--rose-soft), transparent 45%),
    var(--card);
}

.closing-message {
  font-size: 0.92rem;
  line-height: 2.1;
  text-align: left;
}

.closing-sign {
  margin-top: 16px;
  text-align: right;
  font-family: var(--font-hand);
  font-weight: 600;
}

.plans {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  text-align: left;
}

.plans-head {
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 600;
  color: var(--sage-deep);
  margin-bottom: 8px;
}

.plans div {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.9rem;
}

.plans dt {
  color: var(--text-soft);
  font-size: 0.82rem;
  padding-top: 2px;
}

/* ───── フッター ───── */
.footer {
  text-align: center;
  padding: 48px 0 calc(40px + env(safe-area-inset-bottom));
  font-size: 0.75rem;
  color: var(--text-soft);
}

.footer .divider {
  margin-bottom: 12px;
}

/* ───── ページ送り ───── */
.pager {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  height: calc(var(--pager-h) + env(safe-area-inset-bottom));
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: rgba(250, 246, 239, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.pager a {
  text-decoration: none;
  color: var(--text);
  border-radius: 999px;
  line-height: 1.3;
}

.pager-prev {
  justify-self: start;
  grid-column: 1;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-soft) !important;
}

.pager-home {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  font-size: 0.68rem;
  color: var(--text-soft) !important;
}

.pager-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0;
}

.pager-icon i {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--sage-deep);
}

.pager-count {
  font-family: var(--font-hand);
  font-size: 0.62rem;
}

.pager-next {
  justify-self: end;
  grid-column: 3;
  padding: 6px 16px;
  background: var(--sage);
  color: #fff !important;
  font-size: 0.85rem;
  text-align: right;
  white-space: nowrap;
  max-width: 62vw;
}

.pager-sub {
  display: block;
  font-size: 0.65rem;
  opacity: 0.85;
}

.pager-label {
  font-weight: 500;
  display: inline-block;
  max-width: calc(62vw - 48px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* 背の低い画面(iPhone SE の Safari など)では表紙を詰めて、メニューを早めに見せる */
@media (max-height: 640px) {
  .hero { padding: 12px 0 16px; }
  .hero-en { margin-bottom: 8px; }
  .hero-photo { width: min(60vw, 240px, 24vh); width: min(60vw, 240px, 24svh); outline-offset: 5px; }
  .hero-names { margin-top: 14px; font-size: 1.9rem; }
  .hero-date { margin-top: 4px; font-size: 0.9rem; }
  .hero-greeting { margin-top: 10px; font-size: 0.8rem; line-height: 1.75; }
  .menu { margin-top: 24px; }
}

/* ───── 当日のご案内(guide/)───── */
/* 本編とは別の単独ページ。ページ送りのバーは無い */
body.guide-page {
  padding-bottom: env(safe-area-inset-bottom);
}

.guide-page main {
  max-width: 560px;
}

.guide-hero {
  text-align: center;
  padding: 40px 0 8px;
}

.guide-title {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.7rem, 7.5vw, 2.1rem);
  letter-spacing: 0.15em;
  line-height: 1.5;
}

.guide-subtitle {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  color: var(--sage-deep);
}

.guide-page .divider {
  width: 156px;
  height: 26px;
}

.guide-page .section {
  padding: 28px 0 8px;
}

.guide-page .section-head {
  margin-bottom: 20px;
}

.guide-card {
  border-top: 4px solid var(--accent);
}

.guide-time {
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1.3;
  color: var(--sage-deep);
  margin-bottom: 8px;
}

.guide-time small {
  font-size: 0.95rem;
  margin-left: 0.4em;
  color: var(--text);
}

.guide-list div {
  display: grid;
  grid-template-columns: 6em 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}

.guide-list div:last-child {
  border-bottom: none;
}

.guide-list dt {
  color: var(--text-soft);
  font-size: 0.8rem;
  padding-top: 2px;
}

.guide-list a {
  color: var(--sage-deep);
  font-weight: 500;
}

.guide-check li {
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: 1px dashed var(--line);
  line-height: 1.75;
}

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

.guide-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.guide-check li::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 19px;
  width: 8px;
  height: 12px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

.guide-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.7;
}

.guide-url {
  word-break: break-all;
  font-size: 0.85rem;
}

.guide-contact {
  font-size: 0.92rem;
  line-height: 1.9;
}
