/* Card d'œuvre — template-parts/items/artwork-card.php
   Fichier maintenu à la main : la chaîne gulp du thème n'est pas rejouable
   en l'état, donc le CSS des nouveautés vit ici plutôt que dans styles.min.css.
   Couleurs reprises de src/scss/utilities/_variables.scss. */

.artwork-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(var(--artwork-cols, 3), minmax(0, 1fr));
  align-items: start;
}

@media screen and (max-width: 1024px) {
  .artwork-grid { grid-template-columns: repeat(min(var(--artwork-cols, 3), 2), minmax(0, 1fr)); }
}

@media screen and (max-width: 768px) {
  .artwork-grid { grid-template-columns: 1fr; gap: 24px; }
}

.artwork-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.artwork-card__visual {
  position: relative;
  overflow: hidden;
  background: #f5f5fa;
}

.artwork-card__visual img {
  display: block;
  width: 100%;
  height: auto;
}

.artwork-card__visual a {
  display: block;
}

/* Repère « cette œuvre est présente à plusieurs endroits » */
.artwork-card__badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: #32327b;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .04em;
  padding: 6px 10px;
  border-radius: 100px;
}

.artwork-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.artwork-card__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.artwork-card__title a {
  color: inherit;
  text-decoration: none;
}

.artwork-card__title a:hover,
.artwork-card__title a:focus-visible {
  text-decoration: underline;
}

.artwork-card__place {
  margin: 0;
  font-size: .95rem;
  color: #707070;
}

.artwork-card__excerpt {
  margin: 0;
  font-size: .95rem;
}

.artwork-card__locate {
  align-self: flex-start;
  margin-top: 4px;
  background: none;
  border: 1px solid #32327b;
  color: #32327b;
  font: inherit;
  font-size: .9rem;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.artwork-card__locate:hover {
  background: #32327b;
  color: #fff;
}

.artwork-card__locate:focus-visible {
  outline: 2px solid #32327b;
  outline-offset: 2px;
}

/* État actif : cette œuvre est celle isolée sur la carte */
.artwork-card.is-active .artwork-card__locate,
.artwork-card__locate[aria-pressed="true"] {
  background: #32327b;
  color: #fff;
}

.artwork-card.is-dimmed {
  opacity: .35;
}

@media (prefers-reduced-motion: reduce) {
  .artwork-card__locate { transition: none; }
}

/* Cadrage carré : le haut de l'image est conservé (les œuvres sont verticales,
   le sujet est en haut). L'image source n'est pas recadrée côté WordPress,
   c'est ce cadrage CSS qui décide. */
.artwork-card--square .artwork-card__visual {
  aspect-ratio: 1 / 1;
}

.artwork-card--square .artwork-card__visual > a,
.artwork-card--square .artwork-card__slider,
.artwork-card--square .artwork-card__slide {
  height: 100%;
}

.artwork-card--square .artwork-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Cards étroites (3 colonnes à côté de la carte) : on resserre. */
@supports (container-type: inline-size) {
  .artwork-card { container-type: inline-size; }

  @container (max-width: 240px) {
    .artwork-card__title { font-size: 1rem; }
    .artwork-card__locate { font-size: .8rem; padding: 7px 11px; }
  }
}
