/* =====================================================================
   Épreuve du jour : cartes (vignette + description + téléchargement)
   et visionneuse PDF en surimpression avec fond flouté.
   Couleurs reprises du thème du site (vert foncé #0b1f1a / #122e27, vert #0f9d74).
   Tout est préfixé "edj-" : aucun conflit avec le reste du site.
   ===================================================================== */

.epreuve-card .edj-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

/* Carte : un ton plus clair que le fond pour rester bien visible */
.epreuve-card .edj-item {
  display: flex; align-items: center; gap: 14px;
  background: #1a3d33; color: #eef5f2;
  border: 1px solid #2a5147; border-radius: 14px; padding: 12px 14px;
  cursor: pointer; outline: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.epreuve-card .edj-item:hover,
.epreuve-card .edj-item:focus-visible {
  transform: translateY(-2px); background: #1f473b; border-color: #0f9d74;
  box-shadow: 0 12px 26px -12px rgba(0,0,0,.6);
}
.epreuve-card .edj-item:focus-visible { box-shadow: 0 0 0 3px rgba(123,224,187,.55); }

/* Vignette : page blanche du PDF, nette sur fond vert */
.epreuve-card .edj-thumb {
  position: relative; flex: 0 0 76px; height: 100px;
  border: 2px solid #2a5147; border-radius: 8px; background: #fff; overflow: hidden;
}
.epreuve-card .edj-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.epreuve-card .edj-pdf-badge {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  background: #0f9d74; color: #fff; font-size: 9.5px; font-weight: 700;
  letter-spacing: .04em; padding: 2px 6px; border-radius: 4px;
}
.epreuve-card .edj-thumb.is-fallback::after {
  content: "\1F4C4"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 30px;
}

/* Texte à côté */
.epreuve-card .edj-info { flex: 1; min-width: 0; }
.epreuve-card .edj-title {
  margin: 0 0 4px; font-size: 15.5px; font-weight: 700; line-height: 1.3; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.epreuve-card .edj-meta { margin: 0; font-size: 12.5px; color: #c6d9d2; }
.epreuve-card .edj-by   { display: inline-block; margin-top: 6px; font-size: 12px; color: #c6d9d2; }
.epreuve-card .edj-by b { color: #7be0bb; font-weight: 700; }

/* Icône de téléchargement : cercle vert bien visible */
.epreuve-card .edj-dl {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #0f9d74; color: #fff; text-decoration: none;
  transition: background .15s, transform .15s;
}
.epreuve-card .edj-dl:hover, .epreuve-card .edj-dl:focus-visible { background: #12b386; transform: scale(1.08); }

/* ---------- Visionneuse en surimpression ---------- */
.edj-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(6, 20, 16, .6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.edj-overlay.is-open { display: flex; }

.edj-panel {
  width: min(960px, 100%); height: min(92vh, 100%);
  display: flex; flex-direction: column;
  background: #122e27; border: 1px solid #2a5147; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: edjIn .2s ease;
}
@keyframes edjIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.edj-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid #1e433a; background: #0b1f1a;
}
.edj-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.edj-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid #2a5147; border-radius: 10px;
  background: #1a3d33; color: #eef5f2; font: 600 13px/1 inherit; cursor: pointer; text-decoration: none;
}
.edj-btn:hover { background: #24503f; }
.edj-btn--primary { background: #0f9d74; border-color: #0f9d74; color: #fff; }
.edj-btn--primary:hover { background: #12b386; }
.edj-close { width: 38px; padding: 0; font-size: 22px; line-height: 1; }

/* Zone de lecture : fond vert très sombre, pages blanches => texte du PDF très lisible */
.edj-body { flex: 1; overflow: auto; background: #0b1f1a; padding: 16px; -webkit-overflow-scrolling: touch; }
.edj-pages canvas {
  display: block; margin: 0 auto 14px; background: #fff; max-width: none;
  border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.edj-state { text-align: center; padding: 40px 12px; color: #c6d9d2; font-size: 14px; }
.edj-state a { color: #7be0bb; font-weight: 600; }

body.edj-lock { overflow: hidden; }

@media (max-width: 640px) {
  .epreuve-card .edj-thumb { flex-basis: 64px; height: 86px; }
  .epreuve-card .edj-title { font-size: 14.5px; }
  .edj-overlay { padding: 0; }
  .edj-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .edj-head { padding: 10px 12px; }
  .edj-btn .edj-btn-label { display: none; }
  .edj-body { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .edj-panel { animation: none; }
  .epreuve-card .edj-item, .epreuve-card .edj-dl { transition: none; }
}