/*
 * Location pages — booking, and categories that are not collapsed.
 *
 * Styles the markup src/lib/location-page.mjs adds, and replaces what
 * Foundation's accordion CSS used to do for the treatment categories. Colours
 * and metrics are the page's own: #005453 is the header's Book button, square
 * corners and Manrope at 16px, so these read as part of the design rather
 * than bolted on. White on #005453 is about 8.7:1.
 *
 * Loaded after live's stylesheets; the one override of a live rule repeats its
 * ancestor, because live's own selectors here are two classes deep.
 */

/* The action row, directly under the centre's name. */
.loc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 20px 0 8px;
}

.loc-actions__book {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid #005453;
  background: #005453;
  color: #fff;
  font-family: Manrope-Book, Manrope, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
}

.loc-actions__book:hover,
.loc-actions__book:focus-visible {
  background: #003e3d;
  border-color: #003e3d;
  color: #fff;
}

.loc-actions__link {
  color: #005453;
  font-family: Manrope-Book, Manrope, sans-serif;
  font-size: 16px;
  text-underline-offset: 4px;
}

/*
 * Treatment categories.
 *
 * These were five Foundation accordions, collapsed, that a visitor had to open
 * one at a time — and whose toggles rendered in Foundation's default blue
 * (#1779ba), off-brand. The hooks are renamed at build time so Foundation
 * never binds, which leaves them open; this is the styling that replaces
 * `.accordion-title` and `.accordion-content`.
 */
.loc-cats {
  margin: 0;
  padding: 0;
  list-style: none;
}

.loc-cat + .loc-cat {
  margin-top: 36px;
}

.loc-cat__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
  font-family: Lora-Regular, Lora, serif;
  font-size: 24px;
  font-weight: 400;
  color: #000;
}

.loc-cat__name span {
  font-family: Manrope-Book, Manrope, sans-serif;
  font-size: 13px;
  color: #555;
}

.loc-cat__body {
  padding: 0;
}

/*
 * Compact cards on wide screens.
 *
 * Opening every category removes the clicks but adds the height: on desktop
 * live renders each treatment as a 333x281 image tile, so Flatiron's seventeen
 * ran to 2,718px and the page grew from 7,161px to 9,253px. That trades one
 * complaint for another.
 *
 * Narrow screens already use a compact row — a 58px thumbnail beside the text,
 * about 80px tall. This gives wide screens the same shape, two to a row, so
 * everything stays visible and linked without the page getting longer. The
 * location's own photography is the gallery at the top of the page; these are
 * treatment thumbnails and do not need to be the largest thing on screen.
 *
 * Scoped to .loc-cat__body so the treatments index, which uses the same card
 * markup deliberately as image tiles, is untouched.
 */
@media (min-width: 1024px) {
  .location-treatments .loc-cat__body .treatments {
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
  }

  .location-treatments .loc-cat__body .treatment {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 16px;
  }

  /* Live gives this container an explicit height: 197px, which held the card
   * at full tile height even once the image inside it was 72px. */
  .location-treatments .loc-cat__body .treatment .treatment__image {
    height: 72px;
    width: 72px;
    margin: 0;
    overflow: hidden;
  }

  .location-treatments .loc-cat__body .treatment .treatment__image img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
  }

  .location-treatments .loc-cat__body .treatment .treatment__title {
    font-size: 17px;
    margin: 0 0 2px;
  }

  .location-treatments .loc-cat__body .treatment .treatment__short-description {
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
  }
}

/* The card titles carry links now; they did not before. */
.treatment__link {
  color: inherit;
  text-decoration: none;
}

.treatment__link:hover,
.treatment__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/*
 * The section's padding was sized for a block that was mostly collapsed. With
 * every category open it only adds to an already long page. Repeats live's own
 * two-class selector so it wins on specificity, not just source order.
 */
.location-treatments .location-treatments__inner {
  padding-block: 56px;
}

/*
 * A sticky booking bar for narrow screens, where the header's own button is
 * behind the menu and the page runs to several thousand pixels.
 */
.loc-sticky {
  display: none;
}

@media (max-width: 1023px) {
  .loc-sticky {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #e5e5e5;
  }

  .loc-sticky__book {
    display: block;
    padding: 14px;
    background: #005453;
    color: #fff;
    font-family: Manrope-Book, Manrope, sans-serif;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
  }

  /* So the bar never sits over the last of the page. */
  main {
    padding-bottom: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loc-actions__book,
  .loc-sticky__book {
    transition: none;
  }
}
