/* ============================================================
   CAC ShelterLuv – Carousel Styles
   Extends the pet-card base styles from the CAC theme.
   ============================================================ */

/* ── Carousel wrapper ──────────────────────────────────────── */
.pets-carousel {
  position: relative;
  /* Negative margin to allow the prev/next buttons to sit outside the track
     without creating overflow on the section. */
  margin-inline: -2.5rem;
  padding-inline: 2.5rem;
}

@media (max-width: 767px) {
  .pets-carousel {
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
  }
}

/* ── Scrollable track ──────────────────────────────────────── */
.pets-carousel__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  padding-block: 0.5rem; /* room for card hover shadow */
}

.pets-carousel__track::-webkit-scrollbar {
  display: none;
}

/* ── Individual cards inside the carousel ─────────────────── */
.pets-carousel .pet-card {
  flex: 0 0 calc(25% - 0.75rem); /* 4 visible on desktop */
  scroll-snap-align: start;
  min-width: 0;
}

@media (max-width: 1023px) {
  .pets-carousel .pet-card {
    flex: 0 0 calc(50% - 0.5rem); /* 2 visible on tablet */
  }
}

@media (max-width: 639px) {
  .pets-carousel .pet-card {
    flex: 0 0 calc(80%); /* ~1 visible on mobile, peek at next */
  }
}

/* ── Card link (wraps entire card content) ─────────────────── */
.pet-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.pet-card__link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ── Photo placeholder (no image from API) ─────────────────── */
.pet-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
  color: var(--color-border);
  aspect-ratio: 4/3;
  width: 100%;
}

/* ── Prev / Next buttons ───────────────────────────────────── */
.pets-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.pets-carousel__btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
}

.pets-carousel__btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.pets-carousel__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pets-carousel__btn--prev { left: 0; }
.pets-carousel__btn--next { right: 0; }

/* ── Admin-only error / empty notices ──────────────────────── */
.cac-sl-admin-notice {
  padding: 0.75rem 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: #856404;
}

.cac-sl-empty {
  text-align: center;
  color: var(--color-text-mid);
  font-size: 0.9375rem;
  padding: 2rem 0;
}
