/* ============================================================
   wedding-editorial｜雜誌編輯風喜帖
   動態語彙：遮罩顯露（clip-path）＋ 線條抽拉（scaleX）＋ Ken Burns
   大字級 Cormorant 斜體、左對齊不對稱、大量留白
   色彩與間距 token 來自 /shared/base.css
   ============================================================ */

body {
  font-family: var(--font-serif-tc);
  font-size: var(--text-body);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 通用 ---------- */
.section-title {
  font-size: var(--text-h2);
  font-weight: 600;
  letter-spacing: .12em;
  margin-bottom: clamp(2rem, 6vw, 3.5rem);
}
/* 標題下方髮絲線：進場時從左抽拉出來 */
.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 1px;
  background: var(--accent);
  margin-top: 1.1rem;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s var(--ease-out) .35s;
}
.section-title.is-in::after { transform: scaleX(1); }
.gallery .section-title::after { margin-inline: auto; transform-origin: center; }
.rsvp .section-title::after { background: var(--accent-ink); opacity: .6; }
.label-en {
  font-family: var(--font-serif-latin);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: .75rem;
  padding-bottom: .2rem; /* italic descender 保留 */
}
.dot-sep::before { content: "\00B7"; margin-inline: .6em; opacity: .6; }

/* ============ ① Hero ============ */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  /* Ken Burns：開場 14 秒緩慢收攏，只動 transform 不傷效能 */
  animation: hero-zoom 14s var(--ease-out) both;
}
@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}
.hero-scrim { position: absolute; inset: 0; background: var(--scrim); }

/* Hero 文字改用「遮罩顯露」：像印刷品一行行浮出。
   注意：clip-path 會影響 IntersectionObserver 的可視比例，
   初始只裁 55%（其餘由 opacity:0 蓋住），才不會低於 reveal 門檻 */
.hero .reveal {
  transform: translateY(34px);
  clip-path: inset(0 0 55% 0);
  transition:
    opacity 1.1s var(--ease-out),
    transform 1.1s var(--ease-out),
    clip-path 1.1s var(--ease-out);
}
.hero .reveal.is-in { clip-path: inset(0 0 0 0); }
.hero-content {
  position: relative;
  width: 100%;
  max-width: var(--wide-max);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(3rem, 9vw, 5.5rem);
  color: #fdfcf8;
  text-align: center;
}
.hero-greeting {
  font-size: clamp(.95rem, 2.8vw, 1.1rem);
  letter-spacing: .22em;
  opacity: .92;
  margin-bottom: 1rem;
}
.hero-names {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.25;
  text-wrap: balance;
}
.hero-names .amp {
  font-family: var(--font-serif-latin);
  font-style: italic;
  font-weight: 400;
  font-size: .62em;
  margin-inline: .18em;
  opacity: .85;
}
.hero-names-en {
  font-family: var(--font-serif-latin);
  font-style: italic;
  font-size: clamp(1.15rem, 3.6vw, 1.7rem);
  letter-spacing: .22em;
  opacity: .85;
  margin-top: .5rem;
  padding-bottom: .25rem; /* italic descender 保留 */
}
.hero-date {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 3vw, 1.2rem);
  letter-spacing: .18em;
}

/* 倒數：無卡片、髮絲線分隔、Cormorant 數字 */
.countdown {
  display: inline-flex;
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
}
.cd-cell {
  display: grid;
  gap: .1rem;
  padding-inline: clamp(.9rem, 4vw, 1.6rem);
  text-align: center;
}
.cd-cell + .cd-cell { border-left: 1px solid rgba(253, 252, 248, .3); }
.cd-cell strong {
  font-family: var(--font-serif-latin);
  font-weight: 500;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.cd-cell span { font-size: var(--text-tiny); letter-spacing: .3em; opacity: .85; }
.countdown.is-past .cd-cell span { opacity: .5; }

/* 桌機：內容靠左，編輯感 */
@media (min-width: 900px) {
  .hero-content { text-align: left; }
  .hero-names { letter-spacing: .06em; }
}

/* ============ ② Our Story：編輯排版時間軸 ============
   年份改成超大 Cormorant 斜體字（雜誌刊頭手法），
   軸線在支援 :has 的瀏覽器上會隨進場向下抽拉 */
.timeline {
  position: relative;
  display: grid;
  gap: clamp(2.75rem, 8vw, 4.25rem);
  padding-left: 1.75rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: .5rem; bottom: .5rem;
  width: 1px;
  background: var(--hairline);
}
@supports selector(:has(*)) {
  .timeline::before {
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 1.6s var(--ease-out);
  }
  .timeline:has(.is-in)::before { transform: scaleY(1); }
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.75rem; top: 1.1em;
  width: .85rem; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .8s var(--ease-out) .3s;
}
.timeline-item.is-in::before { transform: scaleX(1); }
.tl-date {
  font-family: var(--font-serif-latin);
  font-style: italic;
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.1;
  color: var(--accent);
  display: block;
  padding-bottom: .15rem; /* italic descender 保留 */
}
.tl-title {
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: .1em;
  margin: .45rem 0 .4rem;
}
.tl-text { color: var(--ink-soft); max-width: 34em; }
/* 桌機：偶數則往右推，打破對齊的單調 */
@media (min-width: 900px) {
  .timeline-item:nth-child(even) { margin-left: clamp(3rem, 8vw, 6rem); }
}

/* ============ ③ Gallery：雙欄瀑布 ============ */
.gallery .section-title { text-align: center; }
.photo-grid {
  columns: 2;
  column-gap: clamp(.75rem, 2.5vw, 1.5rem);
}
.photo-item {
  break-inside: avoid;
  margin-bottom: clamp(.75rem, 2.5vw, 1.5rem);
}
.photo-item {
  overflow: hidden;
  border-radius: calc(var(--radius) * .7);
}
.photo-item img {
  width: 100%;
  border-radius: calc(var(--radius) * .7);
  filter: saturate(.9);
  transition: transform 1s var(--ease-out), filter 1s var(--ease-out);
}
@media (hover: hover) {
  /* 編輯風格的凝視感：滑過時飽和度回滿並緩慢推近 */
  .photo-item:hover img { filter: saturate(1); transform: scale(1.045); }
}
@media (min-width: 900px) {
  .photo-grid { columns: 3; }
}

/* Lightbox */
.wk-lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(20, 24, 18, .92);
  padding: 4vh 4vw;
}
.wk-lightbox.is-open { display: flex; }
.wk-lightbox img {
  max-width: 100%; max-height: 88dvh;
  border-radius: .5rem;
  margin-inline: auto;
}
.wk-lightbox button {
  position: absolute;
  color: #fdfcf8;
  font-size: 2rem;
  line-height: 1;
  padding: .75rem 1rem;
  opacity: .8;
  transition: opacity .3s var(--ease-out);
}
.wk-lightbox button:hover { opacity: 1; }
.wk-lb-close { top: .5rem; right: .75rem; font-size: 2.4rem; }
.wk-lb-prev { left: .25rem; top: 50%; transform: translateY(-50%); }
.wk-lb-next { right: .25rem; top: 50%; transform: translateY(-50%); }

/* ============ ④ Event Details ============ */
.details { text-align: center; }
/* 桌機：整段靠左，延續編輯風的不對稱版心 */
@media (min-width: 900px) {
  .details { text-align: left; }
  .details .event-list { margin-inline: 0; }
  .details .calendar-actions { justify-content: flex-start; }
}
.details-date { font-size: var(--text-h3); letter-spacing: .14em; }
.details-note { color: var(--ink-soft); font-size: var(--text-small); letter-spacing: .14em; margin-top: .25rem; }
.details-note:empty { display: none; }

.event-list {
  margin: clamp(2rem, 6vw, 3rem) auto 0;
  max-width: 26rem;
  display: grid;
  gap: 1.5rem;
}
.event-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  align-items: baseline;
  gap: 1.25rem;
  text-align: left;
}
.event-row dt {
  font-family: var(--font-serif-latin);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.event-row dd strong { font-size: var(--text-h3); font-weight: 600; letter-spacing: .1em; display: block; }
.event-row dd span { color: var(--ink-soft); font-size: var(--text-small); }

.calendar-actions {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center;
  margin-top: clamp(2rem, 6vw, 2.75rem);
}
.parents {
  margin-top: clamp(2.5rem, 7vw, 3.5rem);
  color: var(--ink-soft);
  font-size: var(--text-small);
  letter-spacing: .18em;
}

/* ============ ⑤ Venue ============ */
.venue { background: var(--paper-raise); }
.venue .section-title { margin-bottom: .5rem; }
.venue-hall { color: var(--accent); letter-spacing: .18em; }
.venue-hall:empty { display: none; }
.venue-address { color: var(--ink-soft); margin-top: .25rem; }
.map-frame {
  margin-top: clamp(1.5rem, 5vw, 2.5rem);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
}
@media (min-width: 700px) { .map-frame { aspect-ratio: 16 / 8; } }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.venue-bottom {
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
  display: grid;
  gap: 1.5rem;
}
.transport { display: grid; gap: .9rem; }
.transport li { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; align-items: baseline; }
.transport strong { font-weight: 600; letter-spacing: .2em; color: var(--accent); }
.transport span { color: var(--ink-soft); }
@media (min-width: 700px) {
  .venue-bottom { grid-template-columns: 1fr auto; align-items: start; }
}

/* ============ ⑥ RSVP（深綠收尾）============ */
.rsvp {
  background: var(--accent);
  color: var(--accent-ink);
}
.on-dark-label { color: var(--accent-ink); opacity: .75; }
.rsvp-intro { max-width: 30em; }
.rsvp-deadline {
  font-size: var(--text-small);
  letter-spacing: .12em;
  opacity: .8;
  margin-top: .5rem;
}

.rsvp-form {
  margin-top: clamp(2rem, 6vw, 3rem);
  display: grid;
  gap: 1.5rem;
}
.rsvp .field label, .rsvp .field legend {
  color: var(--accent-ink);
  font-size: var(--text-small);
  letter-spacing: .12em;
}
.rsvp .field input, .rsvp .field textarea, .rsvp .field select {
  background: #f4f3ee;
  border-color: transparent;
  color: var(--ink);
}
.rsvp .field input:focus-visible, .rsvp .field textarea:focus-visible, .rsvp .field select:focus-visible {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(244, 243, 238, .45);
}
.rsvp .field .error-text { color: #f0c9b8; }
.rsvp .field.has-error input { border-color: #f0c9b8; }

.attend-field { border: 0; }
.attend-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .5rem; }
.attend-pill input { position: absolute; opacity: 0; pointer-events: none; }
.attend-pill span {
  display: flex; align-items: center; justify-content: center;
  padding: .8rem 1rem;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px rgba(242, 241, 236, .45);
  letter-spacing: .1em;
  transition: background .35s var(--ease-out), color .35s var(--ease-out), box-shadow .35s var(--ease-out);
  user-select: none;
}
.attend-pill input:checked + span {
  background: var(--accent-ink);
  color: var(--accent);
  box-shadow: none;
  font-weight: 600;
}
.attend-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(244, 243, 238, .5); }

.rsvp-details { display: grid; gap: 1.5rem; }
.field-row { display: grid; gap: 1.5rem; }
@media (min-width: 520px) { .field-row { grid-template-columns: repeat(3, 1fr); } }

.rsvp-error { color: #f0c9b8; font-size: var(--text-small); }
.rsvp-submit { width: 100%; padding-block: 1.05rem; letter-spacing: .3em; }
@media (min-width: 700px) { .rsvp-submit { width: auto; justify-self: start; padding-inline: 3.5rem; } }

.rsvp-success, .rsvp-closed {
  margin-top: clamp(2rem, 6vw, 3rem);
  text-align: center;
  display: grid;
  gap: .75rem;
  justify-items: center;
  padding: clamp(2rem, 6vw, 3rem) var(--gutter);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(242, 241, 236, .3);
}
.success-mark {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-ink);
  color: var(--accent);
  font-size: 1.4rem;
}
.rsvp-success h3, .rsvp-closed h3 { font-size: var(--text-h3); letter-spacing: .14em; }
.success-note { font-size: var(--text-small); opacity: .8; }

/* ============ ⑦ Footer ============ */
.footer {
  text-align: center;
  padding: clamp(3.5rem, 10vw, 5.5rem) 0;
}
.footer-message { color: var(--ink-soft); max-width: 28em; margin-inline: auto; }
.footer-names {
  margin-top: 1rem;
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: .2em;
}
.footer-brand {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: var(--text-tiny);
  letter-spacing: .12em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: .15rem;
  transition: color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.footer-brand:hover { color: var(--accent); border-color: var(--accent); }
