/* The first page: the wedding day itself. The giant red date owns the page;
   weekday, lunar date, the couple as the day's entry and the photo printed as
   a flat picture block share what is left. */

.day {
  display: grid;
  height: var(--page-h);
  grid-template:
    "month month" auto
    "num num" minmax(0, 1fr)
    "week week" auto
    "pic note" auto
    "act act" auto
    "foot foot" auto
    / minmax(0, 40%) minmax(0, 1fr);
  column-gap: 14px;
  height: 100%;
  padding: calc(var(--stub-h) + 10px) 16px 14px;
}

.day-month,
.page-head {
  display: flex;
  grid-area: month;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
  font-size: 13px;
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.day-year {
  font-variant-numeric: tabular-nums;
}

.day-numeral {
  display: flex;
  grid-area: num;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.numeral {
  display: block;
  color: var(--red);
  font-family: var(--display);
  font-size: min(78vw, 40svh);
  line-height: 0.82;
  letter-spacing: -0.02em;
  text-box: trim-both cap alphabetic;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-weekday {
  display: flex;
  grid-area: week;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
  font-family: var(--display);
  font-size: 40px;
  line-height: 1.1;
  text-transform: uppercase;
}

.day-time {
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.day-picture {
  grid-area: pic;
  align-self: stretch;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

.day-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
}

.day-note {
  display: flex;
  grid-area: note;
  flex-direction: column;
  min-width: 0;
}

.names {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  font-stretch: 78%;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.name {
  overflow-wrap: anywhere;
}

#name-1 {
  display: block;
}

.amp {
  color: var(--red);
  font-weight: 700;
}

.save {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.lunar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 10px;
}

.lunar-day {
  flex: none;
  min-width: 1.1em;
  padding: 2px 0 0;
  border-right: 2px solid var(--ink);
  padding-right: 8px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lunar-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.countdown {
  display: flex;
  flex-direction: column;
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
}

.countdown-days {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.countdown-big {
  color: var(--red);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.countdown-clock {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.countdown-clock b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.countdown-clock .countdown-unit {
  margin-right: 5px;
  text-transform: lowercase;
}

.day-actions {
  display: grid;
  grid-area: act;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 419px) {
  .day-actions .btn {
    gap: 8px;
    padding: 0 12px;
    font-size: 14px;
    letter-spacing: 0.02em;
  }
}

.btn--tear {
  background: var(--paper);
  color: var(--ink);
}

.btn--tear:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--rsvp {
  border-color: var(--red);
  background: var(--red);
  color: var(--paper);
}

.btn--rsvp:hover {
  border-color: var(--ink);
  background: var(--ink);
}

.sheet--day .leaf {
  cursor: grab;
}

.sheet--day .leaf:active {
  cursor: grabbing;
}

/* a short phone: the photo and note tighten so the date keeps its room */
@media (max-height: 700px) and (max-width: 899px) {
  .day-weekday {
    margin-bottom: 8px;
    font-size: 32px;
  }

  .names {
    font-size: 24px;
  }

  .lunar {
    display: none;
  }

  .day-actions {
    margin-top: 10px;
  }
}

@media (min-width: 900px) and (min-height: 600px) {
  .day {
    grid-template:
      "month pic" auto
      "num pic" minmax(0, 1fr)
      "num note" auto
      "week act" auto
      "foot foot" auto
      / minmax(0, 1.45fr) minmax(0, 1fr);
    column-gap: 48px;
    padding: calc(var(--stub-h) + 22px) 40px 22px;
  }

  .day-month {
    font-size: 15px;
  }

  .day-numeral {
    align-items: center;
  }

  .numeral {
    font-size: min(46vw, 70svh);
  }

  .day-weekday {
    align-self: end;
    margin: 0;
    padding-top: 10px;
    font-size: 54px;
    line-height: 1;
  }

  .day-picture {
    min-height: 0;
  }

  .day-note {
    padding-top: 22px;
  }

  .names {
    font-size: clamp(36px, 5.4vh, 56px);
  }

  .save {
    margin-top: 10px;
    font-size: 17px;
  }

  .lunar {
    margin-top: 18px;
  }

  .lunar-day {
    font-size: 42px;
  }

  .lunar-text {
    font-size: 13px;
  }

  .countdown {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
  }

  .countdown-big {
    font-size: 44px;
  }

  .day-actions {
    align-self: end;
    margin-top: 18px;
  }
}

/* without a photo the day's entry takes the whole row */
.has-no-photo .day-note {
  grid-column: 1 / -1;
}

@media (min-width: 900px) and (min-height: 600px) {
  .has-no-photo .day-note {
    grid-row: 1 / 4;
    justify-content: flex-end;
  }
}
