/* ============================================================================
   Documentation Resthome — thème « docs » aux couleurs LPLG.
   Base : Material for MkDocs. Couleurs ADAPTATIVES clair + sombre.
     bleu #0F43FF · fond clair #FBFCFF · titres Roboto Slab · corps Inter
   ============================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Roboto+Slab:wght@500;600;700&display=swap");

/* ---------- Palette & polices ---------- */
:root {
  --md-primary-fg-color:        #0F43FF;
  --md-primary-fg-color--light: #4f74ff;
  --md-primary-fg-color--dark:  #0a34cc;
  --md-primary-bg-color:        #ffffff;
  --md-primary-bg-color--light: #ffffffcc;
  --md-accent-fg-color:         #0F43FF;
  --md-accent-fg-color--transparent: #0f43ff1a;
  --md-typeset-a-color:         #0F43FF;

  --md-text-font:    "Inter";
  --md-heading-font: "Inter";
  --lplg-slab-font:  "Roboto Slab";

  --lplg-blue:   #0F43FF;
  --lplg-blue-2: #d8dffd;
  --lplg-border: #e6e9f2;
}
[data-md-color-scheme="default"] { --md-default-bg-color: #FBFCFF; }

/* Mode sombre : bleus plus clairs + bordures sombres. */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:  #4f74ff;
  --md-accent-fg-color:   #6f8dff;
  --md-accent-fg-color--transparent: #6f8dff26;
  --md-typeset-a-color:   #8aa2ff;
  --lplg-border: #2b3a4a;
}

/* ---------- Typographie ---------- */
.md-typeset { font-size: 0.78rem; line-height: 1.65; }
.md-typeset p { margin: 0.7em 0 0.9em; }

/* Titres en Roboto Slab — couleur héritée du thème (clair/sombre). */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: var(--lplg-slab-font), Georgia, "Times New Roman", serif;
}
.md-typeset h1 {
  color: var(--md-default-fg-color);
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 0.7em;
}
.md-typeset h2 {
  color: var(--md-default-fg-color);
  font-weight: 600;
  padding-bottom: 0.28em;
  border-bottom: 1px solid var(--lplg-border);
  margin-top: 2.2em;
}
.md-typeset h3 { color: var(--md-default-fg-color); font-weight: 700; margin-top: 1.6em; }

/* ---------- Encadrés (admonitions) ---------- */
.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--lplg-border);
  border-left-width: 4px;
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.75rem;
}
.md-typeset .admonition-title,
.md-typeset summary { font-weight: 700; background-color: transparent; }
.md-typeset .admonition.note,
.md-typeset details.note { border-left-color: var(--lplg-blue); background: #f2f5ff; }
.md-typeset .note > .admonition-title::before { background-color: var(--lplg-blue); }
.md-typeset .admonition.tip,
.md-typeset details.tip { border-left-color: #00a67d; background: #eefaf5; }
.md-typeset .tip > .admonition-title::before { background-color: #00a67d; }
.md-typeset .admonition.warning,
.md-typeset details.warning { border-left-color: #e8871e; background: #fff6ea; }
.md-typeset .warning > .admonition-title::before { background-color: #e8871e; }
/* Fonds d'encadrés en mode sombre. */
[data-md-color-scheme="slate"] .md-typeset .admonition.note,
[data-md-color-scheme="slate"] .md-typeset details.note { background: #16203a; }
[data-md-color-scheme="slate"] .md-typeset .admonition.tip,
[data-md-color-scheme="slate"] .md-typeset details.tip { background: #10261f; }
[data-md-color-scheme="slate"] .md-typeset .admonition.warning,
[data-md-color-scheme="slate"] .md-typeset details.warning { background: #2a2113; }

/* ---------- Images / captures encadrées ---------- */
.md-typeset img:not(.twemoji):not(.emojione):not([src$=".svg"]) {
  max-width: 100%;
  border: 1px solid var(--lplg-border);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(27, 39, 51, 0.08);
  margin: 0.6em 0;
}
.md-typeset figure > figcaption { font-size: 0.72rem; opacity: 0.75; margin-top: 0.4em; }

/* ---------- Tableaux ---------- */
.md-typeset table:not([class]) {
  border: 1px solid var(--lplg-border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.74rem;
}
.md-typeset table:not([class]) th {
  background: var(--md-accent-fg-color--transparent);
  font-weight: 700;
}

/* ---------- En-tête CLAIR (LPLG) ---------- */
.md-header {
  background: #ffffff;
  color: #1b2733;
  border-bottom: 1px solid var(--lplg-border);
  box-shadow: 0 1px 4px rgba(27, 39, 51, 0.05);
}
[data-md-color-scheme="slate"] .md-header {
  background: #0d1522;
  color: #eef2f7;
  border-bottom-color: #223247;
}
/* Logo LPLG = bulle BLEUE cliquable (retour lplg.eu) — l'accent de marque. */
.md-header__button.md-logo {
  margin: 0 0.1rem 0 0.45rem;
  padding: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--lplg-blue);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.md-header__button.md-logo img,
.md-header__button.md-logo svg { width: 1.05rem; height: 1.05rem; }
.md-header__title { margin-left: 0.4rem; font-size: 1rem; color: inherit; }
.md-header__topic .md-ellipsis { font-weight: 700; letter-spacing: -0.01em; }
.md-header__end { display: flex; align-items: center; gap: 0.25rem; }

/* Icônes + dropdown de version : couleur du texte (donc adaptatifs clair/sombre). */
.md-header__button.md-icon { color: currentColor; opacity: 0.68; }
.md-header__button.md-icon:hover { opacity: 1; }
.md-header [data-md-component="palette"] .md-icon svg,
.md-header__option .md-icon svg { fill: currentColor; }
.md-header .md-version__current { color: inherit; font-weight: 600; }
.md-header .md-version__link { color: inherit; }

.md-grid { max-width: 100%; }
.md-content { max-width: 50rem; }
.md-header__inner { position: relative; gap: 0.35rem; }

/* Recherche CENTRÉE sur écran large : titre à gauche, contrôles à droite,
   recherche en position absolue au centre (native : overlay + clic intacts). */
@media screen and (min-width: 76.25em) {
  .md-header__inner { position: relative; }
  /* Le titre GARDE son flex-grow (thème) : sinon son topic absolu l'effondre à 0
     et « Resthome docs » disparaît. En grandissant, il pousse les contrôles à droite. */
  .md-header__title { flex: 1 1 auto; min-width: 6rem; }
  /* AU REPOS : boîte de recherche centrée, largeur maîtrisée. */
  .md-search {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 22rem; flex: none; z-index: 2;
  }
  .md-search__inner { float: none; }
  .md-search__form { width: 100%; }
  /* ACTIVE (focus) : on relâche les contraintes → l'overlay natif reprend toute
     sa largeur (sinon les résultats sont coupés). */
  [data-md-toggle="search"]:checked ~ .md-header .md-search {
    position: static; transform: none; width: auto; z-index: 2;
  }
  [data-md-toggle="search"]:checked ~ .md-header .md-search__form { width: auto; }
}
/* Champ de recherche : clair, bordé (sur header blanc). */
.md-search__form {
  border-radius: 8px;
  background: var(--md-default-bg-color);
  border: 1px solid var(--lplg-border);
  box-shadow: none;
}
.md-search__form:hover { background: var(--md-default-bg-color); }
.md-search__input { color: var(--md-default-fg-color); }
.md-search__input::placeholder { color: #6b7280; }
.md-search__icon { color: #6b7280; }
[data-md-color-scheme="slate"] .md-search__form { background: #16202e; border-color: #223247; }

/* GitHub : icône seule, teinte du texte (sombre sur header clair). */
.md-header__source { max-width: 2.4rem; margin-left: 0.15rem; }
.md-source__repository, .md-source__facts { display: none; }
.md-header__source .md-icon svg, .md-header__source svg { fill: currentColor; }
.md-header__source .md-source__icon { opacity: 0.68; }
.md-header__source:hover .md-source__icon { opacity: 1; }

/* Sélecteur de langue FR|NL|EN (injecté dans l'en-tête par layout.html). */
.lplg-langswitch {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  margin: 0 0.3rem; border: 1px solid var(--lplg-border);
  border-radius: 7px; overflow: hidden;
}
.lplg-langswitch .lplg-lang {
  padding: 0.2rem 0.5rem; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.02em; color: inherit; opacity: 0.72; text-decoration: none;
  border-left: 1px solid var(--lplg-border);
}
.lplg-langswitch .lplg-lang:first-child { border-left: 0; }
.lplg-langswitch .lplg-lang:hover { opacity: 1; background: var(--md-accent-fg-color--transparent); }
.lplg-langswitch .lplg-lang.is-current { background: var(--lplg-blue); color: #fff; opacity: 1; }
[data-md-color-scheme="slate"] .lplg-langswitch { border-color: #223247; }

/* Lien « Site Resthome » vers la vitrine lplg.eu (injecté par layout.html). */
.lplg-site-link {
  display: inline-flex; align-items: center; gap: 0.3rem; flex: 0 0 auto;
  padding: 0.28rem 0.55rem; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.01em; color: inherit; opacity: 0.78; text-decoration: none;
  white-space: nowrap; border-radius: 7px;
}
.lplg-site-link:hover { opacity: 1; background: var(--md-accent-fg-color--transparent); }
.lplg-site-link svg { width: 0.85rem; height: 0.85rem; fill: currentColor; opacity: 0.8; }
/* Header serré sur mobile : on masque le lien vitrine (l'icône GitHub suffit). */
@media screen and (max-width: 44.9375em) { .lplg-site-link { display: none; } }

/* ---------- Barre latérale ---------- */
.md-sidebar--primary { border-right: 1px solid var(--lplg-border); }
/* Desktop : masquer le sommaire de page intégré au tiroir mobile (label + nav
   pour "__toc"). Pour la page active il doublonne le lien dans la barre gauche
   (deux pilules bleues « Support et assistance »). Le sommaire reste en colonne
   de droite. */
@media screen and (min-width: 76.25em) {
  .md-nav--primary label.md-nav__link[for="__toc"],
  .md-nav--primary label.md-nav__link[for="__toc"] ~ .md-nav { display: none !important; }
}
/* Fond neutre (blanc), comme la doc Odoo — pas de teinte. */
.md-sidebar--primary .md-nav--primary { background: transparent; }

/* Typo aérée façon Odoo : Inter, liens plus espacés, encre douce. */
.md-nav { font-size: 0.74rem; line-height: 1.45; }
.md-nav--primary .md-nav__link { padding-top: 0.34rem; padding-bottom: 0.34rem; color: #3c4551; }
.md-nav--primary .md-nav__link:hover { color: var(--lplg-blue); }
[data-md-color-scheme="slate"] .md-nav--primary .md-nav__link { color: #b7c0cc; }

/* Item actif façon Odoo : gras + couleur de marque, léger fond + filet à
   gauche (PAS de pilule bleue pleine). */
.md-nav__item > .md-nav__link--active {
  color: var(--lplg-blue) !important;
  font-weight: 700;
  background: #eef2ff;
  box-shadow: inset 2px 0 0 var(--lplg-blue);
  border-radius: 0 6px 6px 0;
  padding: 0.34rem 0.5rem;
  margin: 0.05rem -0.6rem 0.05rem 0;
}
[data-md-color-scheme="slate"] .md-nav__item > .md-nav__link--active { background: #16223a; }
.md-nav__item > .md-nav__link--active svg { fill: var(--lplg-blue); }

/* Sections et items parents : titre marqué (encre foncée). */
.md-nav__item--nested > .md-nav__link,
.md-nav__item--section > .md-nav__link { font-weight: 700; color: #1b2733; }
[data-md-color-scheme="slate"] .md-nav__item--section > .md-nav__link { color: #eef2f7; }
/* Titre de la nav + captions toctree : gris, majuscules. */
.md-nav--primary > .md-nav__title {
  font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: #8a93ab;
}

/* Icônes devant chaque section de 1er niveau (couleur = texte, donc adaptative). */
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link { display: flex; align-items: center; }
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link::before {
  content: "";
  width: 1rem; height: 1rem;
  margin-right: 0.5rem;
  flex: 0 0 auto;
  background-color: currentColor;
  opacity: 0.72;
  -webkit-mask: var(--si) center / contain no-repeat;
  mask: var(--si) center / contain no-repeat;
}
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link--active::before { opacity: 1; }
/* Sections avec une VRAIE icône d'app (PNG couleur) : Résidents, Facturation,
   Soins, Repas — image couleur, pas de masque monochrome. */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(3) > .md-nav__link::before,
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(4) > .md-nav__link::before,
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(6) > .md-nav__link::before,
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(7) > .md-nav__link::before {
  -webkit-mask: none; mask: none;
  background: var(--app-icon) center / contain no-repeat;
  opacity: 1; width: 1.15rem; height: 1.15rem; border-radius: 3px;
}
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(3) > .md-nav__link { --app-icon: url("app-icons/residents.png"); }  /* Résidents (healthcare_base) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(4) > .md-nav__link { --app-icon: url("app-icons/billing.png"); }    /* Facturation (billing) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(6) > .md-nav__link { --app-icon: url("app-icons/care.png"); }       /* Soins (medical) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(7) > .md-nav__link { --app-icon: url("app-icons/meals.png"); }      /* Repas (meal) */

/* Sections/pages en icône monochrome (pas d'icône d'app dédiée). */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(1) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/></svg>"); }      /* Premiers pas */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(2) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C8 6 8 10 9 14l1 1 4 4c4-1 8-1 12-5-4-4-8-4-12-2l-2-2c-2-4 0-6 0-6zm-3 15-2 2-1-3 2-1z'/></svg>"); }      /* Parcours */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(5) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20.5 9.5C20.5 12 12 20 12 20S3.5 12 3.5 9.5 5.5 5 8 5c1.5 0 3 1 4 2.5C13 6 14.5 5 16 5c2.5 0 4.5 2 4.5 4.5z'/></svg>"); }      /* eHealth (cœur) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(8) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 2h8l4 4v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm7 1.5V8h4.5L13 3.5zM8 13h8v-2H8zm0 4h8v-2H8z'/></svg>"); }      /* Documents (fichier) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(9) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 8a4 4 0 100 8 4 4 0 000-8zm9 5v-2l-2.3-.5a7 7 0 00-.7-1.7l1.3-2-1.4-1.4-2 1.3a7 7 0 00-1.7-.7L13 3h-2l-.5 2.3a7 7 0 00-1.7.7l-2-1.3-1.4 1.4 1.3 2a7 7 0 00-.7 1.7L3 11v2l2.3.5c.2.6.4 1.2.7 1.7l-1.3 2 1.4 1.4 2-1.3c.5.3 1.1.5 1.7.7L11 21h2l.5-2.3c.6-.2 1.2-.4 1.7-.7l2 1.3 1.4-1.4-1.3-2c.3-.5.5-1.1.7-1.7L21 13z'/></svg>"); }      /* Configuration (engrenage) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(10) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 15.5a1.3 1.3 0 110-2.6 1.3 1.3 0 010 2.6zm1.7-6.3c-.6.5-1 .9-1.1 1.5 0 .2-.1.5-.1.8h-2c0-.4 0-.8.1-1.1.2-.7.7-1.2 1.2-1.6.6-.5.9-.8.9-1.4a1.4 1.4 0 00-2.8 0H8a3.4 3.4 0 116.8 0c0 .9-.5 1.5-1.1 2z'/></svg>"); }      /* FAQ (aide) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(11) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 2a2 2 0 00-2 2v16a2 2 0 002 2h13V2H6zm0 16h11v2H6a1 1 0 010-2zM8 5h7v2H8z'/></svg>"); }      /* Glossaire (livre) */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(12) > .md-nav__link { --si: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1a9 9 0 00-9 9v6a3 3 0 003 3h2v-8H5v-1a7 7 0 0114 0v1h-3v8h2a3 3 0 003-3v-6a9 9 0 00-9-9z'/></svg>"); }      /* Support (casque) */

/* Chevron « › » sur les 7 sections repliables (nth-child 3–9), façon Odoo. */
.md-nav--primary > .md-nav__list > .md-nav__item:nth-child(n+3):nth-child(-n+9) > .md-nav__link::after {
  content: "";
  width: 0.42rem; height: 0.42rem;
  margin-left: auto;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);           /* pointe à droite (replié) */
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
/* Section active (on est à l'intérieur) → chevron vers le bas (déplié). */
.md-nav--primary > .md-nav__list > .md-nav__item--active:nth-child(n+3):nth-child(-n+9) > .md-nav__link::after,
.md-nav--primary > .md-nav__list > .md-nav__item--nested:nth-child(n+3):nth-child(-n+9) > .md-nav__link::after {
  transform: rotate(45deg); opacity: 0.7;
}

/* ---------- Cartes de la page d'accueil (sphinx-design + grid.cards) ---------- */
.md-typeset .sd-card,
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid var(--lplg-border);
  border-radius: 0.7rem;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.md-typeset .sd-card:hover,
.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 0.3rem 0.9rem rgba(15, 67, 255, 0.14);
  transform: translateY(-2px);
}
/* Titre de carte = lien bleu de marque, sans soulignement ; corps en encre douce. */
.md-typeset .sd-card-title,
.md-typeset .sd-card-title a { color: var(--md-primary-fg-color); font-weight: 700; }
.md-typeset .sd-card-title a { text-decoration: none; }
.md-typeset .sd-card-title a:hover { text-decoration: underline; }
.md-typeset .sd-card-body { color: var(--md-default-fg-color--light); font-size: 0.75rem; }
.md-typeset .grid.cards .twemoji svg,
.md-typeset .grid.cards .lg svg { fill: var(--md-primary-fg-color); }

.md-content__button { color: var(--md-primary-fg-color); }
