:root {
  --paper: #ffffff;
  --ink: #22242a;
  --accent: #98e6dd;
  --accent-filter: brightness(0) saturate(100%) invert(78%) sepia(19%) saturate(836%) hue-rotate(112deg) brightness(93%) contrast(90%);
  --font-calligraphy-playful: "Playpen Sans", "Noto Sans", sans-serif;
  --card-height: 716.625px;
  --card-width: 530px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  place-items: center;
  background: #e8e8e8;
  font-family: var(--font-calligraphy-playful);
}

.invitation-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.card {
  width: min(var(--card-width), calc(100vw - 2rem));
  max-width: 100%;
  height: var(--card-height);
  position: relative;
  margin-bottom: 2rem !important;
  padding-bottom: 2.3rem !important;
  overflow: hidden;
}

.card-action-button {
  display: inline-grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  justify-items: start;
  gap: 0.55rem;
  min-width: 180px;
  padding: 0.85rem 1.5rem;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1;
}

.card-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: 0 0 auto;
}

.card-action-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.card-action-label {
  display: inline-block;
  width: 100%;
  text-align: left;
  line-height: 1;
}

.qr-page-card {
  width: min(var(--card-width), calc(100vw - 2rem));
  max-width: 100%;
  height: var(--card-height);
  position: relative;
}

.leaf {
  position: absolute;
  display: block;
  width: 104px;
  height: 104px;
  line-height: 1;
  user-select: none;
  object-fit: contain;
  object-position: center;
  filter: saturate(0.92) brightness(1.03);
  opacity: 0.98;
  pointer-events: none;
}

.leaf.top-left {
  top: 0;
  left: 0;
}

.leaf.top-right {
  top: 0;
  right: 0;
  transform: scaleX(-1);
}

.leaf.bottom-left {
  width: 104px;
  height: 104px;
  bottom: 0;
  left: 0;
  transform: scaleY(-1);
}

.leaf.bottom-right {
  width: 104px;
  height: 104px;
  bottom: 0;
  right: 0;
  transform: scale(-1);
}

.date-ribbon {
  margin: 0 auto 20px;
  width: fit-content;
  border: 3px solid var(--accent);
  border-radius: 999px;
  padding: 5px 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 3px;
  color: var(--ink);
  position: relative;
}

.date-ribbon::before,
.date-ribbon::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 18px;
  border: 3px solid var(--accent);
  transform: translateY(-35%) skewX(-25deg);
  background: var(--paper);
}

.date-ribbon::before {
  left: -16px;
  border-right: 0;
}

.date-ribbon::after {
  right: -16px;
  border-left: 0;
  transform: translateY(-35%) skewX(25deg);
}

.family-crop {
  width: 53%;
  margin: 0 auto 10px;
  overflow: hidden;
}

.family {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -18%;
  margin-bottom: -45%;
}

.headline {
  margin: 0;
  text-align: center;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.contact-headline {
  margin-top: 10px;
}

.body-text {
  margin: 14px auto 0;
  color: #292b31;
  text-align: center;
  line-height: 1.06;
}

.body-text a {
  color: inherit;
  text-decoration: none;
}

.body-text a:hover,
.body-text a:focus {
  color: inherit;
  text-decoration: none;
}

.body-text.sm {
  font-size: 70%;
  margin-bottom: 1.25rem;
}

.location-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.location-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, white);
  padding: 10px;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.location-card h3 {
  margin: 0;
  color: #2c3037;
  font-size: 1rem;
}

.location-card p {
  flex: 1;
  margin: 4px 0 8px;
  color: #2c3037;
  font-size: 0.88rem;
  line-height: 1.2;
}

.location-map {
  width: 100%;
  height: 150px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.qr-display-link {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  color: #2c3037;
  border: 0;
  background: transparent;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0;
}

.qr-display-link:hover,
.qr-display-link:focus {
  text-decoration: underline;
}

.qr-back-link,
.qr-panel {
  display: none;
}

.qr-back-link.web-only {
  display: none;
}

.location-card.show-qr .location-map,
.location-card.show-qr [data-action="show-qr"] {
  display: none;
}

.location-card.show-qr .qr-panel,
.location-card.show-qr .qr-back-link {
  display: block;
}

.location-card:not(.show-qr) .qr-panel {
  display: none;
}

.web-only {
  display: block;
}

.print-only {
  display: none;
}

.location-qr {
  margin: 0 auto;
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: #fff;
}

.divider {
  margin: 10px auto 2px;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
}

.divider-icon {
  width: 30px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  filter: brightness(0) saturate(100%) invert(78%) sepia(19%) saturate(836%) hue-rotate(112deg) brightness(93%) contrast(90%);
}

.names {
  margin: 4px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1;
}

.names p {
  margin: 0;
  flex: 1;
}

.small-label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.85em;
}

@media (max-width: 720px) {
  .leaf {
    width: 82px;
    height: 82px;
  }

  .leaf.bottom-left,
  .leaf.bottom-right {
    width: 82px;
    height: 82px;
  }

  .date-ribbon {
    letter-spacing: 3px;
  }

  .body-text {
    width: 91%;
    line-height: 1.08;
  }

  .headline {
    font-size: 1.8rem;
  }

  .names {
    gap: 14px;
  }

  .location-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .location-card {
    padding: 8px;
  }

  .location-card h3 {
    font-size: 0.92rem;
  }

  .location-card p {
    font-size: 0.8rem;
  }

  .location-qr {
    width: 120px;
    height: 120px;
  }

  .location-map {
    height: 120px;
  }

  .location-qr-section{
    margin-bottom:30px;
  }
}

@media print {

  @page {
    size: 10cm 16cm;
    margin: 0;
  }

  body {
    width: 10cm;
    height: auto;
    min-height: 16cm;
    margin: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .container-fluid,
  main.container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .invitation-layout {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .card,
  .qr-page-card {
    width: 10cm !important;
    height: 16cm !important;
    margin: 0 !important;
    padding: 0.9cm 0.2cm !important;
    padding-bottom: 0.45cm !important;
    border: 0 !important;
    border-radius: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .leaf,
  .leaf.bottom-left,
  .leaf.bottom-right {
    width: 76px;
    height: 76px;
  }

  .date-ribbon {
    margin-bottom: 12px;
    padding: 4px 16px;
    border-width: 2px;
    letter-spacing: 2px;
    font-size: 0.85rem;
  }

  .date-ribbon::before,
  .date-ribbon::after {
    width: 16px;
    height: 13px;
    border-width: 2px;
  }

  .family-crop {
    width: 50%;
    margin-bottom: 6px;
  }

  .headline {
    color: var(--accent) !important;
    font-size: 1.5rem;
    line-height: 1.04;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .contact-headline {
    margin-top: 8px;
  }

  .body-text {
    margin-top: 8px;
    font-size: 0.86rem;
    line-height: 1.08;
  }

  .body-text.sm {
    font-size: 0.64rem;
    line-height: 1.05;
    margin-top: 6px;
    margin-bottom: 0;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    break-inside: avoid;
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }

  .print-page-break .rsvp-note {
    margin-top: 14px;
  }

  .divider {
    margin: 7px auto 2px;
  }

  .divider-icon {
    width: 24px;
  }

  .names {
    margin-top: 2px;
    gap: 12px;
    font-size: 0.76rem;
    line-height: 1.06;
  }

  .small-label {
    margin-bottom: 2px;
  }

  .location-grid {
    margin-top: 8px;
    gap: 6px;
  }

  .location-card {
    padding: 6px;
    border-radius: 8px;
  }

  .location-card h3 {
    font-size: 0.82rem;
  }

  .location-card p {
    margin: 2px 0 6px;
    font-size: 0.7rem;
    line-height: 1.15;
  }

  .location-qr {
    width: 92px;
    height: 92px;
    border-radius: 6px;
  }

  .location-qr-section {
    margin-bottom: 10px;
  }

  .print-page-break {
    break-after: page;
    page-break-after: always;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .print-page-break > * {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
  
  .web-only {
    display: none !important;
  }

  .card-action-button {
    display: none !important;
  }

  .location-qr,
  .print-only {
    display: block !important;
  }

  .qr-panel {
    display: block !important;
  }
}
