/**
 * Node Gallery Widget Styles
 * Responsive grid gallery with rounded cards and hover effects
 * Inspired by Sweetgreen card design pattern
 */

/* Gallery Grid Layout */
.node-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

/* Empty state */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-style: italic;
  font-size: 16px;
}

/* Gallery Summary */
.gallery-summary {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

/* Gallery Card - Rounded with hover effect */
.gallery-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Card Image Section */
.gallery-card-image {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  background: #f5f5f5;
  overflow: hidden;
}

.gallery-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-card-image img {
  transform: scale(1.05);
}

/* Placeholder for items without images */
.gallery-card-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  opacity: 0.6;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Type icons within placeholder should be larger */
.gallery-card-placeholder .type-icon {
  font-size: 64px;
  opacity: 1;
}

/* Card Content Section */
.gallery-card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Badge container for type and gender badges */
.gallery-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

/* Card Title */
.gallery-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Card Age */
.gallery-card-age {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* Card Type Badge */
.gallery-card-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.gallery-card-type-badge .type-icon {
  font-size: 14px;
  display: inline-block;
  vertical-align: middle;
}

.gallery-card-type-badge.type-plant {
  background: #e8f5e8;
  color: #2e7d32;
}

.gallery-card-type-badge.type-animal {
  background: #fff3e0;
  color: #ef6c00;
}

/* Card Gender Badge */
.gallery-card-gender-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.gallery-card-gender-badge.gender-male {
  background: #e3f2fd;
  color: #1565c0;
}

.gallery-card-gender-badge.gender-female {
  background: #fce4ec;
  color: #c2185b;
}

.gallery-card-gender-badge.gender-unknown,
.gallery-card-gender-badge.gender-other {
  background: #f5f5f5;
  color: #757575;
}

/* Responsive Design */
@media (max-width: 768px) {
  .node-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  .gallery-card-title {
    font-size: 14px;
  }

  .gallery-card-age {
    font-size: 12px;
  }

  .gallery-card-placeholder {
    font-size: 48px;
  }
}

@media (max-width: 480px) {
  .node-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .gallery-card-content {
    padding: 12px;
  }
}
