/* Deppo: the page where a demo is booked. The picture of the cabinet on the left follows what they are after,
   the choices and the times are on the right. Uses the shop's choice boxes. */

.demo {
  max-width: 112rem;
  margin-inline: auto;
  padding: calc(var(--nav-h) + 0.75rem) var(--gutter) clamp(3rem, 8vh, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 30rem);
  column-gap: clamp(2rem, 4vw, 4.5rem);
  align-items: start;
}
.demo__media {
  position: sticky;
  top: calc(var(--nav-h) + 0.75rem);
  height: calc(100vh - var(--nav-h) - 2.5rem);
  border-radius: var(--r-l);
  overflow: hidden;
  background: var(--night-surface);
}
@supports (height: 100svh) {
  .demo__media {
    height: calc(100svh - var(--nav-h) - 2.5rem);
  }
}
.demo__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 50%;
  opacity: 0;
  transition: opacity 700ms var(--ease);
}
/* the wall cabinet hangs at the right edge of its photograph: keep all of it in the frame */
.demo__media img[data-shows="outdoor"] {
  object-position: 100% 50%;
}
.demo[data-interest="indoor"] .demo__media img[data-shows="indoor"],
.demo[data-interest="both"] .demo__media img[data-shows="indoor"],
.demo[data-interest="outdoor"] .demo__media img[data-shows="outdoor"] {
  opacity: 1;
}

.demo__form,
.demo__done {
  padding-top: clamp(0.5rem, 5vh, 3.5rem);
}
.demo__form[hidden],
.demo__done[hidden] {
  display: none;
}
.demo__title {
  font-size: clamp(2.5rem, 1.7rem + 2vw, 3.75rem);
}
.demo__done:focus {
  outline: none;
}
.demo__when {
  margin: 1rem 0 2rem;
  font-size: 1.25rem;
  color: var(--night-ink-2);
}

.choices--three {
  grid-template-columns: repeat(3, 1fr);
}
.choices--four {
  grid-template-columns: repeat(4, 1fr);
}
.demo .choicebox {
  place-items: center;
  min-height: 3.25rem;
  padding: 0.5rem;
  text-align: center;
}

.demo__note {
  color: var(--night-ink-2);
}
.demo__note[hidden],
.cal[hidden],
.field[hidden],
.config__group[hidden],
.times[hidden],
.demo__retry[hidden],
.demo__error[hidden] {
  display: none;
}
.demo__retry {
  margin-top: 0.75rem;
  font-weight: 560;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

/* a month at a time: the days with a free time can be pressed, the times of the chosen day come under it */
.cal {
  padding: 1rem;
  border-radius: var(--r-l);
  box-shadow: inset 0 0 0 1px var(--night-line);
}
.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cal__month {
  font-family: var(--font-display);
  font-stretch: 106%;
  font-weight: 660;
  font-size: 1.125rem;
}
.cal__month::first-letter {
  text-transform: uppercase;
}
.cal__step {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  transition: background-color 200ms var(--ease);
}
.cal__step svg {
  width: 1.25rem;
  height: 1.25rem;
}
.cal__step:hover {
  background: var(--night-surface);
}
.cal__step[disabled] {
  opacity: 0.25;
  pointer-events: none;
}
.cal__week,
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}
.cal__week {
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  color: var(--night-ink-2);
}
.cal__day {
  aspect-ratio: 1;
  max-height: 3.25rem;
  width: 100%;
  border-radius: var(--r-m);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  transition: box-shadow 200ms var(--ease), background-color 200ms var(--ease);
}
.cal__day[disabled] {
  font-weight: 450;
  color: rgb(243 241 235 / 0.28);
}
.cal__day:not([disabled]) {
  box-shadow: inset 0 0 0 1px var(--night-line);
}
.cal__day:not([disabled]):hover {
  box-shadow: inset 0 0 0 1px rgb(243 241 235 / 0.4);
}
.cal__day[aria-checked="true"] {
  background: var(--night-ink);
  color: var(--night);
  box-shadow: none;
}
.time {
  border-radius: var(--r-m);
  box-shadow: inset 0 0 0 1px var(--night-line);
  font-variant-numeric: tabular-nums;
  transition: box-shadow 200ms var(--ease), background-color 200ms var(--ease);
}
.time:hover {
  box-shadow: inset 0 0 0 1px rgb(243 241 235 / 0.4);
}
.time[aria-checked="true"] {
  background: var(--night-surface);
  box-shadow: inset 0 0 0 2px var(--night-ink);
}
.times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.field--contact {
  margin-top: 0.75rem;
}
.time {
  min-height: 2.875rem;
  font-weight: 620;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.field {
  display: grid;
  gap: 0.375rem;
  font-size: 0.9375rem;
  color: var(--night-ink-2);
}
.field input {
  width: 100%;
  min-height: 3rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: var(--r-m);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--night-line);
  color: var(--night-ink);
  font: inherit;
  font-size: 1rem;
}
.field input:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--night-ink);
}
.field input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 2px var(--signal);
}

.demo__error {
  margin-top: 1.25rem;
  color: var(--signal);
}
.demo__submit {
  width: 100%;
  margin-top: 1.75rem;
}
.demo__submit[disabled] {
  opacity: 0.6;
}

@media (max-width: 60rem) {
  .demo {
    grid-template-columns: minmax(0, 1fr);
  }
  .demo__media {
    position: relative;
    top: auto;
    height: 14rem;
  }
}
@media (max-width: 30rem) {
  .choices--four {
    grid-template-columns: repeat(2, 1fr);
  }
  .times {
    grid-template-columns: repeat(3, 1fr);
  }
  .fields {
    grid-template-columns: 1fr;
  }
}
