/* Rescue records share the site's manual card rail. One family is one record. */
.rescues { background: var(--white); padding: 76px 0; }
.rescues-intro { margin-bottom: 32px; }
.rescues-rail { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; align-items: stretch; }
.rescue-card { flex: 0 0 calc((100% - 24px) / 2); min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); scroll-snap-align: start; scroll-snap-stop: always; }
.rescue-card:only-child { flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: center; gap: 44px; padding: 28px; }
.rescue-gallery, .rescue-copy { min-width: 0; }
.rescue-gallery { width: min(100%, 360px); margin-inline: auto; }
.rescue-photo { display: block; position: relative; overflow: hidden; border-radius: 9px; background: #EEECE6; cursor: zoom-in; }
.rescue-photo img, .rescue-video-thumb video { width: 100%; height: 100%; object-fit: contain; }
.rescue-photo-main { aspect-ratio: 1477 / 1108; }
.rescue-photo-main-family { aspect-ratio: 1381 / 1185; }
.rescue-photo:focus-visible { outline: 3px solid var(--turquoise-dark); outline-offset: 3px; }
.rescue-zoom { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--turquoise-dark); }
.rescue-zoom svg { width: 18px; height: 18px; }
.rescue-thumbnails { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rescue-photo-small { min-width: 0; aspect-ratio: 1; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.rescue-video-thumb { cursor: pointer; background: #172A2D; }
.rescue-video-thumb video { display: block; object-fit: cover; pointer-events: none; }
.rescue-video-play { position: absolute; inset: 50% auto auto 50%; width: 28px; height: 28px; transform: translate(-50%, -50%); display: grid; place-items: center; padding-left: 2px; border-radius: 50%; background: rgba(23,42,45,.84); color: white; font-size: 11px; line-height: 1; }
.rescue-photo-count { grid-column: 1 / -1; margin: 0; color: var(--brown-soft); font-size: 12px; white-space: nowrap; }
.rescue-photo-count-mobile { display: none; }
.rescue-copy { margin-top: 24px; }
.rescue-card:only-child .rescue-copy { margin-top: 0; }
.rescue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.rescue-kind { display: inline-flex; padding: 4px 12px; border-radius: 99px; background: var(--turquoise-pale); color: var(--turquoise-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.rescue-meta p { margin: 0; color: var(--brown-soft); font-size: 12px; white-space: nowrap; }
.rescue-meta time { margin-left: 5px; font-weight: 600; }
.rescue-copy h3 { margin: 0 0 16px; font-family: var(--font-heading); font-size: clamp(24px, 2.5vw, 32px); line-height: 1.5; }
.rescue-description { margin: 0; color: var(--brown-soft); font-size: 14px; line-height: 1.9; text-wrap: pretty; }
.rescue-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.rescue-facts div { min-width: 0; }
.rescue-facts dt { color: var(--brown-soft); font-size: 12px; }
.rescue-facts dd { margin: 3px 0 0; font-size: 17px; font-weight: 700; white-space: nowrap; }
.rescue-age-note { margin: 8px 0 18px; color: var(--brown-soft); font-size: 11px; }
.rescue-adoption { margin: 0 0 14px; padding: 11px 13px; border-left: 3px solid var(--yellow); border-radius: 0 8px 8px 0; background: #FFFCF2; }
.rescue-adoption p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 0; color: var(--brown); font-size: 13px; font-weight: 700; line-height: 1.65; }
.rescue-adoption-label { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: #F4EACF; color: var(--brown); font-size: 10px; letter-spacing: .08em; white-space: nowrap; }
.rescue-adoption a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; margin-top: 3px; color: var(--turquoise-dark); font-size: 12px; font-weight: 700; }
.rescue-adoption a:hover, .rescue-adoption a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.rescue-support-link { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; color: var(--turquoise-dark); font-size: 14px; font-weight: 700; }
.rescue-support-link:hover, .rescue-support-link:focus-visible { text-decoration: underline; text-underline-offset: 5px; }
.rescues-rail + .card-rail-controls[hidden] { display: none; }

/* Native dialog keeps focus inside the gallery and supports Escape. */
.rescue-lightbox { width: min(100% - 24px, 1080px); max-width: none; height: min(92dvh, 1050px); max-height: calc(100dvh - 24px); padding: 18px; border: 0; border-radius: 12px; background: #172A2D; color: white; overflow: hidden; }
.rescue-lightbox::backdrop { background: rgba(10,20,22,.85); }
.rescue-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.rescue-lightbox.is-video { inset-block: auto; top: 50%; height: auto; min-height: 0; transform: translateY(-50%); }
.rescue-lightbox.is-video[open] { display: block; }
.rescue-lightbox.is-video .rescue-lightbox-top { margin-bottom: 12px; }
.rescue-lightbox.is-video .rescue-lightbox-figure { display: block; }
.rescue-lightbox.is-video .rescue-lightbox-caption { margin-top: 10px; }
.rescue-lightbox.is-video .rescue-lightbox-bottom { margin-top: 12px; }
.rescue-lightbox-top, .rescue-lightbox-bottom { display: flex; align-items: center; gap: 12px; }
.rescue-lightbox-title { margin: 0; flex: 1; font-size: 14px; font-weight: 600; }
.rescue-lightbox button { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #9BAFAF; border-radius: 50%; background: transparent; color: white; font-size: 23px; cursor: pointer; }
.rescue-lightbox button:hover, .rescue-lightbox button:focus-visible { background: white; color: #172A2D; outline: 2px solid var(--yellow); outline-offset: 3px; }
.rescue-lightbox button:disabled { opacity: .35; cursor: default; }
.rescue-lightbox-figure { min-height: 0; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
.rescue-lightbox-image, .rescue-lightbox-video { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.rescue-lightbox-video { align-self: center; height: auto; max-height: 100%; background: #000; }
.rescue-lightbox-image[hidden], .rescue-lightbox-video[hidden] { display: none; }
.rescue-lightbox-caption { margin: 0; color: #EDF6F6; font-size: 13px; text-align: center; }
.rescue-lightbox-bottom { justify-content: center; }
.rescue-lightbox-count { min-width: 60px; text-align: center; font-size: 13px; }
body.rescue-gallery-open { overflow: hidden; }

/* Added navigation must still fit the existing desktop header. */
@media (min-width: 901px) and (max-width: 1200px) {
  .header-inner { gap: 18px; }
  .desktop-nav { gap: 16px; }
  .desktop-nav a { font-size: 12px; white-space: nowrap; }
  .header-contact { padding-inline: 12px; font-size: 12px; white-space: nowrap; }
}
@media (max-width: 900px) {
  .rescue-card:only-child { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 24px; padding: 22px; }
  .rescue-card { flex-basis: calc(100% - 40px); }
}
@media (max-width: 600px) {
  .rescues { padding: 52px 0; }
  .rescues-intro { display: block; margin-bottom: 24px; }
  .rescues-intro .section-label { margin-bottom: 12px; font-size: 10px; }
  .rescues-intro h2 { font-size: 27px; }
  .rescues-intro > p { margin: 12px 0 0; font-size: 13px; }
  .rescues-rail { gap: 14px; }
  .rescue-card, .rescue-card:only-child { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 18px; }
  .rescue-gallery { width: min(100%, 300px); display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: start; gap: 8px; }
  .rescue-thumbnails { display: flex; flex-direction: column; gap: 6px; margin-top: 0; }
  .rescue-photo-small { flex-basis: 48px; height: 48px; }
  .rescue-photo-small { width: 48px; }
  .rescue-photo-count { margin-left: 0; font-size: 10px; line-height: 1.2; }
  .rescue-photo-count-desktop { display: none; }
  .rescue-photo-count-mobile { display: inline; white-space: nowrap; }
  .rescue-card .rescue-copy, .rescue-card:only-child .rescue-copy { margin-top: 20px; }
  .rescue-meta { gap: 8px 12px; margin-bottom: 12px; }
  .rescue-kind, .rescue-meta p { font-size: 11px; }
  .rescue-copy h3 { margin-bottom: 10px; font-size: 24px; }
  .rescue-description { font-size: 13px; line-height: 1.85; }
  .rescue-facts { margin-top: 16px; padding-top: 12px; gap: 10px; }
  .rescue-facts dd { font-size: 15px; }
  .rescue-age-note { margin-bottom: 12px; }
  .rescue-adoption { margin-bottom: 10px; padding: 9px 10px; }
  .rescue-adoption p { font-size: 12px; }
  .rescue-adoption a { min-height: 30px; font-size: 11px; }
  .rescue-support-link { gap: 8px; font-size: 13px; }
  .rescue-lightbox { padding: 12px; }
  .rescue-lightbox-title, .rescue-lightbox-caption { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .rescues-rail { scroll-behavior: auto; }
}
