/* ==============================================
   PetFi Rescue Page Styles
   Hero, photo carousel, badges, feature cards,
   story, foundation card, CTA, and donate modal
   ============================================== */

/* ==============================================
   RESCUE PAGE - Hero Section
   ============================================== */

.rescue-hero {
  position: relative;
  background: #1a1a1a;
}

/* Carousel container */
.rescue-hero__carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 400px;
  max-height: 70vh;
}

/* Individual slides */
.rescue-hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  pointer-events: none;
}

.rescue-hero__slide--active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

/* Blurred background image */
.rescue-hero__bg-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(30px);
  transform: scale(1.2);
  opacity: 0.6;
}

/* Main image - maintains aspect ratio */
.rescue-hero__image {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Navigation arrows */
.rescue-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.rescue-hero__arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.rescue-hero__arrow--prev {
  left: 16px;
}

.rescue-hero__arrow--next {
  right: 16px;
}

/* Dots indicator */
.rescue-hero__dots {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 20px;
}

.rescue-hero__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.rescue-hero__dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.rescue-hero__dot--active {
  background: white;
  transform: scale(1.2);
}

/* On mobile, smaller arrows */
@media (max-width: 767.98px) {
  .rescue-hero__carousel {
    max-height: 60vh;
    min-height: 350px;
  }
  
  .rescue-hero__image {
    max-height: 60vh;
  }
  
  .rescue-hero__arrow {
    width: 40px;
    height: 40px;
  }
  
  .rescue-hero__arrow--prev {
    left: 8px;
  }
  
  .rescue-hero__arrow--next {
    right: 8px;
  }
  
  .rescue-hero__dots {
    bottom: 90px;
    gap: 8px;
    padding: 6px 12px;
  }
  
  .rescue-hero__dot {
    width: 8px;
    height: 8px;
  }
}

.rescue-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(0, 0, 0, 0.1) 70%,
    transparent 100%
  );
  pointer-events: none;
}

.rescue-hero__content {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
}

@media (min-width: 768px) {
  .rescue-hero__content {
    padding: 40px;
  }
}

.rescue-hero__title {
  font-weight: 900;
  color: white;
  font-size: clamp(32px, 6vw, 56px);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.rescue-hero__floating-btn {
  position: absolute;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.rescue-hero__floating-btn:hover {
  transform: scale(1.1);
}

.rescue-hero__floating-btn--back {
  top: 16px;
  left: 16px;
}

.rescue-hero__floating-btn--share {
  top: 16px;
  right: 16px;
}

/* ==============================================
   RESCUE PAGE - Photo Carousel
   ============================================== */

.photo-carousel {
  position: relative;
  padding: 0 16px;
  margin-top: -64px;
  z-index: 10;
}

@media (min-width: 768px) {
  .photo-carousel {
    padding: 0 40px;
  }
}

.photo-carousel__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

.photo-carousel__item {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  scroll-snap-align: start;
}

.photo-carousel__item:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--petfi-purple-500);
}

.photo-carousel__item--active {
  box-shadow: 0 0 0 2px var(--petfi-purple-500);
}

.photo-carousel__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==============================================
   RESCUE PAGE - Badges
   ============================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.badge-glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: white;
}

.badge-urgent {
  background: rgba(249, 115, 22, 0.9);
  color: white;
}

.badge-purple {
  background: var(--gradient-purple-light);
  color: var(--petfi-purple-600);
  border: 1px solid var(--petfi-purple-200);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ==============================================
   RESCUE PAGE - Feature Cards
   ============================================== */

/* Feature chips - horizontal pill style */
.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 50px;
  background: white;
  border: 2px solid var(--petfi-purple-100);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}

.feature-chip:hover {
  border-color: var(--petfi-purple-300);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
  transform: translateY(-2px);
}

.feature-chip__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--petfi-purple-50) 0%, var(--petfi-purple-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-chip__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-chip__label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature-chip__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}

/* ==============================================
   RESCUE PAGE - Story Section
   ============================================== */

.story-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.story-card__quote-icon {
  margin-bottom: 12px;
  color: var(--petfi-purple-600);
}

.story-card__text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-600);
}

.story-read-more:hover,
.story-read-less:hover {
  color: var(--petfi-purple-700) !important;
  text-decoration: underline;
}

.story-card__content {
  position: relative;
}

/* ==============================================
   RESCUE PAGE - Foundation Card (dark style for rescue detail page)
   ============================================== */

.rescue-foundation-card {
  display: block;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 2px solid var(--petfi-purple-100);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
  text-decoration: none;
}

.rescue-foundation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
  border-color: var(--petfi-purple-200);
}

.rescue-foundation-card__inner {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.rescue-foundation-card__logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--petfi-purple-200);
  background: white;
}

.rescue-foundation-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rescue-foundation-card__logo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--petfi-purple-100) 0%, var(--petfi-purple-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--petfi-purple-600);
  font-size: 22px;
  font-weight: 700;
}

.rescue-foundation-card__verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--petfi-green);
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rescue-foundation-card__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
}

.rescue-foundation-card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

/* ==============================================
   RESCUE PAGE - CTA Section
   ============================================== */

.cta-container {
  background: var(--gradient-purple);
  border-radius: var(--radius-2xl);
  padding: 20px;
  box-shadow: var(--shadow-purple-lg);
}

.cta-container__title {
  text-align: center;
  color: white;
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: 16px;
}

.cta-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 24px;
  background: white;
  color: var(--gray-900);
  font-size: var(--font-size-base);
  font-weight: 700;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 12px;
}

.cta-btn-primary:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.cta-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.cta-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==============================================
   DONATE MODAL
   ============================================== */

.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.donate-modal--open {
  pointer-events: auto;
  opacity: 1;
}

.donate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.donate-modal__content {
  position: relative;
  background: white;
  border-radius: var(--radius-2xl);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.donate-modal--open .donate-modal__content {
  transform: scale(1) translateY(0);
}

.donate-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all var(--transition-fast);
}

.donate-modal__close:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.donate-modal__body {
  padding-top: 8px;
}

/* /rescatado/{slug} hero layout — Jaspr inline style sets
   grid-template-columns: 1.15fr 1fr unconditionally, which on mobile
   crushes both the gallery and the info panel into ~50% columns and
   the photo renders as a small thumbnail. Override to stack on mobile. */
@media (max-width: 767.98px) {
  .detail-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}
