/*
 * Home page and "Pet care by town and city" hub (design/home-find).
 * Uses the colour tokens from guides.css. Large text and 48px+ tap targets.
 */

.bmg-home,
.bmg-hub {
  color: var(--g-text);
}

.bmg-home a:focus-visible,
.bmg-hub a:focus-visible,
.bmg-home summary:focus-visible,
.bmg-home button:focus-visible,
.bmg-home select:focus-visible,
.bmg-home input:focus-visible {
  outline: 3px solid var(--g-orange);
  outline-offset: 3px;
}

/* ---------- Hero ---------- */

.bmg-home-hero {
  position: relative;
  overflow: hidden;
  background: #f6ead3;
}

.bmg-home-hero__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 30%;
}

.bmg-home-hero__inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 580px;
  padding: 48px 0;
}

.bmg-home-hero__copy {
  max-width: 560px;
}

.bmg-home-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.bmg-home .bmg-home-hero__lead {
  margin: 0 0 24px;
  color: var(--g-text);
  font-size: 1.22rem;
  line-height: 1.5;
}

.bmg-home-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.bmg-home .bmg-home-ticks li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--g-navy);
  font-weight: 600;
}

.bmg-home-ticks li::before {
  content: '';
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: #2f7d4f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Pet Pro strip ---------- */

.bmg-home-pro-strip {
  background: var(--g-navy);
}

.bmg-home-pro-strip .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 16px 0;
}

.bmg-home .bmg-home-pro-strip p {
  margin: 0;
  color: #e6ecf5;
  font-size: 1.05rem;
}

.bmg-home .bmg-home-pro-strip strong {
  color: #fff;
}

.bmg-home .bmg-home-pro-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #ffb36b;
  font-weight: 700;
  text-decoration: none;
}

.bmg-home-pro-strip a span {
  margin-left: 6px;
}

.bmg-home .bmg-home-pro-strip a:hover {
  text-decoration: underline;
}

/* ---------- Sections ---------- */

.bmg-home-section {
  padding: 64px 0;
  background: #fff;
}

.bmg-home-section--soft {
  background: var(--g-cream);
}

.bmg-home-title {
  margin: 0 0 28px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.bmg-home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 28px;
}

.bmg-home-head .bmg-home-title {
  margin: 0;
}

.bmg-home-head a {
  color: var(--g-navy);
  font-weight: 700;
}

/* Services */

.bmg-home-services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.bmg-home-service {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: #fff;
  color: var(--g-navy);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.bmg-home-service:hover {
  border-color: var(--g-navy);
  box-shadow: 0 10px 26px rgba(16, 34, 63, 0.1);
}

.bmg-home-service img {
  width: 100%;
  height: auto;
  aspect-ratio: 44 / 30;
  object-fit: cover;
}

.bmg-home-service strong {
  padding: 16px 18px 4px;
  font-size: 1.2rem;
}

.bmg-home-service span {
  padding: 0 18px 18px;
  color: var(--g-text);
  font-size: 1rem;
  line-height: 1.45;
}

/* How it works */

.bmg-home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.bmg-home-steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bmg-home-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--g-navy);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.bmg-home-steps strong {
  color: var(--g-navy);
  font-size: 1.25rem;
}

.bmg-home-steps span {
  color: var(--g-text);
  font-size: 1.05rem;
  line-height: 1.55;
}

/* Reviews */

.bmg-home-reviews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.bmg-home-review {
  margin: 0;
  padding: 26px 28px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: #fff;
}

.bmg-home-review__stars {
  margin-bottom: 10px;
  color: #e8a317;
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.bmg-home-review blockquote {
  margin: 0 0 18px;
  color: var(--g-navy);
  font-size: 1.15rem;
  line-height: 1.55;
}

.bmg-home-review figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--g-muted);
}

.bmg-home-review figcaption img {
  border-radius: 50%;
}

.bmg-home-review figcaption strong {
  display: block;
  color: var(--g-navy);
}

.bmg-home .bmg-home-reviews__note {
  margin: 18px 0 0;
  color: var(--g-muted);
}

/* FAQ and join */

.bmg-home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.bmg-home-faq details {
  border-bottom: 1px solid var(--g-line);
}

.bmg-home-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  color: var(--g-navy);
  font-size: 1.15rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.bmg-home-faq summary::-webkit-details-marker {
  display: none;
}

.bmg-home-faq summary::after {
  content: '+';
  color: var(--g-orange-text);
  font-size: 1.6rem;
  font-weight: 400;
}

.bmg-home-faq details[open] summary::after {
  content: '−';
}

.bmg-home .bmg-home-faq p {
  margin: 0 0 18px;
  color: var(--g-text);
  font-size: 1.05rem;
  line-height: 1.6;
}

.bmg-home-join {
  padding: 30px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(16, 34, 63, 0.08);
}

.bmg-home-join h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.bmg-home .bmg-home-join p {
  margin: 0 0 16px;
  color: var(--g-text);
  font-size: 1.05rem;
}

.bmg-home-join ul {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.bmg-home .bmg-home-join li {
  padding: 6px 0 6px 28px;
  color: var(--g-navy);
  font-weight: 600;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f7d4f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") left center / 18px no-repeat;
}

.bmg-home-join .btn {
  width: 100%;
  justify-content: center;
  min-height: 52px;
  font-size: 1.05rem;
}

/* ---------- City hub ---------- */

.bmg-hub-letters {
  columns: 3 260px;
  column-gap: 40px;
}

.bmg-hub-letter {
  break-inside: avoid;
  margin-bottom: 24px;
}

.bmg-hub-letter h3 {
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--g-orange);
  color: var(--g-orange-text);
  font-size: 1.1rem;
}

.bmg-hub-letter ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bmg-hub-letter a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--g-line);
  color: var(--g-navy);
  text-decoration: none;
}

.bmg-hub-letter a:hover .bmg-hub-city {
  text-decoration: underline;
}

.bmg-hub-letter h3,
.bmg-hub-city {
  font-family: inherit;
}

.bmg-hub-city {
  font-size: 1.12rem;
  font-weight: 700;
}

.bmg-hub-count {
  flex: none;
  color: var(--g-muted);
  font-size: 0.95rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .bmg-home-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bmg-home-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .bmg-home-hero__image img {
    position: static;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .bmg-home-hero__inner {
    min-height: 0;
    padding: 24px 0 32px;
  }

  .bmg-home-section {
    padding: 44px 0;
  }

  .bmg-home-services {
    gap: 12px;
  }

  .bmg-home-service strong {
    padding: 12px 12px 2px;
    font-size: 1.05rem;
  }

  .bmg-home-service span {
    padding: 0 12px 14px;
    font-size: 0.95rem;
  }

  .bmg-home-steps,
  .bmg-home-reviews {
    grid-template-columns: 1fr;
  }

  .bmg-home-join {
    padding: 22px;
  }
}

/* card-refresh.css forces muted grey on p and li with !important. */
body:not(.wp-admin) .bmg-home .bmg-home-hero__lead,
body:not(.wp-admin) .bmg-home-faq p,
body:not(.wp-admin) .bmg-home-join p {
  color: var(--g-text) !important;
}

body:not(.wp-admin) .bmg-home-ticks li,
body:not(.wp-admin) .bmg-home-join li {
  color: var(--g-navy) !important;
}

body:not(.wp-admin) .bmg-home-pro-strip p {
  color: #e6ecf5 !important;
}

body:not(.wp-admin) .bmg-home-pro-strip strong {
  color: #fff !important;
}

body:not(.wp-admin) .bmg-home-pro-strip a {
  color: #ffb36b !important;
}

body:not(.wp-admin) .bmg-hub-letter .bmg-hub-city {
  color: var(--g-navy) !important;
}

/* ---------- City pages ---------- */

.bmg-city .bmg-guides-intro .bmg-city-chips {
  margin-top: 18px;
}

body:not(.wp-admin) .bmg-city .bmg-city__count {
  margin: 14px 0 0;
  color: var(--g-navy) !important;
  font-size: 1.1rem;
  font-weight: 700;
}

.bmg-city__empty {
  max-width: 640px;
  padding: 24px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: #fff;
}

body:not(.wp-admin) .bmg-city__empty p {
  margin: 0 0 16px;
  color: var(--g-text) !important;
  font-size: 1.1rem;
}

.bmg-city .bmg-guide-search {
  margin-top: 40px;
}

/* Search card in the hero: service buttons as a tidy 2 x 2 grid. */
.bmg-home-hero .bmg-finder__options {
  grid-template-columns: 1fr 1fr;
}

/* ---------- Contact page ---------- */

.bmg-contact-routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.bmg-contact-route {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: #fff;
}

.bmg-contact-route h3 {
  margin: 0;
  font-size: 1.35rem;
}

body:not(.wp-admin) .bmg-contact-route p {
  flex: 1;
  margin: 0;
  color: var(--g-text) !important;
  font-size: 1.05rem;
  line-height: 1.55;
}

.bmg-contact-route .btn {
  min-height: 52px;
}

.bmg-contact-route__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--g-orange-text);
  font-weight: 700;
}

.bmg-contact-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
  padding: 22px 26px;
  border-radius: var(--g-radius);
  background: var(--g-cream);
  border: 1px solid var(--g-line);
}

body:not(.wp-admin) .bmg-contact-email p {
  flex-basis: 100%;
  margin: 0;
  color: var(--g-navy) !important;
  font-weight: 700;
}

.bmg-contact-email__address {
  color: var(--g-navy);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

body:not(.wp-admin) .bmg-contact-email__done {
  color: #1f6b3a;
  font-weight: 700;
}

@media (max-width: 860px) {
  .bmg-contact-routes {
    grid-template-columns: 1fr;
  }
}

/* ---------- Terms, Privacy and Cookies ---------- */

body:not(.wp-admin) .bmg-legal .bmg-legal__updated {
  margin: 14px 0 0;
  color: var(--g-navy) !important;
  font-size: 1rem;
  font-weight: 700;
}

.bmg-legal__layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.bmg-legal__toc {
  position: sticky;
  top: 100px;
  padding: 20px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: var(--g-cream);
}

.bmg-legal__toc h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.bmg-legal__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: legal-toc;
}

/* Numbers in their own column, lined up with the first line of each heading. */
.bmg-legal__toc li {
  display: grid;
  grid-template-columns: 2.1em minmax(0, 1fr);
  align-items: baseline;
  counter-increment: legal-toc;
}

.bmg-legal__toc li::before {
  content: counter(legal-toc) ".";
  color: var(--g-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 0.5em;
}

body:not(.wp-admin) .bmg-legal__toc li {
  margin: 0;
  color: var(--g-navy) !important;
  font-size: 15px !important;
}

.bmg-legal__toc a {
  display: block;
  padding: 5px 0;
  line-height: 1.35;
  color: var(--g-navy);
  text-decoration: none;
}

.bmg-legal__toc a:hover {
  color: var(--g-orange-text);
  text-decoration: underline;
}

.bmg-legal__body {
  max-width: 72ch;
}

.bmg-legal__section {
  padding: 0 0 28px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--g-line);
  scroll-margin-top: 100px;
}

.bmg-legal__section h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

body:not(.wp-admin) .bmg-legal__section :is(p, li) {
  color: var(--g-text) !important;
  font-size: 18px !important;
  line-height: 1.7;
}

.bmg-legal__section p {
  margin: 0 0 12px;
}

.bmg-legal__section ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.bmg-legal__section li {
  margin: 0 0 8px;
}

body:not(.wp-admin) .bmg-legal__also p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--g-navy) !important;
  font-size: 17px !important;
}

.bmg-legal__also a {
  color: var(--g-orange-text);
  font-weight: 700;
}

@media (max-width: 900px) {
  .bmg-legal__layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .bmg-legal__toc {
    position: static;
  }
}

/* The site sets overflow-x: hidden on html and body, which stops sticky; clip keeps sticky working. */
@supports (overflow: clip) {
  html:has(.bmg-legal),
  body:has(.bmg-legal) {
    overflow-x: clip;
  }
}
