/*!
 * MedLab Packages Carousel v1.0.0
 *
 * Palette: only MedLab's greens + white.
 *   lime #C1C80B and teal #04B7B7 (sampled from lab.aw), their light tints,
 *   and a deep green (#0B3D3D) for text so everything stays readable.
 *
 * To change a color, override the variable from your theme or Customizer:
 *   .mlp { --mlp-lime: #C1C80B; }
 */

.mlp {
  --mlp-lime: #C1C80B;
  --mlp-lime-tint: #F5F7D0;
  --mlp-teal: #04B7B7;
  --mlp-teal-tint: #E2F5F5;
  --mlp-teal-line: #B2E0E0;
  --mlp-ink: #0B3D3D;
  --mlp-ink-soft: #2E5B5B;
  --mlp-white: #FFFFFF;

  --mlp-radius: 24px;
  --mlp-gap: 16px;
  --mlp-view: 1.12; /* cards visible at once: phone shows one card plus a peek of the next */

  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  color: var(--mlp-ink);
  font-family: inherit;
  line-height: 1.5;
}

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

/* ---------- Header: title + arrows ---------- */

.mlp .mlp__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}

.mlp .mlp__title {
  margin: 0;
  padding: 0;
  color: var(--mlp-ink);
  font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}

.mlp .mlp__nav {
  display: none; /* shown by JS on tablet and desktop when there is something to scroll */
  gap: 12px;
  flex: none;
}

.mlp .mlp__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--mlp-ink);
  border-radius: 50%;
  background: var(--mlp-white);
  color: var(--mlp-ink);
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}

.mlp .mlp__btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.mlp .mlp__btn:hover {
  background: var(--mlp-lime);
}

.mlp .mlp__btn[aria-disabled="true"] {
  opacity: .35;
  cursor: default;
  background: var(--mlp-white);
}

/* ---------- Track (native scroll-snap: swipe works without JS) ---------- */

.mlp .mlp__track {
  display: flex;
  align-items: stretch;
  gap: var(--mlp-gap);
  margin: 0;
  padding: 4px 0 8px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mlp .mlp__track::-webkit-scrollbar {
  display: none;
}

.mlp .mlp__track:focus-visible {
  outline: 3px solid var(--mlp-ink);
  outline-offset: 2px;
  border-radius: var(--mlp-radius);
}

/* ---------- Card ---------- */

.mlp .mlp__card {
  flex: 0 0 calc((100% - var(--mlp-gap) * (var(--mlp-view) - 1)) / var(--mlp-view));
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  background: var(--mlp-card-bg, var(--mlp-teal-tint));
  border-radius: var(--mlp-radius);
  scroll-snap-align: start;
}

.mlp .mlp__card--teal  { --mlp-card-bg: var(--mlp-teal-tint); --mlp-accent: var(--mlp-teal); }
.mlp .mlp__card--lime  { --mlp-card-bg: var(--mlp-lime-tint); --mlp-accent: var(--mlp-lime); }
.mlp .mlp__card--white { --mlp-card-bg: var(--mlp-white);     --mlp-accent: var(--mlp-lime); box-shadow: inset 0 0 0 2px var(--mlp-teal-line); }

.mlp .mlp__media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--mlp-teal-line);
}

.mlp .mlp__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}

/* shown when a package has no photo yet */
.mlp .mlp__ph {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, var(--mlp-teal-tint) 0 14px, #D3EEEE 14px 28px);
}

.mlp .mlp__tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--mlp-accent, var(--mlp-lime));
  color: var(--mlp-ink);
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.2;
}

.mlp .mlp__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 24px;
}

.mlp .mlp__name {
  margin: 0;
  padding: 0;
  color: var(--mlp-ink);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.mlp .mlp__text {
  flex: 1;
  margin: 0;
  color: var(--mlp-ink-soft);
  font-size: 1rem;
  line-height: 1.55;
  text-align: left;
}

.mlp a.mlp__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch; /* full-width thumb target on phones */
  min-height: 48px;
  margin-top: 8px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--mlp-lime);
  color: var(--mlp-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.mlp a.mlp__cta:hover {
  background: var(--mlp-ink);
  color: var(--mlp-white);
}

.mlp a.mlp__cta:focus-visible,
.mlp .mlp__btn:focus-visible,
.mlp .mlp__dot:focus-visible {
  outline: 3px solid var(--mlp-ink);
  outline-offset: 3px;
}

/* ---------- Dots (phones) ---------- */

.mlp .mlp__dots {
  display: none;
  justify-content: center;
  margin-top: 8px;
}

.mlp.is-ready:not(.is-static) .mlp__dots {
  display: flex;
}

.mlp .mlp__dot {
  position: relative;
  width: 40px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.mlp .mlp__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--mlp-ink-soft);
  border-radius: 999px;
  background: transparent;
  transform: translate(-50%, -50%);
  transition: width .2s ease, background-color .2s ease;
}

.mlp .mlp__dot.is-active::before {
  width: 28px;
  border-color: var(--mlp-ink);
  background: var(--mlp-ink);
}

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

@media (min-width: 640px) {
  .mlp {
    --mlp-gap: 20px;
    --mlp-view: 2.15;
  }

  .mlp .mlp__head {
    margin-bottom: 24px;
  }

  .mlp.is-ready:not(.is-static) .mlp__nav {
    display: flex;
  }

  .mlp.is-ready:not(.is-static) .mlp__dots {
    display: none;
  }

  .mlp .mlp__body {
    padding: 24px 24px 28px;
  }

  .mlp a.mlp__cta {
    align-self: flex-start;
  }
}

/* ---------- Desktop: three packages side by side ---------- */

@media (min-width: 1024px) {
  .mlp {
    --mlp-gap: 24px;
    --mlp-view: 3;
  }

  /* more than three packages: peek at the next card so people know there is more */
  .mlp.mlp--many {
    --mlp-view: 3.2;
  }

  .mlp .mlp__name {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mlp .mlp__track {
    scroll-behavior: auto;
  }

  .mlp .mlp__btn,
  .mlp a.mlp__cta,
  .mlp .mlp__dot::before {
    transition: none;
  }
}
