/*
 * The guest's side: the event page, the send screen, the confirmation.
 *
 * One narrow column of paper, centred. A phone reads it as the whole screen; a
 * desktop reads it as an invitation card resting in the middle of the page —
 * the same page, not a second design.
 */

.guest-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-block: var(--space-8) var(--space-12);
}

@media (min-width: 48rem) {
  .guest-page {
    gap: var(--space-10);
    padding-block: var(--space-12) var(--space-16);
  }
}

/* ---- The cover ---------------------------------------------------------- *
 * The first mounted print anyone sees: opening the event is opening the album. */

.guest-cover {
  display: flex;
  justify-content: center;
}

.guest-cover .print {
  inline-size: 100%;
}

/* The blank mount needs real height to read as a page waiting rather than as
   something that failed to load. */
.guest-cover .print--empty .print__well {
  min-block-size: 18rem;
}

/* The batch just sent, laid out like prints coming out of an envelope. Only
   the mounts still in the darkroom get a shape imposed on them — a print with
   a photo in it takes the photo's own. */
.guest-sent {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gutter);
}

.guest-sent .print {
  flex: 0 1 12rem;
}

.guest-sent .print--empty .print__well {
  min-block-size: 9rem;
  aspect-ratio: 4 / 3;
}

.guest-sent .icon {
  inline-size: 1.75rem;
  block-size: 1.75rem;
  opacity: 0.5;
}

/* ---- The invitation ----------------------------------------------------- */

.guest-intro {
  gap: var(--space-3);
}

.guest-intro__date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--soft-ink);
}

.guest-intro__date svg {
  inline-size: 1rem;
  block-size: 1rem;
}

/* ---- Actions ------------------------------------------------------------ *
 * The primary action fills the column on a phone, where it is the page's one
 * job, and stops growing on a desktop so it does not read as a banner.        */

.guest-actions {
  gap: var(--space-4);
}

.guest-actions .button--block {
  max-inline-size: 24rem;
}

/* A <label> opening the file picker cannot take focus itself, so the ring is
   borrowed from the input it stands for. */
.guest-page:has(input[type="file"]:focus-visible) label[for="guest-photos"] {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---- The album wall ----------------------------------------------------- *
 * Only ever rendered for a shared album. A private one has no feed to hide.   */

.guest-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-block-end: var(--space-12);
}

.guest-feed__foot,
.guest-feed__blank {
  gap: var(--space-3);
  padding-block: var(--space-8);
}

.guest-feed__blank .print {
  inline-size: 100%;
  max-inline-size: 17rem;
}

.guest-feed__blank .print__well {
  min-block-size: 14rem;
}

/* ---- One photo, full width ---------------------------------------------- *
 * The steps sit over the print's edges on a phone, where there is no room
 * beside it, and move outside it once there is.                              */

.photo-view {
  position: relative;
  display: flex;
  justify-content: center;
}

.photo-view .print {
  inline-size: 100%;
}

.photo-view__step {
  position: absolute;
  /* The print carries a `rotate`, which makes it a stacking context of its
     own — without this the steps paint underneath the photograph. */
  z-index: 1;
  inset-block-start: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--print) 82%, transparent);
  box-shadow: var(--shadow-print);
  color: var(--ink);
  backdrop-filter: blur(6px);
}

/* On a phone they rest on the photo's own edges, where the thumbs already are.
   Once there is room beside the print, they step outside it. */
.photo-view__step--previous {
  inset-inline-start: var(--space-2);
  rotate: 180deg;
}

.photo-view__step--next {
  inset-inline-end: var(--space-2);
}

@media (min-width: 48rem) {
  .photo-view__step--previous { inset-inline-start: -3.5rem; }
  .photo-view__step--next { inset-inline-end: -3.5rem; }
}

/* ---- Nothing to show yet ------------------------------------------------ */

.guest-blank {
  gap: var(--space-3);
  padding-block: var(--space-8);
}

.guest-blank .print {
  inline-size: 100%;
  max-inline-size: 15rem;
}

.guest-blank .print__well {
  min-block-size: 11rem;
  aspect-ratio: 4 / 3;
}

.guest-blank .icon {
  inline-size: 2rem;
  block-size: 2rem;
  opacity: 0.5;
}

/* ---- "Este álbum foi encerrado." ---------------------------------------- *
 * Not an error state and not styled as one. The cover is still there, drained
 * of its colour and pushed back behind the paper — the album exists, it is
 * simply not open.                                                           */

.closed {
  position: relative;
  display: grid;
  place-items: center;
  min-block-size: 70svh;
  padding: var(--space-16) var(--container-margin);
  overflow: hidden;
}

.closed__cover {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  filter: grayscale(1);
  opacity: 0.18;
}

/* The paper reasserts itself over the photograph, so the words stay readable
   whatever the cover happens to be. */
.closed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--paper) 72%, transparent),
    color-mix(in srgb, var(--paper) 92%, transparent)
  );
}

.closed__words {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  max-inline-size: var(--reading-max);
}

/* The ampersand alone, in foil — the brand's one flourish, on the one screen
   that has nothing else to offer. */
.closed__mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--gold);
}

.closed__invitation {
  font-family: var(--font-display);
  font-size: var(--text-headline);
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-rule);
  padding-block-end: var(--space-1);
  transition: border-color var(--duration) var(--ease);
}

.closed__invitation:hover {
  border-bottom-color: var(--gold);
}

/* ---- The send screen ---------------------------------------------------- */

.guest-send {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* ---- While the photos are travelling ------------------------------------ *
 * "Revelando suas fotos..." — the wait is a darkroom, not a spinner.          */

.guest-sending {
  gap: var(--space-4);
  padding-block: var(--space-12);
}

.guest-sending .t-label {
  color: var(--gold);
}
