/*
 * Layout for each page builder section (templates/sections). Spacing and backgrounds come from
 * .section in layout.css; these rules only cover what one section does differently.
 */

@layer sections {
  /* The short dark rule (components.css) sits on the left under a heading beside an image */
  .text-image .text-image__heading::after { margin-left: 0; }

  /* Buttons under centred content are centred too */
  :is(.hero, .text--center, .testimonials, .instagram, .cta) .button-group { justify-content: center; }
  /* No rule under the reviews' heading, or under a pull quote */
  :is(.testimonials, .cta) .section__head > h2::after { content: none; }

  /* ---- Hero: the page heading, centred. With an image, the image fills the section under a dark overlay. ---- */
  .hero { text-align: center; }
  .hero--image .hero__title { text-transform: uppercase; }
  .hero__intro { max-width: var(--measure); margin: var(--space-2xs) auto 0; text-wrap: balance; } /* even lines when it wraps on phones */
  .hero__text {
    margin: var(--space-s) auto 0;
    & :is(ul, ol) { padding-left: 0; list-style-position: inside; }
  }
  /* A banner image above the title, in the page column */
  .hero--banner {
    padding-block: var(--space-xl) var(--space-section);
    & .hero__title { margin-top: var(--space-l); }
    & .hero__intro { margin-top: var(--space-s); }
  }
  .hero__banner { width: 100%; }
  /* On the left, as the title of a long text page: close to the header and to the text under it */
  .hero--left {
    padding-block: var(--space-xl) 0; text-align: left;
    & + .section { padding-top: var(--space-xl); }
    & :is(.hero__intro, .hero__text) { margin-inline: 0; }
    & .button-group { justify-content: flex-start; }
  }
  /* The overlay (::before) sits between the photo and the text. White text over it passes 4.5:1 on any photo. */
  .hero--image {
    --color-ink: var(--color-white); --color-text: var(--color-white);
    position: relative; isolation: isolate; display: flex; align-items: center; min-height: var(--hero-height);
    background: var(--color-black); color: var(--color-white); text-shadow: var(--shadow-small);
    &::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
  }
  .hero__image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
  /* Every page but the home page: shorter than the home page slider, and taller if its text needs the room */
  .hero--short { min-height: var(--hero-height-short); }

  /* A hero with slides (Embla, assets/scripts/components/carousel.js); each slide is laid out like a single
     hero. Without the script the viewport scrolls sideways and snaps; with it, Embla moves the track. */
  .hero--slider { position: relative; padding-block: 0; }
  .hero__viewport {
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }
    &[data-carousel-ready] { overflow: hidden; scroll-snap-type: none; }
  }
  .hero__track { display: flex; touch-action: pan-y pinch-zoom; }
  .hero__slide {
    flex: 0 0 100%; scroll-snap-align: start; padding-block: var(--space-section);
    /* Room at the sides for the previous and next buttons, so they never sit over the text */
    & .wrap { padding-inline: max(var(--wrap-gutter), calc(var(--hero-control-width) + 2 * var(--space-s))); }
  }
  .hero__controls {
    position: absolute; inset: 50% 0 auto; translate: 0 -50%; display: flex; justify-content: space-between; padding-inline: var(--space-s);
    pointer-events: none;
  }
  /* The hero's buttons keep their size; ::before grows what can be tapped to at least --target-size */
  .hero__control::before {
    content: ""; position: absolute; inset: min(0px, (100% - var(--target-size)) / 2);
  }
  .hero__control {
    position: relative; display: grid; place-items: center; width: var(--hero-control-width); height: 3.75rem; border-radius: var(--radius);
    background: var(--color-shade); color: var(--color-white); pointer-events: auto; transition: background-color var(--transition);
    @media (hover: hover) { &:hover { background: var(--color-shade-dark); } }
    &:disabled { opacity: 0.4; cursor: default; }
  }
  /* On phones the buttons sit side by side at the foot of the slide, so the text has the full width instead
     of a narrow column between them ("Bathrooms | Tiles | Stone" broke into three short lines at 320px) */
  @media (width < 40rem) {
    .hero__slide {
      padding-bottom: calc(var(--space-section) + var(--target-size));
      & .wrap { padding-inline: var(--wrap-gutter); }
    }
    .hero__controls { inset: auto 0 var(--space-s); translate: none; justify-content: center; gap: var(--space-2xs); }
    .hero__control { width: var(--target-size); height: var(--target-size); }
  }

  /* ---- Text: centred under its heading, or left-aligned and full width for long pages ---- */
  .text__heading { margin-bottom: var(--space-s); }
  .text--center {
    text-align: center;
    & .text__heading, & .prose { max-width: var(--measure); margin-inline: auto; }
    /* The rule sits between the heading and the text (components.css), with the same gap each side */
    & .text__heading:has(+ .prose) { margin-bottom: var(--space-m); }
    & .prose :is(ul, ol) { padding-left: 0; list-style-position: inside; }
  }

  /* ---- Text and image: side by side from medium screens, on the side chosen. As on the old site, the text
     takes a third (with room on its right) and the image the rest, less the column gap. ---- */
  .text-image__inner {
    display: grid; align-items: center; gap: var(--space-xl);
    @media (min-width: 48rem) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--column-gap); }
  }
  .text-image__body { @media (min-width: 64rem) { padding-right: var(--space-2xl); } }
  .text-image__heading { margin-bottom: var(--space-s); }
  .text-image--image-left .text-image__inner { @media (min-width: 48rem) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
  .text-image--image-left .text-image__media { @media (min-width: 48rem) { order: -1; } }
  .text-image__image { width: 100%; border-radius: var(--radius); }

  /* Edge to edge: two halves, the image filling one, the text (a quote) on the section's background */
  .text-image--full {
    padding-block: 0;
    & .text-image__inner { gap: 0; align-items: stretch; @media (min-width: 48rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    & .text-image__body { align-self: center; padding: var(--space-section) var(--wrap-gutter); }
    & .text-image__heading { margin-bottom: 0; &::after { content: none; } font-size: var(--text-quote); line-height: var(--leading-heading); letter-spacing: normal; text-wrap: wrap; }
    & .text-image__media { order: -1; min-height: 34.375rem; @media (min-width: 48rem) { order: 0; } }
    &.text-image--image-left .text-image__media { order: -1; }
    & .text-image__image { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
  }

  /* ---- Cards: the title has a line after it (components.css), or not (plain), or the card is centred
     under an icon (centred), as in the old feature lists ---- */
  .cards .grid { row-gap: var(--space-xl); @media (min-width: 40rem) { column-gap: var(--column-gap); } }
  /* Four to a row on wide screens becomes two on phones, not one, so category cards don't push the
     products several screens down */
  .cards .grid--4 { @media (width < 40rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-s); } }
  /* Two to a row, a cue ("How to order") takes the card's width, without its arrow, so it fits on one line and
     the cues in a row match, as the product cards' do (plugins/woocommerce.css) */
  .cards .grid--4 .card__more { @media (width < 40rem) { align-self: stretch; justify-content: center; padding-inline: var(--space-2xs); & .icon { display: none; } } }
  .cards--plain .card__title::after { content: none; }
  /* Bordered (category cards): a thin light border round each card, the photo edge to edge at the top and the
     title, text and cue inset under it, as the product cards (plugins/woocommerce.css). The gaps are smaller
     than other cards', the same as the product grid's, so category and product cards line up on a page. */
  .cards--bordered {
    & .grid { gap: var(--space-s); @media (min-width: 40rem) { gap: var(--space-m); } }
    & .card { overflow: hidden; padding-bottom: var(--space-m); border: 1px solid var(--color-line); border-radius: var(--radius); background: var(--color-white); }
    & .card > :not(.card__media) { margin-inline: var(--space-m); }
    & :is(.card__media, .card__image) { border-radius: 0; }
    & .card__title { margin-top: var(--space-s); &::after { content: none; } }
    @media (width < 40rem) {
      & .card { padding-bottom: var(--space-s); }
      & .card > :not(.card__media) { margin-inline: var(--space-s); }
      & .card__title { margin-top: var(--space-xs); font-size: var(--text-base); }
      /* Two to a row, the cue's text ("Shop stainless steel radiators") would wrap to several lines; the whole
         card is the link, so the title is enough */
      & .card__more { display: none; }
    }
  }
  .cards--centred {
    & .card { text-align: center; }
    & .card__icon { display: block; width: 2.5rem; height: 2.5rem; margin: 0 auto var(--space-s); color: var(--color-text); }
    & .card__title { justify-content: center; margin-top: 0; &::after { content: none; } }
    & .card__more { align-self: center; }
    & .card > :has(+ .card__more) { margin-bottom: var(--space-2xs); }
  }

  /* ---- Gallery: square-ish images edge to edge with no gaps, in the page column with small gaps, or in the
     page column with the column gap ---- */
  .gallery__grid.grid { gap: 0; }
  .gallery__image { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
  .gallery--column .gallery__grid.grid { gap: var(--space-2xs); }
  .gallery--gaps .gallery__grid.grid { gap: var(--space-m) var(--column-gap); }
  /* Galleries of three or four keep two to a row on phones, so a long one isn't a single column of photos */
  .gallery__grid:is(.grid--3, .grid--4) { @media (width < 40rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

  /* ---- Stats: big figures over their labels, centred ---- */
  .stats { text-align: center; }
  .stats .grid { row-gap: var(--space-xl); @media (min-width: 40rem) { column-gap: var(--column-gap); } }
  .stats__item { display: flex; flex-direction: column-reverse; gap: var(--space-3xs); }
  .stats__value { color: var(--color-ink); font-size: var(--text-stat); line-height: 1; letter-spacing: -0.05em; }
  .stats__label { font-size: var(--text-small); line-height: var(--leading-snug); }

  /* ---- Call to action: on the old landing pages, a pull quote over a button ---- */
  .cta:not(.cta--image) .section__head { margin-bottom: var(--space-s); & h2 { font-size: var(--text-quote); letter-spacing: normal; text-wrap: wrap; } }
  .cta--image {
    --color-ink: var(--color-white); --color-text: var(--color-white);
    position: relative; isolation: isolate; background: var(--color-black); color: var(--color-white); text-align: center;
    text-shadow: var(--shadow-small);
    & .section__head { margin-bottom: 0; }
  }
  .cta--image::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
  .cta__image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }

  /* ---- Image ---- */
  .image__image { width: 100%; border-radius: var(--radius); }
  .image--small .image__image { width: auto; max-width: min(100%, 18.75rem); border-radius: 0; }
  .image__caption { margin-top: var(--space-xs); }

  /* ---- Form ---- */
  /* A container, so the form can split into two columns when it has the room (plugins/forminator.css) */
  .form-section__form { container: form / inline-size; max-width: var(--form-width-wide); margin-inline: auto; }

  /* ---- Instagram: the Instagram Feed plugin's grid, then the button to the profile. With no account connected
     there's no feed, so the button sits straight under the heading. ---- */
  .instagram .section__head + .button-group { margin-top: 0; }
  /* The placeholder until an Instagram account is connected: square tiles, four across, a shade darker than
     the section, with the icon in the middle. Two rows are two by two on phones (only the first four show);
     one row stays four across. */
  .instagram__placeholder {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2xs);
    @media (min-width: 40rem) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    &.instagram__placeholder--one-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    & + .button-group { margin-top: var(--space-l); }
  }
  .instagram__tile {
    display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius); background: var(--color-paper-light); color: var(--color-line-on-grey);
    .section--white & { background: var(--color-paper); }
    & .icon { width: 1.75rem; height: 1.75rem; }
    @media (width < 40rem) {
      &:nth-child(n + 5) { display: none; }
      .instagram__placeholder--one-row & .icon { width: 1.25rem; height: 1.25rem; }
    }
  }

  /* ---- Testimonials: five stars, the quote, then the name beside the review site's logo ---- */
  .testimonials .grid { gap: 0 var(--column-gap); }
  /* Room above the button under the reviews, which otherwise sat tight to the quotes */
  .testimonials .button-group { margin-top: var(--space-xl); }
  .testimonial {
    display: flex; flex-direction: column; padding-block: var(--space-m);
    &:first-child { padding-top: 0; }
    @media (width < 40rem) { & + & { border-top: 1px dashed var(--color-line); } }
    @media (min-width: 40rem) { padding: 0; }
  }
  .testimonial__stars { display: flex; gap: var(--space-2xs); margin-bottom: var(--space-s); color: var(--color-star); & .icon { width: var(--icon-l); height: var(--icon-l); } }
  .testimonial__cite { display: flex; align-items: center; gap: var(--space-s); margin-top: var(--space-s); line-height: var(--leading-snug); }
  .testimonial__logo { display: grid; place-items: center; width: 2.8125rem; height: 2.8125rem; flex-shrink: 0; & .icon { width: var(--icon-l); height: var(--icon-l); } }
  .testimonial__name { display: block; color: var(--color-ink); font-weight: var(--weight-bold); }
  .testimonial__source { display: block; }

  /* As a slider: one quote at a time, centred, between previous and next buttons at the sides */
  .testimonials__slider { position: relative; }
  .testimonials__track {
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }
  }
  .testimonials__list { display: flex; }
  .testimonials--slider {
    & .testimonial { flex: 0 0 100%; align-items: center; padding: 0 calc(var(--control-size) + var(--space-2xs)); scroll-snap-align: start; text-align: center; border: 0; @media (min-width: 40rem) { padding-inline: var(--space-2xl); } }
    & .testimonial__stars { justify-content: center; color: var(--color-text); & .icon { width: 1.25rem; height: 1.25rem; } }
    & .testimonial__quote { max-width: 63rem; margin-inline: auto; font-size: var(--text-quote-small); line-height: var(--leading); }
    & .testimonial__cite { justify-content: center; text-align: left; }
  }
  .testimonials__controls {
    position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; pointer-events: none;
    &[hidden] { display: none; }
  }
  .testimonials__control {
    display: grid; place-items: center; width: var(--control-size); height: var(--control-size); background: var(--color-grey); color: var(--color-white); pointer-events: auto; transition: background-color var(--transition);
    @media (hover: hover) { &:hover { background: var(--color-ink); } }
    &:disabled { opacity: 0.4; cursor: default; }
    & .icon { width: var(--icon-xs); height: var(--icon-xs); }
  }

  /* ---- Showrooms: a carousel of three on large screens, two on small and one on phones ---- */
  .showrooms__slider { display: flex; flex-direction: column; }
  .showrooms__controls { display: flex; gap: 2px; align-self: flex-end; margin-bottom: var(--space-s); }
  .showrooms__control {
    display: grid; place-items: center; width: var(--control-size); height: var(--control-size); background: var(--color-grey); color: var(--color-white); transition: background-color var(--transition);
    @media (hover: hover) { &:hover { background: var(--color-ink); } }
    &:disabled { opacity: 0.4; cursor: default; }
  }
  /* The arrow in a previous or next button (the hero's, the reviews' and the showrooms') moves a little the
     way it points, on hover and keyboard focus */
  :is(.hero__control, .testimonials__control, .showrooms__control) {
    --nudge-by: var(--nudge);
    &:is([data-carousel-previous], [data-slider-previous]) { --nudge-by: calc(var(--nudge) * -1); }
    & .icon { transition: translate var(--transition); }
    @media (prefers-reduced-motion: no-preference) {
      &:focus-visible .icon { translate: var(--nudge-by) 0; }
      @media (hover: hover) { &:hover:not(:disabled) .icon { translate: var(--nudge-by) 0; } }
    }
  }
  .showrooms__track {
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }
  }
  .showrooms__list { display: flex; gap: var(--column-gap); }
  .showrooms__item {
    flex: 0 0 100%; scroll-snap-align: start;
    @media (min-width: 40rem) { flex-basis: calc((100% - var(--column-gap)) / 2); }
    @media (min-width: 64rem) { flex-basis: calc((100% - 2 * var(--column-gap)) / 3); }
  }
  .showroom-card {
    display: block; color: var(--color-ink); text-align: center; text-decoration: none;
    @media (hover: hover) { &:hover .showroom-card__name { text-decoration: underline; } }
    /* The chevron moves right on hover and keyboard focus */
    @media (prefers-reduced-motion: no-preference) {
      &:focus-visible .showroom-card__icon { translate: var(--nudge) 0; }
      @media (hover: hover) { &:hover .showroom-card__icon { translate: var(--nudge) 0; } }
    }
  }
  /* The pictures are trimmed to the drawing, most about 12:5; a taller one is fitted inside, centred */
  .showroom-card__image { width: 100%; aspect-ratio: 12 / 5; object-fit: contain; }
  .showroom-card__name { display: flex; justify-content: center; align-items: center; gap: var(--space-2xs); margin-top: var(--space-s); }
  .showroom-card__icon { flex: none; transition: translate var(--transition); }

  /* As cards beside a map: on large screens the map takes three fifths of the width and the cards, in one
     column, stretch to its height (the map is cropped a little if the cards run taller). On smaller screens
     the map sits above them, with the cards three to a row, then two, then one. */
  .showrooms__map-list {
    display: grid; gap: var(--space-s);
    @media (min-width: 80rem) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  }
  .showrooms__map {
    width: 100%;
    @media (min-width: 80rem) { height: 100%; object-fit: cover; }
  }
  .showrooms__cards {
    display: grid; gap: var(--space-xs);
    @media (min-width: 40rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    @media (min-width: 64rem) and (width < 80rem) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    @media (min-width: 80rem) { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; }
  }
  /* Name and chevron on top, then the town and phone on one line, each with an icon; the name is the link
     and covers the card, and the town and phone links sit above it */
  .showroom-summary {
    display: flex; flex-direction: column; justify-content: center; padding: var(--space-s) var(--space-m); border-radius: var(--radius);
    background: var(--color-white); transition: box-shadow var(--transition);
    & .card__text { margin-top: var(--space-3xs); font-size: var(--text-small); line-height: var(--leading-snug); }
    /* On hover, a dark edge and a soft shadow (and the chevron moves right) */
    @media (hover: hover) { &:hover { box-shadow: inset 0 0 0 1px var(--color-ink), var(--shadow-panel); } }
  }
  .showroom-summary__name {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); font-size: var(--text-base); line-height: var(--leading-snug);
  }
  .showroom-summary__icon { flex: none; transition: translate var(--transition); }
  /* The town and phone links: grey like the text, dark and underlined on hover */
  .showroom-summary__meta {
    display: flex; flex-wrap: wrap; gap: var(--space-3xs) var(--space-m);
    & a {
      color: inherit; text-decoration: underline transparent; text-decoration-thickness: 1px;
      transition: color var(--transition), text-decoration-color var(--transition);
      &:hover { color: var(--color-ink); text-decoration-color: currentColor; }
    }
  }
  /* The icons are 14px, a little under the 15px text, between the --icon-xs and --icon-s sizes */
  .showroom-summary__item {
    --icon-size: 0.875rem;
    display: flex; align-items: flex-start; gap: var(--space-2xs);
    & .icon { flex: none; width: var(--icon-size); height: var(--icon-size); margin-top: calc((1lh - var(--icon-size)) / 2); color: var(--color-text); }
  }
  @media (prefers-reduced-motion: no-preference) {
    .showroom-summary:has(.card__link:focus-visible) .showroom-summary__icon { translate: var(--nudge) 0; }
    @media (hover: hover) { .showroom-summary:hover .showroom-summary__icon { translate: var(--nudge) 0; } }
  }

  /* As details (the Contact page): a white card for each showroom on the light band. The picture (the
     drawing of the building) sits on a paper-light panel, then the name, the address, phone and email with
     icons, the opening times as a two-column list, and the button and directions link at the bottom, so the
     cards in a row end level. Long email addresses break rather than run out of the card. */
  /* The same gap across and down, so the cards read as one set of tiles: 24px on phones, 32px from small screens */
  .showrooms__grid.grid { gap: var(--space-m); @media (min-width: 40rem) { gap: var(--space-l); } }
  .showroom-info {
    /* The padding narrows on the smallest phones, so the opening times stay on one line each */
    display: flex; flex-direction: column; gap: var(--space-s); padding: clamp(var(--space-s), 5vw, var(--space-m));
    border-radius: var(--radius); background: var(--color-white); font-size: var(--text-small); line-height: var(--leading-snug);
    & a:not(.btn) {
      color: inherit; overflow-wrap: break-word; text-decoration: underline transparent; text-decoration-thickness: 1px;
      transition: color var(--transition), text-decoration-color var(--transition);
      &:hover { color: var(--color-ink); text-decoration-color: currentColor; }
    }
  }
  .showroom-info__media { display: block; margin-bottom: var(--space-2xs); padding: var(--space-m); border-radius: var(--radius); background: var(--color-paper-light); }
  .showroom-info__image { width: 100%; aspect-ratio: 12 / 5; object-fit: contain; transition: scale var(--duration-m) var(--ease-out); }
  /* The drawing grows a little inside its panel while the picture or the name is hovered, or the name has
     keyboard focus (the picture's link is skipped by the keyboard) */
  @media (prefers-reduced-motion: no-preference) {
    .showroom-info:has(.showroom-info__name a:focus-visible) .showroom-info__image { scale: var(--zoom); }
    @media (hover: hover) { .showroom-info:has(:is(.showroom-info__media, .showroom-info__name a):hover) .showroom-info__image { scale: var(--zoom); } }
  }
  .showroom-info__name { font-size: var(--text-h3); line-height: var(--leading-heading); & a { color: var(--color-ink); } }
  .showroom-info__contact { display: grid; gap: var(--space-2xs); }
  .showroom-info__item {
    display: flex; align-items: flex-start; gap: var(--space-xs);
    & address { font-style: normal; }
    & .icon { flex: none; width: var(--icon-s); height: var(--icon-s); margin-top: calc((1lh - var(--icon-s)) / 2); color: var(--color-text); }
  }
  .showroom-info__hours {
    /* The gap narrows on the smallest phones too */
    display: grid; grid-template-columns: max-content auto; gap: var(--space-3xs) clamp(var(--space-s), 5vw, var(--space-m)); padding-top: var(--space-s); border-top: 1px solid var(--color-line);
    & dt { color: var(--color-ink); }
    & dd { margin: 0; white-space: nowrap; }
  }
  .showroom-info__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-m); margin-top: auto; padding-top: var(--space-2xs); }

  /* ---- Showroom details: the light band at the top of a showroom page. The name runs across the top on
     one line; below it, the details take the narrower column and the picture the wider one (on large
     screens, all the room the details leave). The pictures are trimmed to the drawing, with no empty edges.
     A long email address breaks before the @ (showroom-details.php) rather than run off a phone's screen. ---- */
  .showroom-details__inner {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-l) calc(var(--space-xl) + var(--space-2xs)); /* 48px between the details and the picture */
    @media (min-width: 48rem) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; }
    @media (min-width: 64rem) { grid-template-columns: max-content minmax(0, 1fr); }
  }
  .showroom-details__title { grid-column: 1 / -1; }
  /* Address, contact and opening times, each a block with a gap between. The phone and email have icons,
     level with their first line, as in the footer's contact list. The links are underlined on hover. */
  .showroom-details__info > * + * { margin-top: var(--space-m); }
  .showroom-details__address { font-style: normal; }
  .showroom-details__contact { display: grid; gap: var(--space-2xs); }
  .showroom-details__item {
    display: flex; align-items: flex-start; gap: var(--space-xs);
    & .icon { flex: none; width: var(--icon-s); height: var(--icon-s); margin-top: calc((1lh - var(--icon-s)) / 2); color: var(--color-text); }
  }
  .showroom-details__info a:not(.btn) {
    color: inherit; text-decoration: underline transparent; text-decoration-thickness: 1px; transition: color var(--transition), text-decoration-color var(--transition);
    &:hover { color: var(--color-ink); text-decoration-color: currentColor; }
  }
  .showroom-details__hours {
    display: grid; grid-template-columns: max-content auto; gap: 0 var(--space-m); white-space: nowrap;
    & dd { margin: 0; }
  }
  .showroom-details__info .button-group { margin-top: var(--space-l); }
  .showroom-details__image { width: 100%; }

  /* ---- Form with an aside (showroom pages): the form and "Find us" in two equal columns ---- */
  .form-section__inner {
    display: grid; gap: var(--space-xl) var(--column-gap);
    @media (min-width: 48rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  /* As .section__head: the heading's gap above the form, or a small one above its intro or text. The gap is
     the same above the intro and the "Find us" text, so the two columns' text starts level. */
  .form-section__heading { margin-bottom: var(--space-head); &:has(+ :is(.form-section__intro, .prose)) { margin-bottom: var(--space-2xs); } }
  .form-section__intro { margin-bottom: var(--space-head); }
  .form-section--aside .form-section__form { max-width: none; }
  /* The map is 4:3 on small screens. Beside the form it fills the rest of its column, so it ends level with
     the form, and is never shorter than 15rem. */
  .form-section__map { display: block; width: 100%; aspect-ratio: 4 / 3; margin-top: var(--space-l); border: 0; }
  .form-section__aside {
    @media (min-width: 48rem) {
      display: flex; flex-direction: column;
      & .form-section__map { flex: 1; min-height: 15rem; aspect-ratio: auto; }
    }
  }
  /* With contact details (the Contact page): the phone and email sit in a light panel on the left, level with
     the form's heading, with icons as in the footer, and the form takes the wider column on the right. On
     phones the panel comes first, so the number is there before the form. Emails break before the @. */
  .form-section--contact {
    & .form-section__aside { order: -1; }
    & .form-section__inner { @media (min-width: 48rem) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } }
    & .form-section__aside { padding: var(--space-l); border-radius: var(--radius); background: var(--color-paper-light); }
    & .form-section__aside .form-section__heading { margin-bottom: var(--space-m); font-size: var(--text-h3); }
  }
  .form-section__contact { display: grid; gap: var(--space-xs); }
  .form-section__item {
    display: flex; align-items: flex-start; gap: var(--space-xs);
    & .icon { flex: none; width: var(--icon-s); height: var(--icon-s); margin-top: calc((1lh - var(--icon-s)) / 2); color: var(--color-text); }
    & a {
      color: var(--color-ink); overflow-wrap: break-word; text-decoration: underline transparent; text-decoration-thickness: 1px;
      transition: text-decoration-color var(--transition);
      &:hover { text-decoration-color: currentColor; }
    }
  }

  /* Rows of contact details (an icon, then a phone, email or address link), in the showroom cards and details
     and the contact panel: on touch screens each link is at least 44px tall, with the icon level with its
     first line */
  @media (pointer: coarse) {
    :is(.showroom-summary__item, .showroom-info__item, .showroom-details__item, .form-section__item) {
      & a { display: inline-block; padding-block: max(0px, (var(--target-size) - 1lh) / 2); }
      & .icon { margin-top: calc((max(1lh, var(--target-size)) - var(--icon-size, var(--icon-s))) / 2); }
    }
  }
}
