/* === Falcify — Styles public v2.7.26 === */

:root {
  --falcify-color: #12294C;
  --falcify-accent: #68C198;
  --falcify-fg: #fff;
  --falcify-radius: 14px;
  --falc-picto-size: 100px;
  --falc-picto-gap: 1.25rem;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.falcify-wrapper { margin: 1.5rem 0; }

/* ── Bouton bascule ──────────────────────────────────────── */
.falcify-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--falcify-accent);
  color: var(--falcify-color);
  border: none;
  border-radius: 999px;
  padding: .75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(104,193,152,.5);
  transition: transform .15s ease, filter .15s ease;
  line-height: 1.2;
}
.falcify-toggle-button:hover  { transform: translateY(-2px); filter: brightness(1.06); }
.falcify-toggle-button:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.falcify-toggle-button .falcify-icon { font-size: 1.1em; }
@media (prefers-reduced-motion: reduce) { .falcify-toggle-button { transition: none; } }

/* ── Bloc FALC ───────────────────────────────────────────── */
/*
  Fond blanc forcé : garantit la lisibilité quel que soit
  le thème WordPress (clair, sombre, contrasté).
*/
.falcify-falc-content {
  margin-top: 1.5rem;
  padding: 2rem 2.25rem;
  background: #fff !important;
  color: #1a1a1a !important;
  border-radius: var(--falcify-radius);
  border: 1.5px solid #e2efe9;
  border-left: 5px solid var(--falcify-accent);
  font-size: 1.1rem;
  line-height: 1.85;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.falcify-falc-content[hidden] { display: none; }

/*
  Chaque bloc = une ligne flex : [picto | texte].
  Séparateur léger entre les lignes pour aérer la lecture.
*/
.falcify-falc-content h2,
.falcify-falc-content h3,
.falcify-falc-content p {
  display: flex !important;
  align-items: center !important;
  gap: var(--falc-picto-gap) !important;
  margin: 0 !important;
  padding: .75rem 0 !important;
  border-bottom: 1px solid #edf3ef !important;
  color: #1a1a1a !important;
  line-height: 1.7 !important;
  overflow-wrap: break-word;
}
.falcify-falc-content h2:last-child,
.falcify-falc-content h3:last-child,
.falcify-falc-content p:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

/* Titre H2 : séparateur de section, couleur forte */
.falcify-falc-content h2 {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  color: var(--falcify-color) !important;
  padding-top: 1.5rem !important;
  border-top: 2px solid var(--falcify-accent) !important;
  border-bottom: none !important;
  margin-top: .25rem !important;
}
.falcify-falc-content h2:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

/* Titre H3 : sous-section, légèrement plus petit */
.falcify-falc-content h3 {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1e3a5f !important;
}

/*
  Blocs SANS picto : décalage à gauche = largeur picto + gap.
  Le texte s'aligne ainsi avec celui des blocs qui ont un picto.
  :has() supporté par tous navigateurs modernes (Chrome 105+, FF 121+, Safari 15.4+).
*/
.falcify-falc-content :is(h2, h3, p):not(:has(.falc-picto)) {
  padding-left: calc(var(--falc-picto-size) + var(--falc-picto-gap)) !important;
}

/* ── Pictogrammes ────────────────────────────────────────── */
.falc-picto {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08), inset 0 0 0 1.5px rgba(104,193,152,.3);
  padding: .3em;
  width:  var(--falc-picto-size);
  height: var(--falc-picto-size);
  min-width: var(--falc-picto-size);
  vertical-align: middle;
  speak: never;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
  font-style: normal;
}
.falc-picto::before,
.falc-picto::after { content: none !important; }

.falc-picto > img {
  display: block;
  width:  calc(var(--falc-picto-size) - .6em);
  height: calc(var(--falc-picto-size) - .6em);
  object-fit: contain;
}

/* ── Accessibilité ───────────────────────────────────────── */
.falc-picto:focus-visible {
  outline: 2px solid var(--falcify-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.falcify-falc-content :is(p, h2, h3):focus-visible {
  outline: 2px dashed var(--falcify-color);
  outline-offset: 2px;
  border-radius: 6px;
}
.falc-sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (forced-colors: active) {
  .falc-picto {
    forced-color-adjust: none;
    color: CanvasText;
    background: Canvas;
    border: 1px solid CanvasText;
  }
  .falc-picto:focus-visible { outline-color: Highlight; }
}

/* ── Mode contraste élevé ────────────────────────────────── */
.falcify-hc .falcify-toggle-button { background: #000; color: #fff; border: 2px solid #ffbf47; }
.falcify-hc .falcify-falc-content  { background: #000 !important; color: #fff !important; border-color: #ffbf47; }
.falcify-hc .falcify-falc-content :is(h2, h3, p) { color: #fff !important; border-bottom-color: #333 !important; }
.falcify-hc .falcify-falc-content h2 { color: #ffbf47 !important; border-top-color: #ffbf47 !important; }
.falcify-hc .falc-picto { background: #111; filter: grayscale(1) contrast(1.4); }
.falcify-hc .falc-picto > img { filter: grayscale(1) contrast(1.3); }

/* ── Bouton flottant ─────────────────────────────────────── */
.falcify-floating {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  max-width: min(420px, calc(100vw - 2rem));
}
.falcify-floating .falcify-floating-content {
  margin-top: .75rem;
  background: #fff;
  color: #111;
  padding: 1.25rem 1.5rem;
  border-radius: var(--falcify-radius);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.25);
  max-height: 60vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
}
.falcify-floating-btn { box-shadow: 0 8px 24px -6px rgba(104,193,152,.5); }

/* ── Impression ──────────────────────────────────────────── */
@media print {
  .falc-picto { filter: grayscale(1); }
  .falcify-toggle-button { display: none; }
  .falcify-falc-content { box-shadow: none; border: 1px solid #ccc; }
}
