/*
 * Shared component: the booking step after a form is sent, the Google
 * Calendar appointment schedule in an iframe. Markup:
 * views/partials/redesign/booking-frame.ejs inside a [data-booking] panel
 * (the free-check card on /en/contact, the funder card in the For funders
 * final ask). Behaviour: public/js/redesign/booking.js.
 *
 * Height: Google's page is ~1650 px tall on desktop and ~2250 px on a phone
 * (one button per 20-minute slot). Fitting the iframe to that would remove the
 * inner scroll, but Google centres its "confirm your booking" dialog in the
 * iframe, so a slot picked low down would open the dialog out of sight. So the
 * iframe stays within the screen and scrolls inside: 700 px on desktop, the
 * screen's height less a margin on phones.
 */
.booking__lead { color: var(--text-2); font-size: 15px; line-height: 22px; }
.booking__frame {
  position: relative;
  margin-inline: -12px;
  border-radius: var(--radius-input);
  background: var(--white);
  overflow: hidden;
}
.booking__iframe {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
  opacity: 0;
  transition: opacity var(--dur-reveal) var(--ease-out);
}
.booking__frame.is-loaded .booking__iframe { opacity: 1; }
.booking__loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px;
}
.booking__frame.is-loaded .booking__loading { display: none; }
.booking__direct { color: var(--muted); font-size: 14px; line-height: 20px; }
.booking__done { display: flex; justify-content: flex-end; }
.booking__done-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 0;
  color: var(--deep-green);
  font-size: 15px; font-weight: 600; line-height: 20px;
  text-decoration: underline 1px;
  text-underline-offset: 4px;
}

/* Without JS: no iframe, the booking page opens in a new tab. html.js is set
   by the inline head script (FOUNDATION.md, "Motion"). */
html:not(.js) .booking__frame,
html:not(.js) .booking__direct { display: none; }
.js .booking__nojs { display: none; }

@media (hover: hover) and (pointer: fine) {
  .booking__done-link { transition: color var(--dur-hover) ease; }
  .booking__done-link:hover { color: var(--ink); }
}

@media (max-width: 767px) {
  .booking__frame { margin-inline: -8px; }
  .booking__iframe { height: clamp(600px, calc(100vh - 40px), 900px); height: clamp(600px, calc(100svh - 40px), 900px); }
  .booking__done { justify-content: center; }
}
