/* ==========================================================
   CLEAN PATCH — Site médecin (header unifié + pathologies)
   - 1 seul système de header
   - 1 seul submenu pathologies
   - pas d'effets qui rendent les pages invisibles par défaut
   ========================================================== */

/* ---------------------------
   1) Reset & Base
--------------------------- */
:root{
  --text:#111111;
  --muted:#4A4A4A;
  --muted-2:#8F8F8F;
  --border:#DFDFDF;
  --soft:#F6F5FB;
  --bg:#FFFFFF;

  --container:1200px;
  --gutter:3rem;

  --header-h:9.6rem;
  --submenu-h:auto;

  --shadow-sm:0 2px 8px rgba(0,0,0,0.05);
  --shadow-md:0 8px 24px rgba(0,0,0,0.08);
}

html{
  font-size: 10px; /* 1rem = 10px */
  scroll-behavior: smooth;
  box-sizing: border-box;
}

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

body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.6rem;
  line-height: 1.7;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* IMPORTANT: header fixed => réserve de l'espace */
  padding-top: var(--header-h);
}

img{
  max-width: 100%;
  height: auto;
  display: block;
}

a{
  color: inherit;
  text-decoration: none;
  transition: color .25s ease, background .25s ease, transform .25s ease, box-shadow .25s ease;
}

ul{ list-style: none; margin:0; padding:0; }

/* Accessibilité */
.skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left:1.6rem;
  top:1.6rem;
  width:auto;
  height:auto;
  padding:1.2rem 2rem;
  background: var(--text);
  color:#fff;
  z-index:9999;
  border-radius: .6rem;
}

/* ---------------------------
   2) Typography
--------------------------- */
h1,h2,h3,h4,h5,h6{
  margin: 0 0 1.6rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text);
}

h1{ font-size: clamp(3.4rem, 5vw, 6.2rem); }
h2{ font-size: clamp(2.6rem, 3.5vw, 4.6rem); }
h3{ font-size: clamp(2.0rem, 2.5vw, 3.0rem); }

p{
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1.8;
}

/* ---------------------------
   3) Layout helpers
--------------------------- */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2.4rem;
}

.section{
  padding: 8rem 0;
}

.section.soft{
  background: var(--bg-soft);
}

.section.accent{
  background: var(--bg-accent);
}

.section--soft{
  background: var(--soft);
}

/* Padding pour pages avec header fixed */
.page-content{
  padding-top: 12rem;
}

/* ---------------------------
   4) Header (1 seul système)
--------------------------- */
/* Utilise toujours <header class="header"> */
.header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;

  /* Institutionnel par défaut */
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Option : header transparent uniquement sur la home
   => <header class="header header--home"> */
.header--home{
  background: rgba(255,255,255,0);
  backdrop-filter: blur(0);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  box-shadow: none;
}

/* Quand tu scroll sur la home, tu ajoutes .header--scrolled via JS */
.header--home.header--scrolled{
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar{
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 1.2rem;
  padding: 2.2rem 0 1.6rem;
}

.brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap: .4rem;
}

.brand-text strong{
  display:block;
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text);
}

.brand-text span{
  display:block;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Si header transparent (home), texte en blanc tant qu'on n'a pas scroll */
.header--home:not(.header--scrolled) .brand-text strong{ color:#fff; }
.header--home:not(.header--scrolled) .brand-text span{ color: rgba(255,255,255,0.9); }

.nav{
  display:flex;
  flex-wrap: wrap;
  justify-content:center;
  align-items:center;
  gap: .4rem;
}

.nav a{
  position: relative;
  padding: 1rem 1.8rem;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: .6rem;
}

/* Sur home transparent : menu blanc tant qu'on n'a pas scroll */
.header--home:not(.header--scrolled) .nav a{
  color: rgba(255,255,255,0.95);
}
.header--home:not(.header--scrolled) .nav a:hover{
  background: rgba(255,255,255,0.1);
  color:#fff;
}

.nav a:hover{
  background: rgba(0,0,0,0.04);
  color: var(--text);
}

/* Active sans layout shift (pas de border-bottom) */
.nav a[aria-current="page"]::after{
  content:"";
  position:absolute;
  left: 1.8rem;
  right: 1.8rem;
  bottom: .6rem;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Active sur home transparent (blanc tant que pas scroll) */
.header--home:not(.header--scrolled) .nav a[aria-current="page"]::after{
  background:#fff;
}

/* Dropdown (desktop only: hover) */
.nav-item{ position: relative; }

.dropdown{
  position:absolute;
  top: 100%;
  left: 0;
  min-width: 22rem;
  background:#fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: .8rem;
  margin-top: 1rem;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-1rem);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  overflow: hidden;
  z-index: 1100;
}

.nav-item:hover .dropdown{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a{
  display:block;
  padding: 1.2rem 2rem;
  color: var(--muted);
  font-size: 1.4rem;
  letter-spacing: .02em;
  text-transform: none;
  border-bottom: 1px solid var(--border);
}

.dropdown a:last-child{ border-bottom: none; }

.dropdown a:hover{
  background: var(--soft);
  color: var(--text);
}

/* ---------------------------
   5) Hero (home)
--------------------------- */
.hero{
  width:100%;
  height:100vh;
  position: relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

/* IMPORTANT: le header est fixed; si hero en top, il doit pouvoir "passer sous" */
.header--home + .hero{ margin-top: calc(var(--header-h) * -1); padding-top: var(--header-h); }

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background: url('https://images.unsplash.com/photo-1551190822-a9333d879b1f?q=80&w=2000') center/cover no-repeat;
  z-index:1;
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.4);
  z-index:2;
}

.hero-grid{
  position: relative;
  z-index: 3;
  max-width: 90rem;
  width: 100%;
  margin: 0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.kicker{
  display:inline-block;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.6rem;
}

.hero h1{
  color:#fff;
  font-size: clamp(4.2rem, 6vw, 7.2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 2.4rem;
}

.hero p{
  font-size: 1.8rem;
  color: rgba(255,255,255,0.9);
  max-width: 60rem;
  margin: 0 auto 3rem;
}

.hero-actions{
  display:flex;
  gap: 1.6rem;
  justify-content:center;
  flex-wrap: wrap;
}

/* ---------------------------
   6) Buttons & links
--------------------------- */
.btn{
  display:inline-block;
  padding: 1.4rem 3.2rem;
  border: 1px solid var(--border);
  background:#fff;
  color: var(--text);
  font-weight: 400;
  transition: all .25s ease;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
}
.btn:hover{
  background: var(--text);
  color:#fff;
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--primary{
  background: var(--text);
  color:#fff;
  border-color: var(--text);
}
.btn--primary:hover{
  background: var(--muted);
  border-color: var(--muted);
}

.btn--accent{
  background: #4A90E2;
  color:#fff;
  border-color: #4A90E2;
}
.btn--accent:hover{
  background: #357ABD;
  border-color: #357ABD;
}

/* ---------------------------
   7) Cards / Grids
--------------------------- */
.grid{
  display:grid;
  gap: 3rem;
}
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }

.card{
  background:#fff;
  border: 1px solid var(--border);
  padding: 4rem;
  transition: transform .25s ease, box-shadow .25s ease;
  border-radius: .8rem;
}
.card:hover{
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.card h3{
  font-weight: 400;
  margin-bottom: 1.6rem;
}
.card p{
  margin: 0;
  font-size: 1.5rem;
}

/* ---------------------------
   8) Forms
--------------------------- */
input, textarea, select{
  font: inherit;
  font-size: 1.6rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: 1.2rem;
  width: 100%;
  margin-bottom: 1.6rem;
  transition: border-color .25s ease, box-shadow .25s ease;
  background:#fff;
}
input:focus, textarea:focus, select:focus{
  outline:none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,17,17,0.08);
}
textarea{
  resize: vertical;
  min-height: 10rem;
}

/* ---------------------------
   9) Pathologies submenu (1 seul)
--------------------------- */
/* Utilise <div class="submenu-pathologies"> ... */
.submenu-pathologies{
  position: sticky;
  top: var(--header-h);
  z-index: 900;
  padding: 1.2rem 0;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid #E6E6E6;
  backdrop-filter: blur(10px);
}

.submenu-pathologies .container{
  display:flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
}

.submenu-pathologies a{
  padding: .8rem 1.4rem;
  font-size: 1.3rem;
  border-radius: 999px;
  border: 1px solid #E6E6E6;
  color: var(--muted);
  background: transparent;
}

.submenu-pathologies a:hover{
  background: var(--soft);
  color: var(--text);
}

.submenu-pathologies a.active{
  background: var(--text);
  border-color: var(--text);
  color:#fff;
}

/* ---------------------------
   10) Pathology content (UNIQUE - tout regroupé ici)
--------------------------- */

/* Cadre de lecture pour les fiches pathologies */
.pathology-content{
  max-width: 78rem;
  margin: 0 auto;
}

.pathology-content h1{
  font-size: 3.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 3rem;
}

.pathology-content section + section{
  margin-top: 3.2rem;
}

.pathology-content h2{
  margin: 2.4rem 0 1.2rem;
  font-size: 1.8rem;
  font-weight: 500;
}

.pathology-content p{
  color: #3b3f45;
  line-height: 1.75;
  margin-bottom: 1.8rem;
}

.pathology-content ul{
  margin: 1.6rem 0;
  padding-left: 2.2rem;
  list-style: disc;
}

.pathology-content li{
  margin-bottom: .8rem;
  line-height: 1.8;
  color: var(--muted);
}

/* Sections colorées alternées */
.pathology-section{
  padding: 3.5rem;
  border-radius: 12px;
  margin-bottom: 2.4rem;
  border-left: 4px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pathology-section--primary{
  background: #ffffff;
  border-left-color: #4A4A4A;
}

.pathology-section--secondary{
  background: #F9FAFB;
  border-left-color: #8F8F8F;
}

.pathology-section--tertiary{
  background: #F6F7F9;
  border-left-color: #DFDFDF;
}

.pathology-section h2{
  margin-top: 0;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--text);
}

/* Sous-titres dans les fiches pathologies (ex: stades) */
.pathology-content .pathology-subtitle{
  margin-top: 2.2rem;
  margin-bottom: .8rem;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.3;
}

.pathology-content .pathology-subtitle + p{
  margin-top: 0;
}

/* Image centrée dans les pathologies */
.pathology-image-centered{
  display: flex;
  justify-content: center;
  margin: 3.5rem 0;
}

.pathology-image-centered img{
  max-width: 35rem;
  width: 100%;
  height: auto;
}

/* Images plus grandes (variante) */
.pathology-image-large img{
  max-width: 65rem;
}

/* ===== Galerie pathologies — centrage fort, images larges ===== */
.pathology-gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 4rem;
  margin: 4rem auto 5rem;
  max-width: 1100px;
  justify-content: center;
}

.pathology-figure{
  margin: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

.pathology-figure img{
  display: block;
  width: 100%;
  max-width: 340px;
  max-height: 280px;
  object-fit: contain;
}

.pathology-figure figcaption{
  margin-top: .8rem;
  font-size: 1.25rem;
  color: #666;
  text-align: center;
}

/* Page index pathologies (cartes) */
.pathologies-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
  gap: 3rem;
  margin-top: 4rem;
}

.pathology-card{
  background:#fff;
  border: 1px solid var(--border);
  padding: 3rem;
  border-radius: .8rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
.pathology-card:hover{
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.pathology-card h3{
  margin-bottom: 1.4rem;
  font-weight: 400;
}
.pathology-card p{
  margin: 0;
}

/* Sources */
.source{
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #E6E6E6;
  font-style: italic;
  color: var(--muted-2);
  font-size: 1.3rem;
}
.source a{
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Lien retour */
.back-link{
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 1.4rem;
  color: var(--muted);
  transition: color .25s ease;
}

.back-link:hover{
  color: var(--text);
}

/* Sécurité : si une section est "nue" dans une page pathologie */
.pathology-content > section:not(.pathology-section):not(.pathology-gallery){
  margin-top: 3.2rem;
  padding: 2.4rem;
  background: #fff;
  border: 1px solid #e6e7ea;
  border-radius: 12px;
}

@media (max-width: 768px){
  :root{
    --header-h: 11.2rem;
    --gutter: 2rem;
  }

  .navbar{
    padding: 1.6rem 0 1.2rem;
    gap: .9rem;
  }

  .brand-text strong{ font-size: 1.8rem; }
  .brand-text span{ font-size: 1.1rem; }

  .nav a{
    padding: .8rem 1.2rem;
    font-size: 1.1rem;
  }

  /* Dropdown -> simple list on mobile */
  .dropdown{
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-top: .6rem;
    box-shadow: none;
    border-radius: .8rem;
  }

  .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; }

  .footer-grid{
    grid-template-columns: 1fr;
    text-align:center;
    gap: 2rem;
  }

  .card{ padding: 2.6rem; }
  .content-wrapper{ padding: 0 2rem; }
  .pathology h1{ font-size: 2.4rem; }
  .pathology h2{ font-size: 1.6rem; }

  .pathology-images-grid{
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
  }

  /* Nouveau footer propre */
  .site-footer {
    background: #0f0f10;
    color: #fff;
    margin-top: 6rem;
    padding: 5rem 0;
  }

  .site-footer small {
    display: block;
    margin-top: 0.8rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.3rem;
    line-height: 1.5;
  }

  .site-footer__grid {
    flex-direction: column;
  }

  .site-footer__right {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 480px){
  .nav a{ padding: .6rem 1rem; font-size: 1.0rem; }
}

/* 16) Misc */
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 16.5) Footer - Nouveau style */
.site-footer {
  background: #0f0f10;
  color: #fff;
  margin-top: 6rem;
  padding: 5rem 0;
}

.site-footer small {
  display: block;
  margin-top: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.3rem;
  line-height: 1.5;
}

.site-footer__grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer__right {
  text-align: right;
  max-width: 520px;
}

/* 17) Animations de transition entre sections */
/* ...existing code... */

/* Responsive adjustments */
@media (max-width: 768px) {
  /* ...existing code... */
  
  .site-footer__grid {
    flex-direction: column;
  }
  
  .site-footer__right {
    text-align: left;
    max-width: none;
  }
}

/* Page pathologies - Grille de cartes */
.page-content {
  padding: 4rem 0 6rem;
  background: #f6f7fb;
}

/* Padding pour pages avec header fixed */
.page-content{
  padding-top: 12rem;
}

/* Bouton retour */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  margin-bottom: 3rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: #111111;
  background: white;
  border: 1px solid #e6e7ea;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: #f6f7fb;
  border-color: #d8dbe0;
  transform: translateX(-4px);
}

.pathologies-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.4rem;
}

.pathology-card {
  display: block;
  background: #fff;
  border: 1px solid #e6e7ea;
  border-radius: 10px;
  padding: 2.4rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 160px;
}

.pathology-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-color: #d8dbe0;
}

.pathology-card h3 {
  margin: 0 0 1rem;
  font-size: 2.0rem;
  line-height: 1.2;
  font-weight: 600;
}

.pathology-card p {
  margin: 0;
  color: #5b6672;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .pathologies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pathologies-grid {
    grid-template-columns: 1fr;
  }
}

/* Styles pour les pages de pathologies */
.pathology-content {
  max-width: 90rem;
  margin: 0 auto;
}

/* ===== Galerie pathologies — centrage fort, images larges ===== */
.pathology-gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 4rem;
  margin: 4rem auto 5rem;
  max-width: 1100px;
  justify-content: center;
}

.pathology-figure{
  margin: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

.pathology-figure img{
  display: block;
  width: 100%;
  max-width: 340px;
  max-height: 280px;
  object-fit: contain;
}

.pathology-figure figcaption{
  margin-top: .8rem;
  font-size: 1.25rem;
  color: #666;
  text-align: center;
}

/* Tablette */
@media (max-width: 980px){
  .pathology-gallery{
    grid-template-columns: repeat(2, 1fr);
  }

  .pathology-figure img{
    max-width: 360px;
    max-height: 300px;
  }
}

/* Mobile */
@media (max-width: 768px){
  /* ...existing code... */

  .pathology-section{
    padding: 2rem;
  }

  .pathology-gallery{
    grid-template-columns: 1fr;
  }

  .pathology-figure img{
    max-width: 420px;
    max-height: 320px;
  }

  /* ...existing code... */
}

.site-footer{
  background:#0f0f10 !important;
  color:#fff !important;
  width:100% !important;
  padding: 3.2rem 0 !important;
  margin-top: 6rem !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
}

.site-footer *{ color: inherit; }

.site-footer .container{
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2.4rem;
  padding-right: 2.4rem;
}

.site-footer__grid{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 2rem;
}

.site-footer__left strong{
  display:block;
  font-weight:600;
  letter-spacing:.01em;
}

.site-footer__left small,
.site-footer__right small{
  display:block;
  margin-top:.8rem;
  color: rgba(255,255,255,.72) !important;
  font-size: 1.3rem;
  line-height: 1.5;
}

.site-footer__right{
  text-align:right;
  max-width: 520px;
}

@media (max-width: 768px){
  .site-footer__grid{ flex-direction:column; }
  .site-footer__right{ text-align:left; max-width:none; }
}

/* Sécurité : si une section est "nue" dans une page pathologie */
.pathology-content > section:not(.pathology-section):not(.pathology-gallery){
  margin-top: 3.2rem;
  padding: 2.4rem;
  background: #fff;
  border: 1px solid #e6e7ea;
  border-radius: 12px;
}
