/* ==========================================================================
   Branch finder (/childcare-agencies/, page_branchlocator.php + GMW form 10)
   and the A-Z branch list (/childcare-agencies/local-nanny-agencies/, page_agencies.php).
   Scoped under .bf. Matches the London landing page: Open Sans, navy, gold.
   ========================================================================== */

.bf {
  --bf-navy: #29385C;
  --bf-navy-deep: #193563;
  --bf-plum: #78526B;
  --bf-gold: #AB8E66;
  --bf-gold-dark: #977A52;
  --bf-cream: #F8F6F2;
  --bf-ink: #2B2F3A;
  --bf-muted: #5D6375;
  --bf-line: #E6E2DB;

  font-family: "Open Sans", Arial, sans-serif;
  color: var(--bf-ink);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bf-cream);
  overflow-x: clip;
}
:where(.bf) *, :where(.bf) *::before, :where(.bf) *::after { box-sizing: border-box; }
:where(.bf) a { color: var(--bf-plum); }
:where(.bf) p { margin: 0 0 1em; }
:where(.bf) ul { margin: 0; padding: 0; list-style: none; }

/* Bootstrap .container, inset a further 12px so the content lines up with the
   visible items in the fixed site header (Menu / Request Callback / Log In). */
@media (min-width: 768px) {
  .bf > section > .container,
  .bf > .container { padding-left: 24px; padding-right: 24px; }
}
.bf h1, .bf h2, .bf h3 { font-family: "Open Sans", Arial, sans-serif; color: var(--bf-navy); line-height: 1.25; margin: 0 0 .5em; }


/* ---------- Buttons ---------- */
.bf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.bf-btn:hover { text-decoration: none; }
.bf-btn:focus-visible { outline: 3px solid rgba(171,142,102,.6); outline-offset: 2px; }
.bf .bf-btn--gold { background: var(--bf-gold); border-color: var(--bf-gold); color: #fff; }
.bf .bf-btn--gold:hover { background: var(--bf-gold-dark); border-color: var(--bf-gold-dark); color: #fff; }
.bf .bf-btn--outline { background: #fff; border-color: #CFCBC3; color: var(--bf-navy); }
.bf .bf-btn--outline:hover { border-color: var(--bf-navy); color: var(--bf-navy); }
.bf .bf-btn--navy { background: var(--bf-navy); border-color: var(--bf-navy); color: #fff; }
.bf .bf-btn--navy:hover { background: var(--bf-navy-deep); border-color: var(--bf-navy-deep); color: #fff; }

/* ==========================================================================
   Branch finder
   ========================================================================== */

/* ---------- Slim title + search bar ---------- */
.bf-bar {
  background: var(--bf-navy-deep);
  color: #fff;
  padding: 160px 0 22px; /* clears the fixed 90px menu bar + 50px strip */
}
.bf-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.bf-bar-title h1 { color: #fff; font-size: 26px; font-weight: 700; margin: 0 0 2px; }
.bf-bar-title p { margin: 0; font-size: 14px; color: rgba(255,255,255,.75); }
.bf .bf-bar-title a { color: var(--bf-gold); font-weight: 600; text-decoration: none; }
.bf .bf-bar-title a:hover { text-decoration: underline; }
.bf-bar-search { flex: 0 1 640px; }

/* GMW search form template "branches" */
.bf-search { margin: 0; }
.bf-search form { margin: 0; }
.bf-search-row { display: flex; align-items: stretch; gap: 8px; }
.bf-search-field { position: relative; flex: 1 1 auto; min-width: 0; }
.bf-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--bf-gold); z-index: 1; pointer-events: none; }
.bf-search .gmw-form-field-wrapper,
.bf-search .gmw-address-field-wrapper { margin: 0 !important; padding: 0 !important; float: none !important; width: 100% !important; }
.bf-search .gmw-field-label { display: none !important; }
.bf-search input[type="text"],
.bf-search input[type="search"] {
  width: 100% !important;
  height: 48px;
  margin: 0 !important;
  padding: 0 14px 0 40px !important;
  font-size: 16px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: none !important;
}
.bf-search input[type="text"]:focus { outline: 3px solid rgba(171,142,102,.55); outline-offset: 0; }
.bf-search select {
  height: 48px;
  min-width: 118px;
  margin: 0 !important;
  padding: 0 32px 0 12px !important;
  font-size: 15px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background-color: #fff;
  color: var(--bf-ink);
}
.bf-search .gmw-locate-btn,
.bf-search .gmw-locator-button { display: none !important; }
.bf-search input[type="submit"],
.bf-search button[type="submit"] {
  height: 48px;
  margin: 0 !important;
  padding: 0 28px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  background: var(--bf-gold) !important;
  border: 0 !important;
  border-radius: 4px !important;
  color: #fff !important;
  cursor: pointer;
  transition: background-color .2s;
}
.bf-search input[type="submit"]:hover,
.bf-search button[type="submit"]:hover { background: var(--bf-gold-dark) !important; }

/* ---------- List + map panel ---------- */
.bf-results { padding: 20px 0 28px; }
.bf-panel {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  height: clamp(540px, calc(100vh - 290px), 800px);
  background: #fff;
  border: 1px solid var(--bf-line);
  box-shadow: 0 14px 34px -24px rgba(25,53,99,.45);
}
.bf-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--bf-line); }
.bf-list-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bf-line);
  font-size: 13px;
  color: var(--bf-muted);
}
.bf-list-head strong { color: var(--bf-navy); font-size: 14px; }
.bf .bf-list-head a { margin-left: auto; font-weight: 700; color: var(--bf-plum); text-decoration: none; }
.bf-list-rows { position: relative; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #D5D0C6 transparent; }

/* Compact branch row */
.bf-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px 13px 13px;
  border-bottom: 1px solid var(--bf-line);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
  scroll-margin-top: 8px;
}
.bf-row:hover, .bf-row.is-active { background: #FBF9F5; border-left-color: var(--bf-gold); }
.bf-row-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--bf-cream); box-shadow: 0 0 0 1px var(--bf-line); }
.bf-row-photo--empty { display: flex; align-items: center; justify-content: center; color: var(--bf-gold); }
.bf-row-body { min-width: 0; }
.bf-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bf .bf-row h3 { font-size: 15.5px; font-weight: 700; margin: 0; }
.bf .bf-row h3 a { color: var(--bf-navy); text-decoration: none; }
.bf .bf-row h3 a:hover { color: var(--bf-plum); }
.bf-row-address {
  margin: 2px 0 7px !important;
  font-size: 13px;
  line-height: 1.45;
  color: var(--bf-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bf-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; }
.bf .bf-row-actions a { color: var(--bf-navy); text-decoration: none; font-weight: 600; white-space: nowrap; }
.bf .bf-row-actions a:hover { color: var(--bf-plum); text-decoration: underline; }
.bf-row-actions i { color: var(--bf-gold); margin-right: 5px; font-size: 11px; }
.bf-row-actions a.bf-row-icon i { margin: 0; font-size: 12px; }
.bf .bf-row-actions a.bf-row-visit { margin-left: auto; color: var(--bf-plum); font-weight: 700; }
.bf-row-actions a.bf-row-visit i { color: var(--bf-plum); margin: 0 0 0 5px; }

/* Unowned branch: link to the Branch Availability map (ticked in wp-admin). */
.bf .bf-row-sale,
.bf .bf-btn--sale { display: inline-flex; align-items: center; gap: 6px; width: max-content; min-height: 0; padding: 5px 12px 5px 6px; border: 0; border-radius: 999px; background: #F6EFE4; color: var(--bf-gold-dark); font-size: 12px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s, transform .2s, box-shadow .2s; }
.bf .bf-row-sale { margin-top: 8px; }
.bf .bf-row-sale .bf-sale-key,
.bf .bf-btn--sale .bf-sale-key { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bf-gold); color: #fff; font-size: 10px; }
.bf .bf-row-sale:hover,
.bf .bf-btn--sale:hover { background: var(--bf-gold); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(171,142,102,.35); }
.bf .bf-row-sale:hover .bf-sale-key,
.bf .bf-btn--sale:hover .bf-sale-key { background: #fff; color: var(--bf-gold); }

.bf-distance {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bf-navy);
  background: rgba(171,142,102,.2);
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}

.bf-map { min-height: 0; }
.bf-map .gmw-map-wrapper,
.bf-map .gmw-map-cover,
.bf-map .gmw-map { height: 100% !important; margin: 0 !important; border: 0 !important; }

.bf-pagination:empty { display: none; }
.bf-pagination { padding: 12px 16px; }

/* .bf .bf-empty.gmw-no-results: beats GEO my WP's own .gmw-no-results styles. */
.bf .bf-empty.gmw-no-results {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 8px auto 0 !important;
  float: none;
  background: #fff;
  border: 1px solid var(--bf-line);
  box-shadow: 0 14px 34px -24px rgba(25,53,99,.45);
  padding: 36px 32px 34px !important;
  text-align: center;
}
.bf-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgba(171,142,102,.15);
  color: var(--bf-gold);
  font-size: 24px;
}
.bf .bf-empty h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.bf .bf-empty.gmw-no-results p { color: var(--bf-muted); max-width: 520px; margin: 0 auto 22px !important; padding: 0; text-align: center; }
.bf-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bf-empty-actions .bf-btn { min-height: 46px; padding: 0 20px; }

/* Map pin highlight when its row is hovered */
.leaflet-marker-icon.bf-pin-active { filter: drop-shadow(0 0 5px rgba(171,142,102,1)) drop-shadow(0 0 2px rgba(171,142,102,1)); }

/* GMW info window: keep it on-brand */
.bf .gmw-info-window .title a { color: var(--bf-navy); font-weight: 700; text-decoration: none; }
.bf .gmw-info-window .address { color: var(--bf-muted); font-size: 13px; }

/* ---------- Footer: page intro copy + call ---------- */
.bf-foot { background: #fff; border-top: 1px solid var(--bf-line); padding: 26px 0; }
.bf-foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.bf-about { max-width: 820px; font-size: 14px; color: var(--bf-muted); }
.bf-about p { margin: 0 0 .5em; }
.bf-about p:last-child { margin: 0; }
.bf-about h1, .bf-about h2, .bf-about h3 { font-size: 16px !important; color: var(--bf-navy); margin: 0 0 .4em; }
.bf-foot-cta { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.bf-foot-cta p { margin: 0; font-weight: 600; color: var(--bf-navy); font-size: 14px; }

/* ==========================================================================
   Branch table (/childcare-agencies/local-nanny-agencies/)
   ========================================================================== */
/* Page intro (editor content): lead heading left, paragraphs right,
   closing "List of..." heading becomes the table title. Words untouched. */
.bf-intro {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  column-gap: 48px;
  align-items: start;
  margin: 28px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--bf-muted);
}
.bf-intro > * { grid-column: 2; margin: 0 0 .8em; }
.bf .bf-intro > h2:first-child {
  grid-column: 1;
  grid-row: 1 / span 4;
  margin: 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--bf-gold);
  border-radius: 0;
  font-size: 22px !important;
  font-weight: 600;
  line-height: 1.4;
  color: var(--bf-navy);
}
.bf .bf-intro > h2:last-child {
  grid-column: 1 / -1;
  margin: 26px 0 14px;
  font-size: 20px !important;
  font-weight: 700;
  color: var(--bf-navy);
}
.bf .bf-intro > h2:last-child::after { content: ""; display: block; width: 48px; height: 3px; background: var(--bf-gold); margin-top: 8px; }
.bf .bf-intro a { color: var(--bf-plum); font-weight: 600; }

.bf-table-wrap { margin-bottom: 48px; background: #fff; border: 1px solid var(--bf-line); box-shadow: 0 14px 34px -24px rgba(25,53,99,.45); }
.bf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bf-table thead th {
  background: var(--bf-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  position: sticky;
  top: 138px; /* below the fixed site header */
  z-index: 2;
}
.bf-table td { padding: 14px 16px; vertical-align: top; color: var(--bf-ink); }
.bf-branch { border-top: 1px solid var(--bf-line); transition: background-color .15s; }
.bf-branch:nth-of-type(even) { background: #FBFAF7; }
.bf-branch:hover { background: #F6F2EA; }
.bf-t-name { width: 28%; }
.bf .bf-t-name a { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.bf-t-name img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--bf-line); }
.bf-t-name strong { display: block; font-size: 15.5px; color: var(--bf-navy); line-height: 1.3; }
.bf-t-name small { display: block; font-size: 12px; color: var(--bf-muted); }
.bf .bf-t-name a:hover strong { color: var(--bf-plum); }
.bf-t-address { color: var(--bf-muted); line-height: 1.5; }
.bf .bf-t-link { color: var(--bf-navy); font-weight: 600; text-decoration: none; white-space: nowrap; }
.bf .bf-t-link:hover { color: var(--bf-plum); text-decoration: underline; }
.bf-t-link i { color: var(--bf-gold); margin-right: 7px; font-size: 12px; }
.bf-t-phone { white-space: nowrap; }
.bf-t-phone .bf-btn { display: flex; width: max-content; margin-top: 10px; min-height: 36px; padding: 0 14px; font-size: 13px; }
.bf .bf-t-phone .bf-btn--sale { min-height: 0; margin-top: 8px; padding: 5px 12px 5px 6px; font-size: 12px; }
.bf-t-more td { padding-top: 0; font-size: 12.5px; line-height: 1.55; color: var(--bf-muted); }
.bf-t-more strong { color: var(--bf-navy); margin-right: 2px; }

/* ==========================================================================
   Map info window: same glass card as the CRM maps (candidates.css .iw-glass),
   scoped to the branch finder. Content from inc/branch-locations.php.
   ========================================================================== */
.bf .leaflet-popup:has(.iw-glass) .leaflet-popup-content-wrapper {
  background: linear-gradient(135deg, rgba(255,255,255,0.86) 0%, rgba(225,235,250,0.7) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 10px 28px rgba(45,62,102,0.18), 0 2px 4px rgba(45,62,102,0.08);
  border-radius: 14px;
  padding: 0;
}
/* GMW's gmw.frontend.css forces overflow-y: scroll and a 250px max on every
   popup, which drew a permanent scrollbar and squeezed the 260px card. */
.bf .gmw-map-wrapper .leaflet-popup:has(.iw-glass) .leaflet-popup-content-wrapper {
  overflow: visible; max-height: none; max-width: none; min-height: 0; min-width: 0; padding-bottom: 0;
}
.bf .leaflet-popup:has(.iw-glass) .leaflet-popup-content { margin: 0; width: 260px !important; text-align: left; }
.bf .leaflet-popup:has(.iw-glass) .leaflet-popup-tip { background: rgba(255,255,255,0.8); box-shadow: 0 6px 12px rgba(45,62,102,0.12); }
.bf .leaflet-popup:has(.iw-glass) .leaflet-popup-close-button,
.bf .leaflet-popup-content .gmw-element-close-button,
.bf .leaflet-popup-content .buttons-wrapper { display: none !important; }
.bf .gmw-info-window.standard { padding: 0; background: none; box-shadow: none; }

.iw-glass--branch {
  position: relative;
  width: 260px;
  padding: 14px 16px 14px;
  font-family: "Lato", "Open Sans", sans-serif;
  color: #2d3e66;
  animation: iwGlassFadeIn .32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes iwGlassFadeIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.iw-glass--branch .iw-glass-head { display: flex; align-items: center; gap: 10px; margin: 0 18px 10px 0; }
.iw-glass--branch .iw-glass-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(45,62,102,.2); }
.iw-glass--branch .iw-glass-name { font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.2px; color: #a0407f; }
.iw-glass--branch .iw-glass-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; margin-top: 5px; color: #4a5575; }
.iw-glass--branch .iw-glass-line i { width: 13px; color: #a0407f; font-size: 12px; margin-top: 3px; flex-shrink: 0; opacity: .85; }
.bf .iw-glass--branch .iw-glass-line a { color: #a0407f; text-decoration: none; border-bottom: 1px solid rgba(160,64,127,0.3); }
.bf .iw-glass--branch .iw-glass-line a:hover { border-bottom-color: #a0407f; }
.iw-glass--branch .iw-glass-actions { display: flex; gap: 8px; margin-top: 12px; }
.bf .iw-glass--branch .iw-glass-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #a0407f;
  color: #fff;
  border: 1.5px solid #a0407f;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, color .15s, transform .15s;
}
.bf .iw-glass--branch .iw-glass-cta:hover { background: #823366; border-color: #823366; color: #fff; transform: translateY(-1px); }
.bf .iw-glass--branch .iw-glass-cta--ghost { background: #e5dceb; color: #a0407f; }
.bf .iw-glass--branch .iw-glass-cta--ghost:hover { background: #a0407f; color: #fff; }
.iw-glass--branch .iw-glass-close {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 6px;
  font: 700 18px/1 Arial, sans-serif;
  color: #2d3e66;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: .5;
}
.iw-glass--branch .iw-glass-close:hover { opacity: 1; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .bf-panel { grid-template-columns: 340px minmax(0, 1fr); }
}
@media (max-width: 991px) {
  .bf-bar-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .bf-bar-search { flex: 1 1 auto; }
  .bf-panel { display: flex; flex-direction: column; height: auto; }
  .bf-map { order: -1; height: 340px; border-bottom: 1px solid var(--bf-line); }
  .bf-list { border-right: 0; }
  .bf-list-rows { overflow: visible; }
  .bf-foot-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767px) {
  .bf-bar { padding: 126px 0 16px; }
  .bf-bar-title h1 { font-size: 21px; }
  .bf-search-row { flex-wrap: wrap; }
  .bf-search-field { flex: 1 1 100%; }
  .bf-search-radius { flex: 1 1 auto; }
  .bf-search-radius select { width: 100%; }
  .bf-search-submit { flex: 0 0 auto; }
  .bf-results { padding-top: 14px; }
  .bf-map { height: 280px; }
  .bf-intro { grid-template-columns: 1fr; }
  .bf-intro > *, .bf .bf-intro > h2:first-child { grid-column: 1; grid-row: auto; }
  .bf .bf-intro > h2:first-child { margin-bottom: 14px; font-size: 19px !important; }
  /* Table becomes stacked cards */
  .bf-table thead { display: none; }
  .bf-table, .bf-table tbody, .bf-table tr, .bf-table td { display: block; width: 100%; }
  .bf-branch { padding: 14px 4px; }
  .bf-table td { padding: 4px 12px; }
  .bf-t-name { width: auto; padding-bottom: 8px !important; }
  .bf-t-phone { white-space: normal; }
  .bf-t-more td { padding-top: 6px; }
}
