/* ─────────────────────────────────────────
   TenebraeCorpus — Paintings Gallery
   ───────────────────────────────────────── */

.paintings-section {
  padding: 2rem 0;
}

.paintings-section h2 {
  text-align: center;
  margin: 0 0 1.5rem;
  font-size: 2.5rem;
  color: var(--text-color, #e0e0e0);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Grid de produits */
.paintings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Carte produit */
.painting-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.painting-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Image wrapper */
.painting-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.6);
}

/* Status badge */
.painting-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
  z-index: 10;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease;
}

.painting-status.available {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.painting-status.sold {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.painting-image-wrapper:hover .painting-status {
  transform: scale(1.05);
}

.painting-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.painting-image-wrapper:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Overlay pour indiquer que c'est cliquable */
.painting-image-wrapper::after {
  content: '\f00e'; /* Font Awesome search-plus icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.painting-image-wrapper:hover::after {
  opacity: 1;
}

/* Contenu de la carte */
.painting-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

.painting-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0;
  letter-spacing: 0.05em;
}

.painting-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent, #b31217);
  margin: 0;
}

.painting-dimensions {
  font-size: 0.9rem;
  color: var(--muted, #9a9a9a);
  margin: 0;
  font-style: italic;
}

.painting-medium {
  font-size: 0.9rem;
  color: var(--muted, #9a9a9a);
  margin: 0;
  font-style: italic;
}

/* Bouton contact */
.painting-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  margin-top: auto;
}

/* Cache le bouton contact et le prix pour les peintures vendues */
.painting-card.sold .painting-contact-btn,
.painting-card.sold .painting-price {
  display: none;
}

.painting-contact-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.painting-contact-btn:active {
  transform: translateY(0);
}

.painting-contact-btn i {
  font-size: 1rem;
}

/* Lightbox pour peintures (réutilise le style existant mais avec un ID différent) */
#paintings-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#paintings-lightbox.active {
  display: flex;
  opacity: 1;
}

.paintings-lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  z-index: 10001;
}

.paintings-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1) rotate(90deg);
}

.paintings-lightbox-content {
  position: relative;
  width: 90%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.paintings-lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: grab;
  transition: transform 0.1s ease-out;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.paintings-lightbox-content img.dragging {
  cursor: grabbing;
}

/* Info produit dans lightbox */
.paintings-lightbox-info {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem 2rem;
  border-radius: 12px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.paintings-lightbox-info .painting-name {
  font-size: 1.5rem;
  margin: 0;
}

.paintings-lightbox-info .painting-price {
  font-size: 1.75rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .paintings-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .paintings-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .painting-info {
    padding: 1rem;
  }

  .painting-name {
    font-size: 1.1rem;
  }

  .painting-price {
    font-size: 1.25rem;
  }

  .painting-status {
    top: 8px;
    right: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .paintings-lightbox-close {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }

  .paintings-lightbox-content {
    width: 95%;
    height: 95%;
  }

  .paintings-lightbox-info {
    bottom: 20px;
    padding: 0.75rem 1.5rem;
  }

  .paintings-lightbox-info .painting-name {
    font-size: 1.2rem;
  }

  .paintings-lightbox-info .painting-price {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .paintings-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .painting-contact-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* Respecte reduced motion */
@media (prefers-reduced-motion: reduce) {
  .painting-card,
  .painting-image-wrapper img,
  .painting-contact-btn,
  .paintings-lightbox-close {
    transition: none !important;
  }

  .painting-card:hover,
  .painting-contact-btn:hover {
    transform: none;
  }

  .painting-image-wrapper:hover img {
    transform: none;
  }
}
