/* Wello — contenu markdown (filtre Jinja `|md`).
 *
 * Pourquoi ce fichier : les classes `prose` de @tailwindcss/typography ne sont
 * PAS dans app/static/css/tailwind.css (le build date du 25/09, le bloc
 * typography n'y est pas). Les `<h1>`/`<h2>` produits par markdown tombaient
 * donc sur les tailles par défaut du navigateur (h1 = 2em = 32px), immenses
 * dans un encart de description.
 *
 * Échelle appliquée = celle du site, pas celle de typography :
 *   - base.html impose déjà h1 = 18px / h2 = 16px sur mobile dashboard ;
 *   - les templates n'utilisent jamais plus gros que `text-xl` pour un titre.
 * D'où : h1 20px, h2 18px, h3 16px, h4 14px, h5 13px, h6 12px.
 *
 * Ne pas reconstruire tailwind.css en espérant retrouver `prose` : ces règles
 * remettraient les titres à 36px. Passer par `.wello-md`.
 */

.wello-md {
  color: #475569;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.wello-md > *:first-child {
  margin-top: 0;
}

/* ── Titres : compacts, comme partout ailleurs sur Wello ─────────────── */
.wello-md h1,
.wello-md h2,
.wello-md h3,
.wello-md h4,
.wello-md h5,
.wello-md h6 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 1.25em 0 0.5em;
}

.wello-md h1 {
  font-size: 20px;
  font-weight: 800;
}
.wello-md h2 {
  font-size: 18px;
}
.wello-md h3 {
  font-size: 16px;
  color: #1e293b;
}
.wello-md h4 {
  font-size: 14px;
  color: #334155;
}
.wello-md h5 {
  font-size: 13px;
  color: #475569;
}
.wello-md h6 {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Texte ────────────────────────────────────────────────────────────── */
.wello-md p {
  margin: 0 0 0.85em;
}

.wello-md strong {
  color: #1e293b;
  font-weight: 800;
}

.wello-md em,
.wello-md i {
  font-style: italic;
}

.wello-md a {
  color: #1d7ef2;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wello-md a:hover {
  color: #1270d6;
}

.wello-md ul,
.wello-md ol {
  margin: 0 0 0.85em;
  padding-left: 1.5rem;
}

.wello-md li {
  margin: 0 0 0.3em;
}

.wello-md ul > li {
  list-style: disc;
}

.wello-md ol > li {
  list-style: decimal;
}

.wello-md li::marker {
  color: #94a3b8;
}

.wello-md li > ul,
.wello-md li > ol {
  margin: 0.2em 0 0.35em;
}

.wello-md hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.5em 0;
}

.wello-md blockquote {
  margin: 0 0 0.85em;
  padding: 0.5em 0 0.5em 0.9em;
  border-left: 3px solid #1d7ef2;
  background: #eef6fe;
  border-radius: 0 6px 6px 0;
  color: #334155;
}

.wello-md blockquote > *:last-child {
  margin-bottom: 0;
}

/* ── Code ─────────────────────────────────────────────────────────────── */
.wello-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.wello-md pre {
  margin: 0 0 0.85em;
  padding: 0.85em;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
}

.wello-md pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* ── Tableaux ─────────────────────────────────────────────────────────── */
.wello-md table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 0.85em;
  font-size: 0.875rem;
}

.wello-md th,
.wello-md td {
  border: 1px solid #e2e8f0;
  padding: 0.5em 0.7em;
  text-align: left;
  vertical-align: top;
}

.wello-md th {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 700;
  white-space: nowrap;
}

.wello-md img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ── Mobile : mêmes valeurs que les overrides dashboard de base.html ──── */
@media (max-width: 767px) {
  .wello-md h1 {
    font-size: 18px;
  }
  .wello-md h2 {
    font-size: 16px;
  }
  .wello-md h3 {
    font-size: 15px;
  }
  .wello-md h4 {
    font-size: 14px;
  }
  .wello-md table {
    font-size: 13px;
  }
}

/* Surlignage recherche (filtre highlight_query) */
mark.wello-hl, mark{background:rgba(255,206,0,.35);color:inherit;border-radius:3px;padding:0 2px}

/* ── Description complète d'une offre : titres du document sous le titre de la section (14px) ── */
.wello-md--doc h1,
.wello-md--doc h2 {
  font-size: 14px;
  margin: 1.5em 0 0.5em;
  padding-top: 1em;
  border-top: 1px solid #f1f5f9;
}
.wello-md--doc > h1:first-child,
.wello-md--doc > h2:first-child {
  border-top: 0;
  padding-top: 0;
}
.wello-md--doc h3 {
  font-size: 13px;
}
.wello-md--doc h4 {
  font-size: 12px;
}

/* ── Sections repliables des fiches (details.wello-fold) ── */
.wello-fold > summary {
  list-style: none;
}
.wello-fold > summary::-webkit-details-marker {
  display: none;
}
.wello-fold[open] > summary .wello-fold__chev {
  transform: rotate(180deg);
}
.wello-fold[open] > summary {
  background: #f8fafc;
}
