/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* container query */

.location-tabs {
  container-type: inline-size;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* card shell */

.location-tabs__card {
  overflow: hidden; /* clip the flush Join Now bar to the card radius */
  border-radius: var(--box-border-radius-lg);
  background: var(--blue-dk);
  color: var(--white);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* tab nav */

.location-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;

  margin: 0;
  padding: 24px 40px 0;
  list-style: none;

  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.location-tabs__nav .nav-item {
  margin-bottom: 16px; /* space between the pills row and the divider */
}

/* override bootstrap .nav-link defaults */
.location-tabs__tab.nav-link {
  margin: 0;
  padding: 11px 24px;

  background: transparent;
  border: none !important;
  border-radius: 999px;

  color: var(--white);
  cursor: pointer;

  transition: all 0.2s ease;
}

.location-tabs__tab.nav-link:hover,
.location-tabs__tab.nav-link:focus {
  color: var(--white);
  background: rgba(255, 255, 255, 0.15);
}

.location-tabs__tab.nav-link.active {
  background: var(--white);
  color: var(--blue-dk);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* panes */

.location-tabs__pane {
  padding: 40px;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* overview */

.location-tabs__overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 36px 48px;
}

/* Intro spans the full width and hosts the floated image so the name + excerpt
   wrap to its left and flow under it as the text grows. Location + Hours each
   span the full width on their own rows below. */
.location-tabs__overview-intro {
  grid-column: 1 / -1;
  min-width: 0;
  position: relative;
}

/* Image floats right; name + excerpt flow to its left and under it as the text grows. */
.location-tabs__overview-image {
  float: right;
  width: 48%;
  margin: 0 0 16px 32px;
}

.location-tabs__overview-image img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--box-border-radius-lg);
}

/* The whole intro is the collapsible region: JS sets an explicit pixel height and
   animates it. Clipping the intro — rather than the read-more block itself — lets the
   read-more copy stay in normal flow and wrap around the floated image, while the
   height still animates. (A BFC on the read-more block would refuse to wrap the float.)
   Spacing before the read-more copy so it doesn't butt against the excerpt. */
.location-tabs__overview-intro.is-collapsible {
  overflow: hidden;
  transition: height 0.35s ease;
}

.location-tabs__read-more-content {
  margin-top: 12px;
}

/* Read More toggle — uses the shared .btn--read-more system. Negative top margin
   trims the grid row-gap above it; justify-self keeps it at its natural width. */
.location-tabs__read-more {
  justify-self: start;
  margin-top: -20px;
}

/* Center the caret with the label and drop the shared icon's bottom margin so the
   180° flip pivots on its true center instead of landing low. */
.location-tabs__read-more .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.location-tabs__read-more .icon {
  display: inline-flex;
  transition: transform 0.25s ease;
}

.location-tabs__read-more.btn.btn--read-more .icon svg {
  margin: 0;
}

.location-tabs__read-more[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.location-tabs__location-name {
  margin: 0 0 16px;
  color: var(--white);
}

.location-tabs__excerpt {
  max-width: 60ch;
  margin-bottom: 28px;
}

/* Location + Hours each span the full grid width, with the label in a fixed
   left column and the content to its right. */
.location-tabs__location,
.location-tabs__hours {
  grid-column: 1 / -1;
  display: flex;
  gap: 48px;
}

.location-tabs__label {
  flex: 0 0 110px;
  margin: 0;
  color: var(--white);
}

.location-tabs__location-details,
.location-tabs__hours-groups {
  flex: 1 1 auto;
  min-width: 0;
}

.location-tabs__address,
.location-tabs__phone {
  margin: 0 0 4px;
}

.location-tabs__directions {
  margin-top: 18px;
}

/* hours — groups pack to natural width so they sit close together */
.location-tabs__hours-groups {
  display: flex;
  gap: 32px;
}

.location-tabs__hours-group {
  min-width: 0;
}

.location-tabs__hours-title {
  margin: 0 0 10px;
  color: var(--white);
}

.location-tabs__hours-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.location-tabs__hours-list li {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.location-tabs__hours-day {
  font-weight: 700;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* featured programs — styled by hover_cards.css (same classes reused).
   Nothing needed here unless we want to deviate from the homepage block. */

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* amenities */

.location-tabs__amenities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;

  margin: 0;
  padding: 0;
  list-style: none;
}

.location-tabs__amenity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;

  color: var(--white);
}

.location-tabs__amenity-icon {
  display: inline-flex;
  align-items: flex-end; /* if a viewBox bottom-pads its content, anchor SVG to the row baseline */
  min-height: 34px;
}

/* Fix the height and let width be intrinsic so wide-aspect icons (person-swimming
   576×512) render at the same vertical height as square ones (heart 512×512),
   instead of being scaled to fit a 34×34 box and shrinking vertically. */
.location-tabs__amenity-icon svg {
  width: auto;
  height: 34px;
  fill: currentColor;
  display: block;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* rates */

/* font sizes here come from the .h3 / .h4 / .h5 / .link-text utility classes
   in defaults.css (which carry their own mobile scaling). Only color + spacing
   are declared per-component. */

.location-tabs__rates-title {
  margin: 0 0 24px;
  color: var(--white);
}

.location-tabs__rates-group {
  margin-bottom: 32px;
}

.location-tabs__rates-group:last-child {
  margin-bottom: 0;
}

.location-tabs__rates-group-title {
  margin: 0 0 16px;
  color: var(--white);
}

.location-tabs__rates-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.location-tabs__rate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 22px 12px;
  border-radius: var(--box-border-radius-sm);

  background: var(--white);
  color: var(--black);
  text-decoration: none;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.location-tabs__rate-card:hover,
.location-tabs__rate-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  color: var(--black);
}

.location-tabs__rate-card-text {
  min-width: 0;
}

.location-tabs__rate-card-title {
  margin: 0 0 8px;
  color: var(--blue-dk);
}

.location-tabs__rate-card-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--black);
}

.location-tabs__rate-card-price {
  flex: 0 0 auto;
  color: var(--blue-dk);
  white-space: nowrap;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* events (placeholder data — card layout is final, source TBD) */

.location-tabs__events-title {
  margin: 0 0 24px;
  color: var(--white);
}

.location-tabs__events-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.location-tabs__event-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--box-border-radius-lg);
  overflow: hidden;
}

/* gray fallback keeps the card shape visible until an event image is wired in */
.location-tabs__event-image {
  background: var(--gray);
}

.location-tabs__event-image img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.location-tabs__event-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}

.location-tabs__event-title {
  margin: 0;
  color: var(--blue-dk);
}

.location-tabs__event-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-tabs__event-icon .icon {
  font-size: 20px;
  color: var(--blue-dk);
}

.location-tabs__event-datetime {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  color: var(--black);
}

.location-tabs__event-date {
  font-weight: 700;
}

.location-tabs__event-card--hidden {
  display: none;
}

.location-tabs__events-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* join now bar (full-width, flush to the card's bottom corners) */

.location-tabs__join.btn {
  display: block;
  width: 100%;
  padding: 20px;
  border-radius: 0;
  text-align: center;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* location picker (shown only when no location is pinned) */

.location-tabs__picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 28px;
}

.location-tabs__picker-label {
  color: var(--blue-dk);
}

.location-tabs__select-wrapper {
  position: relative;
  max-width: 420px;
}

.location-tabs__select {
  width: 100%;
  padding: 14px 52px 14px 20px;

  appearance: none;
  -webkit-appearance: none;
  background: var(--gray-lt);
  border: none;
  border-radius: var(--btn-border-radius-lg);

  color: var(--blue-dk);
  font: inherit;
  cursor: pointer;
}

.location-tabs__select:focus {
  outline: none;
}

/* arrow sits over the native control and ignores clicks so the select still opens */
.location-tabs__select-icon {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}

.location-tabs__select-icon .icon {
  font-size: 14px;
  color: var(--blue-dk);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* responsive */

@container (max-width: 900px) {
  .location-tabs__amenities,
  .location-tabs__rates-cards,
  .location-tabs__events-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container (max-width: 760px) {
  /* full-width select on mobile */
  .location-tabs__select-wrapper {
    max-width: none;
  }

  .location-tabs__nav {
    padding: 18px 20px 0;
  }

  .location-tabs__pane {
    padding: 24px 20px;
  }

  .location-tabs__overview {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* image stacks above the text rather than floating beside it */
  .location-tabs__overview-image {
    float: none;
    width: 100%;
    margin: 0 0 20px;
  }

  /* stack the label above its content on mobile */
  .location-tabs__location,
  .location-tabs__hours {
    flex-direction: column;
    gap: 10px;
  }

  .location-tabs__label {
    flex-basis: auto;
  }

  .location-tabs__hours-groups {
    flex-direction: column;
    gap: 24px;
  }
}

@container (max-width: 560px) {
  .location-tabs__amenities,
  .location-tabs__rates-cards,
  .location-tabs__events-cards {
    grid-template-columns: 1fr;
  }
}
