/*
 *  ボタニカル（theme 4）
 *
 *  緑×白の水彩。スマホの縦スクロールを基準に組み、PC では中央に
 *  紙面の幅（--page）で置く。Bootstrap などの既成の CSS は読まない。
 *
 *  飾りの画像は form/static/botanical/images/ の4点（AI で生成した水彩を
 *  地を透過にして WebP にしたもの）。地の色 --paper に重ねる前提で
 *  半透明のまま残してあるので、濃い地の上には置かないこと。
 */

:root {
  --paper: #FAF9F5;
  --ink: #55564F;
  --ink-soft: #85867D;
  --sage: #8C9A72;
  --sage-deep: #6F7D57;
  --leaf: #C8D3AE;
  --blush: #E9D8D2;
  --line: #E2E4D8;
  --page: 480px;
  --script: 'Allura', 'Snell Roundhand', cursive;
  --sans: 'Kiwi Maru', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  /* 英字が書かれていく動き。書き始めと終わりをゆっくりにして、ペンで書いているように */
  --pen: cubic-bezier(.45, .05, .35, 1);
}

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

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

body.bt {
  margin: 0;
  background: #EEEDE6;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 2;
  letter-spacing: .06em;
  -webkit-font-smoothing: antialiased;
}

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

.bt-page {
  position: relative;
  max-width: var(--page);
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(85, 86, 79, .08);
}

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

/* ───── 表紙 ───── */

.bt-cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26vw 28px 30vw;
  text-align: center;
}
@media (min-width: 480px) { .bt-cover { padding: 125px 28px 145px; } }

/* 紙面より少し広くして左右にはみ出させる。端の枝が切れて、奥へ続いて見える */
.bt-garland { position: absolute; left: -12%; width: 124%; max-width: none !important; pointer-events: none; }
.bt-garland--top { top: -2%; }
.bt-garland--bottom { bottom: 0; }

.bt-cover__title {
  font-family: var(--script);
  font-size: 44px;
  line-height: 1.1;
  color: var(--sage-deep);
  letter-spacing: 0;
  transform: rotate(-6deg);
  margin: 0 0 26px;
}
.bt-cover__title span { display: inline-block; padding: .1em .3em .3em; }

.bt-arch {
  width: 62%;
  max-width: 270px;
  aspect-ratio: 3 / 4;
  margin: 0 auto 30px;
  border-radius: 999px 999px 6px 6px;
  overflow: hidden;
  background: #EEF0E6;
  box-shadow: 0 10px 30px rgba(111, 125, 87, .15);
}
.bt-arch img { width: 100%; height: 100%; object-fit: cover; }

.bt-arch--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 40%, #fff 0%, #F1F3EA 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.bt-arch__sprig { width: 34%; height: auto; }
.bt-arch__names { font-size: 18px; letter-spacing: .2em; }
.bt-arch__names span { font-family: var(--script); font-size: 26px; color: var(--sage); margin: 0 .4em; letter-spacing: 0; }

.bt-cover__families {
  font-weight: 500;
  font-size: 19px;
  line-height: 1.9;
  color: var(--sage-deep);
  letter-spacing: .14em;
}
.bt-cover__families span { display: block; }

.bt-scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 22px;
  height: 36px;
  margin-left: -11px;
  border: 1px solid var(--sage);
  border-radius: 12px;
  opacity: .6;
}
.bt-scroll span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 2px;
  height: 7px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--sage);
  animation: bt-scroll 2s var(--ease) infinite;
}
@keyframes bt-scroll {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

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

.bt-section {
  position: relative;
  padding: 72px 28px;
  text-align: center;
}
.bt-section + .bt-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 1px;
  margin-left: -20px;
  background: var(--leaf);
}
.bt-section--tint { background: #F3F4EC; }

.bt-heading { margin-bottom: 36px; font-weight: 400; }
.bt-heading__en {
  display: inline-block;
  padding: .1em .3em .3em;
  font-family: var(--script);
  font-size: 40px;
  line-height: 1.1;
  color: var(--sage);
  letter-spacing: 0;
}
.bt-heading__ja {
  display: block;
  margin-top: -2px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .22em;
}

.bt-sprig {
  position: absolute;
  top: 40px;
  width: 64px;
  height: auto;
  opacity: .95;
  pointer-events: none;
  transform-origin: 50% 100%;
}
.bt-sprig--right { right: 18px; }
.bt-sprig--left { left: 18px; }

.bt-text { font-size: 15px; line-height: 2.2; }

/* 本日の予定 */
.bt-venue { margin-bottom: 40px; }
.bt-venue__date { font-size: 26px; letter-spacing: .08em; color: var(--sage-deep); line-height: 1.4; }
.bt-venue__date small { font-size: 13px; margin-left: .4em; }
.bt-venue__time { display: block; font-size: 18px; }
.bt-venue__name { margin-top: 14px; font-size: 17px; font-weight: 500; }
.bt-venue__address { font-size: 13px; color: var(--ink-soft); line-height: 1.8; }

/* 地図。Google の埋め込みは配色を指定できないので、filter で彩度を落として緑に寄せる */
.bt-map {
  margin: -16px auto 44px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(111, 125, 87, .1);
}
.bt-map iframe {
  display: block;
  width: 100%;
  height: 240px;
  border: 0;
  filter: grayscale(.55) sepia(.3) hue-rotate(35deg) saturate(.9) brightness(1.03);
}

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


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

/* 協賛 */
.bt-affiliates { display: grid; gap: 40px; }
.bt-affiliate img { margin: 0 auto 12px; height: auto; border-radius: 8px; }
.bt-affiliate p { font-size: 13px; line-height: 1.9; }
.bt-affiliate__name { font-weight: 500; font-size: 15px !important; margin-bottom: 6px !important; }
.bt-affiliate__pick { color: var(--sage-deep); margin-top: 8px !important; }

/* 写真（丸） */
.bt-photo {
  width: 88px;
  aspect-ratio: 1;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  background: #EEF0E6;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line);
}
.bt-photo img { width: 100%; height: 100%; object-fit: cover; }
.bt-photo--lg { width: 116px; }

/* プロフィール */
.bt-couple { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; align-items: start; }
.bt-couple--text { margin-top: 22px; }
.bt-person__name { margin-top: 8px; font-size: 16px; font-weight: 500; letter-spacing: .14em; }
.bt-person__en { font-family: var(--script); font-size: 22px; line-height: 1.2; color: var(--sage); letter-spacing: 0; }
.bt-person__prof { font-size: 13px; line-height: 1.95; text-align: left; overflow-wrap: anywhere; }

/* 家族紹介 */
.bt-family {
  margin: 0 auto 28px;
  padding: 26px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .55);
}
.bt-family + .bt-ad { margin: 0 auto 28px; }
.bt-family__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .24em;
  color: var(--sage-deep);
  margin-bottom: 20px;
}
.bt-members { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 12px; }
.bt-members__name { font-size: 13px; font-weight: 500; line-height: 1.6; }
.bt-members__name span { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.bt-members__prof { margin-top: 4px; font-size: 12px; line-height: 1.75; color: var(--ink-soft); overflow-wrap: anywhere; }

/* 馴れ初め */
.bt-story { position: relative; max-width: 360px; margin: 0 auto; text-align: left; }
.bt-story::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--leaf);
}
.bt-story__item { position: relative; padding: 0 0 36px 30px; }
.bt-story__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--sage);
}
.bt-story__date { font-size: 13px; color: var(--sage); letter-spacing: .12em; line-height: 1.8; }
.bt-story__title { font-size: 16px; font-weight: 500; line-height: 1.7; }
.bt-story__photo { margin-top: 12px; border-radius: 12px; overflow: hidden; }
.bt-story__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.bt-story__text { margin-top: 10px; font-size: 13px; line-height: 1.95; }

/* 今後の予定 */
.bt-schedule { max-width: 300px; margin: 0 auto; }
.bt-schedule > div {
  display: flex;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
  text-align: left;
}
.bt-schedule dt { color: var(--sage-deep); letter-spacing: .08em; white-space: nowrap; }
.bt-schedule dt { flex: 0 0 7.5em; }
.bt-schedule dd { margin: 0; flex: 1; text-align: left; }
/* 時刻・日付が未入力の行は列を詰める（空の列の分だけ予定が右へずれるため） */
.bt-schedule dt:empty { display: none; }

/* 思い出 */
.bt-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bt-gallery li:first-child { grid-column: 1 / -1; }
.bt-gallery figure { position: relative; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.bt-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .8s var(--ease); }
.bt-gallery li:first-child img { aspect-ratio: 4 / 3; }
.bt-gallery figure:hover img { transform: scale(1.04); }
.bt-gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(40, 45, 32, .55));
}
.bt-gallery__ad { grid-column: 1 / -1; display: flex; justify-content: center; padding: 16px 0; }

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

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

/* ───── プレビュー（編集中の確認画面）─────
 *
 *  上の「マイページへ」は form/css/common_style.css が作る。
 *  下の「編集」「共有用ページ」は、他のテーマではテーマ側の CSS（Bootstrap 等）で
 *  形を付けている。このテーマは読まないので、ここで同じ配置（下に固定・2つ並び）にする。
 */
.bt--preview { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.bt .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(250, 249, 245, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
}
.bt .header .btn {
  flex: 1;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--sage);
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-align: center;
  text-decoration: none;
}
.bt .header .preview-btn { background: #fff; color: var(--sage-deep); }

/* プレビューのときのヘッダー（common_style.css）と重ならないように */
.header-top + .header + .bt-page .bt-cover { padding-top: calc(min(26vw, 125px) + 50px); }

/* ───── 動き ─────
 *
 *  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 .bt-heading.reveal { transform: none; }
.js .bt-heading .bt-heading__en { clip-path: inset(-20% 100% -40% -20%); transition: clip-path var(--write, 2.4s) var(--pen) .2s; }
.js .bt-heading.is-in .bt-heading__en { clip-path: inset(-20% -20% -40% -20%); }

/* 表紙。読み込み直後に順に現れる */
.js .bt-cover .bt-garland--top { opacity: 0; transform: translateY(-24px) scale(1.04); }
.js .bt-cover .bt-garland--bottom { opacity: 0; transform: translateY(24px) scale(1.04); }
.js .bt-cover__title span { clip-path: inset(-20% 100% -40% -20%); }
.js .bt-cover .bt-arch,
.js .bt-cover__families { opacity: 0; transform: translateY(14px); }

.bt-garland, .bt-cover__title span, .bt-arch, .bt-cover__families {
  transition: opacity 1.6s var(--ease), transform 2.2s var(--ease), clip-path 2.2s var(--ease);
}

.js.is-ready .bt-cover .bt-garland { opacity: 1; transform: none; }
/* 書く時間 --write は theme.js が文字数から決める（長い英字ほど長く） */
.bt-cover__title span { transition: clip-path var(--write, 2.2s) var(--pen); }
.js.is-ready .bt-cover__title span { clip-path: inset(-20% -20% -40% -20%); transition-delay: .5s; }
.js.is-ready .bt-cover .bt-arch { opacity: 1; transform: none; transition-delay: .9s; }
.js.is-ready .bt-cover__families { opacity: 1; transform: none; transition-delay: 1.3s; }

/* 表紙の葉は、読み込み後にゆっくり揺れ続ける。小枝も同じ */
.is-ready .bt-cover .bt-garland--top { animation: bt-sway-top 9s ease-in-out 2.4s infinite; transform-origin: 50% 0; }
.bt-sprig { animation: bt-sway 7s ease-in-out infinite; }
@keyframes bt-sway-top { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(.6deg) translateY(2px); } }
@keyframes bt-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bt *, .bt *::before, .bt *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .bt-cover .bt-garland, .js .bt-cover .bt-arch,
  .js .bt-cover__families {
    opacity: 1 !important; transform: none !important;
  }
  .js .bt-cover__title span, .js .bt-heading .bt-heading__en { clip-path: none !important; }
}
