/* Page Histoires - Styles minimaux */

/* Surcharge divi pour cette page*/
.container {
  max-width: 1450px !important;
  width: 85% !important;
  padding-bottom: 2rem;
}

p {
  margin: 0;
  padding: 0;
}

.dca-histoires-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 4px 20px;
  font-family: 'Quicksand', Helvetica, Arial, sans-serif;
}

.dca-histoires-user-header {
  text-align: left;
  margin-bottom: 20px;
}

.dca-histoires-greeting {
  font-size: 18px;
  color: #666;
  margin: 0;
}

.dca-histoires-greeting strong {
  color: #282551;
  font-weight: 600;
}

.dca-histoires-login-link {
  color: #282551;
  font-weight: 600;
  text-decoration: underline;
  margin-left: 4px;
}

.dca-histoires-login-link:hover {
  color: #0066cc;
}

/* ============================================================
   BARRE DE NAVIGATION PAR BADGES
   ============================================================ */
.dca-histoires-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.dca-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dca-nav-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Acheté : fond sombre */
.dca-nav-badge-owned {
  background: var(--secondary, #282551);
  color: #fff;
}

/* Gratuit / non-acheté : fond clair */
.dca-nav-badge-free {
  background: var(--primary, #dee9ba);
  color: var(--secondary, #282551);
}

/* Badge du pack actuellement remonté en haut */
.dca-nav-badge-active {
  border-color: var(--secondary, #282551);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.dca-packs-sections {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.dca-pack-section {
  margin: 0;
  padding: 0;
}

/* ============================================================
   EN-TÊTES DE SECTION (démo + packs achetés : même allure)
   ============================================================ */
.dca-demo-section {
  margin-bottom: 20px;
}

.dca-demo-header,
.dca-pack-purchased-header,
.dca-pack-available-header {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.dca-demo-title,
.dca-pack-purchased-title,
.dca-pack-available-title {
  font-size: 34px;
  margin: 0;
  color: var(--secondary, #282551);
  padding: 0;
}

.dca-demo-badge,
.dca-pack-purchased-badge,
.dca-pack-available-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Badge démo + à découvrir : vert doux */
.dca-demo-badge,
.dca-pack-available-badge {
  background: var(--primary, #dee9ba);
  color: var(--secondary, #282551);
}

/* Badge pack acheté : navy plein pour marquer la possession */
.dca-pack-purchased-badge {
  background: var(--secondary, #282551);
  color: #fff;
}

/* ============================================================
   PACKS À DÉCOUVRIR : grille de cartes
   ============================================================ */
/* Grille de cartes : CENTRÉE par défaut (accueil / shortcode).
   Un pack seul se retrouve au milieu. */
.dca-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 480px));
  gap: 24px;
  justify-content: center;
  align-items: start; /* cartes à hauteur de leur contenu -> CTA identique partout */
}

.dca-packs-discover .dca-pack-available-header {
  justify-content: center;
}

/* Variante "start" : alignée à gauche, cartes étirées (page audios générée par le plugin) */
.dca-packs-discover--start .dca-pack-available-header {
  justify-content: flex-start;
}

.dca-packs-discover--start .dca-packs-grid {
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  justify-content: start;
}

/* --- Carte pack : titre pleine largeur / corps (image | infos) / CTA centré --- */
.dca-pack-card {
  background: rgba(222, 233, 186, 0.6); /* --primary (#dee9ba) à 0.6 */
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* même ombre que les audio items */

  p {
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Image bannière en haut de carte */
.dca-pack-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
}

.dca-pack-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* crop si l'image dépasse */
  object-position: center;
  display: block;
}

/* Ligne : titre (gauche) + prix (droite) */
.dca-pack-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.dca-pack-card-title {
  margin: 0;
  padding: 0;
  font-size: 24px;
  color: var(--secondary, #282551);
  /* font héritée de Divi : pas de font-family forcée */
}

.dca-pack-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.dca-pack-card-price-scratch {
  font-size: 15px;
  color: var(--secondary, #282551);
  text-decoration: line-through;
  opacity: 0.55;
}

.dca-pack-card-price-current {
  font-size: 22px;
  font-weight: bold;
  color: var(--secondary, #282551);
}

.dca-pack-card-description {
  font-size: 15px;
  line-height: 1.4;
  color: var(--secondary, #282551);
}

/* Composant nb histoires + titres, très resserré */
.dca-pack-card-histoires {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--secondary, #282551);
}

.dca-pack-card-count {
  font-size: 15px;
  font-weight: bold;
}

/* Titres : 1 seule colonne, à puces */
.dca-pack-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dca-pack-card-audio-title {
  padding-left: 4px !important;
  font-size: 13px;
  line-height: 1.35;
}

/* Wrapper block du CTA (enfant flex de la carte) : gap au-dessus + centrage.
   Indispensable car wpautop enveloppe sinon le <a> dans un <p> (page histoires). */
.dca-pack-card-cta-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

/* CTA vers le paiement */
.dca-pack-card-cta {
  display: inline-block;
  padding: 12px 34px;
  border-radius: 6px;
  background: var(--secondary, #282551);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: opacity 0.2s ease;
}

.dca-pack-card-cta:hover {
  opacity: 0.9;
  color: #fff;
}

.dca-btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.dca-btn-primary {
  background: #0066cc;
  color: white;
}

.dca-btn-primary:hover {
  background: #0052a3;
}

.dca-btn-success {
  background: #28a745;
  color: white;
}

.dca-btn-success:hover {
  background: #218838;
}

@media (max-width: 768px) {
  /* Élargir le container Divi sur mobile (au moins 94%) */
  .container {
    width: 94% !important;
    padding-top: 15px !important;
  }

  .dca-histoires-container {
    padding: 4px 6px;
  }

  /* Colonnes audio moins larges + jamais plus larges que l'espace dispo.
     Sélecteur plus spécifique (.dca-histoires-container .dca-pack-audios)
     pour battre la règle styles.css réinjectée par le loader JS. */
  .dca-histoires-container .dca-pack-audios {
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: 1rem;
  }

  /* Titres réduits sur mobile */
  .dca-demo-title,
  .dca-pack-purchased-title,
  .dca-pack-available-title,
  .dca-pack-card-title {
    font-size: 22px;
  }

  .dca-demo-header {
    gap: 5px;
  }

  /* Badges plus petits sur mobile */
  .dca-nav-badge,
  .dca-demo-badge,
  .dca-pack-purchased-badge,
  .dca-pack-available-badge {
    font-size: 11px;
    padding: 5px 12px;
  }

  /* Grille en 1 colonne, carte pleine largeur, corps empilé (image au-dessus) */
  .dca-packs-grid,
  .dca-packs-discover--start .dca-packs-grid {
    grid-template-columns: 1fr;
  }

  .dca-pack-card {
    padding: 14px;
  }

  .dca-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}
