/* ==========================================================================
   Fluid Palette - Picture Frame & Mat Presentation
   Shared across gallery.html, photography.html, and index.html so every
   artwork display (grid cards, showcase plates, the homepage hero) uses the
   same frame/mat system, driven per-artwork by frame_style + mat_color from
   the admin CMS. Zoom/pan lightboxes intentionally stay unframed — they're
   already crop-free (object-fit: contain) and a frame would fight the
   zoom/pan interaction.

   Structure: .art-frame (frame material + thickness) > .art-mat (mat color +
   width) > img (object-fit: contain, so the full image is always visible —
   never cropped — letterboxed within the mat as needed).
   ========================================================================== */

.art-frame {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
}

.art-frame--none {
  padding: 0;
  background: transparent;
}

.art-frame--black {
  padding: clamp(6px, 2.5%, 16px);
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.art-frame--white {
  padding: clamp(6px, 2.5%, 16px);
  background: #eeece5;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.art-frame--wood {
  padding: clamp(7px, 2.8%, 18px);
  background: linear-gradient(135deg, #c99a63 0%, #8a5d34 55%, #6b4423 100%);
}

.art-frame--walnut {
  padding: clamp(7px, 2.8%, 18px);
  background: linear-gradient(135deg, #4a3226 0%, #2b1c13 55%, #1a100a 100%);
}

.art-frame--gold {
  padding: clamp(6px, 2.4%, 15px);
  background: linear-gradient(135deg, #f0d385 0%, #b8912f 50%, #8a6a1f 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.art-mat {
  flex: 1;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 6%, 32px);
  position: relative;
  overflow: hidden;
}

.art-mat--white {
  background: #fdfcf8;
}

.art-mat--black {
  background: #0b0b0b;
}

/* Image Shimmer & Loading State */
@keyframes fp-img-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.image-loading,
.art-card-media.is-loading,
.fp-hero__figure.is-loading,
.fp-plate__media.is-loading,
.fp-index__preview-media.is-loading,
.fp-lightbox__media.is-loading {
  position: relative;
}

.image-loading::before,
.is-loading .art-mat::before,
.fp-plate__media.is-loading::before,
.fp-index__preview-media.is-loading::before,
.fp-hero__figure.is-loading #fpHeroFrame::before,
.fp-lightbox__media.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(220, 218, 214, 0.25) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(220, 218, 214, 0.25) 100%
  );
  background-size: 200% 100%;
  animation: fp-img-shimmer 1.8s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

.art-frame .art-mat img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.art-frame .art-mat img.is-loaded,
.art-frame .art-mat img[data-loaded="true"] {
  opacity: 1;
}

/* Standalone / Unframed Async Image Loading */
.async-img {
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.async-img.is-loaded {
  opacity: 1;
}

/* Spinner & Progress Bar Animation for Image Loading */
@keyframes fp-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fp-progress-indeterminate {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(30%); }
  100% { transform: translateX(200%); }
}

.fp-img-progress {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(243, 242, 242, 0.45);
  backdrop-filter: blur(2px);
  z-index: 5;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}

.is-loaded ~ .fp-img-progress,
.has-loaded .fp-img-progress,
.is-loaded .fp-img-progress,
img.is-loaded + .fp-img-progress {
  opacity: 0 !important;
  visibility: hidden !important;
}

.fp-img-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(236, 48, 19, 0.15);
  border-top-color: #ec3013;
  border-right-color: #f59e0b;
  animation: fp-spin 0.85s linear infinite;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fp-img-progress-bar {
  width: 54px;
  max-width: 60%;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.fp-img-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ec3013, #f59e0b, #06b6d4);
  border-radius: 999px;
  animation: fp-progress-indeterminate 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}


