/* ============================================================
   Centre Hospitalier MedCenter — chm.ht
   Feuille de style principale — Août 2026
   ============================================================ */

:root {
  /* Palette issue de l'identité visuelle CHM */
  --navy: #14335e;
  --navy-deep: #0c2344;
  --teal: #19a7b8;
  --teal-soft: #e3f5f7;
  --cyan: #35c3d4;
  --red: #e2333f;
  --gold: #f2b705;
  --ink: #16233a;
  --ink-soft: #4a5a72;
  --paper: #ffffff;
  --mist: #f4f8fb;
  --line: #dde7ef;

  --grad-brand: linear-gradient(135deg, var(--navy) 0%, #17518e 55%, var(--teal) 130%);
  --grad-teal: linear-gradient(135deg, var(--teal), var(--cyan));

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 2px 10px rgba(12, 35, 68, .07);
  --shadow-2: 0 14px 40px rgba(12, 35, 68, .14);

  --font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-900: clamp(2.1rem, 1.2rem + 4vw, 3.9rem);
  --fs-800: clamp(1.7rem, 1.1rem + 2.4vw, 2.7rem);
  --fs-700: clamp(1.3rem, 1rem + 1.2vw, 1.75rem);
  --fs-600: clamp(1.08rem, 1rem + .4vw, 1.25rem);
  --fs-500: 1.06rem;
  --fs-400: .97rem;
  --fs-300: .85rem;

  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font);
  font-size: var(--fs-500);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); }

.container { width: min(1180px, 92vw); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 999;
  background: var(--navy); color: #fff; padding: .6rem 1.2rem; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

/* ---------- Bandeau urgence ---------- */
.topbar {
  background: var(--navy-deep);
  color: #cfe3f5;
  font-size: var(--fs-300);
  padding: .45rem 0;
}
.topbar .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar .pulse-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #37e0a1; margin-right: .45rem; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: var(--shadow-1); }
.header-inner { display: flex; align-items: center; gap: 1.4rem; padding: .7rem 0; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand svg { width: 46px; height: 46px; flex: none; }
.brand-name { line-height: 1.15; }
.brand-name .l1 { display: block; font-weight: 800; font-size: .98rem; color: var(--navy); letter-spacing: .02em; }
.brand-name .l2 { display: block; font-weight: 700; font-size: .86rem; letter-spacing: .14em; }
.brand-name .l2 .med { color: var(--teal); }
.brand-name .l2 .center { color: var(--navy); }

.main-nav { display: flex; gap: .2rem; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-400);
  padding: .55rem .8rem; border-radius: 10px; transition: color .2s, background .2s;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--navy); background: var(--teal-soft); }

.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: .45rem;
  font: inherit; font-weight: 700; font-size: var(--fs-300);
  color: var(--navy); background: var(--mist); border: 1px solid var(--line);
  padding: .5rem .8rem; border-radius: 999px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--teal); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2); padding: .4rem; display: none; z-index: 200;
}
.lang-menu.open { display: block; animation: fadeup .18s ease; }
.lang-menu button {
  display: flex; width: 100%; align-items: center; gap: .6rem;
  font: inherit; font-size: var(--fs-400); text-align: left;
  background: none; border: 0; padding: .55rem .7rem; border-radius: 8px; cursor: pointer; color: var(--ink);
}
.lang-menu button:hover { background: var(--teal-soft); }
.lang-menu button[aria-current="true"] { background: var(--navy); color: #fff; }
.lang-menu .code { font-weight: 800; font-size: .75rem; color: var(--teal); width: 2ch; }
.lang-menu button[aria-current="true"] .code { color: var(--cyan); }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: var(--fs-400); text-decoration: none;
  padding: .72rem 1.35rem; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(226, 51, 63, .35); }
.btn-red:hover { background: #c9202c; }
.btn-primary { background: var(--grad-teal); color: #fff; box-shadow: 0 6px 18px rgba(25, 167, 184, .35); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.25); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; isolation: isolate; overflow: clip; }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(9, 26, 51, .88) 0%, rgba(12, 44, 82, .72) 45%, rgba(13, 78, 104, .38) 100%);
}
.hero-inner { padding: clamp(5rem, 12vh, 9rem) 0 clamp(4.5rem, 10vh, 7.5rem); max-width: 780px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(53, 195, 212, .16); border: 1px solid rgba(53, 195, 212, .5);
  color: #b8ecf3; font-weight: 700; font-size: var(--fs-300);
  padding: .4rem 1rem; border-radius: 999px; margin-bottom: 1.3rem;
}
.hero h1 { font-size: var(--fs-900); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; text-wrap: balance; }
.hero h1 .hl { color: var(--cyan); }
.hero p.lead { margin: 1.3rem 0 2rem; font-size: var(--fs-600); color: #dbe9f7; max-width: 60ch; text-wrap: pretty; }
.hero .slogan { margin-top: 1.15rem; font-size: var(--fs-600); font-weight: 800; letter-spacing: .045em; color: #fff; text-transform: uppercase; }
.hero .slogan .alt { color: var(--cyan); }
.hero-ctas { display: flex; gap: .9rem; flex-wrap: wrap; }

.hero-badges { display: flex; gap: .6rem 1.6rem; flex-wrap: wrap; margin-top: 2.6rem; }
.hero-badges span { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--fs-300); font-weight: 600; color: #cfe6f2; }
.hero-badges svg { width: 18px; height: 18px; color: var(--cyan); }

/* ---------- Bande de stats ---------- */
.stats { background: var(--grad-brand); color: #fff; padding: 1.6rem 0; }
.stats .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center; }
.stat .num { font-size: var(--fs-800); font-weight: 800; line-height: 1.1; }
.stat .num small { font-size: .55em; font-weight: 700; vertical-align: super; }
.stat .lbl { font-size: var(--fs-300); color: #c7dcf2; font-weight: 600; }

/* ---------- Sections génériques ---------- */
.section { padding: clamp(3.6rem, 9vh, 6.2rem) 0; }
.section.alt { background: var(--mist); }
.section-head { max-width: 720px; margin-bottom: 2.8rem; }
.kicker {
  display: inline-block; font-weight: 800; font-size: var(--fs-300); letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal); margin-bottom: .6rem;
}
.section-head h2 { font-size: var(--fs-800); font-weight: 800; color: var(--navy); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.section-head p { margin-top: .9rem; color: var(--ink-soft); text-wrap: pretty; }

/* ---------- Services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.svc-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.7rem 1.5rem; box-shadow: var(--shadow-1);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.svc-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: var(--cyan); }
.svc-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal); margin-bottom: 1.1rem;
}
.svc-icon.red { background: #fdeaec; color: var(--red); }
.svc-icon.navy { background: #e8eef7; color: var(--navy); }
.svc-icon.gold { background: #fdf3d7; color: #b8890a; }
.svc-icon svg { width: 28px; height: 28px; }
.svc-card h3 { font-size: var(--fs-600); color: var(--navy); margin-bottom: .5rem; font-weight: 800; }
.svc-card p { font-size: var(--fs-400); color: var(--ink-soft); }
.svc-tag {
  display: inline-block; margin-top: 1rem; font-size: .74rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--red);
  background: #fdeaec; padding: .25rem .7rem; border-radius: 999px;
}
.svc-tag.teal { color: #0e7c8a; background: var(--teal-soft); }

/* ---------- Infrastructure (autonomie) ---------- */
.infra { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.infra + .infra { margin-top: 4.5rem; }
.infra.flip .infra-media { order: 2; }
.infra-media { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2); }
.infra-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.infra-media .float-tag {
  position: absolute; left: 1rem; bottom: 1rem;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-radius: 12px; padding: .6rem 1rem; font-weight: 700; font-size: var(--fs-300);
  color: var(--navy); display: flex; align-items: center; gap: .5rem; box-shadow: var(--shadow-1);
}
.infra-media .float-tag svg { width: 20px; height: 20px; color: var(--teal); }
.infra-body h3 { font-size: var(--fs-700); color: var(--navy); font-weight: 800; margin-bottom: .8rem; text-wrap: balance; }
.infra-body p { color: var(--ink-soft); margin-bottom: 1rem; text-wrap: pretty; }
.check-list { list-style: none; margin-top: 1.2rem; display: grid; gap: .65rem; }
.check-list li { display: flex; gap: .7rem; align-items: flex-start; font-size: var(--fs-400); }
.check-list svg { width: 21px; height: 21px; flex: none; color: var(--teal); margin-top: .12rem; }

/* ---------- AyidaHMS ---------- */
.ayida { background: var(--navy-deep); color: #fff; position: relative; overflow: clip; }
.ayida::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 85% 15%, rgba(53,195,212,.18), transparent 70%),
    radial-gradient(500px 300px at 10% 90%, rgba(25,167,184,.12), transparent 70%);
}
.ayida .container { position: relative; }
.ayida .kicker { color: var(--cyan); }
.ayida h2 { color: #fff; }
.ayida .section-head p { color: #b9cde4; }
.ayida-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.ayida-card {
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius); padding: 1.5rem 1.3rem;
  transition: background .25s, transform .25s;
}
.ayida-card:hover { background: rgba(255,255,255,.1); transform: translateY(-4px); }
.ayida-card svg { width: 30px; height: 30px; color: var(--cyan); margin-bottom: .9rem; }
.ayida-card h3 { font-size: var(--fs-500); font-weight: 700; margin-bottom: .45rem; }
.ayida-card p { font-size: var(--fs-300); color: #a9c1da; }
.ayida-note { margin-top: 2.2rem; font-size: var(--fs-300); color: #8fa9c6; display: flex; align-items: center; gap: .6rem; }
.ayida-note svg { width: 18px; height: 18px; color: var(--cyan); flex: none; }

/* ---------- Galerie ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; gap: 1rem; }
.gallery figure { position: relative; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-1); }
.gallery figure:first-child { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.045); }
.gallery figcaption {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 1.6rem .95rem .7rem; font-size: var(--fs-300); font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(9, 26, 51, .82));
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.6rem; align-items: start; }
.contact-cards { display: grid; gap: 1rem; }
.contact-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-1);
}
.contact-card .ico {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--teal-soft); color: var(--teal);
}
.contact-card .ico.red { background: #fdeaec; color: var(--red); }
.contact-card .ico svg { width: 24px; height: 24px; }
.contact-card h3 { font-size: var(--fs-400); font-weight: 800; color: var(--navy); margin-bottom: .15rem; }
.contact-card p, .contact-card a { font-size: var(--fs-400); color: var(--ink-soft); text-decoration: none; }
.contact-card a:hover { color: var(--teal); }
.hours-table { width: 100%; border-collapse: collapse; font-size: var(--fs-400); }
.hours-table td { padding: .5rem 0; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.hours-table td:last-child { text-align: right; font-weight: 700; color: var(--navy); }
.hours-table .always td:last-child { color: var(--red); }

.map-shell { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.map-shell img { aspect-ratio: 4 / 3.4; object-fit: cover; width: 100%; }
.map-note { padding: 1rem 1.2rem; background: #fff; font-size: var(--fs-300); color: var(--ink-soft); display: flex; gap: .55rem; align-items: center; }
.map-note svg { width: 18px; height: 18px; color: var(--red); flex: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #9db4d0; font-size: var(--fs-300); }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.4rem; padding: 3.4rem 0 2.6rem; }
.footer-main .brand-name .l1 { color: #fff; }
.footer-main .brand-name .l2 .center { color: #fff; }
.footer-about p { margin-top: 1rem; max-width: 34ch; }
.site-footer h4 { color: #fff; font-size: var(--fs-400); font-weight: 800; margin-bottom: 1rem; }
.site-footer ul { list-style: none; display: grid; gap: .55rem; }
.site-footer ul a { color: #9db4d0; text-decoration: none; }
.site-footer ul a:hover { color: var(--cyan); }
.footer-langs { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-langs button {
  font: inherit; font-weight: 700; color: #cfe0f2; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px; padding: .35rem .7rem; cursor: pointer;
}
.footer-langs button:hover, .footer-langs button[aria-current="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom a { color: #9db4d0; }
.footer-slogan { margin-top: 1rem; font-weight: 800; letter-spacing: .05em; color: #fff; text-transform: uppercase; font-size: var(--fs-300); }
.footer-slogan .alt { color: var(--cyan); }
.footer-bottom .credit a { color: #cfe0f2; font-weight: 700; text-decoration: none; }
.footer-bottom .credit a:hover { color: var(--cyan); }

/* ---------- Bouton flottant urgences (mobile) ---------- */
.fab-emergency {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 150;
  display: none; align-items: center; gap: .55rem;
  background: var(--red); color: #fff; font-weight: 800; text-decoration: none;
  padding: .85rem 1.3rem; border-radius: 999px; box-shadow: 0 10px 30px rgba(226,51,63,.5);
}
.fab-emergency svg { width: 20px; height: 20px; }

/* ---------- Animations d'apparition ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .ayida-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .infra { grid-template-columns: 1fr; gap: 1.8rem; }
  .infra.flip .infra-media { order: 0; }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px;
    background: var(--mist); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; color: var(--navy); }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; padding: .8rem;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2);
    display: none;
  }
  .main-nav.open { display: flex; animation: fadeup .2s ease; }
  .header-cta { display: none; }
  .stats .container { grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 190px; }
  .gallery figure:first-child { grid-column: span 2; }
  .fab-emergency { display: inline-flex; }
}

@media (max-width: 560px) {
  .svc-grid, .ayida-grid { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 1.8rem; }
  .topbar .container { justify-content: center; }
  .topbar .topbar-right { display: none; }
}

/* ---------- Impression ---------- */
@media print {
  .topbar, .site-header, .fab-emergency, .hero-ctas, .site-footer { display: none !important; }
  .hero { color: var(--ink); }
  .hero::after, .hero picture { display: none; }
}
