/* Book a Demo (EN /about/contact/book-a-demo/, FR /fr/about/contact/book-a-demo/): the Calendly booking
   calendar, inline, in the white card where the request form was (form archived in
   docs/archive/book-a-demo-original-form/). Nothing is requested from Calendly until someone presses
   "Show available times"; assets/js/book-demo-calendar.*.js then loads the official inline embed (an
   iframe to the event) and sizes it to its content from Calendly's own height messages, so the calendar
   does not scroll inside the page. Linked only from the two Book a Demo pages. */

.demo-calendar {
  margin: 0 0 var(--space-6, 1.5rem);
}

/* Before the calendar loads: one panel with one action, in the brand's teal wash (--bg-teal-wash, as the
   site's light brand sections) with the site's 48 px icon tile (as .card__icon / .value-card__icon). Shown by the
   script; without it the panel stays hidden and the link below the card is the way to book. Desktop: icon, words
   and button in one row; tablets: the button under the words; phones: one column across the card's full width
   (where the calendar will appear). */
.demo-calendar__start {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon intro button";
  align-items: center;
  gap: var(--space-4, 1rem) var(--space-6, 1.5rem);
  padding: var(--space-6, 1.5rem) var(--space-8, 2rem);
  border: 1px solid var(--clr-green-light, rgba(12, 126, 102, 0.10));
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-teal-wash, #EBF5F2);
  text-align: left;
}

/* The grid above would otherwise override the hidden attribute (no JavaScript: no panel). */
.demo-calendar__start[hidden] {
  display: none;
}

.demo-calendar__icon {
  grid-area: icon;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg, 12px);
  background: var(--clr-white, #fff);
  color: var(--color-primary, #0C7E66);
  font-size: 1.5rem;
}

.demo-calendar__icon .ph-duotone {
  font-size: inherit;
  color: inherit;
}

.demo-calendar__intro {
  grid-area: intro;
}

.demo-calendar__title {
  margin: 0 0 var(--space-1, 0.25rem);
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--clr-dark, #0A4F3E);
}

.demo-calendar__note {
  max-width: 60ch;
  margin: 0;
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.6;
  color: var(--text-on-white, #1F2933);
}

.demo-calendar__start .btn {
  grid-area: button;
  justify-self: start;
  white-space: normal;
}

@media (max-width: 899px) {
  .demo-calendar__start {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon intro" ". button";
  }
}

/* The calendar. Height comes from Calendly (calendly.page_height); this is only its size while loading. */
.demo-calendar__frame {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

.demo-calendar__frame:focus,
.demo-calendar__frame:focus-visible {
  outline: 3px solid var(--color-primary, #0C7E66);
  outline-offset: 3px;
}

.demo-calendar__fallback,
.demo-calendar__problem {
  margin: var(--space-3, 0.75rem) 0 0;
  font-size: var(--text-sm, 0.875rem);
}

.demo-calendar__problem {
  font-weight: 600;
}

/* The link to calendly.com is told apart from the text by more than colour (WCAG 1.4.1). */
.demo-calendar__fallback a {
  color: var(--color-primary, #0C7E66);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Phones: Calendly needs about 270 px to lay out its month without squeezing the day names, so the
   calendar (and the panel before it) uses the card's full width (the card keeps its padding for the words
   around it). */
@media (max-width: 600px) {
  .demo-calendar__start {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "icon" "intro" "button";
    margin-inline: calc(-1 * var(--space-8, 2rem));
    padding: var(--space-6, 1.5rem) var(--space-6, 1.5rem);
    border-radius: 0;
    border-inline: 0;
  }

  .demo-calendar__start .btn {
    justify-self: stretch;
  }

  .demo-calendar__frame {
    width: calc(100% + 2 * var(--space-8, 2rem));
    max-width: none;
    margin-inline: calc(-1 * var(--space-8, 2rem));
    border-radius: 0;
    height: 880px;
  }
}
