/* ============================================================
   PERSONNALISATIONS PROCÉDÉS INFORMATIQUE
   Base : Liebling 2.1.7 (github.com/eddiesigner/liebling)

   Couleur d'accentuation (jaune) : à modifier UNIQUEMENT ici,
   dans --pi-accent ci-dessous. Pour suivre plutôt la couleur
   choisie dans Ghost (Paramètres > Conception), remplacez la
   valeur par : var(--ghost-accent-color)
   ============================================================ */
:root {
  --pi-accent: #ffd400;          /* jaune sur fond sombre */
  --pi-accent-light: #c99700;    /* variante lisible sur fond clair */
}

/* ===== Polices personnalisées de Ghost (Paramètres > Conception) =====
   Sans choix dans Ghost, la police d'origine du thème est conservée. */
body {
  font-family: var(--gh-font-body, "Source Sans Pro", Helvetica, Arial, sans-serif);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--gh-font-heading, var(--gh-font-body, "Source Sans Pro", Helvetica, Arial, sans-serif));
}

/* ===== Optimisations lisibilité ===== */
body {
  line-height: 1.7;         /* Plus d'air entre les lignes */
  font-size: 1.05rem;       /* Texte légèrement agrandi */
}

/* ===== Correction image de fond sur smartphone ===== */
@media only screen and (max-width: 768px) {
  body {
    background-attachment: scroll !important;   /* évite les bugs de fixed */
    background-size: cover !important;          /* couvre toute la largeur */
    background-position: center top !important; /* image centrée proprement */
  }
}

/* ===== Recherche : loupe dans le menu ===== */
.m-guides-heading {
  border: 1px solid var(--secondary-border-color);
  border-radius: 10px;
  background: var(--secondary-subtle-color);
  margin: 0 auto 32px;
  max-width: 720px;
  padding: 18px 24px;
  text-align: center;
}

/* Couleur du titre "Découvrir les guides" (jaune vif en mode sombre,
   jaune doré plus foncé en mode clair pour rester lisible sur fond clair) */
:root,
[data-theme=dark] {
  --guides-heading-color: var(--pi-accent);
}

[data-theme=light] {
  --guides-heading-color: var(--pi-accent-light);
}

.m-guides-heading h1,
.m-guides-heading h2 {
  color: var(--guides-heading-color);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.m-search-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--pi-accent, #ffd400);
  cursor: pointer;
  display: flex;
  height: 40px;
  justify-content: center;
  margin-left: 12px;
  padding: 8px;
  width: 40px;
}

.m-search-button:hover,
.m-search-button:focus {
  color: var(--pi-accent, #ffd400);
}

.m-search-button .icon-search {
  font-size: 1.15rem;
}

.m-search-button__label {
  display: none;
}

/* ===== Recherche Pagefind pour le site statique ===== */
.pagefind-search-modal[hidden] {
  display: none;
}

.pagefind-search-modal {
  inset: 0;
  position: fixed;
  z-index: 1000;
}

.pagefind-search-modal__backdrop {
  background: var(--transparent-background-color);
  inset: 0;
  position: absolute;
}

.pagefind-search-modal__dialog {
  background: var(--background-color);
  border: 1px solid var(--primary-border-color);
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0,0,0,.2);
  left: 50%;
  max-height: calc(100vh - 40px);
  max-width: 760px;
  overflow-y: auto;
  padding: 55px 24px 30px;
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  width: calc(100% - 30px);
}

.pagefind-search-modal__close {
  background: transparent;
  border: 0;
  color: var(--primary-foreground-color);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 10px;
  position: absolute;
  right: 10px;
  top: 10px;
}

.pagefind-search-modal__input-wrap {
  align-items: center;
  border-bottom: 2px solid var(--primary-border-color);
  display: flex;
  gap: 12px;
}

.pagefind-search-modal__input-wrap .icon-search {
  color: #9b9b9b;
}

#pagefind-search-input {
  background: transparent;
  border: 0;
  color: var(--primary-foreground-color);
  font-size: 1.25rem;
  outline: 0;
  padding: 12px 0;
  width: 100%;
}

.pagefind-search-modal__summary {
  color: var(--titles-color);
  font-size: .9rem;
  margin: 18px 0 8px;
}

.pagefind-result {
  border-bottom: 1px solid var(--primary-border-color);
  padding: 14px 0;
}

.pagefind-result h3 {
  color: var(--titles-color);
  font-size: 1.15rem;
  margin: 0 0 6px;
}

.pagefind-result p {
  color: var(--primary-foreground-color);
  font-size: .95rem;
  line-height: 1.5;
  margin: 0;
}

@media only screen and (min-width: 48rem) {
  .pagefind-search-modal__dialog {
    padding: 65px 40px 40px;
    top: 40px;
  }
}

/* Language links between hero and guides on both homepages. */
.m-language-switcher { align-items:center; display:flex; justify-content:center; flex-wrap:wrap; gap:12px; padding:22px 12px 0; }
.m-language-switcher a { align-items:center; border:1px solid #506176; border-radius:8px; color:#fff; display:inline-flex; gap:8px; min-height:44px; padding:8px 12px; text-decoration:none; }
.m-language-switcher a:hover,.m-language-switcher a:focus-visible { border-color:var(--pi-accent); color:var(--pi-accent); }
.m-language-switcher img { border-radius:3px; flex:none; }
.m-english-guides { display:grid; gap:18px; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); margin:0 auto 48px; max-width:1000px; }
.m-english-guide,.m-english-section { background:#171d24; border-radius:10px; padding:24px; }
.m-english-guide h3,.m-english-section h2 { margin-top:0; }
.m-english-guide h3 { line-height:1.35; overflow-wrap:anywhere; }
.m-english-guide p { color:var(--primary-foreground-color); line-height:1.5; }
.m-english-empty { text-align:center; margin:25px auto 50px; }
.m-english-section { max-width:1000px; margin:24px auto; }
.m-english-section a,.m-english-guide a { color:var(--pi-accent); }

/* Offer line under the homepage description (FR and EN). */
.m-hero-offer {
  color: var(--pi-accent);
  font-size: clamp(0.92rem, 1.45vw, 1.12rem);
  font-weight: 600;
  line-height: 1.4;
  margin: clamp(24px, 7vh, 72px) auto 0; /* 2.2.84 : bloc jaune centré entre la description et la note */
  max-width: 980px;
  padding: 0 14px;
  text-align: center;
  text-wrap: balance;
}
/* Sur ordinateur : une seule ligne, comme la version anglaise */
@media (min-width: 900px) {
  .m-hero-offer { white-space: nowrap; }
}

/* Lien vers l'Offre Lancement, sous la ligne d'offre (FR). */
.m-hero-cta-wrap { margin: 18px auto 0; text-align: center; }
.m-hero-cta {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--pi-accent);
  border-radius: 8px;
  color: var(--pi-accent);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.m-hero-cta:hover, .m-hero-cta:focus-visible { filter: brightness(1.08); }

/* Short, factual publication note in both homepage hero sections. */
.m-hero-static-note {
  color: #fff;
  font-size: clamp(0.74rem, 1vw, 0.86rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 700px;
  padding: 0 14px;
  text-align: center;
  transform: translateY(clamp(36px, 8vh, 82px));
}

/* 2.3.0 : bouton « Et si on en parlait ? » dans l'en-tête (toutes les pages FR). */
.m-header-cta {
  background: var(--pi-accent);
  border-radius: 8px;
  color: #0a1322 !important;
  font-size: .95rem;
  font-weight: 700;
  margin-left: 12px;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
}
.m-header-cta:hover, .m-header-cta:focus-visible { filter: brightness(1.08); }

@media (max-width: 47.99rem) { .m-header-cta { display: inline-block; margin: 20px 0 0; } }

/* 2.3.3 : page « Guides » sans bannière – espace sous l'en-tête fixe */
.m-guides-page__content { padding-top: 110px; }
@media only screen and (min-width: 48rem) { .m-guides-page__content { padding-top: 130px; } }

/* ============================================================
   2.4.0 : CHARTE GRAPHIQUE (tirée de l'image d'accueil)
   - Bleu nuit      : ambiance professionnelle (fonds)
   - Bleu pétrole   : surfaces, boutons secondaires
   - Bleu cyan      : liens, détails, intertitres
   - Jaune vif      : contraste, appels à l'action
   Les couleurs se modifient ICI, dans les variables ci-dessous.
   ============================================================ */
:root {
  --pi-night: #001330;        /* bleu nuit profond (pied de page, en-tête) */
  --pi-night-2: #011936;      /* bleu nuit (fond général) */
  --pi-night-3: #012a50;      /* bleu nuit clair (bandeaux, encadrés) */
  --pi-petrol: #006a9d;       /* bleu pétrole (boutons, accents) */
  --pi-petrol-deep: #013a62;  /* bleu pétrole foncé (dégradés) */
  --pi-teal: #0ba1af;         /* pétrole-turquoise (détails) */
  --pi-cyan: #37c9f9;         /* bleu cyan */
  --pi-cyan-light: #58e1ff;   /* cyan clair (liens au survol) */
  --pi-line: #0d3a66;         /* bordures */
  --pi-text: #d9e4f1;         /* texte courant */
  --pi-text-soft: #a9c1da;    /* texte secondaire, légendes */
}

/* Le thème est en mode sombre fixe : on remplace ses couleurs */
[data-theme=dark] {
  --background-color: var(--pi-night-2);
  --primary-foreground-color: var(--pi-text);
  --secondary-foreground-color: #fff;
  --primary-subtle-color: var(--pi-petrol);
  --secondary-subtle-color: var(--pi-night-3);
  --titles-color: #fff;
  --link-color: var(--pi-cyan);
  --primary-border-color: var(--pi-line);
  --secondary-border-color: #022448;
  --transparent-background-color: rgba(1,19,48,.97);
  --footer-background-color: var(--pi-night);
  --table-background-color-odd: #01213f;
  --table-head-border-bottom: var(--pi-line);
  --header-menu-gradient-first-color: rgba(1,25,54,0);
  --header-menu-gradient-second-color: rgba(1,25,54,.65);
  --article-shadow-normal: 0 6px 18px rgba(0,8,24,.35);
  --article-shadow-hover: 0 10px 30px rgba(0,8,24,.5);
}

::selection { background: var(--pi-accent); color: var(--pi-night); }

/* ----- En-tête et pied de page ----- */
.m-header { background-color: var(--pi-night); border-bottom: 1px solid rgba(55,201,249,.14); }
.m-footer { border-top: 3px solid var(--pi-accent); }
.m-footer__content a:hover, .m-footer-social a:hover { color: var(--pi-accent); }

/* ----- Bandeau de titre des pages et articles sans image ----- */
.m-hero.no-picture {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(55,201,249,.20) 0%, rgba(55,201,249,0) 55%),
    radial-gradient(ellipse at 10% 100%, rgba(11,161,175,.14) 0%, rgba(11,161,175,0) 50%),
    linear-gradient(135deg, var(--pi-night) 0%, var(--pi-night-3) 60%, var(--pi-petrol-deep) 100%);
  border-bottom: 1px solid rgba(55,201,249,.22);
}
.m-hero-title { color: #fff; }
.m-hero.no-picture .m-hero-title::after,
.m-heading__title::after {
  background: var(--pi-accent);
  border-radius: 2px;
  content: "";
  display: block;
  height: 4px;
  margin: 18px auto 0;
  width: 64px;
}
.m-hero-description { color: var(--pi-text-soft); }
/* Articles avec image à la une : voile bleu nuit plutôt que noir */
.m-hero.with-picture { background-color: var(--pi-night); }

/* ----- Contenu des pages et articles ----- */
.l-post-content { color: var(--pi-text); }
.l-post-content h2 { color: #fff; }
.l-post-content h3 { color: var(--pi-cyan); }
.l-post-content h4, .l-post-content h5, .l-post-content h6 { color: var(--pi-cyan-light); }
.l-post-content strong { color: #fff; }
.l-post-content a { color: var(--pi-cyan); text-decoration-color: rgba(55,201,249,.5); text-underline-offset: 3px; }
.l-post-content a:hover { color: var(--pi-accent); text-decoration-color: var(--pi-accent); }
.l-post-content hr { border-top-color: var(--pi-line); }
.l-post-content hr:after { background-color: var(--pi-accent); }
.l-post-content blockquote:before { color: var(--pi-accent); }
.l-post-content blockquote.kg-blockquote-alt { color: var(--pi-cyan); }
.l-post-content code { background-color: var(--pi-night-3); color: var(--pi-cyan-light); }
.l-post-content pre { background-color: var(--pi-night) !important; border: 1px solid var(--pi-line); }
.l-post-content pre code { background: transparent; color: var(--pi-text); }
.l-post-content figcaption, .l-post-content .kg-card figcaption { color: var(--pi-text-soft); }
.l-post-content table th { color: #fff; }

/* Boutons des cartes Ghost : jaune, comme les appels à l'action du site */
.l-post-content .kg-button-card a.kg-btn,
.l-post-content .kg-button-card a.kg-btn-accent,
.l-post-content .kg-header-card .kg-header-card-button,
.l-post-content .kg-product-card .kg-product-card-button,
.l-post-content .kg-cta-card .kg-cta-button {
  background-color: var(--pi-accent) !important;
  color: var(--pi-night) !important;
  font-weight: 700;
}

/* Encadrés (callout), signets, fichiers, accordéons */
.l-post-content .kg-callout-card { border-left: 4px solid var(--pi-cyan); }
.l-post-content .kg-callout-card-grey,
.l-post-content .kg-callout-card-white { background: var(--pi-night-3); }
.l-post-content .kg-callout-card-blue { background: rgba(55,201,249,.12); }
.l-post-content .kg-callout-card-green { background: rgba(11,161,175,.14); border-left-color: var(--pi-teal); }
.l-post-content .kg-callout-card-yellow { background: rgba(255,212,0,.12); border-left-color: var(--pi-accent); }
.l-post-content .kg-callout-card-accent { background: var(--pi-petrol); }
.l-post-content .kg-bookmark-container,
.l-post-content .kg-file-card-container,
.l-post-content .kg-toggle-card,
.l-post-content .kg-product-card-container {
  background: var(--pi-night-3) !important;
  border: 1px solid var(--pi-line);
  box-shadow: none;
}
.l-post-content .kg-bookmark-container:hover { border-color: var(--pi-cyan); }

/* ----- Méta, étiquettes, auteur, abonnement ----- */
.m-heading__meta__tag:hover, .m-tags li a:hover { color: var(--pi-accent) !important; }
.m-author__name { color: var(--pi-cyan); }
.m-subscribe-section {
  background: linear-gradient(135deg, var(--pi-night-3) 0%, var(--pi-petrol-deep) 100%);
  border-top: 1px solid var(--pi-line);
}

/* ----- Cartes d'articles (listes, articles liés, guides) ----- */
.m-article-card { border-color: var(--pi-line); }
.m-article-card:hover { border-color: rgba(55,201,249,.55); }
.m-article-card__title { color: #fff; }
.m-article-card__tag { color: var(--pi-cyan) !important; }
.m-english-guide, .m-english-section { background: var(--pi-night-3); border: 1px solid var(--pi-line); }
.m-guides-heading { background: var(--pi-night-3); border-color: var(--pi-line); }

/* Bouton de lecture (progression) */
.m-icon-button.progress svg circle { stroke: var(--pi-accent); }


/* ===== 2.5.37 – Accessibilité (RGAA 4.1 / WCAG 2.2 AA) ===== */
/* Lien d'évitement : caché hors écran, visible au focus clavier */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--pi-accent, #ffd400); color: #0a1322 !important;
  padding: .75rem 1rem; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; }
main:focus { outline: none; } /* cible du lien d'évitement, pas un élément interactif */

/* Focus clavier visible partout (WCAG 2.4.7 / 2.4.13) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible { outline: 3px solid var(--pi-accent, #ffd400); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--pi-accent, #ffd400); outline-offset: 1px; }
.pagefind-search-modal__input-wrap:focus-within { outline: 3px solid var(--pi-accent, #ffd400); outline-offset: 2px; }

/* Cartes d'articles : toute la carte s'encadre en jaune au clavier */
.m-article-card:has(.m-article-card__info-link:focus-visible) {
  outline: 3px solid var(--pi-accent, #ffd400); outline-offset: 4px; transform: translateY(-5px);
}
.m-article-card .m-article-card__info-link:focus-visible { outline: none; }

/* Texte réservé aux lecteurs d'écran (si absent du thème) */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ===== 2.5.38 – Pourcentage de lecture des articles ===== */
.pi-progress-pct {
  color: var(--pi-accent, #ffd400);
  font-size: .8rem; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-right: 10px; min-width: 2.6em; text-align: right;
}
@media only screen and (min-width: 64rem) {
  /* ordinateur : sous le rond (colonne inversée, l'élément précède le bouton dans le code) */
  .pi-progress-pct { margin: -12px 0 0; min-width: 0; width: 100%; text-align: center; }
}

/* ===== 2.5.38 – Champs de formulaire dans le contenu (pages, articles) =====
   post.css (Liebling) retire le contour de focus (outline: 0) et pose une bordure
   bleu nuit presque invisible (1,6:1) sur tous les champs du contenu. */
.l-post-content input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.l-post-content select,
.l-post-content textarea {
  border-color: #6f8fb3 !important; /* contour du champ visible : >= 3:1 (WCAG 1.4.11) */
}
.l-post-content input:focus-visible,
.l-post-content select:focus-visible,
.l-post-content textarea:focus-visible {
  border-color: var(--pi-accent, #ffd400) !important;
  outline: 3px solid var(--pi-accent, #ffd400) !important; /* focus clavier visible (WCAG 2.4.7) */
  outline-offset: 2px !important;
}

/* ==========================================================================
   2.5.44 – En-tête : nom du site + menu centrés, jaune au survol
   ========================================================================== */
@media only screen and (min-width: 48rem) {
  .m-header .m-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .m-header .m-nav__left {
    grid-column: 2;
    justify-self: center;
    padding-left: 0;
  }
  .m-header .m-nav__left li:last-of-type { margin-right: 0; }
  .m-header .m-nav__right {
    grid-column: 3;
    justify-self: end;
  }
  .m-header .m-nav__right::before { display: none; }
}

/* Nom du site et liens du menu : jaune au survol et au focus clavier */
.m-header .m-site-name,
.m-header .m-nav__left li a {
  transition: color .2s ease;
}
.m-header .m-site-name:hover,
.m-header .m-site-name:focus-visible,
.m-header .m-nav__left li a:hover,
.m-header .m-nav__left li a:focus-visible {
  color: var(--pi-accent, #ffd400);
}
