/* Fenêtres modales du site (ressources du Hub, disponibilité du livre) : mêmes couleurs, polices et pointillés décalés que le reste. */
.hm-modal {
  --m-navy: #1A2B48;
  --m-orange: #FF7F32;
  --m-orange-dark: #C94A0A; /* compromis, voir accueil.css */
  --m-orange-light: #FFF3E0;
  --m-violet: #6B21A8;
  --m-violet-light: #E9D5FF;
  --m-line: #E2E8F0;
  --m-text: #334155;
  --m-head: Montserrat, sans-serif;

  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  opacity: 0; transition: opacity 0.25s ease;
}
.hm-modal[hidden] { display: none; }
.hm-modal.is-open { opacity: 1; }
.hm-modal--top { z-index: 130; }

.hm-modal__back { position: fixed; inset: 0; background: rgba(248, 250, 252, 0.82); backdrop-filter: blur(4px); cursor: pointer; }
.hm-modal__wrap { position: relative; display: flex; min-height: 100%; align-items: center; justify-content: center; padding: 1rem; pointer-events: none; }
@media (min-width: 640px) { .hm-modal__wrap { padding: 1.5rem; } }

/* Le panneau : cadre marine, pointillés orange décalés derrière (comme les blocs du site) */
.hm-modal__panel {
  position: relative; z-index: 0; width: 100%; max-width: 42rem; margin: auto; pointer-events: auto;
  border: 2px solid var(--m-navy); border-radius: 16px;
  transform: translateY(12px) scale(0.98); transition: transform 0.25s ease;
}
.hm-modal--narrow .hm-modal__panel { max-width: 34rem; }
.hm-modal.is-open .hm-modal__panel { transform: none; }
/* Pointillés puis aplat blanc, tous deux derrière le contenu : le blanc (::after, peint après) recouvre les pointillés à l'intérieur du cadre, qui ne ressortent qu'au bord, derrière la fenêtre */
.hm-modal__panel::before { content: ""; position: absolute; inset: 6px -6px -8px 6px; border: 2px dashed var(--m-orange-dark); border-radius: 18px 12px 16px 20px; z-index: -1; }
.hm-modal__panel::after { content: ""; position: absolute; inset: 0; background: #fff; border-radius: 14px; z-index: -1; }
.hm-modal__panel:focus { outline: none; }

.hm-modal__close { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2; display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; background: transparent; border: 0; border-radius: 10px; color: #DC2626; cursor: pointer; transition: color 0.15s, transform 0.15s; }
.hm-modal__close:hover, .hm-modal__close:focus-visible { color: #B91C1C; transform: scale(1.12); }
.hm-modal__close:focus-visible { outline: 2px solid #DC2626; outline-offset: 2px; }
.hm-modal__close svg { width: 2rem; height: 2rem; stroke-width: 4; }

.hm-modal__body { padding: 1.8rem 1.4rem 1.6rem; font-family: Lora, serif; font-size: 1.02rem; line-height: 1.7; color: var(--m-text); text-align: left; }
@media (min-width: 640px) { .hm-modal__body { padding: 2.2rem 2.4rem 2rem; } }
.hm-modal__body > * + * { margin-top: 1rem; }

.hm-modal__tag { display: inline-block; font: 800 0.66rem var(--m-head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--m-orange-dark); }
.hm-modal__title { margin-right: 3rem; margin-bottom: 0; font: 800 1.35rem/1.2 var(--m-head); text-transform: uppercase; letter-spacing: -0.02em; color: var(--m-navy); }
.hm-modal__body h3, .hm-modal__body h4 { font-family: var(--m-head); font-weight: 800; color: var(--m-navy); line-height: 1.25; }
.hm-modal__body h3:not(.hm-modal__title) { margin-top: 1.4rem; font-size: 1.05rem; }
.hm-modal__body p { margin-bottom: 0; }
.hm-modal__body strong { color: var(--m-navy); }
.hm-modal__body a:not(.hm-modal__btn) { color: var(--m-navy); font-weight: 700; text-decoration: underline; text-decoration-color: var(--m-orange-dark); text-underline-offset: 3px; }
.hm-modal__body a:not(.hm-modal__btn):hover { color: var(--m-orange-dark); }
.hm-modal__body ul, .hm-modal__body ol { display: grid; gap: 0.45rem; margin-bottom: 0; padding-left: 1.3rem; list-style: none; }
.hm-modal__body ul > li { position: relative; }
.hm-modal__body ul > li::before { content: ""; position: absolute; left: -1.05rem; top: 0.7em; width: 0.42rem; height: 0.42rem; background: var(--m-orange-dark); border-radius: 2px; }
.hm-modal__body ol { list-style: decimal; padding-left: 1.5rem; }
.hm-modal__body img { max-width: 100%; height: auto; border-radius: 8px; }
.hm-modal__body table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.hm-modal__body th, .hm-modal__body td { padding: 0.5rem 0.6rem; border-bottom: 1px dashed #CBD5E1; text-align: left; vertical-align: top; }
.hm-modal__body th { font: 800 0.76rem var(--m-head); text-transform: uppercase; color: var(--m-navy); }
.hm-modal__scroll { overflow-x: auto; }

/* Le prompt : exactement le style des citations des articles (.hm-prose blockquote : violet clair à 60 %, sans bordure, texte marine).
   Seul ajout : pre-wrap, pour garder les retours à la ligne du prompt. */
.hm-modal__prompt { margin-block: 1.4rem; padding: 0.75rem 1.1rem; background: rgba(233, 213, 255, 0.6); border: 0; border-radius: 10px; color: var(--m-navy); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.hm-modal__prompt code { font: inherit; }

/* Astuce : encadré crème, comme « Mon astuce » des articles */
.hm-modal__tip { padding: 0.9rem 1.1rem; background: var(--m-orange-light); border-radius: 12px; }
.hm-modal__tip b { display: block; margin-bottom: 0.2rem; font: 800 0.7rem var(--m-head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--m-orange-dark); }

.hm-modal__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.hm-modal__btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.8rem 1.4rem; background: var(--m-orange-dark); border: 2px solid var(--m-orange-dark); border-radius: 12px; color: #fff; font: 800 0.82rem var(--m-head); text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.hm-modal__btn:hover, .hm-modal__btn:focus-visible { background: var(--m-navy); border-color: var(--m-navy); color: #fff; }
.hm-modal__btn.copied { background: #15803D; border-color: #15803D; }

/* Disponibilité du livre : trois formats côte à côte */
.hm-modal__formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1.2rem; text-align: center; }
.hm-modal__fmt { display: grid; gap: 0.35rem; justify-items: center; padding: 0.6rem 0.4rem; border: 1px solid var(--m-line); border-radius: 12px; text-decoration: none; color: var(--m-navy); transition: border-color 0.15s, box-shadow 0.15s; }
.hm-modal__fmt:hover { border-color: var(--m-orange-dark); box-shadow: 0 0 0 1px var(--m-orange-dark); }
.hm-modal__fmt img { width: 100%; max-width: 6.5rem; height: auto; border-radius: 6px; box-shadow: 0 4px 10px rgba(26, 43, 72, 0.2); }
.hm-modal__fmt span { font: 700 0.82rem var(--m-head); }
.hm-modal__fmt b { font: 800 1.05rem var(--m-head); color: var(--m-orange-dark); }
.hm-modal__note { padding: 0.7rem 0.9rem; background: var(--m-orange-light); border-radius: 10px; font-size: 0.92rem; text-align: center; }
.hm-modal__small { font-size: 0.78rem; text-align: center; opacity: 0.8; }
@media (max-width: 420px) { .hm-modal__formats { gap: 0.4rem; } .hm-modal__fmt span { font-size: 0.72rem; } }
.hm-modal__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hm-modal__body a.hm-modal__fmt { text-decoration: none; font-weight: 400; }
.hm-modal__body a.hm-modal__fmt:hover { color: var(--m-navy); }
/* Les « --- » du texte (hr invisibles mais munis de grandes marges) ne servent qu'à créer du vide : masqués, comme dans les articles */
.hm-modal__body hr { display: none; }

/* Bandeau cookies : carte flottante en bas de page, dans le style des blocs du site. « Accepter » et « Refuser » ont le même poids. */
.hm-cookie {
  --m-navy: #1A2B48; --m-orange-dark: #C94A0A; --m-orange-light: #FFF3E0; --m-text: #334155; --m-head: Montserrat, sans-serif;
  position: fixed; left: 0.8rem; right: 0.8rem; bottom: 0.8rem; z-index: 125; max-width: 46rem; margin: 0 auto;
}
.hm-cookie[hidden] { display: none; }
.hm-cookie__card {
  position: relative; z-index: 0; display: grid; gap: 0.9rem; padding: 1rem 1.2rem;
  border: 2px solid var(--m-navy); border-radius: 14px; font-family: Lora, serif; color: var(--m-text);
}
.hm-cookie__card::before { content: ""; position: absolute; inset: 5px -5px -7px 5px; border: 2px dashed var(--m-orange-dark); border-radius: 16px 10px 14px 18px; z-index: -1; }
.hm-cookie__card::after { content: ""; position: absolute; inset: 0; background: #fff; border-radius: 12px; z-index: -1; }
.hm-cookie__tag { display: block; margin-bottom: 0.25rem; font: 800 0.66rem var(--m-head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--m-orange-dark); }
.hm-cookie__text { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.hm-cookie__actions { display: flex; gap: 0.6rem; }
.hm-cookie__btn { flex: 1; padding: 0.7rem 1.3rem; border: 2px solid var(--m-navy); border-radius: 12px; font: 800 0.78rem var(--m-head); text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.hm-cookie__btn--yes { background: var(--m-orange-dark); border-color: var(--m-orange-dark); color: #fff; }
.hm-cookie__btn--yes:hover, .hm-cookie__btn--yes:focus-visible { background: var(--m-navy); border-color: var(--m-navy); }
.hm-cookie__btn--no { background: #fff; color: var(--m-navy); }
.hm-cookie__btn--no:hover, .hm-cookie__btn--no:focus-visible { background: var(--m-navy); color: #fff; }
@media (min-width: 640px) { .hm-cookie__card { grid-template-columns: 1fr auto; align-items: center; gap: 1.4rem; padding: 1rem 1.4rem; } .hm-cookie__btn { flex: none; } }
