/* ==================== GALLERY STYLES ==================== */

.gallery-hero {
  padding: 120px 0 60px;
  background: linear-gradient(135deg, #F5F3EF 0%, #E8E4DF 100%);
  border-bottom: 1px solid rgba(226, 114, 91, 0.1);
}

.gallery-hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 48px;
}

.gallery-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
  color: #2E3A59;
}

.gallery-description {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #5E6B87;
  margin-bottom: 0;
}

/* Gallery Controls */
.gallery-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #5E6B87;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid #E8E4DF;
  border-radius: 12px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  background: white;
}

.search-box input:focus {
  outline: none;
  border-color: #E2725B;
  box-shadow: 0 0 0 4px rgba(226, 114, 91, 0.1);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-label {
  font-weight: 600;
  color: #2E3A59;
  font-size: 14px;
}

#sortSelect {
  padding: 12px 40px 12px 16px;
  border: 2px solid #E8E4DF;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: #2E3A59;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%232E3A59' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

#sortSelect:hover {
  border-color: #E2725B;
}

#sortSelect:focus {
  outline: none;
  border-color: #E2725B;
  box-shadow: 0 0 0 4px rgba(226, 114, 91, 0.1);
}

/* Gallery Section */
.gallery-section {
  padding: 80px 0;
  background: #F5F3EF;
  min-height: 600px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.quilt-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.quilt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.quilt-image-container {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background: #E8E4DF;
  overflow: hidden;
}

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

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

.quilt-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quilt-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2E3A59;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quilt-creator {
  font-size: 0.875rem;
  color: #5E6B87;
  margin-bottom: 12px;
  font-weight: 500;
}

.quilt-description {
  font-size: 0.875rem;
  color: #5E6B87;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.quilt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(226, 114, 91, 0.1);
  color: #E2725B;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

.quilt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #E8E4DF;
}

.quilt-likes {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #E2725B;
  font-weight: 600;
  font-size: 0.875rem;
}

.quilt-likes svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.quilt-date {
  font-size: 0.75rem;
  color: #5E6B87;
}

/* Loading, Error, and Empty States */
.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #E8E4DF;
  border-top-color: #E2725B;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p,
.error-state p,
.empty-state p {
  color: #5E6B87;
  font-size: 1.125rem;
  margin-top: 16px;
}

.error-state h3,
.empty-state h3 {
  color: #2E3A59;
  font-size: 1.5rem;
  margin-top: 16px;
  margin-bottom: 8px;
}

.error-state svg,
.empty-state svg {
  margin: 0 auto;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, #E2725B 0%, #c85a46 100%);
  padding: 80px 0;
  text-align: center;
}

.cta-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
}

.cta-content p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
}

.cta-content .btn-primary {
  background: white;
  color: #E2725B;
}

.cta-content .btn-primary:hover {
  background: #F5F3EF;
  transform: translateY(-2px);
}

/* Quilt Actions (Calculator & Pinterest buttons) */
.quilt-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 1; /* Always visible for now - change to 0 for hover-only */
  transition: opacity 0.3s ease;
}

.quilt-card:hover .quilt-actions {
  opacity: 1;
}

/* Calculator Button */
.calculator-btn {
  background: #7B68EE;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.calculator-btn:hover {
  transform: scale(1.1);
  background: #6A5ACD;
}

/* Pinterest Hover Button */
.pinterest-share {
  background: #E60023;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pinterest-share:hover {
  transform: scale(1.1);
  background: #c7001e;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-hero {
    padding: 80px 0 40px;
  }
  
  .gallery-title {
    font-size: 2rem;
  }
  
  .gallery-description {
    font-size: 1rem;
  }
  
  .gallery-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: 100%;
  }
  
  .sort-controls {
    justify-content: space-between;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
  }
  
  /* Show action buttons always on mobile */
  .quilt-actions {
    opacity: 1;
  }
  
  .calculator-btn,
  .pinterest-share {
    width: 36px;
    height: 36px;
  }
  
  .cta-content h2 {
    font-size: 2rem;
  }
  
  .cta-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Active nav link */
.nav-links a.active {
  color: #E2725B;
  font-weight: 600;
}

/* Logo link */
.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

