/* =======================================================
   Blog 18nelli — style des articles + index
   Généré une fois, bidouillable à la main (le script ne
   l'écrase plus s'il existe). Neutralise les règles globales
   un peu sauvages de styles.css en restant dans la DA rouge/noir.
   ======================================================= */

.article,
.blog-index {
  position: relative;
  z-index: 10;
  max-width: 760px;
  margin: 2rem auto 6rem;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #ff0000;
  box-shadow: 4px 4px 0 #ff0000, 8px 8px 24px rgba(0, 0, 0, 0.8);
  color: #ff0000;
  font-family: "Comic Neue", sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

.article p,
.article li,
.article blockquote,
.blog-index li {
  white-space: normal;
  left: auto;
  background: transparent;
  color: #ff0000;
  font-family: "Comic Neue", sans-serif;
}

.article a,
.blog-index a {
  margin-left: 0;
  color: #ff0000;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.article a:hover,
.blog-index a:hover {
  color: #000;
  background: #ff0000;
}

/* base commune des images : bordure rouge, hauteur auto */
.article img {
  position: static;
  left: auto;
  height: auto;
  border: 1px solid #ff0000;
}

/* ---- IMAGE SEULE -------------------------------------------------
   Taille par défaut plus raisonnable que "plein cadre".
   Change le 70% si tu veux + grand / + petit par défaut.
   Surcharge image par image avec le tag w= (voir blog-gen.sh).   */
.article .img-single { text-align: center; margin: 1.5rem 0; }
.article .img-single img {
  display: inline-block;
  width: 70%;         /* <-- défaut, surchargé par un style inline w= */
  max-width: 100%;
  margin: 0;
}

/* ---- IMAGES CÔTE À CÔTE (colonnes Notion) ----------------------- */
.article .img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
  margin: 1.5rem 0;
}
.article .img-row img { flex: 1 1 0; min-width: 0; max-width: 100%; margin: 0; }
@media (max-width: 600px) {
  .article .img-row { flex-direction: column; }
  .article .img-single img { width: 100%; }
}

/* ---- EMBED FALSTAD (circuitjs) ----------------------------------
   Un lien Falstad seul dans le markdown est transformé en iframe.  */
.article .embed-falstad {
  margin: 1.5rem 0;
  border: 1px solid #ff0000;
  background: #000;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.12);
}
.article .embed-falstad iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
}
.article .embed-falstad .embed-link {
  display: block;
  text-align: right;
  font-family: "Iceland", monospace;
  font-size: 0.85em;
  padding: 0.3rem 0.7rem;
  border-top: 1px dashed rgba(255, 0, 0, 0.5);
  text-decoration: none;
}
@media (max-width: 600px) {
  .article .embed-falstad iframe { height: 400px; }
}

/* ---- titres : police Iceland comme le site --------------------- */
.article h1, .article h2, .article h3, .article h4 {
  font-family: "Iceland", "Comic Neue", sans-serif;
  color: #ff0000;
  line-height: 1.2;
  white-space: normal;
  max-width: none;
  margin: 1.8rem 0 0.8rem;
}
.article h1 { font-size: 2.4rem; border-bottom: 2px solid #ff0000; padding-bottom: 0.3rem; }
.article h2 { font-size: 1.8rem; }
.article h3 { font-size: 1.4rem; }

.article hr { border: none; border-top: 1px dashed #ff0000; margin: 2rem 0; }

.article blockquote {
  margin: 1.2rem 0;
  padding: 0.6rem 1rem;
  border-left: 4px solid #ff0000;
  background: rgba(255, 0, 0, 0.08);
  font-style: italic;
}

/* code : vibe terminal CRT */
.article code {
  font-family: "Iceland", monospace;
  background: #000; color: #ff0000;
  border: 1px solid #ff0000;
  padding: 0.05em 0.35em; font-size: 0.95em;
}
.article pre {
  background: #000; color: #ff0000;
  border: 1px solid #ff0000;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.15);
  padding: 1rem; overflow-x: auto; white-space: pre;
}
.article pre code { border: none; padding: 0; background: transparent; }

/* tableaux : ne débordent jamais (largeur fixe), texte long passe à la ligne */
.article table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 1.2rem 0;
}
.article th, .article td {
  border: 1px solid #ff0000;
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.article th { background: #ff0000; color: #000; }
/* lien DANS un tableau : tronqué avec ... mais toujours cliquable */
.article td a, .article th a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.article-meta { font-family: "Iceland", monospace; opacity: 0.8; margin: 0 0 1.5rem; }

/* ===== Index du blog ===== */
.blog-index ul { list-style: none; padding: 0; margin: 0; }
.blog-index li { padding: 0.6rem 0; border-bottom: 1px dashed rgba(255, 0, 0, 0.4); white-space: normal; }
.blog-index li:last-child { border-bottom: none; }
.blog-index .date { font-family: "Iceland", monospace; opacity: 0.7; margin-left: 0.6rem; font-size: 0.85em; }

@media (max-width: 768px) {
  .article, .blog-index { margin: 1rem 0.5rem 4rem; padding: 1rem 1.1rem; font-size: 17px; }
  .article h1 { font-size: 1.9rem; }
}