/* Reyesink — Custom styles (Tailwind CDN handles most layout) */

:root {
  --accent: #9f1239;
}

/* Smooth everything */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Better base text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nav active-ish feel on mobile links */
.mobile-link {
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: rgba(245, 245, 246, 0.85);
}
.mobile-link:hover {
  color: white;
}

/* Gallery card - Apple-inspired premium feel */
.artwork-card {
  position: relative;
  overflow: hidden;
  background: #0a0a0b;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.04);
  cursor: zoom-in;
  box-shadow: 0 4px 20px -4px rgba(0,0,0,0.4);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.2s ease;
  /* Give cards intrinsic height so lazy-loaded images always start loading in portrait */
  aspect-ratio: 4 / 3;
  min-height: 220px;
}

.artwork-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.08);
}

/* Sale badge sits above the image but below the hover overlay text */
.artwork-card .artwork-sale-badge {
  z-index: 2;
}

.artwork-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto; /* overridden by card */
  transition: transform 0.4s cubic-bezier(0.23, 1.0, 0.32, 1);
  /* Helps some browsers with downscaling quality */
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0); /* promote to GPU layer to reduce blur on hover scale */
}

.artwork-card:hover img {
  transform: scale(1.035) translateZ(0);
}


/* Prevent hover scale on mobile */
@media (max-width: 640px) {
  .artwork-card:hover img {
    transform: none;
  }
}

/* Gallery Grid - explicit row sizing so cards always have height */
#gallery-grid {
  grid-auto-rows: minmax(280px, auto);
}

/* Gallery cards - base styles */
.artwork-card {
  position: relative;
  overflow: hidden;
  background: #0a0a0b;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.04);
  cursor: zoom-in;
  box-shadow: 0 4px 20px -4px rgba(0,0,0,0.4);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.2s ease;
  min-height: 280px;
}

/* Mobile: taller cards + explicit height so images always load in portrait */
@media (max-width: 768px) {
  #gallery-grid {
    grid-auto-rows: minmax(320px, auto);
  }
  
  .artwork-card {
    min-height: 320px;
    height: 320px;
  }
  
  .artwork-card img {
    height: 320px !important;
    object-fit: cover;
    display: block;
  }
}

/* Desktop hover effects */
.artwork-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.08);
}

.artwork-card:hover img {
  transform: scale(1.035) translateZ(0);
}

/* Badge + overlay styles */
.artwork-card .artwork-sale-badge {
  z-index: 2;
}

.artwork-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.23, 1.0, 0.32, 1);
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.artwork-card:hover .artwork-overlay {
  opacity: 1;
}

/* Portrait mode: backdrops show full image at actual size (no cropping) */
@media (orientation: portrait) {
  #hero-backdrop {
    background-size: contain !important;
    background-position: center !important;
  }
  
  /* Also apply to other section backdrops if needed */
  section[style*="background-image"] {
    background-size: contain !important;
  }
}
