/*!
 * MedLab Locations Section. Mobile first, scoped to .mls so it does not touch the rest of the theme.
 * Change the look from the variables below, or with the controls in
 * Appearance > Customize > MedLab Locations Section.
 */

/*
 * SETTINGS. These have zero specificity (:where), so ANY rule of yours wins, wherever it is loaded.
 * Example, in Appearance > Customize > Additional CSS:
 *   .mls { --ml-max: 1440px; --ml-bar-display: block; }
 */
:where(.mls) {
  --ml-max: 1200px;         /* width of the section content (includes the side padding) */
  --ml-ink: #0B3D3D;        /* text */
  --ml-dark: #004854;       /* MedLab dark teal */
  --ml-lime: #C1C80B;       /* MedLab lime */
  --ml-lime-hover: #AEB509;
  --ml-tint: #F1F8F8;       /* section background */
  --ml-line: #D5E9E9;
  --ml-muted: #4B6B6B;

  --ml-bar-display: none;   /* the small lime bar before the label: removed by default, set to block to show it */
  --ml-bar-w: 24px;
  --ml-bar-h: 3px;
  --ml-bar-gap: 10px;
  --ml-bar-color: var(--ml-lime);

  --ml-card-radius: 16px;   /* corners of the location cards */
  --ml-card-bg: #fff;       /* background of the location cards */
  --ml-photo-ratio: 16 / 9; /* shape of the card photos */
  --ml-btn-radius: 999px;   /* corners of the main button (999px = pill) */
  --ml-band-radius: 20px;   /* corners of the dark band */
  --ml-pad-y: 64px;         /* space above and below the section (75% of it on a phone) */
  --ml-title-size: clamp(1.625rem, 4.5vw, 2.25rem);
  --ml-title-color: var(--ml-ink);
  --ml-eyebrow: var(--ml-dark);
  --ml-focus: var(--ml-dark);   /* keyboard focus outline */

  --ml-btn-bg: var(--ml-lime);
  --ml-btn-bg-hover: var(--ml-lime-hover);
  --ml-btn-text: var(--ml-ink);
  --ml-btn-text-hover: var(--ml-btn-text);

  --ml-card-border: var(--ml-line);
  --ml-card-border-w: 1px;
  --ml-card-bg-hover: var(--ml-card-bg);
  --ml-card-border-hover: var(--ml-card-border);
  --ml-card-lift: -3px;         /* how far a card rises on hover */
  --ml-card-shadow-hover: 0 10px 24px rgba(0, 72, 84, .12);
  --ml-card-title: var(--ml-ink);
  --ml-card-title-size: 1.0625rem;
  --ml-card-sub: var(--ml-muted);
  --ml-arrow-bg: var(--ml-lime);
  --ml-arrow-fg: var(--ml-ink);

  --ml-band-text: #fff;
  --ml-band-text-2: rgba(255, 255, 255, .85);
  --ml-band-icon: var(--ml-lime);
}

.mls {
  box-sizing: border-box;
  padding: calc(var(--ml-pad-y) * .75) 0;
  background: var(--ml-tint);
  color: var(--ml-ink);
  font-family: inherit;
  line-height: 1.5;
}

.mls *,
.mls *::before,
.mls *::after {
  box-sizing: border-box;
}

.mls svg { display: block; }

.mls .mls__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "cards" "all" "trust";
  gap: 24px;
  max-width: var(--ml-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */

.mls .mls__head { grid-area: head; }

.mls .mls__eyebrow {
  display: flex;
  align-items: center;
  margin: 0 0 8px;
  color: var(--ml-eyebrow);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mls .mls__eyebrow::before {
  content: "";
  display: var(--ml-bar-display);
  flex: none;
  width: var(--ml-bar-w);
  height: var(--ml-bar-h);
  margin-right: var(--ml-bar-gap);
  border-radius: 2px;
  background: var(--ml-bar-color);
}

.mls .mls__title {
  margin: 0 0 8px;
  padding: 0;
  color: var(--ml-title-color);
  font-family: inherit;
  font-size: var(--ml-title-size);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  text-transform: none;
}

.mls .mls__sub {
  max-width: 34em;
  margin: 0;
  color: var(--ml-muted);
  font-size: 1rem;
}

.mls .mls__notice {
  grid-area: cards;
  margin: 0;
  padding: 14px 16px;
  border: 2px solid var(--ml-lime);
  border-radius: 12px;
  background: #fff;
}

/* ---------- The one main action ---------- */

.mls a.mls__all,
.mls a.mls__all:focus,
.mls a.mls__all:visited {
  color: var(--ml-btn-text);
  text-decoration: none;
}

.mls a.mls__all:hover {
  color: var(--ml-btn-text-hover);
  text-decoration: none;
}

.mls a.mls__all {
  grid-area: all;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--ml-btn-radius);
  background: var(--ml-btn-bg);
  font-size: 1rem;
  font-weight: 600;
  transition: background-color .15s ease;
}

.mls a.mls__all:hover { background: var(--ml-btn-bg-hover); }

.mls a.mls__all svg {
  width: 20px;
  height: 20px;
  transition: transform .15s ease;
}

.mls a.mls__all:hover svg { transform: translateX(3px); }

.mls a.mls__all:focus-visible,
.mls a.mls-card:focus-visible,
.mls .mls-trust a:focus-visible {
  outline: 3px solid var(--ml-focus);
  outline-offset: 3px;
}

/* ---------- Location cards ---------- */

.mls .mls__cards {
  grid-area: cards;
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 4px 16px 8px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mls .mls__cards::-webkit-scrollbar { display: none; }

.mls .mls__cards > li {
  flex: 0 0 72%;
  max-width: 300px;
  margin: 0;
  padding: 0;
  list-style: none;
  scroll-snap-align: start;
}

.mls .mls__cards > li::before,
.mls .mls-trust > li::before { content: none; }

.mls a.mls-card,
.mls a.mls-card:hover,
.mls a.mls-card:focus,
.mls a.mls-card:visited {
  color: inherit;
  text-decoration: none;
}

.mls a.mls-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--ml-card-bg);
  border: var(--ml-card-border-w) solid var(--ml-card-border);
  border-radius: var(--ml-card-radius);
  transition: transform .18s ease, box-shadow .18s ease;
}

.mls a.mls-card:hover {
  transform: translateY(var(--ml-card-lift));
  box-shadow: var(--ml-card-shadow-hover);
  background: var(--ml-card-bg-hover);
  border-color: var(--ml-card-border-hover);
}

.mls .mls-card__photo {
  display: block;
  aspect-ratio: var(--ml-photo-ratio);
  background: var(--ml-line);
}

.mls .mls-card__photo img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}

/* no homepage photo yet: the logo, whole, on a light background */
.mls .mls-card__photo.is-logo {
  background: #fff;
  border-bottom: var(--ml-card-border-w) solid var(--ml-card-border);
}

.mls .mls-card__photo.is-logo img {
  padding: 16px 24px;
  object-fit: contain;
}

/* no photo and no logo */
.mls .mls-card__photo.is-empty {
  background: repeating-linear-gradient(135deg, #E2F1F1 0 12px, #D5E9E9 12px 24px);
}

.mls .mls-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 16px;
}

.mls .mls-card__town {
  display: block;
  color: var(--ml-card-title);
  font-size: var(--ml-card-title-size);
  font-weight: 600;
  line-height: 1.3;
}

.mls .mls-card__site {
  display: block;
  margin-top: 2px;
  color: var(--ml-card-sub);
  font-size: .8125rem;
  line-height: 1.35;
}

.mls .mls-card__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ml-arrow-bg);
  color: var(--ml-arrow-fg);
  transition: transform .18s ease;
}

.mls .mls-card__go svg {
  width: 18px;
  height: 18px;
}

.mls a.mls-card:hover .mls-card__go { transform: translateX(3px); }

/* ---------- Quality and service band ---------- */

.mls .mls-trust {
  grid-area: trust;
  margin: 8px 0 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--ml-band-radius);
  background: var(--ml-dark);
  color: var(--ml-band-text);
}

.mls .mls-trust > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mls .mls-trust > li + li { border-top: 1px solid rgba(255, 255, 255, .16); }

.mls .mls-trust a.mls-trust__item,
.mls .mls-trust a.mls-trust__item:hover,
.mls .mls-trust a.mls-trust__item:focus,
.mls .mls-trust a.mls-trust__item:visited {
  color: var(--ml-band-text);
  text-decoration: none;
}

.mls .mls-trust .mls-trust__item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
  transition: background-color .15s ease;
}

.mls .mls-trust a.mls-trust__item:hover { background: rgba(255, 255, 255, .07); }

.mls .mls-trust__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--ml-band-icon);
}

.mls .mls-trust__icon svg {
  width: 22px;
  height: 22px;
}

.mls .mls-trust__text {
  display: block;
  min-width: 0;
}

.mls .mls-trust__title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.mls .mls-trust__line {
  display: block;
  margin-top: 2px;
  color: var(--ml-band-text-2);
  font-size: .875rem;
  line-height: 1.35;
}

.mls .mls-trust__chev {
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: auto;
  color: var(--ml-band-text-2);
}

/* ---------- Tablet ---------- */

@media (min-width: 640px) {
  .mls { padding: var(--ml-pad-y) 0; }

  .mls .mls__inner {
    gap: 28px;
    padding: 0 24px;
  }

  .mls .mls__cards {
    gap: 16px;
    margin: 0 -24px;
    padding: 4px 24px 8px;
    scroll-padding: 0 24px;
  }

  .mls .mls__cards > li {
    flex: 0 0 calc((100% - 32px) / 3);
    max-width: none;
  }

  .mls a.mls__all { justify-self: start; }
}

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
  .mls .mls__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head all" "cards cards" "trust trust";
    align-items: end;
  }

  .mls a.mls__all { justify-self: end; }

  .mls .mls-trust {
    display: flex;
    padding: 8px;
  }

  .mls .mls-trust > li {
    flex: 1 1 0;
    min-width: 0;
  }

  .mls .mls-trust > li + li {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, .16);
  }

  .mls .mls-trust .mls-trust__item {
    min-height: 88px;
    padding: 16px 20px;
  }
}

@media (min-width: 1024px) {
  .mls .mls__cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 4px 0 8px;
    overflow: visible;
  }

  .mls .mls__cards > li { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mls a.mls-card,
  .mls .mls-card__go,
  .mls a.mls__all,
  .mls a.mls__all svg,
  .mls .mls-trust .mls-trust__item {
    transition: none;
  }

  .mls a.mls-card:hover { transform: none; }
}
