/* ==========================================
   ARTICLE — article.css
   Modal lecture article E-KOULIBA
   ========================================== */


/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes modalIn {
  from { opacity: 0; transform: translateY(50px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes lineGrow {
  from { width: 0; opacity: 0; }
  to   { width: 40px; opacity: 1; }
}

@keyframes pulseTeal {
  0%, 100% { box-shadow: 0 0 0 0   rgba(27, 74, 71, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(27, 74, 71, 0.20); }
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ==========================================
   OVERLAY
   ========================================== */

.article-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: rgba(0, 0, 0, 0.60);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 20px;
  overflow-y: auto;
  animation: overlayIn 0.3s ease both;
}


/* ==========================================
   PANNEAU ARTICLE
   ========================================== */

.article-panel {
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  padding: 40px 48px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(212, 168, 67, 0.10);
  animation: modalIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}

.article-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--color-or) 30%, var(--color-or) 70%, transparent 100%);
}

.article-panel::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,74,71,0.07) 0%, transparent 70%);
  pointer-events: none;
}

body.dark-mode .article-panel {
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.60),
              0 0 0 1px rgba(212, 168, 67, 0.12);
}


/* ==========================================
   EN-TÊTE
   ========================================== */

.article-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease 0.1s both;
}
.article-panel__header .blog-hero__label { margin-bottom: 0; }
.article-panel__header .label-line { animation: lineGrow 0.6s ease 0.2s both; }

.article-panel__close {
  width: 38px; height: 38px;
  border-radius: 50%;
  background-color: var(--color-teal);
  border: none;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  animation: pulseTeal 3s ease-in-out infinite;
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.article-panel__close:hover {
  opacity: 0.88;
  transform: scale(1.15) rotate(90deg);
  animation: none;
  box-shadow: 0 4px 16px rgba(27, 74, 71, 0.40);
}
.article-panel__close svg { width: 16px; height: 16px; stroke: #fff; }


/* ==========================================
   TITRE
   ========================================== */

.article-panel__title {
  font-family: var(--font-titre);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin-bottom: 18px;
  animation: fadeInUp 0.5s ease 0.15s both;
}


/* ==========================================
   MÉTA
   ========================================== */

.article-panel__meta {
  display: flex;
  gap: 28px;
  font-family: var(--font-corps);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease 0.2s both;
}
.article-panel__meta span { display: flex; align-items: center; gap: 6px; }
.article-panel__meta svg  { width: 14px; height: 14px; stroke: var(--color-or); }

.article-panel__sep {
  border: none;
  border-top: 1px solid var(--color-separator);
  margin: 20px 0 28px;
  animation: fadeInUp 0.5s ease 0.25s both;
}


/* ==========================================
   CITATION INTRO
   ========================================== */

.article-quote {
  font-family: var(--font-titre);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.80;
  border-left: 3px solid var(--color-or);
  padding: 14px 22px;
  margin-bottom: 36px;
  background: linear-gradient(135deg, rgba(212,168,67,0.07) 0%, rgba(212,168,67,0.02) 100%);
  border-radius: 0 6px 6px 0;
  animation: fadeInLeft 0.6s ease 0.3s both;
  position: relative;
  overflow: hidden;
}
.article-quote:empty { display: none; }
.article-quote::after {
  content: '"';
  position: absolute;
  bottom: -10px; right: 16px;
  font-family: var(--font-titre);
  font-size: 5rem;
  color: var(--color-or);
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
}


/* ==========================================
   CONTENU — balises HTML brutes de l'éditeur
   ========================================== */

.article-section {
  animation: fadeInUp 0.5s ease 0.35s both;
  font-family: var(--font-corps);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--color-text-primary);
}

.article-section p {
  font-family: var(--font-corps);
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.80;
  margin-bottom: 14px;
}

/* ── H1 / H2 / H3 avec bordure or gauche ── */
.article-section h1,
.article-section h2,
.article-section h3 {
  font-family: var(--font-titre);
  font-weight: 700;
  color: var(--color-text-primary);
  border-left: 4px solid var(--color-or);
  padding-left: 14px;
  margin: 28px 0 12px;
  line-height: 1.35;
  transition: padding-left 0.2s ease;
}
.article-section h1:hover,
.article-section h2:hover,
.article-section h3:hover { padding-left: 18px; }
.article-section h1 { font-size: 1.2rem; }
.article-section h2 { font-size: 1.08rem; }
.article-section h3 { font-size: 0.98rem; }

/* ── Listes UL avec points or ── */
.article-section ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 16px;
  display: flex;
  flex-direction: column;
}
.article-section ul li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-separator);
  font-family: var(--font-corps);
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  transition: color 0.2s ease;
}
.article-section ul li:last-child { border-bottom: none; }
.article-section ul li:hover { color: var(--color-text-primary); }
.article-section ul li::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background-color: var(--color-or);
  flex-shrink: 0;
  margin-top: 7px;
}

/* ── Listes OL ── */
.article-section ol {
  padding-left: 20px;
  margin: 6px 0 16px;
}
.article-section ol li {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  padding: 5px 0;
}

/* ── ✅ Bloc CODE — LIGHT MODE (fond clair) ── */
.article-section pre {
  background: color-bg-secondary;
  color: var(--color-teal);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-code);
  font-size: 0.84rem;
  line-height: 1.75;
  margin: 20px 0;
  overflow-x: auto;
  border-left: 3px solid var(--color-teal);
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.article-section pre p {
  color: var(--color-teal);
  margin: 0;
  line-height: 1.75;
  font-family: var(--font-code);
  font-size: 0.84rem;
}

/* ── ✅ Bloc CODE — DARK MODE (fond sombre) ── */
body.dark-mode .article-section pre {
  background: color-footer;
  color: var(--color-or);
  border-left-color: var(--color-teal);
}
body.dark-mode .article-section pre p {
  color: var(--color-or);
}

/* ── Liens ── */
.article-section a { color: var(--color-or); text-decoration: underline; transition: color var(--transition); }
.article-section a:hover { color: var(--color-or-hover); }

/* ── Code inline ── */
.article-section code {
  font-family: var(--font-code);
  font-size: 0.82rem;
  background: rgba(27,74,71,0.1);
  color: var(--color-teal);
  padding: 2px 7px;
  border-radius: 4px;
}

/* ── Images ── */
.article-section img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 16px 0;
  object-fit: cover;
}


/* ==========================================
   BLOCS SPÉCIAUX
   ========================================== */

/* ── Conseil terrain ── */
.article-section .article-conseil,
.article-conseil {
  background: linear-gradient(135deg, rgba(212,168,67,0.07) 0%, rgba(212,168,67,0.02) 100%);
  border: 1px solid rgba(212,168,67,0.30);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 20px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-conseil:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(212,168,67,0.12);
}
.article-conseil strong {
  display: block;
  font-family: var(--font-titre);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-or);
  margin-bottom: 8px;
}
.article-conseil p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ── Conclusion ── */
.article-section .article-conclusion,
.article-conclusion {
  border: 1px solid var(--color-separator);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--color-bg-primary) 0%, rgba(212,168,67,0.03) 100%);
  margin: 24px 0;
  position: relative;
  overflow: hidden;
  text-align: center;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.article-conclusion:hover {
  box-shadow: 0 8px 24px rgba(212,168,67,0.10);
  transform: translateY(-2px);
}
.article-conclusion::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-or), transparent);
}
.article-conclusion h3 {
  font-family: var(--font-titre);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-or);
  text-align: center;
  margin-bottom: 12px;
  border: none !important;
  padding: 0 !important;
  margin-top: 0 !important;
}
.article-conclusion p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.80;
  font-style: italic;
  margin: 0;
  text-align: center;
}


/* ==========================================
   CLASSES CUSTOM (structure statique)
   ========================================== */

.article-section__title {
  font-family: var(--font-titre);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  border-left: 4px solid var(--color-or);
  padding-left: 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.article-section__text {
  font-family: var(--font-corps);
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.80;
  margin-bottom: 16px;
}

.article-box {
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 16px 0;
  transition: transform 0.2s ease;
}
.article-box:hover { transform: translateX(4px); }
.article-box--list { border: 1px solid var(--color-separator); background-color: var(--color-bg-primary); }
.article-box--tip  { border: 1px solid rgba(212,168,67,0.30); background: linear-gradient(135deg, rgba(212,168,67,0.07) 0%, rgba(212,168,67,0.02) 100%); }
.article-box__title { font-family: var(--font-titre); font-size: 0.9rem; font-weight: 700; color: var(--color-or); margin-bottom: 10px; }
.article-box__text  { font-family: var(--font-corps); font-size: 0.88rem; color: var(--color-text-secondary); line-height: 1.75; }

.article-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.article-list li { font-size: 0.88rem; color: var(--color-text-secondary); padding-left: 16px; position: relative; }
.article-list li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; border-radius: 50%; background-color: var(--color-or); }

.article-bullets { list-style: none; display: flex; flex-direction: column; }
.article-bullets li { font-size: 0.88rem; color: var(--color-text-secondary); padding: 11px 0 11px 26px; border-bottom: 1px solid var(--color-separator); position: relative; }
.article-bullets li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background-color: var(--color-or); }

/* ── Bloc code custom .article-code ── */
.article-code {
  background-color: #F0EDE6;
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(27,74,71,0.15);
  position: relative;
  overflow: hidden;
}
.article-code::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--color-or), var(--color-teal));
}
.article-code p { font-family: var(--font-code); font-size: 0.85rem; color: var(--color-teal); line-height: 1.7; padding-left: 8px; }

body.dark-mode .article-code { background-color: #1C1A16; border-color: rgba(212,168,67,0.15); }
body.dark-mode .article-code p { color: #F0EDE6; }

.article-conclusion__title { font-family: var(--font-titre); font-size: 1rem; font-weight: 700; color: var(--color-or); text-align: center; margin-bottom: 14px; }
.article-conclusion__text  { font-family: var(--font-corps); font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.80; text-align: center; }