/*
 * Pet care guides: blog page and single guides (design/blog-redesign).
 * Loaded only on /blog/ and single posts, after the other theme styles.
 * Large type and generous tap targets so guides are easy to read for everyone.
 */

/* Aliases of the shared tokens in base.css. */
:root {
  --g-navy: var(--bmg-navy);
  --g-text: var(--bmg-text);
  --g-muted: var(--bmg-muted);
  --g-orange: var(--bmg-orange);
  --g-orange-text: var(--bmg-orange-text);
  --g-cream: var(--bmg-cream);
  --g-line: var(--bmg-line);
  --g-radius: var(--bmg-radius);
}

.bmg-guides,
.bmg-guide {
  color: var(--g-text);
}

/* ---------- Breadcrumbs ---------- */

.bmg-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.bmg-crumbs li {
  display: flex;
  align-items: center;
  color: var(--g-muted);
}

.bmg-crumbs li + li::before {
  content: '›';
  margin: 0 10px;
  color: #9aa1ad;
}

.bmg-crumbs a {
  color: var(--g-muted);
  text-decoration: underline;
  text-decoration-color: rgba(91, 100, 117, 0.35);
}

.bmg-crumbs a:hover {
  color: var(--g-navy);
}

.bmg-crumbs [aria-current] {
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Shared bits ---------- */

.bmg-guide-topic {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--g-orange-text);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bmg-guide-meta {
  color: var(--g-muted);
  font-size: 0.95rem;
}

/* ---------- Blog page: intro ---------- */

.bmg-guides-intro {
  padding: 40px 0 28px;
  background: var(--g-cream);
  border-bottom: 1px solid var(--g-line);
}

.bmg-guides-intro h1 {
  max-width: 18ch;
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.bmg-guides .bmg-guides-intro__lead,
.bmg-hub .bmg-hub__lead {
  max-width: 58ch;
  margin: 0;
  color: var(--g-text);
  font-size: 1.2rem;
  line-height: 1.55;
}

.bmg-topic-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 26px;
}

.bmg-topic-filter[hidden] {
  display: none;
}

.bmg-topic-filter__label {
  color: var(--g-muted);
  font-weight: 600;
}

.bmg-topic-filter__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bmg-topic-filter button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--g-line);
  border-radius: 999px;
  background: #fff;
  color: var(--g-navy);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.bmg-topic-filter button:hover {
  border-color: var(--g-navy);
}

.bmg-topic-filter button[aria-pressed='true'] {
  border-color: var(--g-navy);
  background: var(--g-navy);
  color: #fff;
}

.bmg-topic-filter button:focus-visible,
.bmg-guides a:focus-visible,
.bmg-guide a:focus-visible,
.bmg-guide summary:focus-visible {
  outline: 3px solid var(--g-orange);
  outline-offset: 3px;
}

/* ---------- Blog page: list ---------- */

.bmg-guides-list {
  padding: 36px 0 24px;
  background: #fff;
}

.bmg-topic-status:empty {
  display: none;
}

.bmg-topic-status {
  margin: 0 0 18px;
  color: var(--g-muted);
}

.bmg-guide-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 56px;
}

.bmg-guide-lead__image,
.bmg-guide-card__image {
  display: block;
  overflow: hidden;
  border-radius: var(--g-radius);
  background: var(--g-cream);
  aspect-ratio: 16 / 10;
}

.bmg-guide-lead__image img,
.bmg-guide-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.bmg-guide-lead:hover img,
.bmg-guide-card:hover img {
  transform: scale(1.03);
}

.bmg-guide-lead h2 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.bmg-guide-lead h2 a,
.bmg-guide-card__title a {
  color: inherit;
  text-decoration: none;
}

.bmg-guide-lead h2 a:hover,
.bmg-guide-card__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.bmg-guides .bmg-guide-lead p {
  margin: 0 0 24px;
  color: var(--g-text);
  font-size: 1.125rem;
  line-height: 1.6;
}

.bmg-guide-lead__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.bmg-guides-list__title {
  margin: 0 0 22px;
  padding-top: 32px;
  border-top: 1px solid var(--g-line);
  font-size: 1.6rem;
}

.bmg-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 28px;
}

.bmg-guide-card {
  display: flex;
  flex-direction: column;
}

.bmg-guide-card[hidden],
.bmg-guide-lead[hidden] {
  display: none;
}

.bmg-guide-card__body {
  padding-top: 18px;
}

.bmg-guide-card__title {
  margin: 0 0 10px;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.bmg-guides .bmg-guide-card p,
.bmg-guide .bmg-guide-card p {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--g-text);
  font-size: 1.02rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.bmg-guides-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.bmg-guides-pages .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--g-line);
  border-radius: 12px;
  color: var(--g-navy);
  font-weight: 600;
  text-decoration: none;
}

.bmg-guides-pages .page-numbers.current {
  border-color: var(--g-navy);
  background: var(--g-navy);
  color: #fff;
}

.bmg-guides-empty {
  font-size: 1.15rem;
}

/* ---------- Groomer search band ---------- */

.bmg-guide-search {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 28px 40px;
  align-items: center;
  margin: 64px 0 48px;
  padding: 36px 40px;
  border: 1px solid #f3dcc0;
  border-radius: 24px;
  background: #fff5e8;
}

.bmg-guide-search h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.2;
}

.bmg-guide-search .bmg-guide-search__copy p {
  margin: 0;
  color: var(--g-text);
  font-size: 1.05rem;
  line-height: 1.55;
}

.bmg-guide-search__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 12px;
  align-items: end;
}

.bmg-guide-search__form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--g-navy);
  font-size: 0.95rem;
  font-weight: 700;
}

.bmg-guide-search__form select,
.bmg-guide-search__form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #d6cfc3;
  border-radius: 12px;
  background: #fff;
  color: var(--g-navy);
  font: inherit;
  font-size: 1.05rem;
}

.bmg-guide-search__form select:focus,
.bmg-guide-search__form input:focus {
  border-color: var(--g-navy);
  outline: 3px solid rgba(255, 138, 31, 0.35);
  outline-offset: 0;
}

.bmg-guide-search__form .btn {
  min-height: 52px;
  padding: 0 28px;
  font-size: 1.05rem;
}

/* ---------- Single guide: header ---------- */

.bmg-guide-head {
  padding: 36px 0 32px;
  background: var(--g-cream);
}

.bmg-guide-head__inner {
  max-width: 820px;
}

.bmg-guide-head h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.bmg-guide .bmg-guide-head__standfirst {
  margin: 0 0 18px;
  color: var(--g-text);
  font-size: 1.22rem;
  line-height: 1.55;
}

.bmg-guide .bmg-guide-head .bmg-guide-meta {
  margin: 0;
  color: var(--g-muted);
}

.bmg-guide-figure {
  max-width: 1080px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 28px;
}

.bmg-guide-figure img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  border-radius: 22px;
}

/* ---------- Single guide: layout ---------- */

.bmg-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 280px;
  justify-content: center;
  gap: 64px;
  padding-top: 40px;
}

.bmg-guide-layout--single {
  grid-template-columns: minmax(0, 720px);
}

.bmg-guide .bmg-guide-disclosure {
  margin: 14px 0 0;
  color: var(--g-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.bmg-guide-disclosure a {
  color: var(--g-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bmg-guide-aside {
  position: sticky;
  top: 110px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The theme sets overflow-x: hidden on html and body, which stops
   position: sticky working. clip hides sideways overflow the same way. */
@supports (overflow: clip) {
  html:has(body.single-post),
  body.single-post {
    overflow-x: clip;
  }
}

.bmg-guide-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.bmg-guide-toc li {
  counter-increment: toc;
}

.bmg-guide-toc li a {
  display: grid;
  grid-template-columns: 26px 1fr;
  padding: 8px 0;
  color: var(--g-text);
  font-size: 0.98rem;
  line-height: 1.4;
  text-decoration: none;
}

.bmg-guide-toc li a::before {
  content: counter(toc);
  color: var(--g-orange-text);
  font-weight: 700;
}

.bmg-guide-toc li a:hover,
.bmg-guide-toc li a[aria-current='true'] {
  color: var(--g-navy);
  font-weight: 700;
}

.bmg-guide .bmg-guide-toc__title {
  margin: 0 0 8px;
  color: var(--g-navy);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bmg-guide-toc--inline {
  display: none;
  margin: 0 0 28px;
  border: 1px solid var(--g-line);
  border-radius: 14px;
}

.bmg-guide-toc--inline summary {
  min-height: 52px;
  padding: 14px 18px;
  color: var(--g-navy);
  font-weight: 700;
  cursor: pointer;
}

.bmg-guide-toc--inline ol {
  padding: 0 18px 12px;
}

.bmg-guide-aside__cta {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: #fff;
}

.bmg-guide .bmg-guide-aside__cta p {
  margin: 0 0 16px;
  color: var(--g-text);
  font-size: 0.98rem;
  line-height: 1.5;
}

.bmg-guide .bmg-guide-aside__cta .bmg-guide-aside__cta-title {
  margin-bottom: 6px;
  color: var(--g-navy);
  font-size: 1.15rem;
  font-weight: 800;
}

.bmg-guide-aside__cta .btn {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

/* ---------- Single guide: body text ---------- */

.bmg-guide-body {
  font-size: 1.15rem;
  line-height: 1.75;
}

.bmg-guide .bmg-guide-body p,
.bmg-guide .bmg-guide-body li {
  color: var(--g-text);
}

.bmg-guide-body p {
  margin: 0 0 1.25em;
}

.bmg-guide-body h2 {
  margin: 2em 0 0.6em;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  scroll-margin-top: 110px;
}

.bmg-guide-body h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.32rem;
  line-height: 1.3;
}

.bmg-guide-body > :first-child {
  margin-top: 0;
}

.bmg-guide-body ul,
.bmg-guide-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.bmg-guide-body li {
  margin-bottom: 0.5em;
}

.bmg-guide-body li::marker {
  color: var(--g-orange-text);
}

.bmg-guide-body a:not(.btn) {
  color: var(--g-orange-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bmg-guide-body img {
  height: auto;
  border-radius: 14px;
}

.bmg-guide-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--g-orange);
  font-size: 1.2rem;
}

.bmg-guide-body .wp-block-table,
.bmg-guide-body table {
  display: block;
  max-width: 100%;
  margin: 1.6em 0;
  overflow-x: auto;
}

.bmg-guide-body table {
  border-collapse: collapse;
  font-size: 1rem;
}

.bmg-guide-body th,
.bmg-guide-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--g-line);
  text-align: left;
  vertical-align: top;
}

.bmg-guide-body th {
  background: var(--g-cream);
  color: var(--g-navy);
}

/* Product cards inside guides (built in functions.php from .bmg-product-pick). */
.bmg-guide-body .bmg-pick {
  margin: 1.8em 0;
  padding: 22px 24px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 34, 63, 0.05);
}

.bmg-guide .bmg-guide-body .bmg-pick p {
  margin: 0;
}

.bmg-guide .bmg-guide-body .bmg-pick__label {
  margin-bottom: 4px;
  color: var(--g-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.bmg-guide .bmg-guide-body .bmg-pick__name {
  color: var(--g-navy);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.bmg-pick__notes {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 1.02rem;
  line-height: 1.5;
}

.bmg-pick__notes div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
}

.bmg-pick__notes dt {
  color: var(--g-navy);
  font-weight: 700;
}

.bmg-pick__notes dd {
  margin: 0;
  color: var(--g-text);
}

.bmg-guide .bmg-guide-body .bmg-pick__action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--g-line);
}

.bmg-guide .bmg-guide-body a.bmg-pick__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--g-navy);
  border-radius: 999px;
  color: var(--g-navy);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.bmg-guide .bmg-guide-body a.bmg-pick__button:hover {
  background: var(--g-navy);
  color: #fff;
}

.bmg-pick__tag {
  color: var(--g-muted);
  font-size: 0.875rem;
}

/* "At a glance" comparison table. */
.bmg-compare {
  margin: 0 0 2em;
}

.bmg-guide-body .bmg-compare h2 {
  margin-top: 0;
}

.bmg-guide-body .bmg-compare table {
  display: table;
  width: 100%;
  margin: 0;
  overflow: visible;
}

.bmg-guide-body .bmg-compare tbody th {
  background: none;
  color: var(--g-navy);
  font-weight: 700;
}

.bmg-guide .bmg-guide-body .bmg-compare a {
  white-space: nowrap;
}

.bmg-guide .bmg-guide-body .bmg-compare__note {
  margin: 10px 0 0;
  color: var(--g-muted);
  font-size: 0.9rem;
}

.bmg-compare .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* How we choose products. */
.bmg-guide-choose {
  margin-top: 40px;
  padding: 22px 24px;
  border-radius: var(--g-radius);
  background: var(--g-cream);
  scroll-margin-top: 110px;
}

.bmg-guide-choose h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.bmg-guide .bmg-guide-choose p {
  margin: 0 0 10px;
  color: var(--g-text);
  font-size: 1rem;
  line-height: 1.6;
}

.bmg-guide .bmg-guide-choose p:last-child {
  margin-bottom: 0;
}

/* ---------- Single guide: share and related ---------- */

.bmg-guide-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--g-line);
}

.bmg-guide-share span {
  margin-right: 6px;
  color: var(--g-muted);
  font-weight: 600;
}

.bmg-guide-share a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--g-line);
  border-radius: 999px;
  color: var(--g-navy);
  font-weight: 600;
  text-decoration: none;
}

.bmg-guide-share a:hover {
  border-color: var(--g-navy);
}

.bmg-guide-related {
  padding: 48px 0 24px;
  background: var(--g-cream);
}

.bmg-guide-related__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.bmg-guide-related__head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.bmg-guide-related__head a {
  color: var(--g-navy);
  font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .bmg-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bmg-guide-layout {
    grid-template-columns: minmax(0, 720px);
    gap: 0;
  }

  .bmg-guide-aside {
    display: none;
  }

  .bmg-guide-toc--inline {
    display: block;
  }

  .bmg-guide-search {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .bmg-guide-lead {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
  }

  .bmg-guide-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .bmg-guide-search {
    margin: 48px 0 32px;
    padding: 24px 20px;
  }

  .bmg-guide-search__form {
    grid-template-columns: 1fr;
  }

  .bmg-guide-body {
    font-size: 1.1rem;
  }

  .bmg-guide-body h2 {
    font-size: 1.5rem;
  }

  .bmg-crumbs [aria-current] {
    max-width: 20ch;
  }

  .bmg-guide-figure img {
    border-radius: 16px;
  }

  .bmg-guide-body .bmg-pick {
    padding: 18px;
  }

  .bmg-pick__notes div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .bmg-guide-body .bmg-compare thead {
    display: none;
  }

  .bmg-guide-body .bmg-compare table,
  .bmg-guide-body .bmg-compare tbody,
  .bmg-guide-body .bmg-compare tr,
  .bmg-guide-body .bmg-compare th,
  .bmg-guide-body .bmg-compare td {
    display: block;
  }

  .bmg-guide-body .bmg-compare tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--g-line);
  }

  .bmg-guide-body .bmg-compare tbody th,
  .bmg-guide-body .bmg-compare td {
    padding: 2px 0;
    border: 0;
  }

  .bmg-guide-body .bmg-compare td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--g-navy);
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bmg-guide-lead img,
  .bmg-guide-card img {
    transition: none;
  }
}

/* card-refresh.css forces muted grey on every p, li, dd and figcaption with
   !important. Restore readable text colours inside the guide layouts. */
body:not(.wp-admin) .bmg-guides .bmg-guides-intro__lead,
body:not(.wp-admin) .bmg-hub .bmg-hub__lead,
body:not(.wp-admin) .bmg-guide-lead p,
body:not(.wp-admin) .bmg-guide-card p,
body:not(.wp-admin) .bmg-guide-search__copy p,
body:not(.wp-admin) .bmg-guide-head__standfirst,
body:not(.wp-admin) .bmg-guide-body p,
body:not(.wp-admin) .bmg-guide-body li,
body:not(.wp-admin) .bmg-guide-disclosure,
body:not(.wp-admin) .bmg-guide-aside__cta p,
body:not(.wp-admin) .bmg-pick__notes dd,
body:not(.wp-admin) .bmg-guide-choose p,
body:not(.wp-admin) .bmg-guide-toc li {
  color: var(--g-text) !important;
}

body:not(.wp-admin) .bmg-guide-toc__title,
body:not(.wp-admin) .bmg-guide-aside__cta .bmg-guide-aside__cta-title,
body:not(.wp-admin) .bmg-guide-body .bmg-pick__name {
  color: var(--g-navy) !important;
}

body:not(.wp-admin) .bmg-guide-body .bmg-pick__label,
body:not(.wp-admin) .bmg-guide-body .bmg-compare__note,
body:not(.wp-admin) .bmg-guide-head .bmg-guide-meta,
body:not(.wp-admin) .bmg-crumbs li {
  color: var(--g-muted) !important;
}

/* Reading progress bar on guides (moved from the retired blog-redesign.css). */
.bmg-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--g-orange);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

@media print {
  .bmg-progress-bar {
    display: none;
  }
}
