/*
 *  パンパス（theme 7）
 *
 *  白い紙に、淡いドライフラワーの水彩とグレージュの帯。三つ折りの顔合わせしおりの組みを、
 *  スマホの縦スクロールに直したもの。PC では中央に紙面の幅（--page）で置く。
 *  Bootstrap などの既成の CSS は読まない。
 *
 *  見出しは筆記体の英字（Ms Madi）に日本語を小さく添える。文言はボタニカルと同じ。
 *  花の絵（form/static/pampas/images/）は画像AIで作り、白地を透過にした WebP。
 *  文字の後ろに敷くので、CSS で薄くして使う（--wash）。
 */

:root {
  --paper: #FDFCFA;
  --ink: #4A4542;
  --ink-soft: #8A827D;
  --greige: #A59C96;
  --greige-deep: #857C76;
  --greige-pale: #F3F0EC;
  --line: #E4DFDA;
  --wash: .45;
  --page: 480px;
  --serif: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --script: 'Ms Madi', cursive;
  --ease: cubic-bezier(.22, .61, .36, 1);
  /* ペンで書くように、書き始めと終わりをゆっくりに */
  --brush: cubic-bezier(.45, .05, .35, 1);
}

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

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

body.pp {
  margin: 0;
  background: #EEEBE7;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2;
  letter-spacing: .12em;
  -webkit-font-smoothing: antialiased;
}

/* 初期化は :where() で優先度を 0 にする。個別の指定に負けるように */
:where(.pp) img { max-width: 100%; height: auto; display: block; }
:where(.pp) a { color: var(--greige-deep); }
:where(.pp) :is(h1, h2, h3, p, ol, ul, dl, figure) { margin: 0; padding: 0; }
:where(.pp) :is(ol, ul) { list-style: none; }

.pp-page {
  position: relative;
  max-width: var(--page);
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(74, 69, 66, .08);
}

.pp-muted { color: var(--ink-soft); }

/* ───── 表紙 ─────
 *
 *  上に写真（画面の残りいっぱい）、下にグレージュの帯。写真の上に白い筆記体で題を重ねる。
 */

.pp-cover {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.pp-cover__photo {
  position: relative;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  background: var(--greige-pale);
}
.pp-cover__photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 写真が明るくても白い題が読めるよう、題を置く下の方だけ少し暗くする */
.pp-cover__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(40, 34, 30, .32));
  pointer-events: none;
}
/* 題は見本と同じく、大きな筆書きの英字を右上がりに傾け、かすれを付ける。写真の下の方に置く */
.pp-cover__title {
  /* 写真の下の方に置き、顔に掛からないように。箱は字の大きさにしておくこと。
   * 写真いっぱいの箱を傾けると、軸（箱の真ん中）から離れた下の字が右へ流れる */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;                /* 傾けた分、左下の字が帯に掛からないように */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Hurricane', var(--script);
  font-size: min(96px, 23vw);
  line-height: .9;
  letter-spacing: 0;
  color: #fff;
  -webkit-text-stroke: .8px currentColor;   /* Hurricane は線が細いので、見本の筆の太さに寄せる */
  text-shadow: 0 1px 14px rgba(40, 34, 30, .3);
  /* 筆記体は字が右へはみ出して描かれるので、箱の真ん中に置いても右に寄って見える。
   * 実際の字の左右の端を測り、そのずれの分だけ左へ戻す（書体を替えたら測り直すこと） */
  transform: translateX(-.19em) rotate(-7deg);
  filter: url(#pp-dry);
}
.pp-cover__title span { display: block; padding: 0 .2em; }
.pp-cover__filter { position: absolute; width: 0; height: 0; }

/* 写真が無いしおり。淡い地に枝を置き、題はグレージュで */
.pp-cover--empty .pp-cover__photo::after { display: none; }
.pp-cover__photo > .pp-cover__bouquet {
  inset: auto;
  left: 50%;
  top: 50%;
  width: auto;
  height: 82%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: .5;
}
.pp-cover--empty .pp-cover__title { color: var(--greige-deep); text-shadow: none; }

.pp-cover__band {
  padding: 26px 24px 30px;
  background: var(--greige);
  color: #fff;
  text-align: center;
}
.pp-cover__families { font-size: 17px; font-weight: 500; line-height: 1.9; letter-spacing: .2em; }
.pp-cover__families span { display: block; }
.pp-cover__date { margin-top: 10px; font-size: 13px; letter-spacing: .12em; opacity: .92; }

/* ───── セクション ───── */

.pp-section {
  position: relative;
  padding: 64px 28px;
  text-align: center;
}
.pp-section--tint { background: var(--greige-pale); }
/* 思い出。見本の真ん中の面と同じグレージュの地 */
.pp-section--greige { background: var(--greige); color: #fff; }
.pp-section--greige .pp-heading__en { color: #fff; }

/* 文の後ろに敷く淡い花 */
.pp-backdrop {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: var(--wash);
}
.pp-backdrop--right { top: 40px; right: -36px; width: 52%; max-width: 230px; }
.pp-section > :not(.pp-backdrop) { position: relative; z-index: 1; }

/* 見出し。筆記体の英字と、その下に小さな日本語 */
.pp-heading { margin-bottom: 36px; font-weight: 400; }
.pp-heading__en {
  display: block;
  font-family: var(--script);
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--greige-deep);
}
.pp-heading__ja {
  display: block;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .3em;
  padding-left: .3em;   /* 字間の分だけ右へずれるのを戻す */
}

.pp-text { font-size: 14px; line-height: 2.4; }

/* 本日の流れ */
.pp-venue { margin-bottom: 36px; }
.pp-venue__date { font-size: 20px; letter-spacing: .08em; line-height: 1.5; }
.pp-venue__date small { font-size: 13px; }
.pp-venue__time { display: block; font-size: 16px; color: var(--ink-soft); }
.pp-venue__name { margin-top: 14px; font-size: 17px; font-weight: 600; }
.pp-venue__address { font-size: 12px; color: var(--ink-soft); line-height: 1.8; }

/* 地図。Google の埋め込みは配色を指定できないので、filter で彩度を落とす */
.pp-map {
  margin: -8px auto 40px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.pp-map iframe {
  display: block;
  width: 100%;
  height: 240px;
  border: 0;
  filter: grayscale(.75) brightness(1.03);
}

/* 当日の予定と今後の予定。ボタニカルと同じく、時刻・日付の列を揃えて左寄せにし、点線で区切る */
.pp-list { max-width: 300px; margin: 0 auto; }
.pp-list > div {
  display: flex;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
  text-align: left;
}
.pp-list dt { flex: 0 0 7.5em; color: var(--greige-deep); letter-spacing: .08em; white-space: nowrap; }
.pp-list dd { margin: 0; flex: 1; text-align: left; }
/* 時刻・日付が未入力の行は列を詰める（空の列の分だけ予定が右へずれるため） */
.pp-list dt:empty { display: none; }

/* 今後の予定の左右に添える小枝 */
/* 予定の幅を狭めず文字にも重ならないよう、枝は予定の下の左右の端に置く */
.pp-sprigs { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
.pp-sprigs .pp-list { grid-column: 1 / -1; grid-row: 1; width: 100%; }
.pp-sprigs__left, .pp-sprigs__right { grid-row: 2; margin-top: 10px; opacity: .8; pointer-events: none; }
.pp-sprigs__left { justify-self: start; width: 54px; }
.pp-sprigs__right { justify-self: end; width: 32px; }

.pp-button {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 26px;
  border: 1px solid var(--greige-deep);
  font-size: 13px;
  text-decoration: none;
  color: var(--greige-deep);
  letter-spacing: .14em;
  transition: background .3s, color .3s;
}
.pp-button:hover, .pp-button:focus-visible { background: var(--greige-deep); color: #fff; }

/* 広告。中央に寄せ、前後に余白を取る */
.pp-ad { margin: 48px auto 0; text-align: center; }
.pp-ad .google_ads_rec { display: flex; justify-content: center; }

/* 協賛 */
#sponsor .pp-heading__ja { letter-spacing: .12em; padding-left: .12em; }
.pp-affiliates { display: grid; gap: 40px; }
.pp-affiliate img { margin: 0 auto 12px; height: auto; }
.pp-affiliate p { font-size: 13px; line-height: 1.9; }
.pp-affiliate__name { font-weight: 600; font-size: 15px !important; margin-bottom: 6px !important; }
.pp-affiliate__pick { color: var(--greige-deep); margin-top: 8px !important; }

/* ふたりのプロフィール */
.pp-couple { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; align-items: start; }
/* 見本と同じく、上を丸めたアーチ形 */
.pp-portrait { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 999px 999px 0 0; background: var(--greige-pale); }
.pp-portrait img { width: 100%; height: 100%; object-fit: cover; }
.pp-person__name {
  margin-top: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--ink-soft);
  font-size: 16px;
  letter-spacing: .14em;
}
.pp-person__en { margin-top: 4px; font-size: 11px; letter-spacing: .16em; color: var(--ink-soft); line-height: 1.6; }
.pp-person__prof { margin-top: 10px; font-size: 12px; line-height: 2; text-align: left; overflow-wrap: anywhere; }

/* 家族。見本と同じく、家の名前の下を角の丸い枠で囲み、枠の角に淡い花を1輪 */
.pp-family { position: relative; margin: 0 auto 44px; }
.pp-family + .pp-ad { margin: 0 auto 44px; }
.pp-family__title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--greige-deep);
}
.pp-members {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 12px;
  padding: 24px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
/* 文字に重ならないよう、枠の右下の角に */
.pp-family__daisy {
  position: absolute;
  z-index: 2;
  right: -10px;
  bottom: -14px;
  width: 52px;
  opacity: var(--wash);
  pointer-events: none;
}
.pp-photo {
  width: 96px;
  aspect-ratio: 1;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--greige-pale);
}
.pp-photo img { width: 100%; height: 100%; object-fit: cover; }
.pp-members__name { font-size: 13px; letter-spacing: .14em; line-height: 1.7; }
.pp-members__rel { color: var(--greige-deep); }
.pp-members__rel:not(:empty)::after { content: '：'; }
.pp-members__rel:empty { display: none; }
.pp-members__prof { margin-top: 4px; font-size: 12px; line-height: 1.85; color: var(--ink-soft); overflow-wrap: anywhere; }

/* 出会いから今まで。写真と文を左右交互に */
.pp-story { display: grid; gap: 30px; text-align: left; }
.pp-story__item { display: grid; grid-template-columns: 55% 1fr; gap: 14px; align-items: center; }
.pp-story__item:nth-child(even) { grid-template-columns: 1fr 55%; }
.pp-story__item:nth-child(even) .pp-story__photo { order: 2; }
.pp-story__item:nth-child(even) .pp-story__body { text-align: right; }
/* 長い文を右寄せにすると読みにくいので、日付と題だけ右に寄せる */
.pp-story__item:nth-child(even) .pp-story__text { text-align: left; }
.pp-story__item--text { grid-template-columns: 1fr !important; text-align: center; }
.pp-story__item--text .pp-story__body { text-align: center !important; }
.pp-story__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pp-story__date { font-size: 12px; color: var(--greige-deep); letter-spacing: .1em; line-height: 1.7; }
.pp-story__title { font-size: 14px; font-weight: 600; line-height: 1.7; }
.pp-story__text { margin-top: 4px; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }

/* 思い出。見本のように大小を組み合わせる。
 * 3枚で1組（大1・小2）にし、大きい写真を左・右と交互に置く。
 * 枚数が3の倍数でないときは、最後の写真を広げて隙間を埋める。
 * 広告の li を数えないよう、:nth-child(... of .pp-gallery__photo) で数える */
.pp-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 5px;
}
.pp-gallery__photo:nth-child(6n + 1 of .pp-gallery__photo) { grid-column: 1 / span 2; grid-row: span 2; }
.pp-gallery__photo:nth-child(6n + 4 of .pp-gallery__photo) { grid-column: 2 / span 2; grid-row: span 2; }
/* 1組の最初の1枚だけが残ったら、横いっぱいに */
.pp-gallery__photo:nth-child(3n + 1 of .pp-gallery__photo):nth-last-child(1 of .pp-gallery__photo) { grid-column: 1 / -1; grid-row: auto; }
.pp-gallery__photo:nth-child(3n + 1 of .pp-gallery__photo):nth-last-child(1 of .pp-gallery__photo) img { aspect-ratio: 3 / 2; }
/* 大1・小1で終わったら、小を縦に2段ぶん伸ばす */
.pp-gallery__photo:nth-child(3n + 2 of .pp-gallery__photo):nth-last-child(1 of .pp-gallery__photo) { grid-row: span 2; }
.pp-gallery figure { position: relative; height: 100%; overflow: hidden; cursor: zoom-in; }
.pp-gallery img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .8s var(--ease); }
.pp-gallery figure:hover img { transform: scale(1.04); }
.pp-gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 6px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .04em;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(40, 30, 30, .55));
}
.pp-gallery__ad { grid-column: 1 / -1; grid-row: auto !important; display: flex; justify-content: center; padding: 16px 0; }

/* 拡大表示 */
.pp-lightbox {
  max-width: min(92vw, 640px);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}
.pp-lightbox::backdrop { background: rgba(40, 30, 30, .78); }
.pp-lightbox img { width: 100%; max-height: 78vh; object-fit: contain; background: #222; }
.pp-lightbox p { padding: 10px 16px 14px; font-size: 14px; text-align: center; }
.pp-lightbox p:empty { display: none; }
.pp-lightbox__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--ink);
  font-size: 24px;
  line-height: 36px;
  cursor: pointer;
}

/* 結び */
.pp-footer { position: relative; padding: 48px 28px 64px; text-align: center; }
/* 他のテーマと同じロゴ。書体は bloom と同じ M+ 1c Thin のサブセット（4KB・この名前の字だけ入っている） */
@font-face {
  font-family: 'pp-mplus';
  src: url("../fonts/mplus-1c-thin.5223838dc4ed.ttf") format('truetype');
}
.pp-footer__brand { display: inline-flex; align-items: center; gap: 0; text-decoration: none; color: #000 !important; }
.pp-footer__brand img { width: 18px; height: auto; }
.pp-footer__brand span { font-family: 'pp-mplus', Arial, serif; font-size: 16px; letter-spacing: 0; }

/* ───── プレビュー（編集中の確認画面）─────
 *
 *  上の「マイページへ」は form/css/common_style.css が作る。
 *  下の「編集」「共有用ページ」は、このテーマが Bootstrap を読まないので、ここで形を付ける。
 */
.pp--preview { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.pp .header {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
}
.pp .header .btn {
  flex: 1;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--greige-deep);
  background: var(--greige-deep);
  color: #fff;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-align: center;
  text-decoration: none;
}
.pp .header .preview-btn { background: #fff; color: var(--greige-deep); }

/* プレビューのときのヘッダー（common_style.css）と重ならないように */
/* 下の「編集」の帯（約64px）に帯の日付が隠れないよう、表紙の高さからその分を引く */
.header-top + .header + .pp-page .pp-cover {
  padding-top: 50px;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px - env(safe-area-inset-bottom));
}

/* ───── 動き ─────
 *
 *  html.js のときだけ「出現前」にする。JS が読めない環境では最初から全部見える。
 *  動きを減らす設定の端末では一切動かさない（末尾）。
 */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* 見出し。英字はペンで書くように左から現れ、日本語はそのあとに */
.js .pp-heading.reveal { transform: none; }
.js .pp-heading__en { clip-path: inset(-20% 100% -20% 0); transition: clip-path 1.6s var(--brush); }
.js .pp-heading__ja { opacity: 0; transition: opacity 1s var(--ease) 1s; }
.js .pp-heading.is-in .pp-heading__en { clip-path: inset(-20% -5% -20% 0); }
.js .pp-heading.is-in .pp-heading__ja { opacity: 1; }

/* 表紙。写真がゆっくり寄り、題は1行ずつペンで書くように左から現れる。そのあと帯の文字 */
.js .pp-cover__photo > img { opacity: 0; transform: scale(1.06); }
.js .pp-cover__photo > .pp-cover__bouquet { transform: translate(-50%, -50%); }
.js .pp-cover__title span { clip-path: inset(-30% 100% -30% -10%); }
.js .pp-cover__band > * { opacity: 0; transform: translateY(10px); }

.pp-cover__photo > img { transition: opacity 1.6s var(--ease), transform 6s var(--ease); }
.pp-cover__title span { transition: clip-path 1.5s var(--brush); }
.pp-cover__title span:nth-child(1) { transition-delay: .9s; }
.pp-cover__title span:nth-child(2) { transition-delay: 1.6s; }
.pp-cover__title span:nth-child(3) { transition-delay: 2.3s; }
.pp-cover__band > * { transition: opacity 1.2s var(--ease) 3.2s, transform 1.2s var(--ease) 3.2s; }

.js.is-ready .pp-cover__photo > img { opacity: 1; transform: none; }
.js.is-ready .pp-cover__photo > .pp-cover__bouquet { opacity: .5; transform: translate(-50%, -50%); }
.js.is-ready .pp-cover__title span { clip-path: inset(-30% -10% -30% -10%); }
.js.is-ready .pp-cover__band > * { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pp *, .pp *::before, .pp *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .pp-heading__ja, .js .pp-cover__band > *,
  .js .pp-cover__photo > img { opacity: 1 !important; transform: none !important; }
  .js .pp-cover__photo > .pp-cover__bouquet { opacity: .5 !important; transform: translate(-50%, -50%) !important; }
  .js .pp-cover__title span, .js .pp-heading__en { clip-path: none !important; }
}
