/**
 * Height Work Gallery Component - RomaPaint
 * Showcase professional painting work at heights
 * Fully responsive with overlay effects
 */

/* ============================================
   GALLERY SECTION
   ============================================ */

.height-work-section {
  position: relative;
  padding: 4rem 1rem;
  background: linear-gradient(135deg, #FAFAF9 0%, #F7F5F3 100%);
  overflow: hidden;
}

@media (min-width: 768px) {
  .height-work-section {
    padding: 5rem 2rem;
  }
}

@media (min-width: 1024px) {
  .height-work-section {
    padding: 6rem 2rem;
  }
}

/* Background Pattern */
.height-work-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(155, 139, 126, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 139, 126, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

/* ============================================
   GALLERY HEADER
   ============================================ */

.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .gallery-header {
    margin-bottom: 4rem;
  }
}

.gallery-badge {
  display: inline-block;
  background: rgba(155, 139, 126, 0.1);
  color: #9B8B7E;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid rgba(155, 139, 126, 0.2);
}

@media (min-width: 768px) {
  .gallery-badge {
    font-size: 0.875rem;
    padding: 0.625rem 1.5rem;
  }
}

.gallery-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1C1917;
  margin-bottom: 1rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .gallery-title {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .gallery-title {
    font-size: 3.5rem;
  }
}

.gallery-subtitle {
  font-size: 1rem;
  color: #78716C;
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .gallery-subtitle {
    font-size: 1.125rem;
  }
}

@media (min-width: 1024px) {
  .gallery-subtitle {
    font-size: 1.25rem;
  }
}

/* ============================================
   GALLERY GRID - Responsive
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

/* ============================================
   GALLERY ITEM CARD
   ============================================ */

.gallery-item {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(155, 139, 126, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: #FFFFFF;
  cursor: pointer;
  aspect-ratio: 4 / 5;
}

@media (min-width: 768px) {
  .gallery-item {
    aspect-ratio: 3 / 4;
  }
}

@media (min-width: 1024px) {
  .gallery-item {
    aspect-ratio: 1 / 1;
  }
}

/* Hover Effect */
.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(155, 139, 126, 0.25);
}

/* Active State */
.gallery-item:active {
  transform: translateY(-4px) scale(1.01);
}

/* ============================================
   IMAGE
   ============================================ */

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

.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}

/* ============================================
   OVERLAY
   ============================================ */

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(28, 25, 23, 0.9) 0%,
    rgba(28, 25, 23, 0.5) 50%,
    rgba(28, 25, 23, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .gallery-overlay {
    padding: 2rem;
  }
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* ============================================
   OVERLAY CONTENT
   ============================================ */

.overlay-content {
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.gallery-item:hover .overlay-content {
  transform: translateY(0);
}

.overlay-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .overlay-title {
    font-size: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .overlay-title {
    font-size: 1.75rem;
  }
}

.overlay-description {
  font-size: 0.875rem;
  color: #E7E5E4;
  margin-bottom: 1rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .overlay-description {
    font-size: 1rem;
  }
}

/* ============================================
   OVERLAY FEATURES
   ============================================ */

.overlay-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(212, 165, 116, 0.2);
  border: 1px solid rgba(212, 165, 116, 0.4);
  color: #D4A574;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
  .feature-tag {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

.feature-icon {
  font-size: 0.875rem;
}

/* ============================================
   ICON BADGE (Top Right)
   ============================================ */

.gallery-icon-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .gallery-icon-badge {
    width: 56px;
    height: 56px;
  }
}

.gallery-item:hover .gallery-icon-badge {
  transform: scale(1.1) rotate(10deg);
  background: rgba(212, 165, 116, 0.95);
}

.gallery-icon-badge i {
  font-size: 1.25rem;
  color: #9B8B7E;
  transition: color 0.3s ease;
}

@media (min-width: 768px) {
  .gallery-icon-badge i {
    font-size: 1.5rem;
  }
}

.gallery-item:hover .gallery-icon-badge i {
  color: #FFFFFF;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.gallery-item {
  opacity: 0;
  animation: fadeInScale 0.6s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Disable animations on mobile for performance */
@media (max-width: 767px) {
  .gallery-item {
    animation: none;
    opacity: 1;
  }
}

/* ============================================
   CTA SECTION
   ============================================ */

.gallery-cta {
  text-align: center;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .gallery-cta {
    margin-top: 4rem;
  }
}

.gallery-cta-text {
  font-size: 1rem;
  color: #78716C;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .gallery-cta-text {
    font-size: 1.125rem;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
.gallery-item:focus-visible {
  outline: 3px solid #D4A574;
  outline-offset: 4px;
}

/* Keyboard navigation */
.gallery-item:focus-visible .gallery-overlay {
  opacity: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-image,
  .gallery-overlay,
  .overlay-content,
  .gallery-icon-badge {
    animation: none;
    transition: none;
  }

  .gallery-item:hover {
    transform: none;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  .gallery-item {
    border: 2px solid currentColor;
  }

  .gallery-overlay {
    background: rgba(0, 0, 0, 0.9);
  }
}
