/* Invitation cover — shared by gallery thumbnails and live invitations.
   Sizes inside .cv-in use container units so one cover scales from a card to a phone. */
.cv {
  position: relative; overflow: hidden; width: 100%; height: 100%;
  background: radial-gradient(120% 80% at 50% 45%, var(--bg) 40%, var(--bg2) 100%);
  color: var(--ink); font-family: var(--fb); display: flex; align-items: center; justify-content: center;
}
.cv-in {
  container-type: inline-size; position: relative; z-index: 1;
  width: min(84%, 440px); display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 2.4cqw;
}
.cv-in > * { margin: 0; }
.cv-kicker { font-size: 3.6cqw; letter-spacing: .18em; text-transform: uppercase; color: var(--ac-ink, var(--ac)); font-weight: 600; }
.cv-names { font-family: var(--fd); font-size: 11cqw; line-height: 1.05; }
.cv-names.script { font-family: var(--fs); font-size: 14cqw; line-height: 1.1; }
.cv-sub { font-family: var(--fd); font-size: 6cqw; color: var(--ac-ink, var(--ac)); margin-top: -1cqw; }
.cv-line { font-size: 4cqw; line-height: 1.4; opacity: .85; max-width: 90%; }
.cv-when { display: flex; flex-direction: column; gap: .8cqw; padding: 2.4cqw 4cqw; border-top: 1px solid var(--ac); border-bottom: 1px solid var(--ac); }
.cv-when span { font-family: var(--fd); font-size: 4.6cqw; }
.cv-when small { font-size: 3.2cqw; opacity: .8; }
.cv-btns { display: flex; gap: 2cqw; }
.cv-btn { font-size: 3.4cqw; padding: 1.8cqw 4cqw; border-radius: 99px; border: 1px solid var(--ac); color: var(--ink); font-weight: 600; }
.cv-btn.solid { background: var(--ac-ink, var(--ac)); color: var(--bg); border-color: var(--ac-ink, var(--ac)); }

/* Frames */
.cv-frame { width: 52cqw; position: relative; }
.cv-frame .ph { width: 100%; height: 100%; overflow: hidden; }
.cv-frame .ph > img, .cv-frame .ph > svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-arch { aspect-ratio: 3 / 4; padding: 1.4cqw; border: 1.5px solid var(--ac); border-radius: 999px 999px 6px 6px; }
.fr-arch .ph { border-radius: 999px 999px 4px 4px; }
.fr-circle { width: 46cqw; aspect-ratio: 1; padding: 1.6cqw; border: 1.5px solid var(--ac); border-radius: 50%; outline: 1px solid var(--ac); outline-offset: 1.6cqw; }
.fr-circle .ph { border-radius: 50%; }
.fr-oval { width: 44cqw; aspect-ratio: 3 / 4; padding: 1.4cqw; border: 1.5px solid var(--ac); border-radius: 50%; }
.fr-oval .ph { border-radius: 50%; }
.fr-rect { aspect-ratio: 4 / 5; padding: 1.6cqw; border: 1.5px solid var(--ac); outline: 1px solid var(--ac); outline-offset: -4.4cqw; }

.fr-polaroid { aspect-ratio: 4 / 5; background: #fff; padding: 3cqw 3cqw 11cqw; transform: rotate(-3deg); box-shadow: 0 2cqw 5cqw rgba(0,0,0,.18); }
.fr-torn { aspect-ratio: 4 / 5; width: 58cqw; filter: sepia(.35) contrast(1.05);
  clip-path: polygon(0 3%, 6% 0, 14% 2%, 22% 0, 31% 3%, 40% 1%, 50% 3%, 60% 0, 70% 2%, 80% 0, 90% 3%, 100% 1%, 98% 12%, 100% 25%, 97% 40%, 100% 55%, 98% 70%, 100% 85%, 98% 100%, 88% 97%, 76% 100%, 64% 97%, 52% 100%, 40% 97%, 28% 100%, 16% 97%, 6% 100%, 0 96%, 2% 82%, 0 68%, 3% 52%, 0 38%, 2% 22%); }

/* Ornaments */
.cv .orn { position: absolute; width: 50%; max-width: 300px; height: auto; pointer-events: none; z-index: 0; }
.cv .orn.tl { top: 0; left: 0; }
.cv .orn.tr { top: 0; right: 0; transform: scaleX(-1); }
.cv .orn.bl { bottom: 0; left: 0; transform: scaleY(-1); }
.cv .orn.br { bottom: 0; right: 0; transform: scale(-1, -1); }
.cv .orn.band { width: 100%; max-width: none; height: 10%; left: 0; }
.cv .orn.band.top { top: 0; }
.cv .orn.band.bottom { bottom: 0; transform: rotate(180deg); }

/* Newspaper layout */
.cv-paper .cv-in { gap: 2cqw; }
.cv-mast { font-family: var(--fd); font-size: 10.5cqw; line-height: 1; }
.cv-rule { width: 100%; border-top: 3px double var(--ink); }
.cv-meta { width: 100%; display: flex; justify-content: space-between; font-size: 3cqw; font-style: italic; border-bottom: 1px solid var(--ink); padding-bottom: 1.4cqw; }
.cv-paper .cv-kicker { color: var(--ac-ink, var(--ac)); }
.cv-paper .cv-btn.solid { background: var(--ink); border-color: var(--ink); }

/* Comic layout */
.cv-comic { background: radial-gradient(circle, rgba(0,0,0,.09) 1px, transparent 1.5px) 0 0 / 9px 9px, var(--bg); }
.cv-burst { font-family: var(--fd); font-size: 4.4cqw; background: var(--ac2); color: #fff; padding: 1.6cqw 4cqw; border: .7cqw solid var(--ink); transform: rotate(-5deg); box-shadow: 1.2cqw 1.2cqw 0 var(--ink); }
.cv-comic .cv-names { color: var(--ac); font-size: 16cqw; -webkit-text-stroke: .7cqw var(--ink); paint-order: stroke fill; text-shadow: 1.2cqw 1.2cqw 0 var(--ink); }
.cv-comic .cv-sub { font-size: 8cqw; color: var(--ink); }
.cv-comic .cv-frame { border: 1cqw solid var(--ink); outline: none; box-shadow: 2cqw 2cqw 0 var(--ink); background: #fff; }
.cv-bubble { position: relative; background: #fff; border: .7cqw solid var(--ink); border-radius: 6cqw; padding: 2.4cqw 5cqw; font-family: var(--fd); font-size: 4.2cqw; display: flex; flex-direction: column; color: #16130F; }
.cv-bubble small { font-family: var(--fb); font-size: 3.2cqw; }
.cv-comic .cv-btn { border: .6cqw solid var(--ink); }
.cv-comic .cv-btn.solid { background: var(--ac-ink, var(--ac)); color: var(--bg); }

/* Dark themes */
.cv.dark .cv-btn.solid { color: var(--bg); }

/* Thumbnails: drop the long line so the whole cover fits a 9:16 card */
.tcard .cv-line, .cat .cv-line, .phone .cv-line { display: none; }
/* Thumbnails are shorter than a phone screen: drop the buttons so the whole cover fits */
.tcard .cv-btns, .cat .cv-btns { display: none; }
/* Comic and newspaper covers carry bigger type; tighten them in thumbnails so nothing is cut off */
:is(.tcard, .cat) :is(.cv-comic, .cv-paper) .cv-in { gap: 1.2cqw; }
:is(.tcard, .cat) :is(.cv-comic, .cv-paper) .cv-frame { width: 40cqw; }
:is(.tcard, .cat) .cv-comic .cv-names { font-size: 13cqw; }
:is(.tcard, .cat) .cv-paper .cv-mast { font-size: 9cqw; }
