/* ========================================
   DETAIL ARTICLE CSS - "La Lecture au Crépuscule"
   Vision : Une expérience de lecture immersive et cinématographique
   ======================================== */

/* Variables CSS - Palette "Soleil de 18h30" */
:root {
  --brun-cendre: #4A4644;
  --ambre-fonce: #2B2A2E;
  --or-pale: #FFF5E1;
  --degrade-rayons: linear-gradient(45deg, #D95D39, #F0A27B);
  --orange-sanguine: #D95D39;
  --peche-douce: #F0A27B;
  --bourgogne-profond: #5C2E35;
  
  /* Variables pour les animations */
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease-out;
  --shadow-warm: 0 8px 32px rgba(217, 93, 57, 0.15);
  --shadow-deep: 0 16px 48px rgba(92, 46, 53, 0.3);
}

/* Reset et base */
* {
  box-sizing: border-box;
}

body {
  line-height: 1.6;
  color: var(--or-pale);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   ACTE 1 : LA TOILE DE FOND (#article-hero)
   ======================================== */

#article-hero {
  position: relative;
  height: 100vh;
  background-image: var(--background-image-url);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

/* Effet DuoTone - Le "WOW" principal */
#article-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    var(--bourgogne-profond) 0%,
    rgba(92, 46, 53, 0.7) 30%,
    rgba(217, 93, 57, 0.6) 70%,
    var(--orange-sanguine) 100%
  );
  mix-blend-mode: multiply;
  z-index: 1;
}

#article-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(74, 70, 68, 0.3) 60%,
    var(--brun-cendre) 100%
  );
  z-index: 2;
}

.lens-flare-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  pointer-events: none;
}

/* ========================================
   CONTENEUR PRINCIPAL (.article-body-wrapper)
   ======================================== */

.article-body-wrapper {
  position: relative;
  background: var(--brun-cendre);
  min-height: 100vh;
  z-index: 10;
}

/* ========================================
   ACTE 2 : LE FOYER DE LA NARRATION
   ======================================== */

/* Barre de Titre Sticky */
.sticky-article-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(74, 70, 68, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 245, 225, 0.1);
  transition: var(--transition-smooth);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.sticky-article-header h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--or-pale);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 245, 225, 0.7);
  margin-bottom: 1rem;
}

.article-meta span {
  position: relative;
}

.article-meta span:not(:last-child)::after {
  content: '•';
  position: absolute;
  right: -0.6rem;
  color: var(--orange-sanguine);
}

/* Barre de Progression */
.reading-progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 245, 225, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--degrade-rayons);
  border-radius: 2px;
  transform-origin: left;
  transition: transform 0.1s ease-out;
}

/* Contenu Principal */
.article-main-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.article-content {
  max-width: 65ch;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--or-pale);
}

.article-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
  hyphens: auto;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  font-size: 1.8rem !important;
  font-family: 'Lora', serif;
  background: var(--degrade-rayons);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 2rem 0 1rem 0;
  line-height: 1.3;
}

.article-content h2 {
  font-size: 1.8rem;
}

.article-content h3 {
  font-size: 1.5rem;
}

.article-content h4 {
  font-size: 1.3rem;
}

/* Citations */
.article-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  position: relative;
  background: rgba(43, 42, 46, 0.5);
  border-left: 4px solid var(--orange-sanguine);
  border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1.2rem;
  background: var(--degrade-rayons);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0;
}

.article-content blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-size: 4rem;
  color: var(--orange-sanguine);
  font-family: 'Lora', serif;
  line-height: 1;
}

/* Images dans le contenu */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: var(--shadow-warm);
  transition: var(--transition-smooth);
  opacity: 0;
  transform: translateY(20px);
}

.article-content img.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lueur de Focalisation */
.focus-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    circle at var(--focus-x, 50%) var(--focus-y, 50%),
    transparent 0%,
    transparent 30%,
    rgba(74, 70, 68, 0.3) 60%,
    rgba(74, 70, 68, 0.7) 100%
  );
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* ========================================
   ACTE 3 : LA CONVERSATION (#article-author-share)
   ======================================== */

#article-author-share {
  background: var(--ambre-fonce);
  padding: 4rem 2rem;
  border-top: 1px solid rgba(255, 245, 225, 0.1);
}

.author-share-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

/* Biographie Auteur */
.author-bio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--orange-sanguine);
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.author-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-warm);
}

.author-name {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  color: var(--or-pale);
  margin-bottom: 1rem;
}

.author-description {
  color: rgba(255, 245, 225, 0.8);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.author-social {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: var(--or-pale);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 245, 225, 0.3);
  border-radius: 20px;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.social-link:hover {
  background: var(--orange-sanguine);
  border-color: var(--orange-sanguine);
  transform: translateY(-2px);
}

/* Section Partage */
.share-links h4 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  color: var(--or-pale);
  margin-bottom: 1.5rem;
  text-align: center;
}

.share-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.share-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--or-pale);
  text-decoration: none;
  padding: 1rem 1.5rem;
  background: rgba(255, 245, 225, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 245, 225, 0.1);
  transition: var(--transition-fast);
}

.share-link:hover {
  background: rgba(217, 93, 57, 0.1);
  border-color: var(--orange-sanguine);
  transform: translateX(5px);
}

.share-link:hover .share-text {
  color: var(--orange-sanguine);
}

.share-icon {
  opacity: 0;
  transform: translateX(-10px);
  transition: var(--transition-fast);
}

.share-link:hover .share-icon {
  opacity: 1;
  transform: translateX(0);
}

/* ========================================
   ACTE 4 : LA CROISÉE DES CHEMINS (#related-articles)
   ======================================== */

#related-articles {
  background: var(--ambre-fonce);
  padding: 4rem 2rem;
  border-top: 1px solid rgba(255, 245, 225, 0.05);
}

.related-articles-container {
  max-width: 1200px;
  margin: 0 auto;
}

#related-articles h2 {
  font-family: 'Lora', serif;
  font-size: 2.5rem;
  text-align: center;
  background: var(--degrade-rayons);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 3rem;
}

/* Grille des Cartes Tarot */
.tarot-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.tarot-card {
  position: relative;
  display: block;
  text-decoration: none;
  background: rgba(255, 245, 225, 0.03);
  border: 1px solid rgba(255, 245, 225, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
  transform-origin: center;
}

.tarot-card:hover {
  transform: perspective(1000px) rotateY(5deg) translateY(-10px);
  box-shadow: var(--shadow-deep);
}

.card-image-container {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.3) contrast(0.9) brightness(0.8);
  transition: var(--transition-smooth);
}

.tarot-card:hover .card-image {
  filter: sepia(0.1) contrast(1.1) brightness(1);
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(43, 42, 46, 0.3) 60%,
    rgba(43, 42, 46, 0.8) 100%
  );
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  color: var(--or-pale);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 245, 225, 0.6);
}

.card-meta span:not(:last-child)::after {
  content: '•';
  position: absolute;
  margin-left: 0.5rem;
  color: var(--orange-sanguine);
}

/* Lueur Dorée des Cartes */
.card-glow {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--degrade-rayons);
  border-radius: 14px;
  opacity: 0;
  z-index: -1;
  transition: var(--transition-smooth);
  filter: blur(8px);
}

.tarot-card:hover .card-glow {
  opacity: 0.6;
}

/* Message si pas d'articles */
.no-related-articles {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 245, 225, 0.6);
  font-style: italic;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  #article-hero {
    background-attachment: scroll;
  }
  
  .header-content {
    padding: 1rem 1.5rem;
  }
  
  .sticky-article-header h1 {
    font-size: 1.5rem;
  }
  
  .article-main-content {
    padding: 2rem 1.5rem;
  }
  
  .article-content {
    font-size: 1rem;
    max-width: none;
  }
  
  .author-share-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .tarot-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .focus-light {
    display: none;
  }
}

@media (max-width: 480px) {
  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .article-meta span::after {
    display: none;
  }
  
  .share-list {
    gap: 0.75rem;
  }
  
  .share-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

/* ========================================
   ANIMATIONS ET ÉTATS POUR JAVASCRIPT
   ======================================== */

/* États pour les animations d'entrée */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-smooth);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* État pour la barre de progression */
.reading-progress-bar.is-reading {
  transform: scaleX(var(--progress, 0));
}

/* Effet de lecture active sur les paragraphes */
.article-content p.reading-focus {
  color: var(--or-pale);
  text-shadow: 0 0 20px rgba(255, 245, 225, 0.3);
}

.article-content p.reading-dimmed {
  color: rgba(255, 245, 225, 0.5);
  transition: color 0.3s ease;
}

/* États hover personnalisés pour les interactions JS */
.interactive-element {
  cursor: pointer;
  transition: var(--transition-fast);
}

.interactive-element:hover {
  transform: scale(1.02);
}