/* =====================================================================
   Retouches propres au site, par-dessus nsh.css (issue des maquettes) :
   logo plus petit, mode sombre revu, accueil plus sobre, et adaptation
   au HTML que produit Quarto (billets, figures, notes, listings).
   ===================================================================== */

/* ---------- Mode sombre : gris chaud plutôt que noir, rose adouci ---------- */
:root[data-theme="dark"] {
  --bg: #211f23; --panel: #2a272d; --ink: #ebe6df; --muted: #a8a199; --rule: #3c383f;
  --accent: #ebe6df; --accent-2: #ec82b9; --accent-2-text: #f3a3cb; --on-accent: #211f23;
  --rub-eco: #f3a3cb; --rub-ref: #ebe6df; --rub-met: #a8a199;
  --code-bg: #2a272d; --tok-fn: #f3a3cb; --tok-str: #d9c2cf; --tok-num: #f3a3cb;
  --sub-bg: #2a272d; --sub-ink: #ebe6df; --sub-h2: #f3a3cb; --sub-muted: rgba(235,230,223,.8);
  --sub-btn: #ec82b9; --sub-btn-ink: #211f23; --field-bg: #211f23; --field-border: 2px solid #6b6570;
  --shadow-ink: rgba(236,130,185,.32); --logo-sh: #ec82b9; --logo-shadow: rgba(236,130,185,.3); --logo-dot: #ebe6df;
  --hl: rgba(236,130,185,.26); --nav-hover-ink: #ebe6df;
  --statement-bg: #2a272d; --statement-ink: #ebe6df; --statement-strong: #f3a3cb;
  --frame: #57525c;
}
:root { --frame: var(--ink); }
.card { border-color: var(--frame); }
[data-theme="dark"] blockquote.statement { box-shadow: 7px 6px 0 rgba(236,130,185,.4); }
[data-theme="dark"] .callout { border-color: var(--frame); }

/* ---------- En-tête : logo plus petit, bouton clair / sombre ---------- */
.logo { font-size: 24px; }
.logo .l-sh { text-shadow: 2px 1.5px 0 var(--logo-shadow); }
.site-header .wrap { min-height: 60px; }
.theme-btn { font: inherit; font-size: 16px; line-height: 1; width: 34px; height: 34px; display: inline-grid; place-items: center; margin-left: 6px;
  background: none; color: var(--ink); border: 2px solid var(--ink); cursor: pointer; }
.theme-btn { transition: color .15s, border-color .15s; }
.theme-btn:hover { color: var(--accent-2); border-color: var(--accent-2); }
.theme-btn .moon, [data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: inline; }
@media (max-width: 760px) { .menu-btn { margin-left: auto; } .logo { margin-right: 0; } }

/* ---------- Accueil : plus sobre ---------- */
.hero { padding: 54px 0 38px; }
.hero h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.22; max-width: 34ch; margin: .4em 0 .6em; text-shadow: 2px 1.5px 0 var(--shadow-ink); }

/* ---------- Socle Quarto : neutraliser Bootstrap là où il gêne ---------- */
body { background-color: var(--bg); color: var(--ink); }
a:hover { color: inherit; }
h1, h2, h3, h4 { color: inherit; }
#quarto-content, main.content { margin: 0; padding: 0; max-width: none; }
.page-head h1 { margin-top: .2em; }
.listing-empty, .quarto-listing-empty { color: var(--muted); font-style: italic; }
::selection { background: var(--hl); color: var(--ink); }

/* Chips de rubrique en liens */
a.chip { text-decoration: none; display: inline-block; }
a.chip[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------- Billet ---------- */
.billet #quarto-content > :not(.site-header):not(.site-footer):not(.progress):not(script) {
  max-width: 680px; margin-left: max(32px, calc((100% - 1120px) / 2 + 32px)); margin-right: 32px; }
.billet #quarto-content > header.post-head { max-width: 780px; }
.billet #quarto-content p { margin: 0 0 1.05em; }
.billet #quarto-content h2 { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 28px; line-height: 1.2; margin: 1.8em 0 .6em; color: var(--accent); }
.billet #quarto-content h3 { font-family: var(--font-head); font-weight: 800; font-size: 21px; margin: 1.5em 0 .5em; }
.billet #quarto-content ul, .billet #quarto-content ol { padding-left: 1.3em; margin: 0 0 1.05em; }
.billet #quarto-content li { margin-bottom: .3em; }
.billet #quarto-content blockquote { margin: 26px 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--accent-2); color: var(--ink); font-size: inherit; }
.billet #quarto-content > :not(.site-header):not(.post-head) a { text-decoration-color: var(--accent-2); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.billet #quarto-content > :not(.site-header):not(.post-head) a:not(.ico):not(.cite-btn):hover { background: var(--hl); }
.post-head .origin { display: block; margin: 0 0 8px; }
.post-head .origin a { text-decoration-color: var(--accent-2); }
@media (max-width: 760px) { .billet #quarto-content > :not(.site-header):not(.site-footer):not(.progress):not(script) { margin-left: 16px; margin-right: 16px; } }

/* Figures et légendes */
.quarto-figure { margin: 30px 0; }
.quarto-figure img, .billet #quarto-content img { border: 2px solid var(--frame); background: #fff; }
.quarto-figure figcaption, figcaption.figure-caption { font-family: var(--font-label); font-size: 14px; color: var(--muted); margin-top: 8px; text-align: left; }
.quarto-figure figcaption a { color: var(--accent-2-text); font-weight: 700; }
.quarto-figure-center > figure > p, .quarto-figure-center > figure > div { text-align: left; }

/* Notes de bas de page */
section.footnotes { margin-top: 44px; padding-top: 14px; border-top: 5px solid var(--ink); font-size: 15px; color: var(--muted); }
section.footnotes hr { display: none; }
section.footnotes ol { padding-left: 1.2em; }
a.footnote-ref { text-decoration: none; font-family: var(--font-label); font-weight: 800; color: var(--accent-2-text); }
a.footnote-ref sup { font-size: 12px; }
.footnote-back { text-decoration: none; }

/* Code */
div.sourceCode, pre.sourceCode { background: var(--code-bg); border: 0; border-left: 6px solid var(--accent); border-radius: 0; }
code { color: inherit; font-family: var(--font-code); }

/* Fin de billet */
.post-end { max-width: 680px; margin: 40px 0 0; }
.post-end .origin { font-size: 15px; color: var(--muted); }

/* ---------- Écrits ---------- */
.ecrit-row { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 16px 0; border-bottom: var(--row-rule); }
.ecrit-row .when { font-family: var(--font-label); font-size: 13px; color: var(--muted); padding-top: 4px; }
.ecrit-row .t { font-family: var(--font-head); font-weight: 800; font-size: 19px; line-height: 1.25; text-decoration: none; }
.ecrit-row a.t:hover { color: var(--accent-2-text); }
.ecrit-row p { margin: 4px 0 0; font-size: 16px; color: var(--muted); }
.ecrit-row .venue { font-style: italic; }
.ecrit-row .ext::after { content: " ↗"; font-weight: 400; color: var(--accent-2-text); }
@media (max-width: 760px) { .ecrit-row { grid-template-columns: 1fr; gap: 2px; } }

/* Mini-listes de la page de garde */
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { padding: 10px 0; border-bottom: var(--row-rule); }
.mini li a { font-weight: 700; text-decoration: none; }
.mini li a:hover { background: var(--hl); }
.mini li span { display: block; font-size: 14px; color: var(--muted); }

/* Page simple (Cours, À propos) */
.page-body { max-width: 760px; }
.note-v0 { font-family: var(--font-label); font-size: 13px; color: var(--muted); margin-top: 10px; }

/* Annexe Quarto (notes) : même colonne que le texte */
#quarto-appendix, #quarto-appendix.default { padding: 0; background: none; background-color: transparent; border: 0; color: var(--muted); }
#quarto-appendix section { border: 0; }
#quarto-appendix .appendix-heading, #quarto-appendix h2.anchored { font-family: var(--font-label); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); border: 0; margin: 0 0 8px; }
.billet #quarto-content a.lightbox { display: block; }

/* =====================================================================
   V0.1 : retours du 28 octobre
   ===================================================================== */

/* Rubrique en texte normal (plus de tampon) */
.rub { display: inline; border: 0; padding: 0; transform: none !important; -webkit-mask-image: none; mask-image: none;
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 800; line-height: inherit; }

/* Temps de lecture : en texte, dans la police des étiquettes */
.readtime { font-family: var(--font-label); font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.post-row .readtime { display: block; margin-top: 8px; }

/* Bootstrap a sa propre classe .card : on l'annule */
.card { --bs-card-bg: transparent; color: var(--ink); border-radius: 0; }
.card .t { color: var(--ink); }

/* Derniers billets : des blocs plus vivants */
.cards { gap: 30px; }
.cards .card { display: flex; flex-direction: column; min-height: 290px; padding: 18px 18px 14px;
  border: 2.5px solid var(--frame); border-top: 7px solid var(--rc); background: var(--card-tint, var(--bg));
  box-shadow: 7px 7px 0 var(--accent-2); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.cards .card:nth-child(1) { --card-tint: color-mix(in srgb, var(--accent-2) 16%, var(--bg)); }
.cards .card:nth-child(2) { --card-tint: var(--panel); }
.cards .card:nth-child(3) { --card-tint: var(--bg); }
.cards .card:hover { transform: translate(-3px, -3px) rotate(-.5deg); box-shadow: 11px 11px 0 var(--accent-2); }
.cards .card .t { font-size: 23px; margin: 12px 0 10px; }
.cards .card .t::after { content: ""; position: absolute; inset: 0; }
.cards .card .t:hover { color: var(--ink); }
.card-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 10px; }
[data-theme="dark"] .cards .card { box-shadow: 7px 7px 0 rgba(236,130,185,.45); }
[data-theme="dark"] .cards .card:hover { box-shadow: 11px 11px 0 rgba(236,130,185,.55); }

/* Icônes dans la barre du haut */
.nav .social { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; padding-left: 10px; border-left: 2px solid var(--rule); }
.ico { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.ico svg { width: 17px; height: 17px; }
.ico { transition: color .15s; }
.ico:hover, .ico:focus-visible { color: var(--accent-2); background: none; box-shadow: none; }
.nav .social .ico::before { display: none; }
@media (max-width: 1000px) and (min-width: 761px) { .nav a:not(.ico) { padding: 6px 8px; } .nav .social { margin-left: 4px; padding-left: 4px; } }
@media (max-width: 760px) { .nav .social { margin: 10px 0 0; padding: 10px 0 0; border-left: 0; border-top: 2px solid var(--rule); } }

/* Billet : barre de partage et bouton Citer */
.post-head .share { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 0; padding: 8px 0; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.post-head .share .ico { width: 34px; height: 34px; }
.post-head .share .ico.done { color: var(--accent-2); }
.cite-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 12px; border: 2px solid var(--ink);
  font-family: var(--font-label); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; color: var(--ink); }
.cite-btn svg { width: 14px; height: 14px; }
.cite-btn { transition: color .15s, border-color .15s; }
.cite-btn:hover { color: var(--accent-2); border-color: var(--accent-2); }
.post-head .meta .readtime { margin-left: 4px; }

/* Pour citer (bloc ajouté par site.js) */
.billet #quarto-content > .pour-citer { margin-top: 40px; padding: 16px 18px; border: 2.5px solid var(--frame); border-left: 8px solid var(--accent-2); }
.pour-citer h2 { font-family: var(--font-label) !important; font-size: 13px !important; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted) !important; margin: 0 0 6px !important; }
.pour-citer p { margin: 0 0 10px; font-size: 16px; overflow-wrap: anywhere; }
.cite-copy { font: inherit; font-family: var(--font-label); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 12px; background: none; color: var(--ink); border: 2px solid var(--ink); cursor: pointer; }
.cite-copy:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* Bloc « Citation » de Quarto en fin de billet */
#quarto-citation { margin-top: 24px; }
#quarto-citation .citation-bibtex, #quarto-appendix pre { background: var(--code-bg); color: var(--ink); border: 0; border-left: 6px solid var(--accent-2); font-size: 13px; padding: 12px 14px; white-space: pre-wrap; }
#quarto-appendix .quarto-appendix-contents { margin: 0; }
#quarto-appendix .quarto-appendix-secondary-label { font-family: var(--font-label); font-weight: 800; font-size: 13px; color: var(--ink); margin-top: 14px; }

/* Barre du haut : au survol, seul le surlignage glisse sous le mot (clair comme sombre) */
.nav a:not(.cta):not(.ico):hover { background: none; }
[data-theme="dark"] .nav a:not(.cta)::before { mix-blend-mode: normal; }
[data-theme="dark"] { --nav-hl: rgba(236,130,185,.4); }
.nav a.ico:not(.cta):hover, .nav a.ico:not(.cta):focus-visible { color: var(--accent-2); }

/* =====================================================================
   V0.2 : accueil qui respire, menu fiable sur tablette et téléphone
   ===================================================================== */

/* Accueil : « Salut, c'est Nabil ! » aux couleurs du logo */
.hero { padding: 72px 0 60px; }
.hero h1.hello { color: var(--accent); text-shadow: 2px 1.5px 0 var(--shadow-ink); font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; max-width: none; margin: 0 0 .5em; }
.hero p { font-size: 19px; line-height: 1.6; max-width: 60ch; color: var(--ink); margin: 0; }
.section { padding: 64px 0; }
.section-head { margin-bottom: 30px; }
.two-col { gap: 72px; }
@media (max-width: 760px) { .hero { padding: 52px 0 44px; } .section { padding: 44px 0; } .two-col { gap: 40px; } }

/* Menu replié dès la tablette (sous 1000 px) : la barre complète n'y tient pas */
@media (max-width: 1000px) {
  .site-header .wrap { position: relative; }
  .menu-btn { display: inline-block; margin-left: auto; }
  .logo { margin-right: 0; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 30; flex-direction: column; align-items: flex-start; gap: 0;
         background: var(--bg); border-bottom: var(--header-border); padding: 10px 32px 18px; box-shadow: 0 10px 0 -6px var(--accent-2); }
  .nav.open { display: flex; }
  .nav a:not(.ico) { padding: 10px 2px; }
  .nav .cta { align-self: stretch; text-align: center; margin: 10px 0 0; padding: 10px 12px; }
  .nav .social { margin: 14px 0 0; padding: 12px 0 0; border-left: 0; border-top: 2px solid var(--rule); align-self: stretch; }
}
@media (max-width: 760px) { .nav { padding: 8px 16px 16px; } }

/* Le surlignage suit le mot, pas toute la largeur du menu */
.nav a:not(.cta):not(.ico) { display: inline-block; width: max-content; }

/* Cartes : trois colonnes seulement quand il y a la place */
@media (max-width: 1000px) {
  .cards { grid-template-columns: 1fr; gap: 26px; }
  .cards .card { min-height: 0; }
  .cards .card .t { margin-top: 10px; }
}

/* Icônes de liens dans le texte (Cash Cash Sardine) */
.inline-icons { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 4px; }
.inline-icons .ico { width: 28px; height: 28px; }
.inline-icons .ico svg { width: 16px; height: 16px; }
.bilingual h3 { font-family: var(--font-head); font-weight: 800; font-size: 19px; margin: 1.3em 0 .4em; }

/* Quarto ajoute 14 px en haut des enfants de #quarto-content : on reprend la main */
#quarto-content > .hero { padding: 76px 0 60px; }
.block { padding: 60px 0; }
.block + .block { padding-top: 12px; }
.section-head .soon { font-family: var(--font-label); font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { #quarto-content > .hero { padding: 48px 0 40px; } .block { padding: 44px 0; } .block + .block { padding-top: 8px; } }

/* =====================================================================
   V0.3 : revue design du 30 octobre (air, contrastes, clavier, téléphone)
   ===================================================================== */

/* Billets : Quarto écrase l'espace sous la barre (14 px) ; on le rend */
#quarto-content > header.post-head { padding: 56px 0 26px; }
@media (max-width: 760px) { #quarto-content > header.post-head { padding: 36px 0 22px; } }

/* Boutons simples : Bootstrap leur donne une encre fixe, illisible en sombre */
.btn:not(.primary), .btn:not(.primary):hover, .btn:not(.primary):focus-visible { color: var(--ink); background: none; border-color: var(--ink); border-radius: 0; }

/* Focus clavier : contour rose, visible en clair comme en sombre */
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.ico:focus-visible { outline-offset: 0; }

/* Rubriques : rose un peu plus foncé en clair, pour le niveau AA sur fond gris */
:root:not([data-theme="dark"]) { --rub-eco: #b3126f; }

/* Liens « Tous → » : plus lisibles, cible d'au moins 24 px */
.section-head a { font-size: 14px; display: inline-flex; align-items: center; min-height: 28px; }
.section-head a:hover { color: var(--ink); }

/* Billet sur téléphone : « Citer » reste sur la ligne des icônes */
@media (max-width: 420px) { .post-head .share { gap: 0; } .post-head .share .ico { width: 32px; } .cite-btn { padding: 4px 10px; } }

/* Bouton Menu : mêmes capitales que la barre */
.menu-btn { font-family: var(--font-label); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  height: 34px; padding: 0 12px; border: 2px solid var(--ink); color: var(--ink); }
.menu-btn:hover { color: var(--accent-2); border-color: var(--accent-2); }
.menu-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); }

/* Listes de billets sur téléphone : rubrique et date sur une ligne */
@media (max-width: 760px) {
  .post-row { grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 0; }
  .post-row > div:not(.when) { display: contents; }
  .post-row .meta { grid-column: 1; grid-row: 1; }
  .post-row .when { grid-column: 2; grid-row: 1; padding-top: 0; align-self: center; }
  .post-row .t, .post-row p, .post-row .readtime { grid-column: 1 / -1; }
  .post-row .t { margin-top: 6px; }
}

/* Cours : même espace sous l'introduction que sur la page Blog */
.page-head + .block { padding-top: 0; }

/* Bootstrap affiche .nav:not(.nav-hidden) dès 576 px, en !important : sans ceci, le menu reste ouvert sur tablette */
@media (max-width: 1000px) { .site-header .nav:not(.open) { display: none !important; } }

/* Abonnement : liens vers les flux RSS */
.subscribe .rss-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 14px 0 0; font-family: var(--font-label); font-size: 14px; color: var(--sub-muted, var(--muted)); }
.subscribe .rss-links svg { width: 14px; height: 14px; }
.subscribe .rss-links a { color: var(--sub-ink); text-decoration-color: var(--accent-2); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.subscribe .rss-links a:hover { color: var(--sub-h2); }

/* Portrait : la photo telle quelle, cadre d'encre et ombre rose comme les cartes */
.portrait { background: none; border: 2.5px solid var(--frame); box-shadow: 7px 7px 0 var(--accent-2); overflow: hidden; }
.portrait img { filter: none; mix-blend-mode: normal; }
.portrait::after { display: none; }
[data-theme="dark"] .portrait { box-shadow: 7px 7px 0 rgba(236,130,185,.45); }

/* Abonnement : message de confirmation et mention sur les données */
.subscribe .sub-msg { margin: 4px 0 0; font-weight: 700; color: var(--sub-ink); }
.subscribe .sub-legal { margin: 12px 0 0; font-size: 13px; color: var(--sub-muted, var(--muted)); }
.subscribe form[hidden] { display: none; }
.subscribe button:disabled { opacity: .6; cursor: wait; }

/* =====================================================================
   Abonnement, façon carte Kit : titre à gauche, champ et bouton à droite.
   Plus de coupon en pointillés ; fonctionne en clair comme en sombre.
   ===================================================================== */
#abonnement.subscribe { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 56px; align-items: start;
  margin: 0; padding: 36px 0 8px; outline: 0; background: none; color: var(--ink); border-top: 5px solid var(--ink); box-shadow: inset 0 4px 0 -0px transparent; }
#abonnement.subscribe::before { content: none; }
#abonnement.subscribe::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 4px; background: var(--accent-2); }
#abonnement .sub-intro h2 { margin: 0 0 16px; font-family: var(--font-head); font-weight: 900; font-size: clamp(26px, 3vw, 34px); line-height: 1.12;
  text-transform: none; letter-spacing: -0.01em; color: var(--ink); text-shadow: 2px 1.5px 0 var(--shadow-ink); }
#abonnement .sub-intro p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); }
#abonnement form { display: grid; gap: 12px; }
#abonnement input[type="email"] { width: 100%; font-family: var(--font-label); font-size: 17px; padding: 13px 14px;
  background: var(--field-plain, #fff); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; }
#abonnement input[type="email"]::placeholder { color: var(--muted); }
#abonnement input[type="email"]:focus { outline: 3px solid var(--accent-2); outline-offset: 2px; }
#abonnement button { width: 100%; padding: 14px 18px; background: var(--ink); color: var(--bg); border: 0; border-radius: 0;
  font-family: var(--font-label); font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; transition: box-shadow .15s; }
#abonnement button:hover { box-shadow: 5px 4px 0 var(--accent-2); }
#abonnement .sub-msg { margin: 0; font-weight: 700; color: var(--ink); }
#abonnement .sub-legal { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
#abonnement .rss-links { margin: 14px 0 0; color: var(--muted); }
#abonnement .rss-links a { color: var(--ink); }
#abonnement .rss-links a:hover { color: var(--accent-2-text); }
[data-theme="dark"] { --field-plain: #2a272d; }
#abonnement { position: relative; }
@media (max-width: 760px) { #abonnement.subscribe { grid-template-columns: 1fr; gap: 22px; padding-top: 28px; } }
#abonnement h2 { border: 0; padding-bottom: 0; }
