/*
 *  テラコッタ（theme 8）
 *
 *  生成りの紙に、テラコッタの面と白いアーチ。三つ折りの顔合わせしおりの組みを、
 *  スマホの縦スクロールに直したもの。PC では中央に紙面の幅（--page）で置く。
 *  Bootstrap などの既成の CSS は読まない。
 *
 *  見出しはスモールキャップの英字（Cormorant SC）に日本語を小さく添える。文言はボタニカルと同じ。
 *  イラスト（form/static/terracotta/images/）は画像AIで作った平たい色面の絵で、
 *  外周から続く白だけを透過にした WebP（絵の中の生成りは残してある）。
 */

:root {
  --paper: #FBF7F2;
  --ink: #4B403B;
  --ink-soft: #8C7E77;
  --terra: #D9785B;
  --terra-deep: #C0603F;
  --blush: #EBC2B5;
  --sage: #8FA68A;
  --cream: #FFFDF9;
  --line: #EAD9CF;
  --page: 480px;
  --serif: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --caps: 'Cormorant SC', 'Shippori Mincho', serif;
  --script: 'Pinyon Script', 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.tc {
  margin: 0;
  background: #EFE6DE;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2;
  letter-spacing: .12em;
  -webkit-font-smoothing: antialiased;
}

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

.tc-page {
  position: relative;
  max-width: var(--page);
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(75, 64, 59, .08);
}

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

/* ───── 表紙 ─────
 *
 *  題・両家・お皿のイラスト・日付と会場を、1画面に縦に並べる。写真は置かない。
 */

.tc-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 48px 28px 72px;
  text-align: center;
}
.tc-cover__title {
  font-size: min(30px, 7.6vw);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: .22em;
}
.tc-cover__title span { display: block; padding-left: .22em; }
.tc-cover__families { margin-top: 10px; font-size: 19px; font-weight: 500; letter-spacing: .2em; }

/* お皿。カードは画像では無地で、文字はここで重ねる。
 * 位置と傾きは画像（table.webp・754×760）のカードの枠を測った値。
 * 枠の中心は (49.8%, 50.1%)、傾き -11.5度、幅は画像の 34.4%。
 * 右下の角にオリーブの枝が掛かるので、文字は少し左上に寄せる。 */
.tc-table {
  position: relative;
  width: min(300px, 78vw);
  margin: 22px auto 18px;
  container-type: inline-size;
}
.tc-table img { width: 100%; }
.tc-table__card {
  position: absolute;
  left: 48.4%;
  top: 48.6%;
  transform: translate(-50%, -50%) rotate(-11.5deg);
  font-family: var(--script);
  font-size: 6.4cqw;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--terra-deep);
  white-space: nowrap;
}
.tc-table__card span { display: block; }
.tc-table__card span + span { padding-left: 1.4em; }

.tc-cover__date { font-size: 16px; letter-spacing: .14em; line-height: 1.8; }
.tc-cover__place { font-size: 15px; letter-spacing: .14em; line-height: 1.8; }

.tc-scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 1px;
  height: 40px;
  margin-left: -.5px;
  background: var(--line);
  overflow: hidden;
}
.tc-scroll span {
  position: absolute;
  left: 0;
  top: -40px;
  width: 1px;
  height: 40px;
  background: var(--terra);
  animation: tc-scroll 2.4s var(--ease) infinite;
}
@keyframes tc-scroll { to { transform: translateY(80px); } }

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

.tc-section {
  position: relative;
  padding: 64px 28px;
  text-align: center;
}
.tc-section--tint { background: #F3EAE3; }

/* ごあいさつ。見本と同じく、テラコッタの地に白いアーチ形の面を立てる */
.tc-section--terra { padding: 36px 16px; background: var(--terra); }
/* 上を半円にする。角の丸みを大きく取ると、幅の半分で頭打ちになり半円になる */
.tc-arch {
  padding: 120px 14px 52px;
  border-radius: 999px 999px 0 0;
  background: var(--cream);
}
/* ごあいさつは1行が長いので、字間を詰めて折り返しを減らす */
.tc-arch .tc-text { font-size: 13.5px; letter-spacing: .05em; }

/* 見出し。スモールキャップの英字（頭の字だけ大きい）と、その下に小さな日本語 */
.tc-heading { margin-bottom: 32px; font-weight: 400; }
.tc-heading__en {
  display: block;
  font-family: var(--caps);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .06em;
  color: var(--terra);
}
.tc-heading__ja {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: .3em;
  padding-left: .3em;   /* 字間の分だけ右へずれるのを戻す */
}

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

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

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

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

/* 乾杯のグラス（当日の予定の見出しの下） */
.tc-toast { width: 104px; margin: -12px auto 26px; }

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

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

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

/* ふたりのプロフィール */
.tc-couple { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; align-items: start; }
/* 見本と同じく丸く切り抜き、2人の上にオリーブの冠を置く（写真の顔に掛からないよう、重ねない） */
.tc-wreath { width: 62%; margin: -6px auto 14px; pointer-events: none; }
.tc-portrait { width: 82%; margin: 0 auto; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: #F3EAE3; }
.tc-portrait img { width: 100%; height: 100%; object-fit: cover; }
.tc-person__name {
  margin-top: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--terra);
  font-size: 16px;
  letter-spacing: .14em;
}
.tc-person__en { margin-top: 4px; font-size: 11px; letter-spacing: .16em; color: var(--ink-soft); line-height: 1.6; }
.tc-person__prof { margin-top: 10px; font-size: 12px; line-height: 2; text-align: left; overflow-wrap: anywhere; }

/* 家族。家の名前の左右にテラコッタの細い線を引いて区切る */
.tc-family { margin: 0 auto 44px; }
.tc-family + .tc-ad { margin: 0 auto 44px; }
.tc-family__title {
  display: flex;
  align-items: center;
  gap: 1.4em;
  margin-bottom: 26px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .24em;
  color: var(--terra-deep);
}
.tc-family__title::before,
.tc-family__title::after { content: ''; flex: 1; height: 1px; background: var(--terra); }
.tc-family__title span { padding-left: .24em; }   /* 字間の分だけ右へずれるのを戻す */
.tc-members { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 14px; }
.tc-photo {
  width: 96px;
  aspect-ratio: 1;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  background: #F3EAE3;
}
.tc-photo img { width: 100%; height: 100%; object-fit: cover; }
.tc-members__name { font-size: 13px; letter-spacing: .14em; line-height: 1.7; }
.tc-members__rel { color: var(--terra-deep); }
.tc-members__rel:not(:empty)::after { content: '：'; }
.tc-members__rel:empty { display: none; }
.tc-members__prof { margin-top: 4px; font-size: 12px; line-height: 1.85; color: var(--ink-soft); overflow-wrap: anywhere; }

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

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

/* 拡大表示 */
.tc-lightbox {
  max-width: min(92vw, 640px);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}
.tc-lightbox::backdrop { background: rgba(40, 30, 30, .78); }
.tc-lightbox img { width: 100%; max-height: 78vh; object-fit: contain; background: #222; }
.tc-lightbox p { padding: 10px 16px 14px; font-size: 14px; text-align: center; }
.tc-lightbox p:empty { display: none; }
.tc-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;
}

/* 結び。見本の真ん中の面と同じく、テラコッタの地に角の丸い縦長の白い面。ロゴと案内はその下の生成りの地に */
.tc-footer { position: relative; padding: 0 0 64px; text-align: center; }
.tc-closing { margin-bottom: 48px; padding: 36px 16px; background: var(--terra); }
.tc-pill {
  padding: 64px 20px;
  border-radius: 140px;
  background: var(--cream);
}
.tc-pill__letter { width: 120px; margin: 0 auto 18px; }
.tc-pill__text { margin-top: 8px; font-size: 13px; line-height: 2.2; }
/* 他のテーマと同じロゴ。書体は bloom と同じ M+ 1c Thin のサブセット（4KB・この名前の字だけ入っている） */
@font-face {
  font-family: 'tc-mplus';
  src: url("../fonts/mplus-1c-thin.5223838dc4ed.ttf") format('truetype');
}
.tc-footer__brand { display: inline-flex; align-items: center; gap: 0; text-decoration: none; color: #000 !important; }
.tc-footer__brand img { width: 18px; height: auto; }
.tc-footer__brand span { font-family: 'tc-mplus', Arial, serif; font-size: 16px; letter-spacing: 0; }

/* ───── プレビュー（編集中の確認画面）─────
 *
 *  上の「マイページへ」は form/css/common_style.css が作る。
 *  下の「編集」「共有用ページ」は、このテーマが Bootstrap を読まないので、ここで形を付ける。
 */
.tc--preview { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.tc .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);
}
.tc .header .btn {
  flex: 1;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--terra-deep);
  background: var(--terra-deep);
  color: #fff;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-align: center;
  text-decoration: none;
}
.tc .header .preview-btn { background: #fff; color: var(--terra-deep); }

/* プレビューのときのヘッダー（common_style.css）と重ならないように */
/* 下の「編集」の帯（約64px）に帯の日付が隠れないよう、表紙の高さからその分を引く */
.header-top + .header + .tc-page .tc-cover {
  padding-top: 98px;
  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 .tc-heading.reveal { transform: none; }
.js .tc-heading__en { letter-spacing: .3em; opacity: 0; transition: letter-spacing 1.4s var(--ease), opacity 1.2s var(--ease); }
.js .tc-heading__ja { opacity: 0; transition: opacity 1s var(--ease) .8s; }
.js .tc-heading.is-in .tc-heading__en { letter-spacing: .06em; opacity: 1; }
.js .tc-heading.is-in .tc-heading__ja { opacity: 1; }
/* アーチの中の見出しは、アーチと一緒に出す */
.js .tc-arch.is-in .tc-heading__en { letter-spacing: .06em; opacity: 1; }
.js .tc-arch.is-in .tc-heading__ja { opacity: 1; }

/* 表紙。題、両家、お皿、カードの文字、日付の順に現れる */
.js .tc-cover > *:not(.tc-scroll), .js .tc-table__card { opacity: 0; }
.js .tc-cover > *:not(.tc-scroll) { transform: translateY(12px); }
.js .tc-table__card { clip-path: inset(-20% 100% -20% -10%); }

.tc-cover > * { transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
.tc-cover__title { transition-delay: .2s; }
.tc-cover__families { transition-delay: .7s; }
.tc-table { transition-delay: 1.1s; }
.tc-table__card { transition: opacity .6s var(--ease) 2.2s, clip-path 1.8s var(--brush) 2.2s; }
.tc-cover__date, .tc-cover__place { transition-delay: 2.8s; }

.js.is-ready .tc-cover > *:not(.tc-scroll) { opacity: 1; transform: none; }
.js.is-ready .tc-table__card { opacity: 1; clip-path: inset(-20% -10% -20% -10%); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tc *, .tc *::before, .tc *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .tc-heading__en, .js .tc-heading__ja, .js .tc-cover > *,
  .js .tc-table__card { opacity: 1 !important; transform: none !important; }
  .js .tc-table__card { transform: translate(-50%, -50%) rotate(-11.5deg) !important; clip-path: none !important; }
  .js .tc-heading__en { letter-spacing: .06em !important; }
}
