/* The invitation view (views/invitation.js), shown to guests who have
   reached the RSVP before. Everything is scoped to .view-invitation so it
   can't leak into the save-the-date view, and class names that the
   save-the-date stylesheet also uses (eyebrow, countdown, venues) carry an
   inv- prefix so its rules can't leak in here either.

   Three bands, top to bottom: the couple, the date and the video strip; what
   the guest can do (the RSVP, a proposal still waiting on them, then the
   links); and when and where, for reference, pinned to the bottom.

   Sizes are in rem against the 12.8px root the page sets (see the font-size
   script in index.html). */

/* The page never scrolls: the view is scaled down by script to fit the
   viewport instead. */
html[data-view="invitation"],
html[data-view="invitation"] body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.view-invitation {
  max-width: 600px;
  /* at least a screen tall, so the reference band sits at the bottom */
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.1875rem, 5vh, 3.75rem) clamp(1.875rem, 6vw, 3.75rem) clamp(2.1875rem, 4vh, 2.8rem);
  transform-origin: top center;
  font-family: var(--font-sans);
}

/* ---- top: names, date, video strip ---- */
.view-invitation .names {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 5.6vw, 2rem);
  letter-spacing: 0.1em;
  color: var(--charcoal);
  white-space: nowrap;
}

/* On phones the fixed music player sits over the top of the page; start the
   names below it. */
@media (max-width: 600px) {
  .view-invitation .names { margin-top: 3.125rem; }
}

.view-invitation .names .plus {
  color: var(--gold);
  margin: 0 0.15em;
}

.view-invitation .wedding-date {
  margin: 0.3rem 0 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.25rem, 4.4vw, 1.4375rem);
  letter-spacing: 0.02em;
  color: var(--sienna);
}

.view-invitation .media {
  margin-top: 1.72rem;
  width: 80%;
  aspect-ratio: 8 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--charcoal);
}

.view-invitation .media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 80%;
  display: block;
}

/* ---- middle: RSVP, proposal, links ---- */
.view-invitation .inv-actions {
  margin-top: 3.4375rem;
  /* keeps the reference band clear of the links on a short screen, where
     its auto margin collapses */
  padding-bottom: 2.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.09rem;
}

/* The RSVP gets room to itself: a wide gap separates it from everything
   under it. */
.view-invitation .rsvp-block {
  margin-bottom: 4.0625rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.view-invitation .rsvp-status {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.3rem, 4.9vw, 1.5rem);
  letter-spacing: 0.01em;
  color: var(--sienna);
}

/* The RSVP button: a full pill in the soft gold of the deadline highlight. */
.view-invitation .rsvp-btn {
  min-width: 17.2rem;
  min-height: 3.9rem;
  padding: 0 3.125rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 1.0156rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--charcoal);
  background: rgba(219, 164, 0, 0.28);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.view-invitation .rsvp-btn:hover {
  background: rgba(219, 164, 0, 0.42);
}

.view-invitation .rsvp-note {
  margin: 0;
  max-width: 26em;
  font-size: 0.977rem;
  line-height: 1.4;
  text-wrap: balance;
  color: var(--charcoal-soft);
}

/* A role proposal the guest hasn't answered yet. */
.view-invitation .proposal-card {
  width: 100%;
  max-width: 26.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.25rem;
  font-family: inherit;
  color: var(--charcoal);
  background: var(--cream-2);
  border: 0;
  border-radius: 1.5625rem;
  cursor: pointer;
}

.view-invitation .proposal-card-eyebrow {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sienna);
}

.view-invitation .proposal-card-title {
  font-weight: 500;
  font-size: 1.17rem;
}

/* Dress code, a proposal already answered, and the pre-invite: an icon over
   a label, no boxes. */
.view-invitation .inv-links {
  margin-top: 1.09rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.8rem;
}

.view-invitation .inv-link {
  min-width: 5rem;
  max-width: 8.5rem;
  min-height: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.25s ease;
}

.view-invitation .inv-link:hover {
  color: var(--gold);
}

.view-invitation .inv-link svg {
  width: 1.72rem;
  height: 1.72rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view-invitation .rsvp-block[hidden],
.view-invitation .rsvp-status[hidden],
.view-invitation .rsvp-note[hidden],
.view-invitation .proposal-card[hidden],
.view-invitation .inv-link[hidden] { display: none; }

/* ---- bottom: countdown and venues, below a hairline ---- */
.view-invitation .inv-reference {
  margin-top: auto;
  padding-top: 1.5625rem;
  width: 100%;
  border-top: 1px solid rgba(99, 107, 47, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.72rem;
}

.view-invitation .inv-countdown {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.view-invitation .inv-countdown .unit {
  min-width: 1.7em;
  text-align: center;
}

.view-invitation .inv-countdown .num {
  font-weight: 700;
  font-size: 1.17rem;
  color: var(--olive);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.view-invitation .inv-countdown .label {
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.625rem;
  color: var(--charcoal-soft);
  margin-top: 0.35em;
}

.view-invitation .deadline-passed {
  margin: 0;
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--sienna);
}

.view-invitation .inv-venues {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.9375rem;
  row-gap: 0.625rem;
  align-items: baseline;
  text-align: left;
}

.view-invitation .venue-label {
  font-weight: 600;
  font-size: 0.825rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
  white-space: nowrap;
  padding-right: 0.9375rem;
  border-right: 1px solid rgba(99, 107, 47, 0.35);
}

.view-invitation .venue-value {
  font-weight: 400;
  font-size: clamp(0.975rem, 2vw, 1.1rem);
  letter-spacing: 0.02em;
  color: var(--charcoal-soft);
}
