/* ============================================================
   v2 province landing — hero and club list.
   Source: maquette Web Desktop (1440) / Web Movil (430), the
   province page (sc-if isProv, #clubes-madrid).
   Mobile first; desktop from UIkit @m (960px). Visibility of the
   club count comes from UIkit (uk-visible@m).
   ============================================================ */

/* ---- Hero ----
   Stage, poster and video come from css/v2/video-hero.css; the content layer is in flow on
   mobile (it sets the stage height, text at its foot) and laid over a fixed-height stage on
   desktop (text centred vertically, maquette WD l.408). */

/* Maquette mobile: the gradient layer itself is at opacity .5 (WM l.426). */
.bf-prov-hero__stage::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .88) 76%, rgba(0, 0, 0, .96) 100%);
  opacity: .5;
}

/* Mobile stage: min(630px, viewport under the header), at least 480px (WM l.424); it grows
   when the content needs it, so nothing is ever cut. */
.bf-prov-hero__content {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(480px, calc(100vh - var(--bf-country-h) - var(--bf-header-h) - var(--bf-promo-h)), 630px);
  min-height: clamp(480px, calc(100svh - var(--bf-country-h) - var(--bf-header-h) - var(--bf-promo-h)), 630px);
  padding-bottom: 48px;
}

/* Mobile: "BROOKLYN FITBOXING" (every locale's first line) must hold on one line. It
   measures 7.208px of text per px of font-size: 7.4 leaves a small margin inside the two
   gutters; capped at the maquette's 52px. Longer place names still wrap on line 2. */
.bf-prov-hero .bf-prov-hero__title {
  margin: 12px 0 0;
  font: 400 52px/.95 var(--bf-font-display);
  font-size: min(52px, calc((100vw - 2 * var(--bf-gutter)) / 7.4));
  text-transform: uppercase;
  color: var(--bf-c-white);
}

.bf-prov-hero__accent {
  color: var(--bf-c-yellow);
}

.bf-prov-hero .bf-prov-hero__lead {
  margin: 16px 0 0;
  font: 400 17px/1.5 var(--bf-font-body);
  color: var(--bf-c-white);
}

.bf-prov-hero__search {
  margin-top: 22px;
}

/* Native input until the Places API lands, then <gmp-place-autocomplete id="search-address">
   (which drops the input's class): both get the same box, pinned to the same height so
   nothing moves when Google swaps them. Mobile = maquette's white field with a black edge. */
.bf-prov-hero .bf-prov-hero__input,
.bf-prov-hero__field gmp-place-autocomplete::part(input) {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  background: var(--bf-c-white);
  border: 1px solid var(--bf-c-black);
  border-radius: var(--bf-radius-field);
  color: var(--bf-c-black);
  font: 400 16px/1 var(--bf-font-body);
  padding: 16px 14px;
  outline: none;
}

/* Chrome won't let a text input's line box shrink to line-height: 1: pin its height. */
.bf-prov-hero .bf-prov-hero__input {
  height: 50px;
}

.bf-prov-hero .bf-prov-hero__input::placeholder,
.bf-prov-hero__field gmp-place-autocomplete::part(input)::placeholder {
  color: #757575;
  opacity: 1;
}

/* Focus: a 2px gold edge. The Places element draws its own 2px ring (::part(focus-ring),
   Google blue by default), which is recoloured instead of adding ours. */
.bf-prov-hero .bf-prov-hero__input:focus-visible {
  outline: none;
  border-color: var(--bf-c-gold);
  box-shadow: inset 0 0 0 1px var(--bf-c-gold);
}

.bf-prov-hero__field gmp-place-autocomplete::part(focus-ring) {
  border-color: var(--bf-c-gold);
  border-radius: var(--bf-radius-field);
}

/* The element's input and icons live in a closed shadow root; the input is laid absolutely
   over the host so it covers the built-in icons (they have no part), as in finder.css. */
.bf-prov-hero__field gmp-place-autocomplete {
  display: block;
  position: relative;
  width: 100%;
  height: 50px;
  background: transparent;
  border: 0;
  border-radius: var(--bf-radius-field);
  padding: 0;
  color-scheme: light;
}

.bf-prov-hero__field gmp-place-autocomplete::part(input) {
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: 10;
}

/* Small screens: Google's fullscreen <dialog> back button sits under our absolute input
   once the visitor types; the loader's .is-typing puts the input back in flow. */
@media (max-width: 599px) {
  .bf-prov-hero__field gmp-place-autocomplete.is-typing {
    height: auto;
  }

  .bf-prov-hero__field gmp-place-autocomplete.is-typing::part(input) {
    position: static;
    z-index: auto;
  }
}

.bf-prov-hero__field gmp-place-autocomplete::part(prediction-list) {
  background: var(--bf-c-white);
  color: var(--bf-c-ink-idle);
  border: 1px solid var(--bf-c-line-light);
  border-radius: var(--bf-radius-field);
  font-family: var(--bf-font-body);
}

.bf-prov-hero__field gmp-place-autocomplete::part(prediction-item) {
  color: var(--bf-c-ink-idle);
  padding: 10px 14px;
}

.bf-prov-hero__field gmp-place-autocomplete::part(prediction-item-main-text) {
  color: var(--bf-c-black);
}

.bf-prov-hero__field gmp-place-autocomplete::part(prediction-item-match) {
  color: var(--bf-c-black);
  font-weight: 600;
}

/* Mobile: full width under the field, may wrap in long locales (WM l.435). No glow; the
   white/black hover comes from .bf-btn--on-media (tokens.css). */
.bf-prov-hero .bf-prov-hero__btn {
  display: flex;
  width: 100%;
  margin-top: 10px;
  font-size: 19px;
  padding: 16px 26px;
  white-space: normal;
  text-align: center;
}

/* ---- Club list ---- */

.bf-prov-clubs {
  padding: 40px 0 44px;
  background: var(--bf-c-white);
  border-top: 1px solid var(--bf-c-line-light);
  scroll-margin-top: calc(var(--bf-header-h) + var(--bf-promo-h));
}

.bf-prov-clubs .bf-prov-clubs__title {
  margin: 0;
  font: 400 38px/.95 var(--bf-font-display);
  /* Fluid below 390px only: 38px (maquette) from 390 up, 30px at 320. */
  font-size: clamp(30px, calc((100vw - 2 * var(--bf-gutter)) / 9.2), 38px);
  text-transform: uppercase;
  color: var(--bf-c-black);
}

/* Per-locale text-fit (es-es is the reference): one line like es, the es clamp scaled by a
   factor. Body class language-{locale} from base_v2. */
@media (max-width: 959px) {
  .language-en-us .bf-prov-clubs .bf-prov-clubs__title {
    font-size: clamp(29px, calc((100vw - 2 * var(--bf-gutter)) / 9.6), 36.5px); /* 0.96 × es */
  }
}

.bf-prov-clubs .bf-prov-clubs__lead {
  margin: 14px 0 0;
  font: 400 16px/1.6 var(--bf-font-body);
  color: var(--bf-c-black);
}

.bf-prov-clubs__number {
  display: block;
  font: 900 64px/1 var(--bf-font-numeric);
  color: var(--bf-c-gold);
}

.bf-prov-clubs__label {
  display: block;
  margin-top: 8px;
  font: 400 12px/1 var(--bf-font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bf-c-ink-idle);
}

.bf-prov-clubs .bf-prov-clubs__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.bf-prov-clubs .bf-prov-card {
  margin: 0;
  padding: 0;
}

.bf-prov-card__link,
.bf-prov-card__link:hover {
  display: block;
  box-sizing: border-box;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--bf-c-line-light);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--bf-dur) var(--bf-ease);
}

.bf-prov-card__link:focus-visible {
  outline: 2px solid var(--bf-c-gold);
  outline-offset: 2px;
}

@media (hover: hover) {
  .bf-prov-card__link:hover {
    border-color: var(--bf-c-black);
  }
}

.bf-prov-clubs .bf-prov-card__name {
  margin: 0;
  font: 400 26px/1 var(--bf-font-display);
  text-transform: uppercase;
  color: var(--bf-c-black);
}

.bf-prov-clubs .bf-prov-card__meta {
  margin: 8px 0 14px;
  font: 400 14px/1.45 var(--bf-font-body);
  color: var(--bf-c-black);
}

.bf-prov-card__cta {
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--bf-c-gold);
  font: 400 14px/1 var(--bf-font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bf-c-black);
}

/* ---- Tablet (UIkit @s to @m, still the mobile layout) ---- */

@media (min-width: 640px) and (max-width: 959px) {
  /* The search block (field + CTA) stops stretching: left-aligned, at most 480px. */
  .bf-prov-hero .bf-prov-hero__search {
    max-width: 480px;
  }

  .bf-prov-clubs .bf-prov-clubs__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (min-width: 960px) {
  /* Stage: min(540px, viewport under the header), at least 460px (WD l.405). */
  .bf-prov-hero__stage {
    height: clamp(460px, calc(100vh - var(--bf-header-h-desktop) - var(--bf-promo-h)), 540px);
  }

  .bf-prov-hero__stage::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .5) 48%, rgba(0, 0, 0, .12) 100%);
    opacity: 1;
  }

  /* Full-height layer in the container geometry; left/right 0 + max-width keep
     .uk-container centred. Back to content-box: .uk-container-bf's max-width is the
     content width (1360), border-box would eat the 2 × 48px gutters. */
  .bf-prov-hero__content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    box-sizing: content-box;
    justify-content: center;
    min-height: 0;
    padding-bottom: 0;
  }

  /* One line on desktop (WD l.411): the translation's <br> only breaks on mobile. */
  .bf-prov-hero .bf-prov-hero__title {
    margin: 0;
    font-size: clamp(56px, 5.4vw, 76px);
  }

  .bf-prov-hero__title br {
    display: none;
  }

  .bf-prov-hero .bf-prov-hero__lead {
    max-width: 640px;
    font-size: 21px;
  }

  .bf-prov-hero__search {
    display: flex;
    gap: 12px;
    max-width: 660px;
    margin-top: 28px;
  }

  .bf-prov-hero__field {
    flex: 1;
    min-width: 0;
  }

  .bf-prov-hero .bf-prov-hero__input,
  .bf-prov-hero__field gmp-place-autocomplete::part(input) {
    background: rgba(255, 255, 255, .96);
    border: 0;
    font-size: 17px;
    padding: 20px 18px;
  }

  /* Same height as the button next to it (20px text + 2 × 20px). */
  .bf-prov-hero .bf-prov-hero__input,
  .bf-prov-hero__field gmp-place-autocomplete {
    height: 60px;
  }

  .bf-prov-hero .bf-prov-hero__input:focus-visible {
    box-shadow: inset 0 0 0 2px var(--bf-c-gold);
  }

  .bf-prov-hero__field gmp-place-autocomplete::part(prediction-item) {
    padding: 12px 16px;
  }

  .bf-prov-hero .bf-prov-hero__btn {
    width: auto;
    margin-top: 0;
    font-size: 20px;
    padding: 20px 28px;
    white-space: nowrap;
  }

  .bf-prov-clubs {
    padding: 72px 0;
    border-top: 0;
    border-bottom: 1px solid var(--bf-c-line-light);
    scroll-margin-top: calc(var(--bf-header-h-desktop) + var(--bf-promo-h));
  }

  .bf-prov-clubs__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 56px;
  }

  /* 52px (maquette) from 1278px up, 40px at 960. */
  .bf-prov-clubs .bf-prov-clubs__title {
    font-size: clamp(40px, 4.07vw, 52px);
  }

  .bf-prov-clubs .bf-prov-clubs__lead {
    max-width: 680px;
    margin-top: 20px;
    font-size: 19px;
    line-height: 1.65;
  }

  .bf-prov-clubs__count {
    flex: 0 0 auto;
    text-align: right;
  }

  .bf-prov-clubs .bf-prov-clubs__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 48px;
  }

  .bf-prov-card__link,
  .bf-prov-card__link:hover {
    padding: 26px 24px 28px;
  }

  .bf-prov-clubs .bf-prov-card__name {
    font-size: 32px;
  }

  .bf-prov-clubs .bf-prov-card__meta {
    margin: 10px 0 20px;
    font-size: 15px;
    line-height: 1.5;
  }

  .bf-prov-card__cta {
    padding-bottom: 6px;
    font-size: 15px;
  }
}
