/* =============================================================================
   Breed Spotlight  ·  Trupanion AU theme  ·  v0.1.0
   ============================================================================ */

.tru-breeds {
  --br-blue: var(--tru-blue, #3A5DAE);
  --br-deep: var(--tru-hero-blue, #28396F);
  --br-ink: var(--tru-web-copy, #222725);
  --br-white: var(--tru-white, #FFFFFF);
  --br-tint: var(--tru-blue-tint-90, #EBEFF7);
  --br-line: var(--tru-silver-tint-10, #E3E3E3);
  --br-blue-plus: var(--tru-blue-plus, #2C5697);
  --br-purple: var(--tru-purrfect-purple, #403A60);
  --br-focus: var(--tru-canary-yellow, #FBD872);
  --br-font-heading: var(--tru-font-heading, 'Mont', 'Montserrat', 'Helvetica Neue', Arial, sans-serif);
  --br-font-body: var(--tru-font-body, 'Mulish', 'Helvetica Neue', Arial, sans-serif);
  --br-gutter: var(--tru-gutter, clamp(20px, 5vw, 40px));
  --br-radius: var(--tru-radius-card, 16px);
  --br-max: var(--tru-width-standard, 1200px);

  --br-surface: var(--br-white);
  --br-text: var(--br-ink);
  --br-card-surface: var(--br-tint);
  --br-card-text: var(--br-ink);
  --br-cols: 3;
  --br-gap: 24px;
  --br-ratio: 4 / 3;

  padding-block: var(--br-pad-top, clamp(48px, 7vw, 88px)) var(--br-pad-bottom, clamp(48px, 7vw, 88px));
  font-family: var(--br-font-body);
  background: var(--br-surface);
  color: var(--br-text);
}
.tru-breeds *, .tru-breeds *::before, .tru-breeds *::after { box-sizing: border-box; }

/* --- Section background and scheme ---------------------------------------- */
.tru-breeds[data-bg="muted"]  { --br-surface: var(--br-tint); }
.tru-breeds[data-bg="brand"]  { --br-surface: var(--br-blue); }
.tru-breeds[data-bg="dark"]   { --br-surface: var(--br-deep); }
.tru-breeds[data-bg="custom"] { --br-surface: var(--tru-custom-surface, var(--br-white)); }
.tru-breeds[data-scheme="dark"] { --br-text: var(--br-white); }

.tru-breeds[data-width="narrow"] { --br-max: var(--tru-width-narrow, 960px); }
.tru-breeds[data-width="wide"]   { --br-max: var(--tru-width-wide, 1360px); }
.tru-breeds[data-width="full"]   { --br-max: none; }

.tru-breeds[data-space-top="none"]    { --br-pad-top: 0; }
.tru-breeds[data-space-top="small"]   { --br-pad-top: clamp(24px, 4vw, 40px); }
.tru-breeds[data-space-top="large"]   { --br-pad-top: clamp(72px, 10vw, 128px); }
.tru-breeds[data-space-bottom="none"]  { --br-pad-bottom: 0; }
.tru-breeds[data-space-bottom="small"] { --br-pad-bottom: clamp(24px, 4vw, 40px); }
.tru-breeds[data-space-bottom="large"] { --br-pad-bottom: clamp(72px, 10vw, 128px); }

.tru-breeds[data-card-space="tight"] { --br-gap: 16px; }
.tru-breeds[data-card-space="loose"] { --br-gap: 36px; }

.tru-breeds__inner { max-inline-size: var(--br-max); margin-inline: auto; padding-inline: var(--br-gutter); }

/* --- Header ---------------------------------------------------------------- */
.tru-breeds__header { max-inline-size: 46rem; margin-block-end: clamp(24px, 4vw, 40px); }
.tru-breeds[data-header-align="center"] .tru-breeds__header { margin-inline: auto; text-align: center; }
.tru-breeds__eyebrow { margin: 0 0 10px; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--br-blue); }
.tru-breeds[data-scheme="dark"] .tru-breeds__eyebrow { color: var(--tru-canary-yellow-tint-50, #FFE3AC); }
.tru-breeds__heading {
  margin: 0; font-family: var(--br-font-heading); font-variation-settings: var(--tru-heading-settings, normal);
  font-weight: 800; font-size: var(--tru-fs-h2, clamp(1.75rem, 1.3rem + 2vw, 2.75rem)); line-height: 1.15; text-wrap: balance;
}
.tru-breeds[data-heading-size="small"] .tru-breeds__heading { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); }
.tru-breeds[data-heading-size="large"] .tru-breeds__heading { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
.tru-breeds__intro { margin-block-start: 14px; font-size: 1.0625rem; line-height: 1.55; }
.tru-breeds__intro p { margin: 0; }
.tru-breeds__intro p + p { margin-block-start: 0.7em; }

/* Editor only guidance. Never rendered on a live page. */
.tru-breeds__note {
  margin: 0 0 24px; padding: 14px 16px; border-radius: 10px;
  background: var(--br-tint); color: var(--br-deep); font-size: 0.9375rem; line-height: 1.5;
}

/* --- Search ---------------------------------------------------------------- */
.tru-breeds__search { margin-block-end: clamp(20px, 3vw, 28px); max-inline-size: 26rem; }
.tru-breeds[data-header-align="center"] .tru-breeds__search { margin-inline: auto; }
.tru-breeds__search-label { display: block; margin-block-end: 6px; font-size: 0.875rem; font-weight: 700; }
.tru-breeds__search-input {
  inline-size: 100%; min-block-size: 48px; padding: 10px 14px;
  border: 2px solid var(--br-line); border-radius: 10px;
  background: var(--br-white); color: var(--br-ink);
  font: inherit; font-size: 1rem;
}
.tru-breeds__search-input:focus-visible { outline: 3px solid var(--br-focus); outline-offset: 2px; border-color: var(--br-blue); }
/* Dimmed from the section's own text colour rather than set to silver, which
   only reaches 3.54:1 on white. */
.tru-breeds__search-count { margin: 8px 0 0; font-size: 0.875rem; color: inherit; opacity: 0.72; }

/* --- Grid ------------------------------------------------------------------ */
.tru-breeds__grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: var(--br-gap); margin: 0; padding: 0; list-style: none; }
@media (min-width: 48em) { .tru-breeds__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .tru-breeds__grid { grid-template-columns: repeat(var(--br-cols), minmax(0, 1fr)); } }
.tru-breeds[data-cols="2"] { --br-cols: 2; }
.tru-breeds[data-cols="4"] { --br-cols: 4; }
.tru-breeds[data-mode="one"] .tru-breeds__grid { grid-template-columns: minmax(0, 1fr); }

.tru-breeds__card {
  position: relative; display: flex; flex-direction: column; block-size: 100%; min-inline-size: 0;
  overflow: hidden; border-radius: var(--br-radius);
  background: var(--br-card-surface); color: var(--br-card-text);
}
.tru-breeds[data-radius="none"]  .tru-breeds__card { border-radius: 0; }
.tru-breeds[data-radius="small"] .tru-breeds__card { border-radius: 8px; }
.tru-breeds[data-radius="large"] .tru-breeds__card { border-radius: 24px; }

.tru-breeds[data-card-bg="surface"]     { --br-card-surface: var(--br-white); }
.tru-breeds[data-card-bg="brand"]       { --br-card-surface: var(--br-blue); }
.tru-breeds[data-card-bg="transparent"] { --br-card-surface: transparent; }
.tru-breeds[data-card-bg="custom"]      { --br-card-surface: var(--card-custom, var(--br-tint)); }
.tru-breeds[data-card-scheme="dark"]    { --br-card-text: var(--br-white); }

.tru-breeds[data-card="plain"] .tru-breeds__card    { background: transparent; }
.tru-breeds[data-card="bordered"] .tru-breeds__card { border: 1px solid var(--br-line); }
.tru-breeds[data-card="elevated"] .tru-breeds__card { box-shadow: 0 2px 16px rgba(34, 39, 37, 0.09); }
.tru-breeds[data-scheme="dark"][data-card="bordered"] .tru-breeds__card { border-color: rgba(255, 255, 255, 0.22); }

.tru-breeds__photo { display: block; inline-size: 100%; block-size: auto; aspect-ratio: var(--br-ratio); object-fit: cover; }
.tru-breeds[data-ratio="1x1"] { --br-ratio: 1; }
.tru-breeds[data-ratio="4x5"] { --br-ratio: 4 / 5; }
.tru-breeds[data-mode="one"] .tru-breeds__photo { aspect-ratio: 16 / 9; }

/* Card interiors are left aligned even when the section header is centred. */
.tru-breeds__body { display: flex; flex-direction: column; gap: 8px; padding: clamp(16px, 2.2vw, 22px); text-align: start; }
.tru-breeds[data-card="plain"] .tru-breeds__body { padding-inline: 0; }

.tru-breeds__name {
  margin: 0; font-family: var(--br-font-heading); font-variation-settings: var(--tru-heading-settings, normal);
  font-weight: 800; font-size: 1.25rem; line-height: 1.2;
}
.tru-breeds[data-mode="one"] .tru-breeds__name { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.tru-breeds__link { color: inherit; text-decoration: none; }
.tru-breeds__link:hover { text-decoration: underline; text-underline-offset: 0.18em; }
/* Stretched link: the anchor wraps the breed name, so the accessible name is
   the breed rather than the cue wording underneath. */
.tru-breeds__link--cover::after { content: ""; position: absolute; inset: 0; }

.tru-breeds__summary { margin: 0; font-size: 1rem; line-height: 1.5; }
.tru-breeds__label { margin: 6px 0 0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
.tru-breeds__conditions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tru-breeds__conditions li {
  padding: 3px 10px; border-radius: 9999px; border: 1px solid currentColor;
  font-size: 0.8125rem; line-height: 1.4;
}
.tru-breeds__claim { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-size: 0.9375rem; }
/* Not Catnip Green Plus: at 18px on a light card it measures 2.76:1, and the
   rest of the library only uses that green for ticks and icons. */
.tru-breeds__claim-amount { font-family: var(--br-font-heading); font-weight: 800; font-size: 1.125rem; color: var(--br-blue-plus); }
/* Catnip Green on TruBlue measures 3.77:1, under the 4.5 this size needs.
   Canary tint 50 is the pairing the brand rules give for TruBlue. */
.tru-breeds[data-card-scheme="dark"] .tru-breeds__claim-amount { color: var(--tru-canary-yellow-tint-50, #FFE3AC); }

.tru-breeds__cue { margin-block-start: auto; padding-block-start: 6px; font-size: 0.9375rem; font-weight: 700; color: var(--br-blue); }
.tru-breeds[data-card-scheme="dark"] .tru-breeds__cue { color: var(--tru-canary-yellow-tint-50, #FFE3AC); }
.tru-breeds__card:hover .tru-breeds__cue { text-decoration: underline; text-underline-offset: 0.18em; }

/* Focus lands on the card, refined so a mouse click does not ring it. */
.tru-breeds__card:focus-within { outline: 3px solid var(--br-focus); outline-offset: 2px; }
@supports selector(:has(*)) {
  .tru-breeds__card:focus-within { outline: none; }
  .tru-breeds__card:has(a:focus-visible) { outline: 3px solid var(--br-focus); outline-offset: 2px; }
}

.tru-breeds__card[hidden] { display: none; }
.tru-breeds__no-match { margin: 20px 0 0; font-size: 1rem; }
.tru-breeds__no-match[hidden] { display: none; }

.tru-breeds__actions { margin-block-start: clamp(24px, 4vw, 36px); }
.tru-breeds[data-header-align="center"] .tru-breeds__actions { text-align: center; }

/* --- One breed on its own --------------------------------------------------- */
@media (min-width: 64em) {
  .tru-breeds[data-mode="one"] .tru-breeds__card { flex-direction: row; align-items: stretch; }
  .tru-breeds[data-mode="one"] .tru-breeds__photo { inline-size: 45%; block-size: auto; aspect-ratio: auto; object-fit: cover; }
  .tru-breeds[data-mode="one"] .tru-breeds__body { flex: 1 1 auto; justify-content: center; padding: clamp(24px, 3vw, 40px); }
}

/* --- Entrance --------------------------------------------------------------
   The hidden state lives inside the query, so without the script or with
   reduced motion the cards are simply visible. */
@media (prefers-reduced-motion: no-preference) {
  .tru-breeds[data-tru-stagger] .tru-breeds__card { opacity: 0; transform: translateY(var(--tru-reveal-y, 16px)); }
  .tru-breeds[data-tru-stagger].is-visible .tru-breeds__card {
    opacity: 1; transform: none;
    transition: opacity var(--tru-motion-ms, 600ms) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 90ms),
                transform var(--tru-motion-ms, 600ms) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 90ms);
  }
}

.tru-breeds[data-hide="both"] { display: none; }
@media (max-width: 47.99em) { .tru-breeds[data-hide="mobile"] { display: none; } }
@media (min-width: 48em) { .tru-breeds[data-hide="desktop"] { display: none; } }

/* =============================================================================
   Phone carousel (added 28 Sept 2026)
   Below 48em a grid of many breeds becomes a row of cards, one centred at a
   time, running edge to edge with the neighbours fading in at the sides. The
   search box still filters: hidden cards drop out of the row and the dots.
   From 48em up this block does nothing.
   ============================================================================ */
.tru-breeds__controls { display: none; }

@media (max-width: 47.99em) {
  .tru-breeds[data-mobile="carousel"] { --br-slide: 82%; }
  .tru-breeds[data-mobile="carousel"] .tru-breeds__grid {
    display: flex; flex-wrap: nowrap; gap: 16px; position: relative;
    margin-inline: calc(var(--br-gutter, 20px) * -1);
    padding-block: 4px 8px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  }
  .tru-breeds[data-mobile="carousel"] .tru-breeds__grid::-webkit-scrollbar { display: none; }
  /* Spacers either side let the first and last cards centre. */
  .tru-breeds[data-mobile="carousel"] .tru-breeds__grid::before,
  .tru-breeds[data-mobile="carousel"] .tru-breeds__grid::after {
    content: ""; flex: 0 0 calc((100% - var(--br-slide)) / 2 - 16px);
  }
  .tru-breeds[data-mobile="carousel"] .tru-breeds__card {
    flex: 0 0 var(--br-slide); block-size: auto; scroll-snap-align: center;
  }
  .tru-breeds[data-mobile="carousel"] .tru-breeds__card[hidden] { display: none; }

  .tru-breeds[data-mobile="carousel"] .tru-breeds__controls {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-block-start: 16px;
  }
  .tru-breeds__dots { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 2px; max-inline-size: 60%; }
  .tru-breeds__dot {
    inline-size: 24px; block-size: 24px; padding: 0; border: 0; background: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: inherit;
  }
  .tru-breeds__dot[hidden] { display: none; }
  .tru-breeds__dot::before {
    content: ""; inline-size: 8px; block-size: 8px; border-radius: 999px;
    background: currentColor; opacity: 0.3; transition: inline-size 200ms ease, opacity 200ms ease;
  }
  .tru-breeds__dot.is-on::before { inline-size: 20px; opacity: 1; }
  .tru-breeds__counter { margin: 0; min-inline-size: 5.5em; text-align: center; font-weight: 700; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
  .tru-breeds__arrow, .tru-breeds__pause {
    inline-size: 36px; block-size: 36px; padding: 0; cursor: pointer; color: inherit;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1.5px solid var(--br-line, #E3E3E3); border-radius: 50%;
  }
  .tru-breeds[data-scheme="dark"] .tru-breeds__arrow, .tru-breeds[data-scheme="dark"] .tru-breeds__pause { border-color: rgba(255, 255, 255, 0.35); }
  .tru-breeds__pause { inline-size: 32px; block-size: 32px; margin-inline-start: 4px; }
  .tru-breeds__arrow:hover, .tru-breeds__pause:hover { border-color: currentColor; }
  .tru-breeds__dot:focus-visible, .tru-breeds__arrow:focus-visible, .tru-breeds__pause:focus-visible {
    outline: 2px solid currentColor; outline-offset: 2px;
  }
  .tru-breeds__play-icon { display: none; }
  .tru-breeds__pause[aria-pressed="true"] .tru-breeds__pause-icon { display: none; }
  .tru-breeds__pause[aria-pressed="true"] .tru-breeds__play-icon { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .tru-breeds__pause { display: none !important; }
}

/* Heading and text width (added 7 Oct 2026). Full width, the default, lets
   the eyebrow, heading, introduction and footnote run the width of the
   section; Reading width keeps the original narrower column. */
.tru-breeds[data-header-width="full"] .tru-breeds__header { max-inline-size: none; }
