.cats-section {
  padding: 2rem 2vmax;
  max-width: 120rem;
  margin: 0 auto;
}

.cats-header {
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
  margin-bottom: 2rem;
}

.cats-header h1 {
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.light .cats-header h1 {
  color: var(--green-light);
}

.cats-header p {
  font-size: 1.2rem;
  color: var(--fg-dark);
  opacity: 0.7;
  font-weight: 300;
}

.light .cats-header p {
  color: var(--fg-light);
}

/* Neat masonry-style grid with varied sizes */
.cats-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  grid-auto-rows: 280px;
  gap: 1.5rem;
  padding: 1rem 0;
}

/* Different card sizes for varied layout */
.cat-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--gray-dark);
}

.light .cat-card {
  background: var(--bg-light);
  border: 1px solid rgba(93, 68, 131, 0.1);
}

/* Large cards take up more space */
.cat-card.large {
  grid-row: span 2;
  grid-column: span 1;
}

.cat-card.medium {
  grid-row: span 1;
  grid-column: span 1;
}

.cat-card.small {
  grid-row: span 1;
  grid-column: span 1;
}

.cat-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.cat-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-card:hover .cat-overlay {
  transform: translateY(0);
}

.cat-card:hover .cat-image img {
  transform: scale(1.1);
}

.cat-info h3 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cat-info p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  font-size: 0.9rem;
  font-weight: 300;
}

/* Modal styles */
.cat-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  margin: auto;
  padding: 0;
  width: 90%;
  max-width: 800px;
  background: var(--bg-dark);
  border-radius: 12px;
  overflow: hidden;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light .modal-content {
  background: var(--bg-light);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: var(--fg-dark);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s ease;
}

.light .modal-close {
  color: var(--fg-light);
}

.modal-close:hover {
  color: var(--green-dark);
}

.light .modal-close:hover {
  color: var(--green-light);
}

#modal-image {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: cover;
}

.modal-info {
  padding: 2rem;
}

.modal-info h3 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--blue-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.light .modal-info h3 {
  color: var(--blue-light);
}

.modal-info p {
  color: var(--fg-dark);
  line-height: 1.6;
  font-size: 1.1rem;
}

.light .modal-info p {
  color: var(--fg-light);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive design */
@media (max-width: 1200px) {
  .cats-gallery {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    grid-auto-rows: 250px;
  }
}

@media (max-width: 1024px) {
  .cats-gallery {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 220px;
  }
}

@media (max-width: 768px) {
  .cats-section {
    padding: 1rem 1rem;
  }

  .cats-header h1 {
    font-size: 2.5rem;
  }

  .cats-gallery {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 200px;
    gap: 1rem;
  }

  .cat-overlay {
    padding: 1.5rem 1rem 1rem;
  }

  .cat-info h3 {
    font-size: 1.2rem;
  }

  .modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .modal-info {
    padding: 1.5rem;
  }

  .modal-info h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .cats-header h1 {
    font-size: 2rem;
  }

  .cats-header p {
    font-size: 1rem;
  }

  .cats-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
    gap: 1rem;
  }

  .cat-overlay {
    padding: 1rem 0.8rem 0.8rem;
  }

  .cat-info h3 {
    font-size: 1rem;
  }

  .cat-info p {
    font-size: 0.8rem;
  }
}
