/* ============================================
   The printable invitation (invitation.html)
   Builds on styles.css. Card internals are sized
   in container units (cqw) so the same card scales
   from a phone preview to a printed A5 panel.
   ============================================ */

/* --- Screen chrome --- */
.inv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--space-md);
}
.inv-back {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.inv-back:hover { text-decoration: underline wavy; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.inv-logo {
  font-family: var(--font-brush);
  font-size: 1.7rem;
  line-height: 1;
  transform: rotate(-4deg);
}

.inv-intro {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  text-align: center;
}
.inv-intro .sub { margin-bottom: var(--space-lg); }

.inv-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1.25rem 2rem;
  margin-bottom: var(--space-lg);
}

.chip-group { border: 0; }
.chip-group legend {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.4rem;
}
.chip { position: relative; display: inline-block; margin: 0 0.15rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  font-size: 0.92rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--wobble-sm);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.3,1.7,.5,1), background 0.15s ease;
}
.chip span:hover { transform: rotate(-2deg); }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px dashed var(--ink); outline-offset: 3px; }

.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  cursor: pointer;
  padding-bottom: 0.35rem;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  position: relative;
  width: 22px; height: 22px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 6px 4px 7px 5px;
  background: var(--paper);
}
.check input:checked + .check-box::after {
  content: '';
  position: absolute;
  left: 5px; top: 0;
  width: 7px; height: 13px;
  border: solid var(--ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(40deg);
}
.check input:focus-visible + .check-box { outline: 2px dashed var(--ink); outline-offset: 3px; }

.inv-howto,
.inv-tip {
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.98rem;
}
.inv-tip {
  margin-top: var(--space-sm);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-soft);
}
.mode-folded #howto-flat,
.mode-flat #howto-folded { display: none; }

/* only the chosen front is shown (and printed) */
.front-sea .card-cake,
.front-cake .card-sea { display: none; }

/* --- The table the cards lie on --- */
.table { padding-bottom: calc(var(--space-2xl) + 1rem); }

.sheet {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xl) clamp(2rem, 6vw, 4.5rem);
}

.side { width: min(420px, 100%); }

.side-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

/* --- The card itself (A5: 148 × 210 mm) --- */
.card {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 148 / 210;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
  /* traced art: ink stays ink, the paper silhouettes go see-through so card stock shows */
  --art-ink: var(--ink);
  --art-paper: transparent;
  box-shadow:
    0 1px 2px rgba(50, 35, 10, 0.12),
    0 22px 40px -14px rgba(60, 40, 10, 0.35);
}
.side-front .card { transform: rotate(-1.4deg); }
.side-back .card  { transform: rotate(1.1deg); }

/* padding lives on an inner box so every cqw inside refers to the card's full width */
.card-in { height: 100%; }

/* front: mirrors the printed design */
.card-front .card-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10cqw 8cqw 8cqw;
}
.c-names {
  width: 80cqw;
  margin-left: -3cqw;
  aspect-ratio: 3028 / 1232;
  height: auto;
}
.c-art { height: auto; margin-top: auto; }
.c-art-sea  { width: 77cqw; aspect-ratio: 2960 / 2248; }
.c-art-cake { width: 62cqw; aspect-ratio: 2272 / 2168; }
.c-invite {
  margin-top: auto;
  font-size: 2.4cqw;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 2.3;
  text-transform: uppercase;
}
.c-date {
  margin-top: 1.2cqw;
  font-size: 3.9cqw;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* back: the plan, the dress code, the RSVP */
.card-back .card-in {
  display: flex;
  flex-direction: column;
  padding: 10cqw 9cqw 9cqw;
}
.b-cherries {
  position: absolute;
  top: 6cqw; right: 8cqw;
  width: 11cqw;
  height: auto;
  transform: rotate(14deg);
}
.b-ink {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.b-fill  { fill: currentColor; }
.b-shine { fill: var(--paper); }

.b-kicker {
  font-size: 2.5cqw;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.b-title {
  font-family: var(--font-brush);
  font-weight: 400;
  font-size: 9.5cqw;
  line-height: 1.1;
  transform: rotate(-2deg);
  margin: 0.5cqw 0 4.5cqw;
}

.b-plan {
  list-style: none;
  display: grid;
  gap: 3.4cqw;
  text-align: left;
}
.b-plan li {
  display: grid;
  grid-template-columns: 19cqw 1fr;
  column-gap: 4cqw;
}
.b-time {
  grid-row: span 2;
  padding-top: 1.5cqw;
  font-size: 2.3cqw;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
}
.b-what {
  font-family: var(--font-brush);
  font-size: 5cqw;
  line-height: 1.2;
}
.b-where { font-size: 2.8cqw; line-height: 1.4; }

.b-dress {
  margin-top: auto;
  padding-top: 4.5cqw;
  font-size: 2.7cqw;
  line-height: 1.55;
  background: var(--squiggle) center top / 40% 1.6cqw no-repeat;
}
.b-dress strong {
  font-size: 2.5cqw;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.b-rsvp {
  display: flex;
  align-items: center;
  gap: 4.5cqw;
  margin-top: auto;
  padding: 4cqw 4.5cqw;
  text-align: left;
  border: 0.45cqw solid var(--ink);
  border-radius: 4cqw 1.5cqw 4.5cqw 2cqw;
  transform: rotate(-1deg);
}
.b-qr {
  flex: none;
  width: 19cqw;
  height: 19cqw;
}
.b-ps {
  margin-top: 2.5cqw;
  font-size: 2.5cqw;
  font-style: italic;
  color: var(--ink-soft);
  transform: rotate(-1.5deg);
}

.b-rsvp-text p { font-size: 2.6cqw; line-height: 1.45; }
.b-rsvp-text .b-rsvp-big {
  font-family: var(--font-brush);
  font-size: 4.5cqw;
  line-height: 1.2;
  margin-bottom: 0.8cqw;
  white-space: nowrap;
}
.b-rsvp-text .b-url { font-size: 3cqw; font-weight: 700; }
.b-rsvp-text .b-small {
  display: flex;
  align-items: center;
  gap: 1cqw;
  margin-top: 1cqw;
  font-style: italic;
  color: var(--ink-soft);
}
.b-heart { width: 2.9cqw; height: 2.9cqw; fill: var(--heart); }

@media (max-width: 767px) {
  .inv-controls { flex-direction: column; align-items: center; }
}

/* --- Print: just the paper --- */
@media print {
  html, body { background: none !important; }
  body::after,
  .inv-bar,
  .inv-intro,
  .side-label,
  .table::before,
  .table::after { display: none !important; }

  .table { padding: 0; background: none; }
  .sheet { display: block; gap: 0; }
  .side { width: auto; }

  .card {
    width: 148mm;
    height: 210mm;
    aspect-ratio: auto;
    box-shadow: none;
    transform: none !important;
    background: transparent;
    break-inside: avoid;
  }
  .print-paper .card {
    background: var(--paper);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* folded: one A4 landscape sheet — back cover on the left, front cover on the right */
  .mode-folded .sheet {
    display: flex;
    flex-direction: row-reverse;
    width: 297mm;
    height: 210mm;
    overflow: hidden;
  }
  .mode-folded .card { width: 148.5mm; }

  /* flat: one A5 page per side */
  .mode-flat .side-front { break-after: page; }
}
