/*
 * Landing page block styles (Oct 2026).
 * Each one is picked in the block sidebar under Styles, registered in functions.php:
 *   Heading / Paragraph → Garamond      .is-style-garamond
 *   List                → Checklist     .is-style-checklist
 *   Group               → Booking card  .is-style-booking-card (wraps the RSI scheduling widget)
 *   Cover               → Landing hero  .is-style-landing-hero (less top padding on phones and tablets)
 */

/* Landing hero. The block's padding is an inline style, hence !important.
   The theme also pads the inner container 20px below 782px. */

@media (max-width: 781px) {
  .wp-block-cover.is-style-landing-hero {
    padding-top: 24px !important;
  }
}

/* Garamond */

.is-style-garamond {
  font-family: "EB Garamond", serif;
  font-weight: 400;
  letter-spacing: normal;
}

/* The theme gives every h1 1.7em of padding top and bottom. */
h1.is-style-garamond {
  padding: 0;
  margin: 1.75rem 0;
  font-size: clamp(2.5rem, 4.4vw, 3.5rem);
  line-height: 1.1;
}

h2.is-style-garamond {
  margin: 0 0 1rem;
  line-height: 1.2;
}

/* Checklist */

ul.is-style-checklist {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
}

ul.is-style-checklist li {
  position: relative;
  padding-left: 1.9em;
  margin-bottom: 0.6em;
  font-size: 0.9em;
  line-height: 1.5;
}

ul.is-style-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.05em;
  height: 1.05em;
  background-color: currentColor;
  opacity: 0.85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Booking card */

.is-style-booking-card {
  --card-ink: #14404a;
  --card-accent: #1b6f7a;
  --card-tint: #f0f6f6;
  --card-line: #cfe2e4;
  background: #fff;
  color: var(--card-ink);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.is-style-booking-card > :first-child {
  margin-top: 0;
}

/* Show more times inside the card (phones; desktop uses the popup): Back in the
   top left as in the popup, the card's heading below it. The widget's own
   relative wrapper would hold Back below the heading, so it is released here. */
.is-style-booking-card:has(app-slots) {
  position: relative;
  padding-top: 4.5rem;
}

.is-style-booking-card:has(app-slots) rsi-online-scheduling .rsi-online-scheduling {
  position: static;
}

.is-style-booking-card:has(app-slots) rsi-online-scheduling .content-container > a.action-text {
  position: absolute;
  top: 2rem;
  left: 2rem;
  color: var(--card-ink);
  text-decoration: none;
}

/* RSI spaces every item in this view 20px apart and keeps an empty location row */
.is-style-booking-card rsi-online-scheduling .content-container {
  gap: 12px;
}

.is-style-booking-card rsi-online-scheduling .content-container > .location-container:empty {
  display: none;
}

/* RSI holds the times area at 410px tall, leaving a gap under short lists.
   Its component rule outranks this, hence !important. */
.is-style-booking-card rsi-online-scheduling .slots-wrapper {
  min-height: 0 !important;
}

/* RSI's "Checking availability…" loader. It sits in the widget's own box, which
   starts below the card heading and changes height between steps, so it shows
   partway down the card; let it cover the whole card and center there instead. */
.is-style-booking-card:has(app-loader .loader-overlay) {
  position: relative;
}

.is-style-booking-card:has(app-loader .loader-overlay) rsi-online-scheduling .rsi-online-scheduling {
  position: static;
}

.is-style-booking-card rsi-online-scheduling app-loader .loader-overlay {
  inset: 0;
  border-radius: 16px;
  opacity: 0.9;
}

.is-style-booking-card rsi-online-scheduling app-loader .loader-wrapper {
  inset: 0;
  gap: 14px;
  --theme-color-300: var(--card-accent);
}

.is-style-booking-card rsi-online-scheduling app-loader .loader-text {
  color: var(--card-ink);
  font-size: 15px;
}

.is-style-booking-card rsi-online-scheduling app-loader .rsi-cal {
  box-shadow: 0 6px 18px rgba(20, 64, 74, 0.12);
}

/* The card's heading ("Choose a time…") hides once a time is picked: on phones
   RSI shows its later screens (patient forms, booking) inside the card */
.is-style-booking-card:has(app-existing-patient, app-new-patient, app-new-patient-wizard, app-payment, app-book-appointment, app-save-card) h2.wp-block-heading {
  display: none;
}

.is-style-booking-card > :last-child {
  margin-bottom: 0;
}

/* RSI widget. Its Angular styles are added after ours at runtime, so these
   selectors carry the extra rsi-online-scheduling element to win. */

.is-style-booking-card rsi-online-scheduling {
  color: var(--card-ink);
}

.is-style-booking-card rsi-online-scheduling .inline-select-label {
  color: #5b6e72;
  font-size: 13px;
}

.is-style-booking-card rsi-online-scheduling .inline-select-value {
  color: var(--card-accent);
  font-size: 13px;
  text-decoration: none;
}

.is-style-booking-card rsi-online-scheduling .location-container {
  border: 0;
  padding: 0;
  margin: 1rem 0 0;
  box-shadow: none;
}

/* The practice name and the address (an unclassed div after it) */
.is-style-booking-card rsi-online-scheduling .location-name,
.is-style-booking-card rsi-online-scheduling .location-name + div {
  display: none;
}

.is-style-booking-card rsi-online-scheduling .location-slots {
  margin-top: 0;
  gap: 14px;
}

/* RSI fixes each slot at 50px tall with no padding */
.is-style-booking-card rsi-online-scheduling .rsi-slot {
  height: auto;
  padding: 14px 10px;
  gap: 6px;
  background-color: var(--card-tint);
  color: var(--card-ink);
  border: 1px solid var(--card-line);
  border-radius: 8px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.is-style-booking-card rsi-online-scheduling .rsi-slot .rsi-xxs-text {
  color: #5b6e72;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.is-style-booking-card rsi-online-scheduling .rsi-slot:hover,
.is-style-booking-card rsi-online-scheduling .rsi-slot:focus-visible {
  background-color: var(--card-ink);
  border-color: var(--card-ink);
  color: #fff;
}

.is-style-booking-card rsi-online-scheduling .rsi-slot:hover .rsi-xxs-text,
.is-style-booking-card rsi-online-scheduling .rsi-slot:focus-visible .rsi-xxs-text {
  color: #acd2d7;
}

/* .location-container outranks RSI's .rsi-online-scheduling[id^=rsi-widget-] .action-text,
   which also underlines it on hover */
.is-style-booking-card rsi-online-scheduling .location-container .action-text,
.is-style-booking-card rsi-online-scheduling .location-container .action-text:hover {
  display: block;
  margin-top: 1.25rem;
  text-align: center;
  color: #5b6e72;
  text-decoration: none;
  font-size: 0; /* hides RSI's "Show more times>" text; redrawn below with an arrow */
}

.is-style-booking-card rsi-online-scheduling .location-container .action-text::before {
  content: "Show more times";
  content: "Show more times" / ""; /* screen readers already read RSI's text */
  font-size: 14px;
}

.is-style-booking-card rsi-online-scheduling .location-container .action-text::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  vertical-align: -2px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s;
}

.is-style-booking-card rsi-online-scheduling .location-container .action-text:hover::after {
  transform: translateX(3px);
}

/* RSI's "Complete Your Booking" popup (Show more times). It opens in an overlay
   outside the card, so it is scoped to pages that have a booking card. */

body:has(.is-style-booking-card) .rsi-scheduling-popup {
  --card-ink: #14404a;
  --card-accent: #1b6f7a;
  --card-tint: #f0f6f6;
  --card-line: #cfe2e4;
}

/* Title level with the close button; on the steps with a Back link, Back and
   close share the top row and the title drops below them.
   RSI's component rule for the header outranks these, hence !important. */
body:has(.is-style-booking-card) .rsi-scheduling-popup .scheduling-popup-header {
  padding-top: 14px !important;
  padding-right: 56px !important;
  padding-bottom: 14px !important;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup:has(.content-container > a.action-text) .scheduling-popup-header {
  padding-top: 60px !important;
}

/* "Complete Your Booking" in Garamond, like the card's heading */
body:has(.is-style-booking-card) .rsi-scheduling-popup .scheduling-popup-header .rsi-xxl-text {
  font-family: "EB Garamond", serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  color: var(--card-ink);
}

/* RSI forces every icon to 18px with !important */
body:has(.is-style-booking-card) .rsi-scheduling-popup .close-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px !important;
  height: 32px !important;
  font-size: 32px !important;
  line-height: 32px;
  color: var(--card-ink);
}

/* Back sits in the scrolling body but is positioned against the popup */
body:has(.is-style-booking-card) .rsi-scheduling-popup .content-container > a.action-text {
  position: absolute;
  top: 19px;
  left: 20px;
  color: var(--card-ink);
  text-decoration: none;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .inline-select-value {
  color: var(--card-accent);
  text-decoration: none;
}

/* RSI spreads the date columns to the edges (space-between); group them instead.
   Its component rule outranks this, hence !important. */
body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-container {
  justify-content: center !important;
  gap: 32px !important;
}

/* The prev/next arrows sit in the first and last date headers and push those
   dates off center; take them out of the flow so each date centers over its times.
   On phones, Show more times opens in the card instead of the popup. */
body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column-header,
.is-style-booking-card rsi-online-scheduling .slots-column-header {
  position: relative;
  align-self: stretch;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column-header .mat-icon,
.is-style-booking-card rsi-online-scheduling .slots-column-header .mat-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column-header .mat-icon:first-child,
.is-style-booking-card rsi-online-scheduling .slots-column-header .mat-icon:first-child {
  left: 0;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column-header .mat-icon:last-child,
.is-style-booking-card rsi-online-scheduling .slots-column-header .mat-icon:last-child {
  right: 0;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column-date,
.is-style-booking-card rsi-online-scheduling .slots-column-date {
  align-items: center;
  color: var(--card-ink);
}

/* Patient information step (after a time is picked). On desktop it opens in
   the popup; on phones RSI shows it inside the card instead, with its own
   "Complete your booking" title. */

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-book-info-container,
.is-style-booking-card rsi-online-scheduling .rsi-book-info-container {
  background-color: var(--card-tint);
  border: 1px solid var(--card-line);
  border-radius: 8px;
  box-shadow: none;
  color: var(--card-ink);
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .appt-info-item-text,
body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-label,
.is-style-booking-card rsi-online-scheduling .appt-info-item-text,
.is-style-booking-card rsi-online-scheduling .rsi-label {
  color: var(--card-ink);
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .appt-info-item-icon,
.is-style-booking-card rsi-online-scheduling .appt-info-item-icon {
  color: var(--card-accent);
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-booking-header .rsi-xl-text,
.is-style-booking-card rsi-online-scheduling .rsi-booking-header .rsi-xl-text,
.is-style-booking-card rsi-online-scheduling .rsi-scheduling-content > .rsi-xxl-text {
  font-family: "EB Garamond", serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: var(--card-ink);
}

/* Fields 24px apart (RSI's 10px reads cramped), and "Supplementary Information"
   set off as its own section. RSI's component rule outranks the gap, hence !important. */
body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-patient-form,
.is-style-booking-card rsi-online-scheduling .rsi-patient-form {
  gap: 24px !important;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-patient-form > .rsi-xl-text,
.is-style-booking-card rsi-online-scheduling .rsi-patient-form > .rsi-xl-text {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-line);
  font-family: "EB Garamond", serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: var(--card-ink);
}

/* Go Back / Complete Booking: smaller text, Go Back sized to its label and
   Complete Booking taking the rest of the row, card colors */
body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-patient-form-buttons,
.is-style-booking-card rsi-online-scheduling .rsi-patient-form-buttons {
  gap: 12px;
  margin-top: 2rem !important; /* RSI's component rule sets 20px */
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-patient-form-buttons button,
.is-style-booking-card rsi-online-scheduling .rsi-patient-form-buttons button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
  font-size: 13px;
  letter-spacing: 0.03em;
  border-radius: 8px;
  --mdc-filled-button-container-color: var(--card-ink);
  --mdc-filled-button-label-text-color: #fff;
  --mdc-outlined-button-label-text-color: var(--card-ink);
  --mdc-outlined-button-outline-color: var(--card-line);
  --mat-filled-button-container-color: var(--card-ink);
  --mat-filled-button-label-text-color: #fff;
  --mat-outlined-button-label-text-color: var(--card-ink);
  --mat-outlined-button-outline-color: var(--card-line);
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-patient-form-buttons button.mat-mdc-outlined-button,
.is-style-booking-card rsi-online-scheduling .rsi-patient-form-buttons button.mat-mdc-outlined-button {
  flex: 0 0 auto !important; /* RSI's phone layout sets both buttons to flex: 1 */
  padding: 0 18px;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-patient-form-buttons button .mdc-button__label,
.is-style-booking-card rsi-online-scheduling .rsi-patient-form-buttons button .mdc-button__label {
  font-size: 13px;
  white-space: nowrap;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-light-text,
body:has(.is-style-booking-card) .rsi-scheduling-popup .dob-hint,
.is-style-booking-card rsi-online-scheduling .rsi-booking-header .rsi-light-text,
.is-style-booking-card rsi-online-scheduling .rsi-form-control .dob-hint {
  color: #5b6e72;
}

/* Same as the card's time buttons */
body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-slot {
  height: auto;
  padding: 14px 10px;
  background-color: var(--card-tint);
  color: var(--card-ink);
  border: 1px solid var(--card-line);
  border-radius: 8px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-slot:hover,
body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-slot:focus-visible {
  background-color: var(--card-ink);
  border-color: var(--card-ink);
  color: #fff;
}

@media (max-width: 575px) {
  .is-style-booking-card {
    padding: 1.5rem 1.1rem;
  }

  /* Same size as RSI's "Complete your booking" title on phones */
  .is-style-booking-card h2.wp-block-heading {
    font-size: 26px;
  }

  .is-style-booking-card:has(app-slots) {
    padding-top: 3.75rem;
  }

  .is-style-booking-card:has(app-slots) rsi-online-scheduling .content-container > a.action-text {
    top: 1.5rem;
    left: 1.1rem;
  }

  .is-style-booking-card rsi-online-scheduling .location-slots {
    gap: 10px;
  }

  .is-style-booking-card rsi-online-scheduling .rsi-slot {
    padding: 12px 4px;
    white-space: nowrap;
  }

  .is-style-booking-card rsi-online-scheduling .rsi-slot .rsi-xxs-text {
    letter-spacing: 0;
    font-size: 10px;
  }

  .is-style-booking-card rsi-online-scheduling .rsi-slot span:last-child {
    font-size: 14px;
  }

  /* Popup across the full width (Angular Material caps dialogs at 80vw) */
  body:has(.is-style-booking-card) .cdk-overlay-pane.mat-mdc-dialog-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  body:has(.is-style-booking-card) .mat-mdc-dialog-container {
    --mat-dialog-container-max-width: 100vw;
    --mdc-dialog-container-shape: 0;
  }

  body:has(.is-style-booking-card) .rsi-scheduling-popup .scheduling-popup-header .rsi-xxl-text {
    font-size: 26px;
  }

  /* RSI sets fixed 100px slots, which run three columns past the edge
     (in the popup, and in the card where Show more times opens on phones) */
  body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-container,
  .is-style-booking-card rsi-online-scheduling .slots-container {
    gap: 8px !important;
  }

  body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column,
  .is-style-booking-card rsi-online-scheduling .slots-column {
    flex: 1 1 0;
    min-width: 0;
  }

  body:has(.is-style-booking-card) .rsi-scheduling-popup .slots-column app-slot,
  .is-style-booking-card rsi-online-scheduling .slots-column app-slot {
    align-self: stretch;
  }

  .is-style-booking-card rsi-online-scheduling .slots-column .rsi-slot {
    width: 100% !important;
  }

  body:has(.is-style-booking-card) .rsi-scheduling-popup .rsi-slot {
    width: 100% !important;
    padding: 12px 4px;
    white-space: nowrap;
    font-size: 14px;
  }
}
