/* Breed profile window on the Breeds page. */
.breed-profile-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(90dvh, 960px);
  padding: 0;
  border: 1px solid #e1e6da;
  border-radius: 24px;
  background: #fffefa;
  color: var(--ink, #10251f);
  box-shadow: 0 28px 90px rgba(11, 51, 42, .28);
  overscroll-behavior: contain;
}

.breed-profile-dialog::backdrop {
  background: rgba(24, 62, 50, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

body:has(.breed-profile-dialog[open]) {
  overflow: hidden;
}

.bp-close {
  position: sticky;
  top: 12px;
  z-index: 3;
  float: right;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 12px 12px -56px 0;
  padding: 0;
  border: 1px solid #d9e2d2;
  border-radius: 50%;
  background: #fffefa;
  color: #244b35;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.bp-close:hover {
  background: #f1f4ea;
}

.breed-profile-dialog :focus-visible {
  outline: 3px solid var(--gold-accent, #d8b85a);
  outline-offset: 2px;
}

.bp-header {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 32px 72px 28px 32px;
  background: #edf1e5;
}

.bp-image {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
}

.bp-eyebrow {
  margin: 0 0 8px;
  color: #4e6b58;
  font-family: var(--font-ui, sans-serif);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.bp-heading h2 {
  margin: 0 0 10px;
  color: var(--forest, #0b332a);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
  outline: none;
  overflow-wrap: anywhere;
}

.bp-summary {
  margin: 0 0 14px;
  color: #3f5a4b;
  font-size: 16px;
  line-height: 1.6;
}

.bp-lifespan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
}

.bp-lifespan-value {
  padding: 6px 14px;
  border: 1px solid rgba(185, 145, 53, .35);
  border-radius: 999px;
  background: #fbf3dc;
  color: var(--gold-text, #785c1f);
  font-family: var(--font-ui, sans-serif);
  font-size: 16px;
  font-weight: 800;
}

.bp-lifespan-kind {
  color: #4e6b58;
  font-size: 14px;
}

.bp-content {
  padding: 26px 32px 30px;
}

.bp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.bp-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bp-actions svg {
  width: 19px;
  height: 19px;
}

.bp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.bp-stat {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--forest, #0b332a);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bp-stat span {
  color: #50654f;
  font-size: 13px;
  font-weight: 600;
}

/* Quick facts: size, daily exercise, coat care and loose fur, first thing. */
.bp-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.bp-fact {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f2f5ec;
}

.bp-fact dt {
  color: #50654f;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.bp-fact dd {
  margin: 0;
  color: #1f4535;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* The homepage card shows the same facts, smaller, two by two. */
.bp-facts--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.bp-facts--compact .bp-fact {
  padding: 8px 10px;
  border-radius: 12px;
}

.bp-facts--compact .bp-fact dt {
  font-size: 11.5px;
}

.bp-facts--compact .bp-fact dd {
  font-size: 14px;
}

/* "Explore all breeds" on the homepage, where the heart would be. */
.bp-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #c9d6c1;
  border-radius: 999px;
  background: #f2f5ec;
  color: #244e3c;
  font-weight: 800;
  text-decoration: none;
}

.bp-link:hover {
  background: #e8efe0;
}

.bp-variety-note {
  margin: 16px 0 0;
  color: #50654f;
  font-size: 14px;
  line-height: 1.6;
}

.bp-glance {
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e6da;
}

.bp-health {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(185, 145, 53, .28);
  border-left: 5px solid var(--gold-accent, #d8b85a);
  border-radius: 18px;
  background: #fffaf0;
}

.bp-health h3,
.bp-glance h3,
.bp-life h3 {
  margin: 0 0 14px;
  color: var(--forest, #0b332a);
  font-size: 20px;
  line-height: 1.2;
}

.bp-health-grid,
.bp-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}

.bp-life {
  margin-top: 28px;
}

.bp-topic h4 {
  margin: 0 0 6px;
  color: #244e3c;
  font-family: var(--font-ui, sans-serif);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.bp-topic p {
  margin: 0;
  color: #44584e;
  font-size: 16px;
  line-height: 1.65;
}

/* Closes Health & aging, below the two health topics. */
.bp-good-to-know {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(185, 145, 53, .25);
}

.bp-vet-note {
  margin: 16px 0 0;
  color: #5c5236;
  font-size: 14px;
  line-height: 1.5;
}

/* "More info": one tap opens size, care, everyday life and sources. */
.bp-content .bp-more > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  min-height: 56px;
  padding: 12px 52px 12px 18px;
  position: relative;
  border: 1px solid #d9e2d2;
  border-radius: 16px;
  background: #f2f5ec;
  color: #244e3c;
  font-size: 17px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

/* Scrolled into view below the close button, which stays at the top. */
.bp-content .bp-more > summary {
  scroll-margin-top: 68px;
}

.bp-content .bp-more > summary::-webkit-details-marker {
  display: none;
}

.bp-content .bp-more > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s;
}

.bp-content .bp-more[open] > summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.bp-content .bp-more > summary:hover {
  background: #e8efe0;
}

.bp-more-hint {
  color: #50654f;
  font-size: 14px;
  font-weight: 600;
}

.bp-more-body {
  padding-top: 22px;
}

.bp-sources {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e3e8dd;
  color: #4f6455;
  font-size: 15px;
  line-height: 1.65;
}

.bp-content .bp-sources > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #244e3c;
  font-weight: 700;
  cursor: pointer;
}

.bp-content .bp-sources[open] > summary {
  margin-bottom: 10px;
}

.bp-sources-body strong {
  display: block;
  margin: 12px 0 4px;
  color: #244e3c;
}

.bp-sources-body p {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.bp-sources-body a {
  color: #28583e;
  overflow-wrap: anywhere;
}

.bp-sources-body > a {
  display: block;
  margin: 6px 0;
}

.bp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bp-caveat {
  margin: 20px 0 0;
  color: #50654f;
  font-size: 14px;
  line-height: 1.6;
}

.bp-status {
  margin: 18px 0;
  color: #50654f;
  font-size: 15px;
}

/* Previous and next breed, always in reach at the foot of the window. */
.bp-step {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e3e8dd;
  background: #fffefa;
}

.bp-step-btn {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  max-width: calc(50% - 5px);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d9e2d2;
  border-radius: 999px;
  background: #fffefa;
  color: #244e3c;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.bp-step-btn:hover:not(:disabled) {
  background: #f1f4ea;
}

.bp-step-btn:disabled {
  opacity: .45;
  cursor: default;
}

.bp-step-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-step-arrow {
  flex: none;
  font-size: 22px;
  line-height: 1;
}

.bp-retry {
  min-height: 44px;
  margin-left: 6px;
  padding: 0 16px;
  border: 1px solid #c9d6c1;
  border-radius: 999px;
  background: #f2f5ec;
  color: #244e3c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 760px) {
  .breed-profile-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  /* On phones the description flows around the picture instead of squeezing beside it. */
  .bp-header {
    display: flow-root;
    padding: 20px 18px;
  }

  .bp-image {
    float: left;
    width: 96px;
    height: 104px;
    margin: 0 14px 8px 0;
  }

  .bp-heading h2 {
    margin-right: 46px;
  }

  .bp-eyebrow {
    font-size: 11px;
  }

  .bp-content {
    padding: 20px 18px 24px;
  }

  .bp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-health-grid,
  .bp-topics {
    grid-template-columns: 1fr;
  }

  .bp-step {
    padding-right: 12px;
    padding-left: 12px;
  }

  .bp-health {
    padding: 18px 16px;
  }

  .bp-content .bp-more > summary {
    padding-left: 16px;
  }
}

@media (max-width: 599.98px) {
  .bp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-content .bp-more > summary::after {
    transition: none;
  }
}
