/* Birthday page: the card file and the few things site.css does not already cover. Phone first, in reading order. */

:root {
  --index-card-reach: 24rem;
  --card-turn-gap: 4vw;
}

/* Opening and the counter scene lean on site.css; the scene's paragraphs only need air between them. */
.vis-read p + p { margin-top: 0.9em; }

/* The card file: five sample cards in one place. Without script they simply stack. */
.vis-file {
  display: grid;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.25rem;
}
.vis-pair {
  display: grid;
  gap: 0.75rem;
  align-items: center;
}

/* The card: the foundation's enclosure, with a sunflower bar laid across its upper-left corner. */
.vis-sample {
  position: relative;
  align-items: center;
  margin-block: 0.5rem 0.75rem;
  padding: 1.6rem 1.4rem 1.2rem;
  font-size: var(--read-size);
}
.vis-sample::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--bar-long);
  height: var(--bar-thick);
  background: var(--sunflower);
}
.vis-sample p { max-width: 16em; }

/* The florist's reply, printed on raspberry beside the card. */
.vis-reply { max-width: var(--read-wide); }
.vis-reply .vis-slip {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  font-size: var(--read-size);
  line-height: 1.6;
}
.vis-reply .vis-slip dd { margin-bottom: 0.9rem; }
.vis-reply .vis-slip dd:last-child { margin-bottom: 0; }

/* With script, the cards share one place and only the shown one is visible; the others wait with visibility:hidden. */
.js .vis-file { gap: 0; }
.js .vis-pair {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-1.25rem);
  transition: opacity var(--slow-ease), transform var(--slow-ease), visibility 0s linear 800ms;
}
.js .vis-pair[data-state="shown"] {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity var(--slow-ease), transform var(--slow-ease), visibility 0s;
}

/* The turning link and its count only exist when script can turn the cards. */
.vis-turnrow {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  margin-top: 1rem;
}
.js .vis-turnrow { display: flex; }
.vis-count { font-size: var(--small-size); }

@media (min-width: 48em) {
  .vis-pair {
    grid-template-columns: minmax(0, var(--index-card-reach)) minmax(0, 1fr);
    column-gap: var(--card-turn-gap);
  }
  .vis-sample { margin-block: 0.75rem; }
}

/* Anniversary: the photograph keeps a steady shape beside its text. */
.vis-beside .vis-photo img { aspect-ratio: 3 / 2; }

/* Birthday in Brights: the photograph sits under its text, wider than a reading line, one step right. */
.vis-wide { width: min(100% - var(--photo-shift), 44rem); }
.vis-wide img { aspect-ratio: 3 / 2; }

/* Four things to say on the phone. */
.vis-read + .vis-slip { margin-top: 1.25rem; }
.vis-slip dd a { text-underline-offset: 0.24em; }

/* Reduced motion: the cards change in place. */
@media (prefers-reduced-motion: reduce) {
  .js .vis-pair,
  .js .vis-pair[data-state="shown"] { transition: none; transform: none; }
}
