/* ===== CD54 BILLARD - STYLES ARTICLES (single.php) ===== */
/* Version: 1.0 - Template article style magazine */

/* ============================================================
   ARTICLE AVEC HERO (IMAGE MISE EN AVANT)
   ============================================================ */

/* Hero pleine largeur */
.cd54-single-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: 50vh;
  min-height: 350px;
  max-height: 500px;
  overflow: hidden;
  margin-bottom: 40px;
}

.cd54-single-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay gradient sur l'image */
.cd54-single-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
  pointer-events: none;
}

/* Contenu superposé sur le hero */
.cd54-single-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 40px;
}

.cd54-single-hero-content-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Titre sur le hero */
.cd54-single-with-hero .cd54-single-title {
  font-family: var(--cd54-font-heading, 'Outfit', sans-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 16px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Métadonnées sur le hero */
.cd54-single-with-hero .cd54-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.cd54-single-with-hero .cd54-single-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icônes SVG - TAILLE FIXE OBLIGATOIRE */
.cd54-single-meta-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
}

.cd54-single-with-hero .cd54-single-meta-icon {
  stroke: rgba(255, 255, 255, 0.9);
}

/* ============================================================
   ARTICLE SANS HERO (PAS D'IMAGE)
   ============================================================ */

.cd54-single-no-hero .cd54-single-header {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 40px 24px;
  text-align: center;
}

.cd54-single-no-hero .cd54-single-title {
  font-family: var(--cd54-font-heading, 'Outfit', sans-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--cd54-text-dark, #1a1a2e);
  line-height: 1.2;
  margin: 0 0 16px 0;
}

/* Soulignement rouge sous le titre */
.cd54-single-no-hero .cd54-single-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cd54-primary, #DD183B) 20%, var(--cd54-primary, #DD183B) 80%, transparent);
  margin: 16px auto 0;
  border-radius: 2px;
}

.cd54-single-no-hero .cd54-single-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--cd54-text-secondary, #6B7280);
  font-size: 0.95rem;
  margin-top: 16px;
}

.cd54-single-no-hero .cd54-single-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cd54-single-no-hero .cd54-single-meta-icon {
  stroke: var(--cd54-text-secondary, #6B7280);
}

/* ============================================================
   CONTENU DE L'ARTICLE
   ============================================================ */

.cd54-single-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.cd54-single-content {
  font-family: var(--cd54-font-body, 'Inter', system-ui, sans-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--cd54-text-dark, #374151);
}

/* Typographie du contenu */
.cd54-single-content p {
  margin-bottom: 1.5em;
}

.cd54-single-content h2 {
  font-family: var(--cd54-font-heading, 'Outfit', sans-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cd54-text-dark, #1a1a2e);
  margin: 2em 0 1em;
}

.cd54-single-content h3 {
  font-family: var(--cd54-font-heading, 'Outfit', sans-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cd54-text-dark, #1a1a2e);
  margin: 1.5em 0 0.75em;
}

.cd54-single-content a {
  color: var(--cd54-primary, #DD183B);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cd54-single-content a:hover {
  color: var(--cd54-primary-dark, #b81432);
}

/* Listes */
.cd54-single-content ul,
.cd54-single-content ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.cd54-single-content li {
  margin-bottom: 0.5em;
}

/* Images dans le contenu */
.cd54-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--cd54-radius-md, 12px);
  margin: 1.5em 0;
}

/* Citations */
.cd54-single-content blockquote {
  border-left: 4px solid var(--cd54-primary, #DD183B);
  padding: 16px 24px;
  margin: 2em 0;
  background: rgba(221, 24, 59, 0.05);
  border-radius: 0 var(--cd54-radius-md, 12px) var(--cd54-radius-md, 12px) 0;
  font-style: italic;
}

/* ============================================================
   ARTICLES LIÉS
   ============================================================ */

.cd54-related-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  border-top: 1px solid var(--cd54-border, #e5e7eb);
}

.cd54-related-title {
  font-family: var(--cd54-font-heading, 'Outfit', sans-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cd54-text-dark, #1a1a2e);
  margin: 0 0 32px 0;
  text-align: center;
}

.cd54-related-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cd54-primary, #DD183B) 20%, var(--cd54-primary, #DD183B) 80%, transparent);
  margin: 12px auto 0;
  border-radius: 2px;
}

.cd54-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cd54-related-card {
  background: var(--cd54-bg-light, #fff);
  border-radius: var(--cd54-radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--cd54-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cd54-related-card:hover {
  box-shadow: var(--cd54-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.1));
  transform: translateY(-4px);
}

.cd54-related-card a {
  text-decoration: none;
  display: block;
}

.cd54-related-card-image {
  height: 160px;
  overflow: hidden;
}

.cd54-related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cd54-related-card:hover .cd54-related-card-image img {
  transform: scale(1.05);
}

.cd54-related-card-content {
  padding: 16px;
}

.cd54-related-card-date {
  font-size: 0.8rem;
  color: var(--cd54-text-secondary, #6B7280);
  margin-bottom: 8px;
}

.cd54-related-card-title {
  font-family: var(--cd54-font-heading, 'Outfit', sans-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cd54-text-dark, #1a1a2e);
  line-height: 1.3;
  margin: 0;
}

.cd54-related-card:hover .cd54-related-card-title {
  color: var(--cd54-primary, #DD183B);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 992px) {
  .cd54-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 782px) {
  /* Hero mobile */
  .cd54-single-hero {
    height: 40vh;
    min-height: 280px;
  }

  .cd54-single-hero-content {
    padding: 24px;
  }

  .cd54-single-with-hero .cd54-single-title {
    font-size: 1.5rem;
  }

  .cd54-single-with-hero .cd54-single-meta {
    gap: 12px;
    font-size: 0.875rem;
  }

  /* Contenu mobile */
  .cd54-single-container {
    padding: 0 16px 40px;
  }

  .cd54-single-content {
    font-size: 1rem;
    line-height: 1.7;
  }

  /* Articles liés mobile */
  .cd54-related-section {
    padding: 40px 16px;
  }

  .cd54-related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cd54-related-card {
    display: flex;
    flex-direction: row;
  }

  .cd54-related-card-image {
    width: 120px;
    min-width: 120px;
    height: auto;
  }

  .cd54-related-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.cd54-single-content a:focus,
.cd54-related-card a:focus {
  outline: 3px solid var(--cd54-primary, #DD183B);
  outline-offset: 2px;
}

/* ============================================================
   OVERRIDE ASTRA - Assurer que les styles s'appliquent
   ============================================================ */

/* Supprimer le style par défaut d'Astra sur les articles single */
.single .ast-article-single {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.single .entry-header {
  display: none !important; /* On utilise notre propre header */
}

/* Container principal transparent et pleine largeur */
.single #primary {
  background: transparent !important;
  max-width: 100% !important;
  width: 100% !important;
}

.single .site-content > .ast-container {
  background: transparent !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Forcer Astra à ne pas limiter la largeur */
.single .ast-container,
.single .ast-separate-container .ast-container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Fix Astra separate container padding sur desktop */
@media (min-width: 993px) {
  .ast-separate-container #primary,
  .ast-separate-container.ast-left-sidebar #primary,
  .ast-separate-container.ast-right-sidebar #primary {
    padding: 0 !important;
  }
}

/* Assurer que notre contenu a le bon background et largeur */
.cd54-single-container {
  background: linear-gradient(
    165deg,
    rgba(254, 253, 251, 0.98) 0%,
    rgba(255, 255, 255, 0.98) 50%,
    rgba(248, 249, 252, 0.98) 100%
  );
  border-radius: var(--cd54-radius-lg, 16px);
  padding: 40px 60px 60px !important;
  margin-top: -40px;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1200px !important;
  width: calc(100% - 48px) !important;
  position: relative;
  z-index: 3;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

/* Override container.css pour les articles single */
.single .cd54-single-content.entry-content,
.single .entry-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Supprimer la bordure décorative de container.css sur les articles */
.single .entry-content::before {
  display: none !important;
}

/* Pour les articles sans hero, pas de margin négatif */
.cd54-single-no-hero .cd54-single-container {
  margin-top: 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}
