/* Boutique Whitening practice page: layout for templates/whitening-practice-page.html.
   Layout only: fonts, colours and text sizes come from the website.
   Every rule starts with .bwp-page, so nothing else on the site changes.
   The grids need no media queries: they stack on narrow screens. */

.bwp-page {
  box-sizing: border-box;
  max-width: 72rem;
  margin-inline: auto;
}

.bwp-page *,
.bwp-page *::before,
.bwp-page *::after {
  box-sizing: inherit;
}

.bwp-page > section,
.bwp-page > div {
  margin-block: 2.5rem;
}

.bwp-page img,
.bwp-page iframe {
  max-width: 100%;
}

.bwp-page img {
  display: block;
  height: auto;
}

.bwp-page figure {
  margin: 0;
}

/* Calls to action: links side by side, wrapping when there is no room. */
.bwp-page div.bwp-cta p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

/* Hero: the photo across the top, cropped to a sensible height. */
.bwp-page .bwp-hero > figure {
  margin-block-end: 1.5rem;
}

.bwp-page .bwp-hero > figure img {
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
}

/* "On this page" links in a wrapping row. */
.bwp-page .bwp-jump ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bwp-page .bwp-jump p {
  margin-block-end: 0.5rem;
}

/* Quick answers, the three steps and the gel cards: as many columns as fit. */
.bwp-page .bwp-answers__grid,
.bwp-page .bwp-steps__grid,
.bwp-page .bwp-gels__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem 2rem;
}

.bwp-page .bwp-answers__grid h3,
.bwp-page .bwp-steps__grid h3,
.bwp-page .bwp-gel h3 {
  margin-block: 0 0.5rem;
}

.bwp-page .bwp-gel {
  padding: 1rem 1.25rem;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 0.5rem;
}

/* The comparison table scrolls sideways on its own on a narrow phone. */
.bwp-page .bwp-table {
  overflow-x: auto;
  margin-block: 1.5rem;
}

.bwp-page .bwp-table table {
  width: 100%;
  border-collapse: collapse;
}

.bwp-page .bwp-table th,
.bwp-page .bwp-table td {
  padding: 0.5rem 0.75rem;
  border-block-end: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  text-align: start;
  vertical-align: top;
}

.bwp-page .bwp-table caption {
  text-align: start;
  font-weight: bold;
  padding-block-end: 0.5rem;
}

/* Before-and-after cases: the two photos side by side, cases in a grid. */
.bwp-page .bwp-cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 2rem;
}

.bwp-page .bwp-case figure {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.bwp-page .bwp-case img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.bwp-page .bwp-case figcaption {
  grid-column: 1 / -1;
}

/* Patient videos: 16:9 players, the same size however many there are. */
.bwp-page .bwp-videos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1.5rem;
  margin-block-end: 1rem;
}

.bwp-page .video-embed iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* Tray features and price lists: a comfortable line length. */
.bwp-page .bwp-trays > ul,
.bwp-page .bwp-price > ul {
  max-width: 48rem;
}

/* Meet the dentist: photo beside the biography, above it on narrow screens. */
.bwp-page .bwp-dentist__profile {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem 2rem;
}

.bwp-page .bwp-dentist__profile > figure {
  flex: 1 1 12rem;
  max-width: 18rem;
}

.bwp-page .bwp-dentist__bio {
  flex: 999 1 20rem;
}

.bwp-page .bwp-dentist__bio > :first-child {
  margin-block-start: 0;
}

/* Questions and the science stages: a divider between expandable items. */
.bwp-page .bwp-faqs > details,
.bwp-page .bwp-results > details,
.bwp-page .bwp-science > details {
  padding-block: 0.75rem;
  border-block-end: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.bwp-page details > summary {
  cursor: pointer;
}

/* The final call to action stands apart from the page above it. */
.bwp-page .bwp-final {
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 0.5rem;
}

.bwp-page .bwp-final > h2 {
  margin-block-start: 0;
}