/* ==================== THE CARD: PANELS ====================
   Each panel declares its stock (red, deep red, paper, indigo) through custom properties,
   and every component below reads those properties. So a component is written once and
   never needs a per-panel override. */
.card-panel {
  --panel-bg: var(--vermilion);
  --text: var(--parchment);
  --text-soft: rgba(251, 243, 223, 0.82);
  --accent: var(--gold);
  --line: rgba(233, 196, 122, 0.5);
  --btn-bg: var(--gold);
  --btn-text: var(--vermilion-deep);
  --shadow: rgba(40, 6, 8, 0.38);

  position: relative;
  padding: 54px 28px 60px;
  text-align: center;
  background: var(--panel-bg);
  color: var(--text);
}

.panel-red {
  background: radial-gradient(130% 55% at 50% 0%, #b5272d 0%, var(--vermilion) 58%, #971a20 100%);
}
.panel-red-deep {
  --panel-bg: var(--vermilion-deep);
  background: radial-gradient(130% 45% at 50% 0%, #8f171d 0%, var(--vermilion-deep) 62%, #6c0e13 100%);
}
.panel-paper, .panel-paper-shade {
  --panel-bg: var(--parchment);
  --text: var(--ink);
  --text-soft: var(--ink-mid);
  --accent: var(--vermilion);
  --line: rgba(169, 120, 31, 0.55);
  --btn-bg: var(--vermilion);
  --btn-text: var(--parchment);
  --shadow: rgba(46, 26, 20, 0.2);
}
.panel-paper-shade { --panel-bg: var(--parchment-warm); }
.panel-indigo {
  --panel-bg: var(--indigo-deep);
  --shadow: rgba(4, 6, 20, 0.5);
  background: radial-gradient(130% 50% at 50% 0%, var(--indigo) 0%, var(--indigo-deep) 70%);
}

/* A scalloped paper edge where one stock overlaps the previous one, like a cut sheet laid on top. */
.has-cut-edge::before {
  content: '';
  position: absolute; left: 0; right: 0; top: -11px; height: 12px;
  background: radial-gradient(circle at 12px 12px, var(--panel-bg) 11px, transparent 11.6px) repeat-x;
  background-size: 24px 12px;
  pointer-events: none;
}

/* ==================== TYPE ==================== */
.panel-title {
  font-weight: 600; font-size: 31px; line-height: 1.15; letter-spacing: 0.005em;
  color: var(--accent);
  margin-bottom: 26px;
  text-wrap: balance;
}
.panel-title::after {
  content: ''; display: block; width: 46px; height: 2px; margin: 14px auto 0;
  background: var(--line);
}
.formal-line { font-style: italic; font-size: 17.5px; line-height: 1.5; color: var(--text-soft); }
.guest-name {
  font-family: var(--font-script); font-size: clamp(42px, 12vw, 52px); line-height: 1.05; color: var(--accent);
  margin: 8px 0 14px; overflow-wrap: anywhere; text-wrap: balance;
}
.letter-copy { max-width: 33ch; margin: 0 auto; font-size: 16.5px; line-height: 1.8; text-wrap: pretty; }

/* ==================== SEAL ==================== */
.songhy-emblem {
  width: 62px; height: 62px; margin: 0 auto 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--foil); color: var(--vermilion-deep);
  font-size: 30px; font-weight: 600;
  box-shadow: -4px 4px 0 var(--shadow);
}

/* ==================== COUPLE NAMES (set on a diagonal, as on a printed card) ==================== */
.couple-names { max-width: 340px; margin: 34px auto 0; }
.couple-side { display: flex; flex-direction: column; text-align: left; }
.couple-side.is-bride { text-align: right; margin-top: -14px; }
.couple-role { font-style: italic; font-size: 15px; color: var(--text-soft); }
.couple-name { font-family: var(--font-script); font-size: 68px; line-height: 0.95; }
.couple-amp { font-family: var(--font-script); font-size: 44px; line-height: 0.6; color: var(--text-soft); }

/* ==================== MOUNTED PICTURES ==================== */
.paper-photo {
  display: block; position: relative;
  max-width: 300px; margin: 34px auto 0; padding: 9px;
  background: var(--paper-pure);
  box-shadow: -9px 9px 0 var(--shadow);
  transform: rotate(var(--tilt, 0deg));
  cursor: pointer;
}
.paper-photo img { display: block; width: 100%; height: auto; }
.paper-photo.is-portrait img { aspect-ratio: 3 / 4; object-fit: cover; object-position: center 15%; }
.paper-photo.is-landscape { max-width: 330px; }
.paper-photo.is-landscape img { aspect-ratio: 4 / 3; object-fit: cover; object-position: center 22%; }
.paper-photo.is-wide { max-width: 100%; }
.panel-title + .paper-photo { margin-top: 0; }

/* ==================== DATE (three columns, the classic layout) ==================== */
.date-ticket {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  max-width: 350px; margin: 14px auto 0;
}
.date-ticket-side {
  padding: 10px 0; font-size: 17px; font-weight: 500;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.date-ticket-day b { display: block; font-weight: 600; font-size: 104px; line-height: 0.84; }
.date-ticket-day span { display: block; margin-top: 12px; font-size: 16px; }
.date-lunar { margin-top: 12px; font-style: italic; font-size: 16.5px; color: var(--text-soft); }

.venue-block { max-width: 340px; margin: 30px auto 0; text-wrap: balance; }
.venue-block strong { display: block; font-weight: 600; font-size: 22px; line-height: 1.25; color: var(--accent); }
.venue-block span { display: block; margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--text-soft); }

/* ==================== ORDER OF THE DAY ==================== */
.day-timeline {
  list-style: none; max-width: 280px; margin: 34px auto 0; padding: 2px 0 2px 26px;
  text-align: left; border-left: 1px solid var(--line);
}
.day-timeline li { position: relative; display: flex; gap: 14px; align-items: baseline; padding-bottom: 14px; }
.day-timeline li:last-child { padding-bottom: 0; }
.day-timeline li::before {
  content: ''; position: absolute; left: -31px; top: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
}
.day-timeline b { flex: 0 0 56px; font-weight: 600; font-size: 19px; color: var(--accent); font-variant-numeric: tabular-nums; }
.day-timeline span { font-size: 16.5px; }

/* ==================== COUNTDOWN ==================== */
.countdown { max-width: 340px; margin: 38px auto 0; padding-top: 26px; border-top: 1px solid var(--line); }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 10px; }
.cd-cell { padding: 2px 4px; border-right: 1px solid var(--line); }
.cd-cell:last-child { border-right: none; }
.cd-num { display: inline-block; font-weight: 500; font-size: 42px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; transform-origin: 50% 100%; }
.cd-lbl { margin-top: 6px; font-size: 14.5px; font-style: italic; color: var(--text-soft); }

/* ==================== BUTTONS (cut paper tabs with a hard shadow) ==================== */
.button-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 34px; }
.paper-button {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border: none; border-radius: 3px;
  background: var(--btn-bg); color: var(--btn-text);
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: -4px 4px 0 var(--shadow);
}
.paper-button:active { transform: translate(-3px, 3px); box-shadow: -1px 1px 0 var(--shadow); }
.paper-button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.paper-button.is-full { width: 100%; justify-content: center; padding: 14px 22px; }

.text-link {
  background: none; border: none; padding: 4px 0; cursor: pointer;
  font-size: 16px; color: var(--text); text-decoration: underline; text-underline-offset: 5px;
  text-decoration-color: var(--line);
}
.text-link:active { color: var(--accent); }

/* ==================== CYCLO RIBBON ==================== */
.xichlo-ribbon {
  position: relative; height: 104px; overflow: hidden;
  background: var(--parchment-warm);
  border-top: 2px solid var(--ochre); border-bottom: 2px solid var(--ochre);
}
.xichlo-driver {
  position: absolute; bottom: 4px; left: 0; width: 66px; aspect-ratio: 712 / 1192;
  will-change: transform; filter: drop-shadow(-6px 4px 0 rgba(46, 26, 20, 0.16));
}

/* ==================== ALBUM (pictures hung on the night wall) ==================== */
.album-lantern { position: absolute; top: -6px; width: 52px; pointer-events: none; }
.album-lantern.is-left { left: 14px; }
.album-lantern.is-right { right: 14px; width: 44px; top: -10px; }
.album-lantern img { display: block; width: 100%; height: auto; }

.album-tabs {
  display: flex; gap: 22px; margin: 0 -28px 24px; padding: 0 28px 6px;
  overflow-x: auto; scrollbar-width: none;
}
.album-tabs::-webkit-scrollbar { display: none; }
.album-tab {
  flex: 0 0 auto; padding: 5px 1px; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: 16px; color: var(--text-soft); cursor: pointer;
}
.album-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.album-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.album-tile {
  position: relative; padding: 7px 7px 10px; cursor: pointer;
  background: var(--paper-pure); box-shadow: -6px 6px 0 var(--shadow);
}
.album-tile:nth-child(odd) { transform: rotate(-0.8deg); }
.album-tile:nth-child(even) { transform: rotate(0.9deg); margin-top: 14px; }
.album-tile:active { box-shadow: -2px 2px 0 var(--shadow); }
.album-tile img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 16%; }
.album-cap { margin-top: 8px; font-style: italic; font-size: 14px; line-height: 1.3; color: var(--ink); text-wrap: balance; }
