/**
 * download.css — Fiche de téléchargement (patterns/fiche-telechargement.php).
 * Restylise aussi le HTML généré par Simple Download Monitor (classes
 * sdm_*), sans toucher à son fonctionnement (comptage, restriction).
 */

/* ── En-tête de la ressource ──────────────────────────────────── */
.hub-download-hero {
  gap: 1.5rem;
}

.hub-download-hero__icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.hub-download-hero__icon::before {
  font-family: "boxicons" !important;
  font-style: normal;
  content: "\e9bf"; /* bx-book-open */
  line-height: 1;
}

.hub-download-hero__icon--file::before {
  content: "\eaa1"; /* bx-file */
}

.hub-download-hero__icon--archive::before {
  content: "\e984"; /* bx-archive */
}

/* ── Colonnes de licence ──────────────────────────────────────── */
.hub-license-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.hub-license-grid > * {
  margin-top: 0 !important;
}

.hub-license-card {
  flex: 1 1 260px;
  padding: 1.3rem 1.4rem;
  border-radius: 12px;
  border: 1px solid #e8eef6;
}

.hub-license-card h3 {
  margin: 0 0 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-license-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
}

.hub-license-card--do {
  background: #f3faf6;
}

.hub-license-card--do h3::before {
  font-family: "boxicons" !important;
  font-style: normal;
  content: "\ea13"; /* bx-check-circle */
  color: #2e7d32;
}

.hub-license-card--condition {
  background: #fef8ec;
}

.hub-license-card--condition h3::before {
  font-family: "boxicons" !important;
  font-style: normal;
  content: "\eaed"; /* bx-info-circle */
  color: #b8860b;
}

/* ── Carte de téléchargement ──────────────────────────────────── */
.hub-download-card {
  max-width: 560px;
  margin: 0 auto 3rem;
  text-align: center;
  background: var(--wp--preset--color--surface);
  border-radius: 16px;
  border: 1px solid #e8eef6;
  /* !important : la marge d'origine vient du padding du bloc Groupe
     lui-même (attribut de style inline), plus prioritaire qu'une classe
     CSS classique. */
  padding: 1.75rem 2rem !important;
}

.hub-download-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.hub-download-card__icon::before {
  font-family: "boxicons" !important;
  font-style: normal;
  content: "\ea86"; /* bx-download */
  line-height: 1;
}

.hub-download-card__note {
  color: #666;
  margin-top: -0.4rem;
}

/* ── Restylage du bloc généré par Simple Download Monitor ────── */
.hub-download-card .sdm_download_button_box_default {
  margin-top: 1.2rem;
}

.hub-download-card .sdm-termscond-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #444;
  margin-bottom: 1rem;
}

.hub-download-card .sdm-termscond-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--wp--preset--color--primary);
}

.hub-download-card .sdm-termscond-checkbox a {
  color: var(--wp--preset--color--primary);
}

.hub-download-card .sdm_download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  background: var(--wp--preset--color--primary);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s, opacity 0.15s;
}

.hub-download-card .sdm_download:hover {
  background: var(--wp--preset--color--primary-dark);
}

/* Le shortcode SDM ajoute une classe de couleur ("green") au bouton :
   sans cette règle plus spécifique, sa propre feuille de style reprend
   la main dès que la case à cocher est validée (perte de la classe
   sdm_disabled_button, seule à avoir une spécificité suffisante pour
   la neutraliser), et le bouton vire au vert du plugin au lieu du bleu
   du thème. */
.hub-download-card .sdm_download.green {
  background: var(--wp--preset--color--primary);
}

.hub-download-card .sdm_download.green:hover {
  background: var(--wp--preset--color--primary-dark);
}

.hub-download-card .sdm_download.sdm_disabled_button {
  background: #b7bfcc;
  cursor: not-allowed;
  pointer-events: none;
}
