/* Đăng Khoa & Minh Thúy — CSS dùng chung cho trang khách và trang ekip.
   Màu: kem + đỏ rượu + xanh lá rừng; vàng đồng chỉ dùng cho đường kẻ trang trí. */
:root {
  --cream: #f6f0e4;
  --paper: #fcf9f3;
  --wine: #6b1f2a;
  --wine-deep: #4a1520;
  --forest: #2e4a3b;
  --ink: #2a2421;
  --muted: #5f5650;
  --gold: #a8854a;
  --line: #e2d6c1;
  --on-wine: #f6f0e4;
  --on-wine-muted: #e3d3c6;
  --line-on-wine: rgba(246, 240, 228, 0.22);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --script: "Great Vibes", cursive;
  --serif: "Cormorant Infant", "Cormorant Garamond", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  interpolate-size: allow-keywords;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.seg:empty { display: none; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* Cormorant mặc định dùng số kiểu cũ; giờ phải thẳng hàng. */
  font-variant-numeric: lining-nums;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; border-radius: 6px; }
.band :focus-visible { outline-color: var(--on-wine); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--wine); color: var(--on-wine); padding: 10px 16px; border-radius: 999px;
}
.skip:focus { top: 16px; }

.wrap { width: min(760px, 100% - 32px); margin-inline: auto; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  border: 1px solid currentColor; background: transparent;
  font: 500 15px/1 var(--sans); letter-spacing: 0.01em; text-decoration: none;
  cursor: pointer; transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-solid { background: var(--wine); border-color: var(--wine); color: var(--on-wine); }
.btn-solid:hover { background: var(--wine-deep); }
.band .btn-solid { background: var(--on-wine); border-color: var(--on-wine); color: var(--wine-deep); }
.btn svg { width: 16px; height: 16px; flex: none; }

.link {
  text-decoration: underline; text-decoration-color: var(--gold);
  text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.link:hover { text-decoration-color: currentColor; }

/* ---------- Phần mở đầu ---------- */
.hero {
  min-height: 100svh; display: grid; place-content: center; justify-items: center;
  text-align: center; padding: 64px clamp(32px, 6vw, 56px) 56px; gap: 18px; position: relative;
}
.monogram { width: clamp(120px, min(26vw, 20svh), 184px); height: auto; }
/* Khung viền kiểu thiệp cưới: hai đường mảnh màu đồng. */
.hero::before, .hero::after { content: ""; position: absolute; pointer-events: none; border: 1px solid rgba(168, 133, 74, 0.5); }
.hero::before { inset: clamp(12px, 2.4vw, 28px); }
.hero::after { inset: calc(clamp(12px, 2.4vw, 28px) + 6px); border-color: rgba(168, 133, 74, 0.22); }
.kicker { font: 500 13px/1.4 var(--sans); letter-spacing: 0.28em; text-transform: uppercase; color: var(--forest); }
.names { font: 400 clamp(56px, min(13vw, 13svh), 116px)/0.95 var(--script); color: var(--wine); display: grid; gap: 0.08em; }
.names .amp { font-size: 0.5em; color: var(--forest); line-height: 1; }
.date { display: flex; align-items: center; gap: 18px; color: var(--forest); }
.date .rule { width: 48px; height: 1px; background: var(--gold); }
.date strong { font: 500 clamp(26px, 5vw, 34px)/1 var(--serif); letter-spacing: 0.08em; color: var(--ink); }
.date span { font: 500 13px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; }
.countdown { display: flex; gap: 0; color: var(--forest); }
.countdown div { min-width: 76px; padding: 4px 14px; border-left: 1px solid var(--line); }
.countdown div:first-child { border-left: 0; }
.countdown b { display: block; font: 300 34px/1.15 var(--sans); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.countdown small { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }

/* Vào trang một lần (không có hiệu ứng khi cuộn). */
@media (prefers-reduced-motion: no-preference) {
  [data-enter] > * { animation: enter 0.9s var(--ease) both; }
  [data-enter] > *:nth-child(2) { animation-delay: 0.08s; }
  [data-enter] > *:nth-child(3) { animation-delay: 0.16s; }
  [data-enter] > *:nth-child(4) { animation-delay: 0.26s; }
  [data-enter] > *:nth-child(5) { animation-delay: 0.34s; }
  [data-enter] > *:nth-child(n+6) { animation-delay: 0.42s; }
  @keyframes enter { from { opacity: 0; transform: translateY(14px); } }
}

/* ---------- Các phần lịch ---------- */
.section { padding: 88px 0; }
.band { background: var(--wine-deep); color: var(--on-wine); }
.section-head { text-align: center; display: grid; gap: 10px; justify-items: center; margin-bottom: 36px; }
.section-head h2 { font: 500 clamp(40px, 7vw, 56px)/1.05 var(--serif); color: var(--forest); text-wrap: balance; }
.band .section-head h2 { color: var(--on-wine); }
.section-head .sub { color: var(--muted); }
.band .section-head .sub { color: var(--on-wine-muted); }
.ornament { width: 120px; height: 12px; color: var(--gold); }

.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
}
.seg button {
  min-height: 44px; min-width: 128px; padding: 8px 20px; border: 0; border-radius: 999px;
  background: transparent; font-weight: 500; cursor: pointer; transition: background-color 0.25s var(--ease), color 0.25s;
}
.seg button:hover { color: var(--wine); }
.seg button[aria-pressed="true"] { background: var(--wine); color: var(--on-wine); }

.place { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; color: var(--muted); }
.band .place { color: var(--on-wine-muted); }
.place svg { width: 18px; height: 18px; color: var(--gold); }

.toolbar { display: flex; justify-content: flex-end; margin: 28px 0 8px; }
.ghost {
  min-height: 44px; padding: 8px 4px; border: 0; background: none; cursor: pointer;
  font-weight: 500; color: var(--wine); display: inline-flex; align-items: center; gap: 8px;
}
.band .ghost { color: var(--on-wine); }
.ghost svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.ghost[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- Timeline ---------- */
.tl { list-style: none; padding: 0; position: relative; }
.tl-sec + .tl-sec { margin-top: 56px; }
.tl-sub { list-style: none; padding: 0; position: relative; }
/* Đường nối các chấm của một chương, đi qua tâm cột chấm (padding 12 + giờ 64 + gap 12 + nửa chấm 9). */
.tl-sub::before {
  content: ""; position: absolute; left: 96.5px; top: 32px; bottom: 32px; width: 1px;
  background: var(--line); transform-origin: 50% 0;
}
.band .tl-sub::before { background: var(--line-on-wine); }

.tl-group {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 16px;
  padding: 0 12px 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(107, 31, 42, 0.35);
}
.band .tl-group { border-color: rgba(246, 240, 228, 0.45); }
.tl-num { font: 500 13px/1 var(--sans); letter-spacing: 0.16em; color: var(--wine); font-variant-numeric: lining-nums tabular-nums; }
.tl-gname { font: 600 clamp(26px, 4.2vw, 32px)/1.15 var(--serif); color: var(--forest); text-wrap: balance; }
.tl-span { font: 500 14px/1 var(--sans); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.band .tl-num, .band .tl-span { color: var(--on-wine-muted); }
.band .tl-gname { color: var(--on-wine); }

/* Hiện dần khi cuộn (JS bật class reveal-on); giảm chuyển động thì chỉ mờ dần, không dịch. */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .reveal-on [data-reveal][data-visible] { opacity: 1; transform: none; }
  /* Đường nối vẽ một lần khi tiêu đề chương hiện ra. */
  .reveal-on .tl-group[data-reveal] + .tl-sub::before { transform: scaleY(0); transition: transform 1.4s var(--ease) 0.2s; }
  .reveal-on .tl-group[data-visible] + .tl-sub::before { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-on [data-reveal] { opacity: 0; transition: opacity 0.4s ease; }
  .reveal-on [data-reveal][data-visible] { opacity: 1; }
}

.tl-item { border-bottom: 1px solid var(--line); }
.band .tl-item { border-color: var(--line-on-wine); }
.tl-item summary {
  list-style: none; cursor: pointer; display: grid; align-items: center;
  grid-template-columns: 64px 18px 1fr 24px; gap: 12px; min-height: 64px; padding: 10px 12px;
  border-radius: 10px; transition: background-color 0.2s;
}
.tl-item summary::-webkit-details-marker { display: none; }
.tl-item summary:hover { background: rgba(107, 31, 42, 0.05); }
.band .tl-item summary:hover { background: rgba(246, 240, 228, 0.06); }
.tl-time { font: 500 15px/1 var(--sans); color: var(--wine); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.02em; }
.band .tl-time { color: var(--on-wine); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--gold); justify-self: center; transition: background-color 0.25s; }
.tl-dot { position: relative; background: var(--cream); }
.band .tl-dot { background: var(--wine-deep); }
.tl-item[open] .tl-dot { background: var(--gold); }
.tl-title { font: 500 21px/1.25 var(--serif); }
.tl-chev { width: 20px; height: 20px; color: var(--muted); transition: transform 0.35s var(--ease); }
.band .tl-chev { color: var(--on-wine-muted); }
.tl-item[open] .tl-chev { transform: rotate(180deg); }

.tl-item::details-content { block-size: 0; overflow: clip; transition: block-size 0.4s var(--ease), content-visibility 0.4s allow-discrete; }
.tl-item[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) {
  .tl-item::details-content, .tl-chev, .ghost svg { transition: none; }
  html { scroll-behavior: auto; }
}

.tl-body { padding: 4px 12px 22px calc(64px + 18px + 24px + 12px); display: grid; gap: 12px; }
.tl-meta { font-size: 14px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.band .tl-meta { color: var(--on-wine-muted); }
.tl-detail { white-space: pre-line; color: var(--ink); }
.band .tl-detail { color: var(--on-wine); }
.tl-extra { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: rgba(46, 74, 59, 0.07); }
.tl-extra dt { font: 600 12px/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--forest); }
.tl-extra dd { white-space: pre-line; }
.band .tl-extra { background: rgba(246, 240, 228, 0.08); }
.band .tl-extra dt { color: var(--on-wine-muted); }
.tl-tag {
  display: inline-block; vertical-align: middle; font: 500 12px/1 var(--sans); padding: 4px 10px;
  border-radius: 999px; background: rgba(107, 31, 42, 0.1); color: var(--wine);
}
.band .tl-tag { background: rgba(246, 240, 228, 0.14); color: var(--on-wine); }

.ekip-pill {
  position: fixed; top: 12px; right: 12px; z-index: 15; margin: 0;
  padding: 10px 16px; border-radius: 999px; font-size: 14px;
  background: var(--forest); color: var(--on-wine); box-shadow: 0 6px 20px rgba(42, 36, 33, 0.18);
}
.ekip-pill a { display: inline-block; padding: 2px 0; }

.state { text-align: center; color: var(--muted); padding: 32px 0; display: grid; gap: 14px; justify-items: center; }
.band .state { color: var(--on-wine-muted); }

/* ---------- Cuối trang ---------- */
.footer { text-align: center; padding: 96px 16px 56px; display: grid; gap: 14px; justify-items: center; }
.footer .mark { width: 72px; height: auto; margin-bottom: 4px; }
.footer .script { font: 400 clamp(40px, 8vw, 64px)/1 var(--script); color: var(--wine); }
.footer p { color: var(--muted); max-width: 32ch; }
.footer .fine { font-size: 14px; margin-top: 24px; }

@media (max-width: 560px) {
  .section { padding: 64px 0; }
  .tl-item summary { grid-template-columns: 52px 14px 1fr 20px; gap: 10px; }
  .tl-title { font-size: 19px; }
  .tl-body { padding-left: 12px; position: relative; background: var(--cream); }
  .band .tl-body { background: var(--wine-deep); }
  .tl-sub::before { left: 80.5px; }
  .tl-group { grid-template-columns: auto 1fr; row-gap: 8px; }
  .tl-span { grid-column: 2; }
  .countdown div { min-width: 0; padding: 4px 12px; }
  .countdown b { font-size: 28px; }
  .seg button { min-width: 0; }
  .hero-nav { flex-direction: column; align-self: stretch; width: min(100%, 320px); justify-self: center; }
  .hero-nav .btn { width: 100%; }
}
