/* =========================================================
   global-site.css
   Design global – Header, footer, layout, TOC, FAQ, nav cocon
   ========================================================= */

/* ------------------------------
   1. RESET LÉGER & VARIABLES
   ------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 auto;
  max-width: 1200px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1f2933;
  background-color: #ffffff;
}

/* Palette commune (compatible avec les pages prothèse) */
:root {
  --blue-main: #0070BD;
  --blue-dark: #003F7F;
  --blue-soft: #E6F2FA;
  --blue-soft-alt: #F7FAFC;

  --grey-700: #4B5563;
  --grey-500: #9CA3AF;
  --grey-200: #E5E7EB;

  --danger: #C53030;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.08);

  --container: min(1200px, 100% - 2rem);

  --font-title: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Liens génériques */
a {
  color: var(--blue-dark);
  text-decoration: underline;
  font-weight: 500;
}

a:hover {
  color: #FF8C00;
}

/* Images responsives */
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scroll pour que les ancres ne passent pas sous le header fixe */
h2[id],
h3[id],
h4[id] {
  scroll-margin-top: 80px;
}

/* ------------------------------
   2. HEADER GLOBAL (bandeau bleu)
   ------------------------------ */

.site-header.simple-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0 auto;
  background: linear-gradient(90deg, #004678, #0070BD);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.site-header .header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
}

.brand-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Bouton RDV dans le bandeau */
.btn-rdv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-rdv:hover {
  background: #ffffff;
  color: #004678;
}

/* ------------------------------
   3. HEADER DE PAGE MÉDICALE (#mainHeader)
   ------------------------------ */

.header-medical,
#mainHeader {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.75rem 1rem 1rem;
  text-align: center;
}

#mainHeader h1 {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: #111827;
}

#mainHeader .lead {
  max-width: 48rem;
  margin: 0 auto 1rem;
  font-size: 0.98rem;
  color: #4B5563;
}

#mainHeader .date,
#mainHeader .maj {
  font-size: 0.85rem;
  color: #6B7280;
  margin: 0.4rem 0 0.2rem;
}

/* Sur-titre éventuel (page index) */
#mainHeader .surtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  color: #0F172A;
}

/* ------------------------------
   4. BREADCRUMB
   ------------------------------ */

.breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem 0.7rem;
  margin: 0.4rem 0 0;
  list-style: none;
  border-radius: 999px;
  background: #F3F4F6;
  font-size: 0.8rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  margin: 0 0.25rem;
  color: #9CA3AF;
}

.breadcrumb a {
  text-decoration: none;
  color: #374151;
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--blue-main);
}

.breadcrumb-item.active {
  color: #6B7280;
}

/* ------------------------------
   5. LAYOUT : TOC + CONTENU
   ------------------------------ */

main {
  max-width: var(--container);
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

/* Grille : colonne gauche (TOC) + colonne droite (contenu) */
.grid-container-barre-laterale {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

/* Sommaire (TOC) */
.toc {
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 0.9rem 0.9rem 1rem;
  background: #F9FAFB;
  font-size: 0.92rem;
}

.toc-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: #111827;
  font-size: 0.95rem;
}

.toc ol {
  margin: 0;
  padding-left: 1rem;
}

.toc li {
  margin: 0.15rem 0;
}

.toc a {
  text-decoration: none;
  color: #1F2933;
  font-weight: 500;
}

.toc a:hover {
  color: var(--blue-main);
}

/* Version mobile en <details> : laisser le style natif, juste allègement */
.toc details {
  padding: 0.2rem 0;
}

.toc summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

/* Cacher / montrer en fonction de la largeur */
.none-si-inf-768 {
  display: none;
}
.none-si-sup-768 {
  display: block;
}

@media (min-width: 768px) {
  .none-si-inf-768 {
    display: block;
  }
  .none-si-sup-768 {
    display: none;
  }

  .grid-container-barre-laterale {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: flex-start;
  }

  .toc {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow: auto;
  }
}

/* ------------------------------
   6. BLOC TEXTE + IMAGE (flex-col-…)
   ------------------------------ */

.flex-col-texte-image-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin: 0.75rem 0 1.5rem;
}

.flex-col-texte,
.flex-col-image {
  max-width: 420px;
}

.flex-col-texte p {
  margin-top: 0;
}

.flex-col-image img {
  border-radius: 8px;
}

.flex-col-image p {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #6B7280;
}

@media (min-width: 768px) {
  .flex-col-texte-image-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* Image helper */
.img-responsive {
  max-width: 100%;
  height: auto;
}

/* ------------------------------
   7. NAV “COCON” (pastilles de pages)
   ------------------------------ */

.cocon-prothese-nav {
  margin: 1.5rem auto;
  padding: 0.75rem 1rem 0.9rem;
  max-width: var(--container);
  background: var(--blue-soft-alt);
  border: 1px solid #E6EAF0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.cocon-prothese-nav > p {
  margin: 0 0 0.5rem;
  font-weight: 600;
  text-align: left;
  color: #111827;
}

.cocon-prothese-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cocon-prothese-nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.35rem 0.9rem;
  border-radius: 999px;

  font-size: 0.9rem;
  font-family: var(--font-title);
  font-weight: 500;

  text-decoration: none;
  color: var(--blue-dark);
  background: #FFFFFF;

  border: 1px solid #D8E2F0;
  transition: background 0.15s ease, color 0.15s ease,
              box-shadow 0.15s ease, transform 0.06s ease;
}

.cocon-prothese-nav-list a:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

/* Onglet actif optionnel */
.cocon-prothese-nav-list .is-active a {
  background: var(--blue-main);
  color: #fff;
  border-color: var(--blue-main);
  box-shadow: 0 6px 16px rgba(0, 112, 189, 0.25);
}

/* h2 cachés accessibilité */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------
   8. FAQ EN <details>
   ------------------------------ */

#faq-index {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #E5E7EB;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid #E6F2FA;
  padding: 0.4rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue-dark);
  position: relative;
  padding-right: 1.4rem;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "＋";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--blue-main);
  font-weight: 700;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
  transform: rotate(90deg);
}

.faq-item p {
  margin: 0.5rem 0 0.25rem;
  line-height: 1.6;
  color: #374151;
}

/* ------------------------------
   9. RÉFÉRENCES BIBLIOGRAPHIQUES
   ------------------------------ */

#references {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid #E5E7EB;
}

#references h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--blue-main);
}

#references ol {
  margin: 0;
  padding-left: 1.4rem;
}

#references li {
  margin: 0.35rem 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

#references em {
  font-style: italic;
}

.back-ref {
  margin-left: 0.4rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--blue-main);
}

.back-ref:hover {
  text-decoration: underline;
}

/* ------------------------------
   10. SCROLL TO TOP
   ------------------------------ */

#scroll_to_top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
}

#scroll_to_top a img {
  width: 32px;
  height: auto;
}

/* ------------------------------
   11. FOOTER GLOBAL
   ------------------------------ */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
  font-size: 0.9rem;
  color: #4B5563;
}

.site-footer .footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.75rem 1rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.footer-col h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: #111827;
}

.footer-col p {
  margin: 0.1rem 0;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
}

.footer-col li {
  margin: 0.15rem 0;
}

.footer-col a {
  text-decoration: none;
  color: var(--blue-dark);
}

.footer-col a:hover {
  text-decoration: underline;
}

/* Bas de footer */
.footer-bottom {
  border-top: 1px solid #E5E7EB;
  padding: 0.8rem 1rem 1.2rem;
}

.footer-bottom-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom a {
  text-decoration: none;
  color: #4B5563;
}

.footer-bottom a:hover {
  color: var(--blue-main);
}

@media (min-width: 768px) {
  .site-footer .footer-inner {
    grid-template-columns: 2fr 1fr 2fr;
  }
}

/* ------------------------------
   12. BOUTONS GÉNÉRIQUES
   ------------------------------ */

.btn,
.btn.primary,
.btn.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  background: var(--blue-main);
  color: #ffffff;
}

.btn.primary:hover {
  background: #005a97;
}

.btn.secondary {
  background: #ffffff;
  border-color: var(--blue-main);
  color: var(--blue-main);
}

.btn.secondary:hover {
  background: var(--blue-soft);
}

/* ------------------------------
   13. BARRE DE RECHERCHE GOOGLE CSE
   ------------------------------ */

.search-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 1.25rem auto 0.75rem;
}

.search-wrapper .gcse-search {
  display: block !important;
  width: 80% !important;
  max-width: 900px !important;
  min-width: 280px !important;
}

/* Forcer la largeur interne des composants Google */
.search-wrapper .gsc-control-cse {
  width: 100% !important;
}

.search-wrapper .gsc-input-box {
  background: #ffffff !important;
  border-radius: 999px !important;
  border: 1px solid #C8D3E2 !important;
  padding: 4px 10px !important;
  height: 38px !important;
  width: 100% !important;
}

.search-wrapper input.gsc-input {
  font-size: 0.95rem !important;
  background: transparent !important;
  color: #003F7F !important;
  padding: 4px !important;
  border: none !important;
  height: 30px !important;
}

/* Bouton loupe */
.search-wrapper .gsc-search-button,
.search-wrapper .gsc-search-button-v2 {
  background: var(--blue-main) !important;
  border-radius: 999px !important;
  border: none !important;
  padding: 4px 14px !important;
  height: 30px !important;
}

/* Mobile */
@media (max-width: 600px) {
  .search-wrapper .gcse-search {
    width: 95% !important;
    max-width: none !important;
  }
}

/* =========================================
   Headers non sticky sur tout le site
   ========================================= */

/* Bandeau bleu global */
.site-header,
.site-header.simple-header {
  position: static !important;
  top: auto !important;
}

/* Header de contenu des pages (LCA, PTG, kyste, etc.) */
#mainHeader,
.header-medical {
  position: static !important;
  top: auto !important;
}

/* Sécurité : ne jamais coller les <header> en haut */
body header {
  position: static !important;
  top: auto !important;
}

