/* =====================
   ROOT & RESET
   ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream: #fdf8f2;
  --warm-white: #fff9f4;
  --brown: #7a5c3e;
  --brown-light: #a07850;
  --brown-dark: #5a3e28;
  --blush: #f0dfd0;
  --sage: #8fa886;
  --text: #3d2b1a;
  --text-light: #7a6350;
  --shadow: rgba(90, 62, 40, 0.10);
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* =====================
   HEADER
   ===================== */
header {
  text-align: center;
  padding: 60px 24px 40px;
  background: var(--warm-white);
  border-bottom: 1px solid var(--blush);
}

header .paw {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: var(--brown-dark);
  font-weight: 600;
  letter-spacing: -0.5px;
}

header .tagline {
  margin-top: 10px;
  font-size: 1.05rem;
  color: var(--text-light);
  font-weight: 300;
  font-style: italic;
}

/* =====================
   MAIN GRID
   ===================== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

/* =====================
   DOG CARD
   ===================== */
.card {
  background: var(--warm-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 16px var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--blush);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(90, 62, 40, 0.16);
}

.card-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--blush);
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-photo img {
  transform: scale(1.04);
}

.card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 249, 244, 0.92);
  color: var(--brown-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
  border: 1px solid var(--blush);
}

.card-info {
  padding: 18px 20px 20px;
}

.card-info h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  color: var(--brown-dark);
  font-weight: 600;
}

.card-info p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 300;
}

/* =====================
   LIGHTBOX
   ===================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(40, 24, 10, 0.65);
  z-index: 100;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 32px 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  display: block;
  opacity: 1;
}

.lightbox-inner {
  background: var(--warm-white);
  border-radius: var(--radius);
  max-width: 820px;
  margin: 0 auto;
  padding: 40px;
  position: relative;
  border: 1px solid var(--blush);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
  padding: 4px;
}

.lightbox-close:hover { color: var(--brown-dark); }

.lightbox-header {
  margin-bottom: 16px;
}

.lightbox-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--brown-dark);
  font-weight: 600;
}

.lightbox-header p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 300;
}

.status-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 13px;
  border-radius: 99px;
}

.status-badge.adopted  { background: #e8f5e9; color: #2e7d32; }
.status-badge.available { background: #e3f2fd; color: #1565c0; }
.status-badge.foster   { background: #fff3e0; color: #e65100; }

.lightbox-bio {
  font-size: 0.97rem;
  color: var(--text-light);
  line-height: 1.75;
  margin: 20px 0 28px;
  font-style: italic;
  border-left: 3px solid var(--blush);
  padding-left: 16px;
}

.lightbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.lightbox-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--blush);
}

.lightbox-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px var(--shadow);
}

/* =====================
   FULL PHOTO OVERLAY
   ===================== */
.photo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 0, 0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.photo-overlay.open { opacity: 1; }

.photo-overlay img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

.photo-overlay-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
}

.photo-overlay-close:hover { opacity: 1; }

/* =====================
   FOOTER
   ===================== */
footer {
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-light);
  border-top: 1px solid var(--blush);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 600px) {
  .lightbox-inner { padding: 28px 20px; }
  .lightbox-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  header { padding: 44px 20px 32px; }
}
