/* ═══════════════════════════════════════════════════════════════
   HD Decorations - bibliothèque de patterns et styles partagés
   pour les SVG thématiques HD injectés via hd_svg_icon().

   Toutes les classes utilisent var(--gold) et currentColor pour
   fonctionner indifféremment en light-mode et dark-mode (BG).
   ═══════════════════════════════════════════════════════════════ */

/* ── Base icon ─────────────────────────────────────────────── */
.hd-icon {
  display: inline-block;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--gold);
}

.hd-icon--sm { width: 16px; height: 16px; }
.hd-icon--md { width: 32px; height: 32px; }
.hd-icon--lg { width: 48px; height: 48px; }
.hd-icon--xl { width: 72px; height: 72px; }
.hd-icon--2xl { width: 120px; height: 120px; }

/* Centres : respectent leurs couleurs intrinsèques via fill inline,
   mais les outlines héritent de currentColor */
.hd-icon[class*="centres-"][class*="-outline"] {
  color: var(--text-secondary, #888);
}

/* Hexagrammes : monochrome, hérite de currentColor */
.hd-icon[class*="hexagrams-"] {
  color: var(--gold);
}

.hd-icon--gold { color: var(--gold); }
.hd-icon--muted { color: var(--text-muted, #666); opacity: 0.6; }

/* ── Pattern mandala subtil en background ─────────────────── */
.hd-pattern-mandala-bg {
  position: relative;
  isolation: isolate;
}
.hd-pattern-mandala-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/hd-icons/mandalas/bg-pattern.svg");
  background-size: 300px 300px;
  background-repeat: repeat;
  background-position: center;
  opacity: 0.04;
  z-index: -1;
  pointer-events: none;
}
.light-mode .hd-pattern-mandala-bg::before {
  opacity: 0.06;
}

/* ── Radial gold backdrop (hero) ──────────────────────────── */
.hd-radial-gold {
  position: relative;
  isolation: isolate;
}
.hd-radial-gold::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background: radial-gradient(
    ellipse at center,
    rgba(201, 168, 76, 0.14) 0%,
    rgba(201, 168, 76, 0.04) 40%,
    transparent 70%
  );
  z-index: -1;
  pointer-events: none;
}
.light-mode .hd-radial-gold::before {
  background: radial-gradient(
    ellipse at center,
    rgba(201, 168, 76, 0.18) 0%,
    rgba(201, 168, 76, 0.05) 40%,
    transparent 70%
  );
}

/* ── Grille hexagonale discrète ──────────────────────────── */
.hd-hexgrid-bg {
  position: relative;
  isolation: isolate;
}
.hd-hexgrid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(60deg, transparent 49.5%, currentColor 49.5%, currentColor 50.5%, transparent 50.5%),
    linear-gradient(-60deg, transparent 49.5%, currentColor 49.5%, currentColor 50.5%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, currentColor 49.5%, currentColor 50.5%, transparent 50.5%);
  background-size: 40px 69.28px;
  color: var(--gold);
  opacity: 0.04;
  z-index: -1;
  pointer-events: none;
}

/* ── Card glow animée (pour tiers/offres) ──────────────── */
.hd-card-glow {
  position: relative;
  isolation: isolate;
}
.hd-card-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(201, 168, 76, 0) 0%,
    rgba(201, 168, 76, 0.5) 50%,
    rgba(201, 168, 76, 0) 100%
  );
  background-size: 200% 200%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
  animation: hd-card-glow-shimmer 3s ease-in-out infinite;
}
.hd-card-glow:hover::before,
.hd-card-glow--featured::before {
  opacity: 1;
}
@keyframes hd-card-glow-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-card-glow::before { animation: none; }
}

/* ── Section accent (mandala coin supérieur-gauche) ───── */
.hd-section-accent {
  position: relative;
  isolation: isolate;
}
.hd-section-accent::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 60px;
  height: 60px;
  background-image: url("../img/hd-icons/mandalas/yi-king-small.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.18;
  color: var(--gold);
  pointer-events: none;
  z-index: 0;
}
.light-mode .hd-section-accent::before {
  opacity: 0.22;
}

/* ── Divider glyph (remplace <hr>) ──────────────────── */
.hd-divider-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem auto;
  color: var(--gold);
  max-width: 360px;
  opacity: 0.7;
}
.hd-divider-glyph img,
.hd-divider-glyph svg {
  width: 100%;
  height: 24px;
}

/* ── Grille d'icônes pour listes de bénéfices ────────── */
.hd-benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.hd-benefit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.25rem 0.75rem;
}
.hd-benefit-item .hd-icon {
  width: 48px;
  height: 48px;
  color: var(--gold);
}
.hd-benefit-item__label {
  font-family: var(--font-heading, 'Lora', serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text-primary, #fff);
}
.hd-benefit-item__desc {
  font-size: 0.78rem;
  color: var(--text-secondary, #aaa);
  line-height: 1.4;
  max-width: 180px;
}

/* ── Rangée de types en pills ───────────────────────── */
.hd-type-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}
.hd-type-row .hd-icon {
  width: 56px;
  height: 56px;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .hd-section-accent::before { width: 44px; height: 44px; top: 6px; left: 6px; }
  .hd-benefit-grid { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .hd-benefit-item .hd-icon { width: 40px; height: 40px; }
  .hd-divider-glyph { margin: 2rem auto; }
}
