/* =========================================================
   Cabinet de Cardiologie et Rythmologie de Nancy
   Feuille de style unique — rythmo-nancy.fr
   ========================================================= */

/* ---------- Polices auto-hébergées ---------- */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/work-sans-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/open-sans-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Jetons de design ---------- */
:root {
  --c-dark:      #002725;
  --c-deep:      #093a3e;
  --c-teal:      #3aafb9;
  --c-mint:      #56cec6;
  --c-aqua:      #02dbbe;
  --c-sky:       #97c8eb;
  --c-blue:      #0c71c5;
  --c-blue-dark: #0a5fa5;
  --c-ink:       #3c3a47;
  --c-ink-strong:#0e0c19;
  --c-cream:     #f9f6f5;
  --c-btn-light: #eaebed;
  --c-white:     #fff;

  --font-head: 'Poppins', Helvetica, Arial, sans-serif;
  --font-body: 'Work Sans', Helvetica, Arial, sans-serif;
  --font-btn:  'Open Sans', Helvetica, Arial, sans-serif;

  --shadow-card: 0 12px 18px -6px rgba(0, 0, 0, .3);
  --radius: 10px;
  --wrap: 1080px;
  --header-h: 137px;
}

/* ---------- Réinitialisation ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-ink);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
ul, ol { padding-left: 1.4em; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 10px; }
p { margin: 0 0 16px; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

/* Accessibilité clavier */
:focus-visible { outline: 3px solid var(--c-blue); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--c-dark); color: #fff; padding: 12px 20px; text-decoration: none;
}
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Structure ---------- */
/* Largeurs relevées sur rythmo-nancy.fr (rangées Divi) :
   contenu et haut d’en-tête 80 % / 1080 px · barre de menu 100 %
   · pied de page 100 % / 1080 px · grilles de l’accueil 95 % / 2560 px. */
.wrap { width: 80%; max-width: var(--wrap); margin: 0 auto; }
.nav-bar .wrap { width: 90%; }
/* Pied de page : rangée à 100 % / 1080 px comme sur l’original, mais avec le
   retrait de 30 px des modules Divi — sinon les cartes colorées touchent les
   bords de la fenêtre entre 1080 px et 1140 px de large. */
.site-footer .wrap { width: 100%; padding-left: 30px; padding-right: 30px; }
/* Grilles Équipe et Interventions de l’accueil : quasiment pas de marge latérale. */
.wrap-wide { width: 95%; max-width: 2560px; margin: 0 auto; }
.section { padding: 60px 0; }
.stack > * + * { margin-top: 26px; }

/* Grilles */
.grid { display: grid; gap: 30px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-3-2 { grid-template-columns: 3fr 2fr; }
.grid-2-3 { grid-template-columns: 2fr 3fr; }
.grid-3-1 { grid-template-columns: 3fr 1fr; }
.grid-align-center { align-items: center; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-btn);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.7;
  color: #fff;
  background: var(--c-blue);
  border: 0;
  border-radius: 100px;
  padding: 10px 24px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.btn:hover { background: var(--c-blue-dark); color: #fff; transform: translateY(-1px); }

.btn-hero {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #000;
  background: var(--c-btn-light);
  padding: 18px 40px;
}
.btn-hero:hover { background: #fff; color: #000; }

/* ---------- En-tête ---------- */
.site-header { background: #fff; position: relative; z-index: 50; }
/* Hauteurs relevées sur rythmo-nancy.fr : barre blanche 56 px (bouton 44 px
   + 6 px de part et d’autre), barre de menu 81 px — total 137 px (--header-h). */
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 6px 0;
}
.header-phone {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 500; font-size: 16px;
  color: var(--c-ink-strong); text-decoration: none;
}
.header-phone svg { width: 22px; height: 22px; flex: none; color: var(--c-teal); }
.header-phone:hover { color: var(--c-teal); }

/* Barre de navigation */
.nav-bar { background: var(--c-mint); }
.nav-bar .wrap { display: flex; align-items: center; justify-content: center; min-height: 81px; }

.nav-list { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-list > li { position: relative; }
.nav-list a {
  font-family: var(--font-head); font-weight: 500; font-size: 16px;
  color: #fff; text-decoration: none; display: block; padding: 6px 0;
}
.nav-list > li > a:hover,
.nav-list > li[aria-current] > a { opacity: .75; }
.nav-list a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

/* Sous-menu */
.has-sub > button.sub-toggle {
  display: none; background: none; border: 0; cursor: pointer;
}
.sub-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 280px; background: var(--c-mint); list-style: none;
  margin: 0; padding: 10px 0; border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden; transition: opacity .18s ease;
}
.sub-menu a { padding: 9px 22px; font-size: 15px; line-height: 1.4; }
.sub-menu a:hover { background: rgba(255, 255, 255, .18); }
.has-sub:hover > .sub-menu,
.has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; }

/* Bouton burger */
.burger {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 10px; margin-left: auto; color: #fff;
}
.burger svg { width: 26px; height: 26px; display: block; }

/* ---------- Section héros (accueil) ---------- */
.hero {
  position: relative;
  padding: 114px 0;
  background:
    linear-gradient(rgba(9, 58, 62, .58), rgba(9, 58, 62, .58)),
    var(--hero-img, none) center / cover no-repeat;
  background-color: var(--c-deep);
  color: #fff;
}
.hero h1 {
  font-weight: 600;
  font-size: clamp(32px, 5.2vw, 60px);
  line-height: 1.15;
  color: #fff;
  margin-bottom: 10px;
}
.hero .lead {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.6;
  font-weight: 500;
  color: #fff;
  max-width: 720px;
  margin-bottom: 34px;
}
/* Bouton « Prendre rendez-vous » + cœur animé côte à côte */
.hero-cta { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.heartbeat { display: block; flex: none; }

/* Battement du titre : dans « Cardiologie », une lettre tirée au sort bat
   en rouge toutes les 5 s, l’onde se propage ensuite à gauche et à droite
   (voir main.js). Effet volontairement discret : léger gonflement et rouge
   partiellement mêlé de blanc.
   `.hb-word` garde le mot insécable, les lettres étant en inline-block. */
.hb-word { white-space: nowrap; }
.hb-l {
  display: inline-block;
  will-change: transform;
  /* --amp : intensité (1 à la lettre d’origine, décroît en s’éloignant) */
  --amp: 1;
}
.hb-l.is-beating { animation: hb-beat .82s ease-out both; }
@keyframes hb-beat {
  0%   { transform: scale(1); color: inherit; }
  14%  { transform: scale(calc(1 + .11 * var(--amp))); color: #ff8a95; color: color-mix(in srgb, #ff4a58 calc(var(--amp) * 62%), #fff); }
  28%  { transform: scale(calc(1 + .02 * var(--amp))); color: #ff8a95; color: color-mix(in srgb, #ff4a58 calc(var(--amp) * 62%), #fff); }
  42%  { transform: scale(calc(1 + .07 * var(--amp))); color: #ff8a95; color: color-mix(in srgb, #ff4a58 calc(var(--amp) * 62%), #fff); }
  60%  { transform: scale(1); color: #ff8a95; color: color-mix(in srgb, #ff4a58 calc(var(--amp) * 62%), #fff); }
  100% { transform: scale(1); color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  .hb-l.is-beating { animation: none; }
}

/* ---------- Titres de section ---------- */
.section-title {
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 60px);
  line-height: 1.2;
  color: #000;
  text-align: center;
  margin-bottom: 24px;
}
/* `p.section-intro` (et non `.section-intro`) pour passer devant la règle
   `p:last-child { margin-bottom: 0 }` : le chapô est le dernier enfant de son
   `.wrap` quand la grille qui suit est sortie du conteneur (accueil). */
p.section-intro {
  max-width: 900px; margin: 0 auto 44px;
  text-align: center;
}

/* ---------- Titre de page (pages internes) ---------- */
.page-head { padding-top: 60px; }
.page-title {
  font-weight: 600;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  color: var(--c-deep);
  margin-bottom: 24px;
}
.h2-block {
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.25;
  color: var(--c-deep);
  margin: 0 0 16px;
}

/* Bandeau décoratif (motifs Divi) */
.section-pattern {
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
}

/* ---------- Section Équipe ---------- */
.team { padding: 60px 0; }
.team-grid { margin-bottom: 50px; }

/* Gouttières fluides des grilles pleine largeur (gutter Divi : 3 % de la rangée) */
.team-grid, .card-grid { column-gap: 3%; row-gap: 50px; }

.doc-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
}
.doc-card__media { aspect-ratio: 273 / 295; }
.doc-card__media img { width: 100%; height: 100%; object-fit: cover; }
.doc-card--1 .doc-card__media { background: var(--c-teal); }
.doc-card--2 .doc-card__media { background: var(--c-sky); }
.doc-card--3 .doc-card__media { background: var(--c-mint); }
.doc-card--4 .doc-card__media { background: var(--c-sky); }
.doc-card__body { padding: 16px 15px 20px; }
.doc-card__body h3 {
  font-weight: 500; font-size: 22px; line-height: 1.2;
  color: var(--c-deep); margin-bottom: 10px;
}
.doc-card__body p { font-size: 15px; line-height: 1.7; margin: 0; }

/* ---------- Cartes Interventions ---------- */
.interventions { padding: 100px 0; }

.card {
  border-radius: var(--radius);
  padding: 40px 30px;
  box-shadow: var(--shadow-card);
  color: #fff;
  text-align: center;
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center;
  transition: transform .22s ease, box-shadow .22s ease;
}
a.card:hover { transform: translateY(-6px); box-shadow: 0 20px 26px -8px rgba(0, 0, 0, .34); color: #fff; }
.card img { width: 48px; height: 48px; margin-bottom: 30px; }
.card h3 {
  font-family: var(--font-body); font-weight: 500;
  font-size: 16px; line-height: 1.2; color: #fff; margin-bottom: 10px;
}
.card p { font-size: 13px; line-height: 1.75; color: #fff; margin: 0; }

.card--dark { background: var(--c-dark); }
.card--teal { background: var(--c-teal); }
.card--sky  { background: var(--c-sky); }
.card--aqua { background: var(--c-aqua); }

/* ---------- Section « Pourquoi consulter » ---------- */
.why {
  padding: 100px 0 60px;
  background: var(--c-cream);
  background-image: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0) 48%);
}
.why .section-title, .why .section-intro { text-align: left; margin-left: 0; }
.why .section-intro { margin-bottom: 40px; }
.feature { margin-bottom: 28px; }
.feature h3 {
  font-weight: 600; font-size: 20px; line-height: 1.4;
  color: var(--c-teal); margin-bottom: 8px;
}
.feature p { margin: 0; line-height: 1.8; }
.why-media { display: grid; gap: 28px; }

/* ---------- Contenu éditorial (pages internes) ---------- */
/* Surtout pas de max-width ici : le conteneur des pages internes est
   `.wrap.prose`, et une valeur posée sur .prose écraserait le plafond
   de 1080 px de .wrap (même spécificité, déclarée après). */
.prose p, .prose li { font-size: 16px; line-height: 1.75; }
.prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose li > ul { margin-top: 8px; }
.prose strong { font-weight: 700; }
.prose h2 {
  font-weight: 600; font-size: clamp(22px, 2.4vw, 28px);
  color: var(--c-deep); margin: 36px 0 14px;
}
.prose h2:first-child { margin-top: 0; }
.prose a { color: var(--c-dark); }

/* Figures / légendes */
.fig { margin: 0; }
.fig img, .fig video { width: 100%; border-radius: 4px; }
.fig figcaption {
  margin-top: 10px;
  font-size: 15px; line-height: 1.6; color: var(--c-ink);
}
.fig--plain img { border-radius: 0; }

.btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 28px 0; }
.btn-row--center { justify-content: center; }

.divider { border: 0; border-top: 1px solid #e2e2e2; margin: 50px 0; }

/* ---------- Formulaire de contact ---------- */
.form-card {
  border: 1px solid #e2e2e2;
  border-radius: var(--radius);
  padding: 34px;
  background: #fff;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--c-deep);
}
.field input, .field textarea {
  font-family: var(--font-body); font-size: 16px; color: var(--c-ink);
  padding: 13px 16px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  background: #f7f7f7;
  width: 100%;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus {
  border-color: var(--c-teal); background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(58, 175, 185, .18);
}
/* Piège à robots — invisible pour les humains */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg { padding: 14px 18px; border-radius: 6px; margin-bottom: 22px; font-size: 15px; }
.form-msg--ok  { background: #e6f7f2; border: 1px solid var(--c-mint); color: #0a5c50; }
.form-msg--err { background: #fdecec; border: 1px solid #e9a3a3; color: #a12626; }

/* Mention légale reCAPTCHA sous le formulaire */
.form-legal { margin-top: 14px; font-size: 13px; line-height: 1.5; color: #5b6b6d; }
.form-legal a { color: inherit; }

/* ---------- Pied de page ---------- */
.site-footer {
  padding: 60px 0;
  color: #fff;
  background:
    linear-gradient(rgba(151, 200, 235, .51), rgba(151, 200, 235, .33)),
    var(--footer-img, none) center / cover no-repeat;
  background-color: var(--c-sky);
}
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-card {
  padding: 40px 30px;
  text-align: center;
  color: #fff;
}
.footer-card svg { width: 34px; height: 34px; margin: 0 auto 16px; display: block; }
.footer-card h2 {
  font-family: var(--font-head); font-weight: 500;
  font-size: 18px; line-height: 1.3; color: #fff; margin-bottom: 8px;
}
.footer-card p { font-size: 15px; line-height: 1.6; margin: 0 0 8px; color: #fff; }
.footer-card p:last-child { margin-bottom: 0; }
.footer-card a { color: #fff; text-decoration: underline; }
.footer-card a:hover { text-decoration: none; }

.footer-card--mint { background: var(--c-mint); }
.footer-card--teal { background: var(--c-teal); }
.footer-card--sky  { background: var(--c-sky); }
.footer-card--dark { background: var(--c-dark); margin-top: 20px; }

/* Ligne légale, désormais à l’intérieur de la carte sombre : sélecteur à deux
   classes pour passer devant `.footer-card p` (marges et corps de texte). */
.footer-card .footer-legal {
  text-align: center;
  margin: 22px 0 0; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .82);
}
.footer-card .footer-legal a { color: #fff; }

/* ---------- Bannière cookies ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 560px; margin: 0 auto;
  background: #fff; color: var(--c-ink);
  border: 1px solid #e2e2e2; border-radius: var(--radius);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .4);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
/* Indispensable : `display:flex` (feuille auteur) l'emporte sur le `display:none`
   de l'attribut [hidden] (feuille navigateur). Sans cette règle, la bannière
   reste affichée même après un choix. */
.cookie-banner[hidden] { display: none; }
.cookie-banner__text { margin: 0; font-size: 14px; line-height: 1.6; }
.cookie-banner__actions { display: flex; gap: 12px; justify-content: flex-end; }
.btn--ghost {
  background: transparent; color: var(--c-deep);
  border: 1px solid #cdd3d3;
}
.btn--ghost:hover { background: #f0f4f4; color: var(--c-deep); }

/* ---------- Adaptatif ---------- */
@media (max-width: 1080px) {
  .nav-list { gap: 16px; }
  .nav-list a { font-size: 15px; }
}

@media (max-width: 980px) {
  .burger { display: block; }
  .nav-bar .wrap { justify-content: flex-end; min-height: 52px; }

  .nav-list {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-mint);
    padding: 8px 0 16px;
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav-bar { position: relative; }
  .nav-list.is-open { display: flex; }
  .nav-list > li { border-top: 1px solid rgba(255, 255, 255, .25); }
  .nav-list > li:first-child { border-top: 0; }
  .nav-list a { padding: 14px 5vw; font-size: 16px; }

  .has-sub { display: flex; flex-wrap: wrap; align-items: center; }
  .has-sub > a { flex: 1; }
  .has-sub > button.sub-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 50px; color: #fff;
  }
  .has-sub > button.sub-toggle svg { width: 18px; height: 18px; transition: transform .2s ease; }
  .has-sub > button.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .sub-menu {
    position: static; transform: none; width: 100%;
    opacity: 1; visibility: visible; display: none;
    background: rgba(255, 255, 255, .14);
    border-radius: 0; box-shadow: none; padding: 4px 0;
  }
  .sub-menu.is-open { display: block; }
  .sub-menu a { padding: 12px 5vw 12px calc(5vw + 16px); }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1, .grid-1-2, .grid-3-2, .grid-2-3, .grid-3-1 { grid-template-columns: 1fr; }
  .grid-1-2 > :first-child, .grid-2-3 > :first-child { order: 2; }
  .grid-1-2 > :last-child,  .grid-2-3 > :last-child  { order: 1; }

  .team-grid, .card-grid { row-gap: 30px; }
  .why { background-image: none; padding: 60px 0; }
  .interventions { padding: 60px 0; }
  .hero { padding: 80px 0; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid { gap: 24px; }
  .team-grid, .card-grid { row-gap: 24px; }
  .section, .team, .page-head { padding-top: 44px; padding-bottom: 44px; }
  .interventions { padding: 50px 0; }
  .hero { padding: 64px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 20px; }
  .header-top { padding: 5px 0; }   /* barre blanche : 54 px comme l’original mobile */
  .header-phone { font-size: 15px; }
  .btn-hero { padding: 16px 28px; }
  .card { padding: 32px 24px; }
  .footer-card { padding: 32px 24px; }
  .site-footer { padding: 44px 0; }
}
