/* ==========================================================================
   Photography Contact-Sheet Mosaic Layout — Atelier Coloré Canada
   ========================================================================== */

:root {
  --photo-gold: #b28a2f;
  --photo-gold-bright: #d4af62;
  --photo-bg: #FAFAFA;
  --photo-surface: #FFFFFF;
  --photo-text: #111111;
  --photo-text-muted: rgba(17, 17, 17, 0.6);
  --photo-border: #E5E5E5;
}

/* Mosaic Container */
.mosaic-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 48px) 120px;
}

/* CSS Multi-column Masonry */
.photo-mosaic {
  column-count: 4;
  column-gap: 8px;
  width: 100%;
}

@media (max-width: 1099px) {
  .photo-mosaic {
    column-count: 3;
    column-gap: 8px;
  }
}

@media (max-width: 767px) {
  .photo-mosaic {
    column-count: 2;
    column-gap: 8px;
  }
}

/* Each Tile */
.photo-tile {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 2px;
  display: block;
  text-decoration: none;
  color: inherit;
  background: #ece8e1;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

.photo-tile:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* Photo Frame holding the image with clamped aspect-ratio */
.photo-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: block;
  background: #ece8e1;
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-tile:hover .photo-img {
  transform: scale(1.04);
}

/* Neutral Placeholder for broken/timed-out images */
.photo-placeholder {
  width: 100%;
  height: 100%;
  background: #e3ded5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8c857b;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
}

/* Sold Out Status Badge */
.card-status-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 2px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-status-tag.sold-out {
  background: rgba(18, 18, 18, 0.90);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.4);
}

/* Desktop Hover Overlay (devices with hover capability) */
@media (hover: hover) and (pointer: fine) {
  .photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    opacity: 0;
    transition: opacity 250ms ease;
    z-index: 4;
    pointer-events: none;
  }

  .photo-tile:hover .photo-overlay,
  .photo-tile:focus-visible .photo-overlay {
    opacity: 1;
  }

  .photo-overlay-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  }

  .photo-overlay-price {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--photo-gold-bright);
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  }

  .photo-touch-caption {
    display: none !important;
  }
}

/* Touch Devices (no hover: small caption always visible beneath photo) */
@media (hover: none), (pointer: coarse) {
  .photo-overlay {
    display: none !important;
  }

  .photo-touch-caption {
    display: block;
    padding: 10px 12px 12px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .photo-touch-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 3px;
    line-height: 1.3;
  }

  .photo-touch-price {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--photo-gold);
    letter-spacing: 0.5px;
  }
}

/* Loading Spinner State */
.photo-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  gap: 16px;
  width: 100%;
}

.photo-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(178, 138, 47, 0.2);
  border-top-color: var(--photo-gold);
  border-radius: 50%;
  animation: photoSpin 0.75s linear infinite;
}

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

.photo-loading-text {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--photo-text-muted);
}

/* Empty & Error States */
.photo-empty {
  text-align: center;
  padding: 110px 24px;
  color: var(--photo-text-muted);
  width: 100%;
}

.photo-empty-glyph {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  color: var(--photo-gold);
  margin-bottom: 16px;
  line-height: 1;
}

.photo-empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--photo-text);
  margin-bottom: 10px;
}

.photo-empty-text {
  font-size: 14px;
  color: var(--photo-text-muted);
  max-width: 440px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.photo-empty-link {
  display: inline-block;
  padding: 11px 28px;
  border: 1px solid var(--photo-gold);
  color: var(--photo-text);
  background: var(--photo-surface);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.25s ease;
}

.photo-empty-link:hover {
  background: var(--photo-gold);
  color: #ffffff;
}
