/* ============================================================
 * DCOD Amazon CSS v1.2 – 2025-07-20
 * Styles unifiés pour les blocs Amazon générés (plugin) ou intégrés manuellement.
 * ============================================================ */

/* ===== Amazon DCOD – Styles communs pour bloc et ad ===== */

.dcod-amazon-block,
.dcod-amazon-books {
  max-width: 1024px;
  margin: 0 auto;
  background-color: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  gap: 40px;
}

/* Optimisation de l'espacement vertical pour le bloc plugin */
.dcod-amazon-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 1.5rem auto; /* réduit la marge verticale */
}

/* Mise en page Gutenberg (colonnes multiples centrées) */
.dcod-amazon-books .wp-block-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-right: 20px;
}
.dcod-amazon-books .wp-block-column:last-child {
  margin-right: 0;
}

/* Image */
.dcod-amazon-img,
.dcod-amazon-books .wp-block-image img {
  width: 160px;
  max-width: 100%;
  aspect-ratio: 5 / 7;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

/* Image hover effet */
.dcod-amazon-books .wp-block-image img:hover {
  transform: scale(1.03);
  transition: transform 0.3s ease;
}

/* Contenu (plugin) */
.dcod-amazon-content {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Titre */
.dcod-amazon-title {
  font-size: 17px;
  font-weight: bold;
  margin: 0 0 6px 0;
}
.dcod-amazon-title a,
.dcod-amazon-books p strong a {
  color: #0057B8;
  text-decoration: none;
}
.dcod-amazon-title a:hover,
.dcod-amazon-books p strong a:hover {
  text-decoration: underline;
}

/* Résumé */
.dcod-amazon-summary,
.dcod-amazon-books p em {
  font-size: 15px;
  color: #333;
}

/* Bouton Amazon */
.amazon-button {
  display: inline-block;
  padding: 8px 14px;
  background: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  margin-top: 10px;
  transition: background 0.3s ease;
}
.amazon-button:hover,
.dcod-amazon-books a.amazon-button:hover {
  background-color: #ff4081 !important;
  color: #fff !important;
}

/* Note d'affiliation */
.dcod-amazon-note,
.dcod-amazon-books-note {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin-top: 20px;
}

/* ===== Responsive mobile commun ===== */
@media (max-width: 600px) {
  .dcod-amazon-block {
    flex-direction: column;
    align-items: center;
    padding: 16px;
  }

  .dcod-amazon-image {
    width: 100%;
    margin-bottom: 16px;
  }

  .dcod-amazon-img {
    width: 140px;
  }

  .dcod-amazon-content {
    width: 100%;
    text-align: center;
  }

  .amazon-button {
    align-self: center;
  }

  .dcod-amazon-books .wp-block-image img {
    width: 100%;
    max-width: 140px;
  }
}
