.dog-gallery {
  background: #f4eee6;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
}

.dog-gallery .main-image {
  inset: auto;
  min-height: 390px;
  overflow: hidden;
  position: relative;
}

.gallery-stage {
  background: #ece4da;
  border: 0;
  cursor: zoom-in;
  display: block;
  height: 100%;
  inset: 0;
  padding: 0;
  position: absolute;
  width: 100%;
  touch-action: pan-y;
  user-select: none;
}

.dog-gallery .gallery-stage img {
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.25s ease;
  width: 100%;
}

.dog-gallery .gallery-stage img.is-loaded { opacity: 1; }

.gallery-stage:hover img { transform: scale(1.025); }

.gallery-expand,
.gallery-count {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(22, 38, 31, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  bottom: 14px;
  color: #fff;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.gallery-expand { left: 14px; min-width: 32px; padding: 0; }
.gallery-count { right: 14px; }

.gallery-arrow {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  color: #173d2d;
  cursor: pointer;
  display: flex;
  font-size: 2rem;
  height: 42px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  width: 42px;
  z-index: 5;
}

.gallery-arrow:hover { background: #eb562f; color: #fff; transform: translateY(-50%) scale(1.06); }
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-thumbnails {
  display: grid;
  gap: 8px;
  grid-auto-columns: minmax(64px, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 10px;
  scrollbar-width: thin;
}

.gallery-thumbnails button {
  aspect-ratio: 1.25;
  background: #fff;
  border: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.gallery-thumbnails button:hover { transform: translateY(-2px); }
.gallery-thumbnails button.is-active { border-color: #eb562f; }
.gallery-thumbnails img { display: block; height: 100%; object-fit: cover; width: 100%; }

.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox {
  align-items: center;
  background: rgba(8, 16, 13, 0.94);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 70px 90px 45px;
  position: fixed;
  z-index: 12000;
}

body.gallery-open { overflow: hidden; }
.gallery-lightbox figure { margin: 0; max-height: 100%; max-width: min(1100px, 100%); text-align: center; touch-action: pan-y; user-select: none; }
.gallery-lightbox figure img { border-radius: 12px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45); max-height: calc(100vh - 145px); max-width: 100%; object-fit: contain; }
.gallery-lightbox figcaption { color: #fff; font-size: 0.9rem; font-weight: 700; margin-top: 12px; }
.gallery-lightbox-close,
.gallery-lightbox-arrow {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: center;
  position: absolute;
}
.gallery-lightbox-close { font-size: 2rem; height: 46px; right: 24px; top: 20px; width: 46px; }
.gallery-lightbox-arrow { font-size: 3rem; height: 58px; top: 50%; transform: translateY(-50%); width: 58px; }
.gallery-lightbox-prev { left: 20px; }
.gallery-lightbox-next { right: 20px; }
.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover { background: #eb562f; }

.dog-contact-actions {
  margin-top: 1.25rem;
}

.dog-contact-actions[hidden] { display: none !important; }

.dog-contact-link {
  align-items: center;
  background: #eb562f;
  border: 2px solid #eb562f;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(235, 86, 47, 0.22);
  color: #fff;
  display: inline-flex !important;
  font-size: 0.95rem;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dog-contact-link > span:last-child {
  font-size: 1.25rem;
  line-height: 1;
  margin-left: 0.65rem;
}

.dogs-section .dog-card {
  scroll-margin-top: 100px;
}

.dogs-section .dog-card.is-targeted {
  box-shadow: 0 0 0 4px rgba(235, 86, 47, 0.28), 0 18px 44px rgba(33, 33, 33, 0.18);
}

.dog-contact-link:hover,
.dog-contact-link:focus-visible {
  background: #cf4321;
  border-color: #cf4321;
  box-shadow: 0 10px 24px rgba(207, 67, 33, 0.3);
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .dog-gallery .main-image { height: 430px; min-height: 430px; }
  .gallery-lightbox { padding: 65px 55px 35px; }
}

@media (max-width: 600px) {
  .dog-gallery .main-image { height: 380px; min-height: 380px; }
  .gallery-arrow { height: 38px; width: 38px; }
  .gallery-prev { left: 10px; }
  .gallery-next { right: 10px; }
  .gallery-thumbnails { grid-auto-columns: 76px; }
  .gallery-lightbox { padding: 62px 12px 30px; }
  .gallery-lightbox-arrow { height: 44px; top: auto; bottom: 22px; width: 44px; }
  .gallery-lightbox-prev { left: 18px; }
  .gallery-lightbox-next { right: 18px; }
  .gallery-lightbox figure img { max-height: calc(100vh - 165px); }
  .dog-contact-actions { margin-top: 1rem; }
  .dog-contact-link { display: flex; width: 100%; }
}
