/* Centre Hospitalier Éducatif El Youssef — homepage styles
   Direction B "Accueil" — colours come from the logo (#345562). */

:root {
  --brand: #345562;        /* logo blue-teal */
  --brand-dark: #22404B;   /* top bar, practical info */
  --brand-tint: #7FA6B4;   /* accents on dark backgrounds */
  --brand-pale: #C9DAE0;
  --mist: #EEF2F1;         /* light section background */
  --line: #DDE4E3;
  --ink: #18252A;
  --text: #3B4D52;
  --urgent: #B3261E;       /* emergency only */
  --panel-opacity: 0.72;
  --wrap: 1280px;
  --section-pad: clamp(64px, 7vw, 96px);
  --font-display: 'Readex Pro', sans-serif;
  --font-body: 'Atkinson Hyperlegible', 'Readex Pro', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--font-body); font-size: 18px; line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
section[id] { scroll-margin-top: 96px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.ar { font-family: var(--font-display); }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Skip link */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: #fff; color: var(--brand-dark); padding: 12px 18px; font-weight: 700; }
.skip:focus { left: 16px; }

/* Section headings — one style everywhere */
.sec-head { display: flex; flex-direction: column; gap: 10px; }
.sec-title { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(34px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); }
.sec-ar { align-self: flex-start; font-family: var(--font-display); font-size: 20px; color: var(--brand); }
.on-dark .sec-title { color: #fff; }
.on-dark .sec-ar { color: #BFD3D9; }
.text-link { display: inline-flex; align-items: center; min-height: 48px; font-family: var(--font-display); font-weight: 500; font-size: 16px; color: var(--brand); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; font-family: var(--font-display); font-size: 15px; font-weight: 500; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn--ghost-light { border-color: rgba(255,255,255,.45); color: #fff; }
.btn--brand { background: var(--brand); border-color: #5F8593; color: #fff; }
.btn--outline { border: 1.5px solid var(--brand); color: var(--brand); background: #fff; }
.btn--white { background: #fff; color: var(--brand); min-height: 52px; padding: 0 22px; font-size: 17px; font-weight: 600; }
.btn:hover { filter: brightness(1.08); color: inherit; }
.btn--brand:hover, .btn--ghost-light:hover { color: #fff; }

/* ---------- Top bar ---------- */
.topbar { background: var(--brand-dark); color: #DCE6E6; font-size: 15px; }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 28px; }
.urgent { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; margin-left: -18px; background: var(--urgent); color: #fff; font-weight: 700; text-decoration: none; }
.urgent:hover { color: #fff; }
.urgent__num { font-family: var(--font-display); font-weight: 500; letter-spacing: .02em; }
.urgent__ar { font-family: var(--font-display); font-weight: 400; opacity: .9; }
.directlines { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 0; font-size: 14px; line-height: 1.35; }
.directlines span { display: flex; gap: 8px; }
.directlines b { color: #fff; }
.nowrap { white-space: nowrap; }
.directlines .lbl { width: 84px; }
.topctas { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); transition: box-shadow .2s ease; }
.header.is-compact { box-shadow: 0 4px 16px rgba(34,64,75,.10); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; transition: padding .2s ease; }
.header.is-compact .header__in { padding-top: 6px; padding-bottom: 6px; }
.logo img { height: 60px; width: auto; transition: height .2s ease; }
.header.is-compact .logo img { height: 44px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-family: var(--font-display); font-size: 16px; }
.nav a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--text); text-decoration: none; }
.nav a { transition: background-color .15s ease, color .15s ease; }
.nav a:hover { color: var(--brand); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand); }
/* Rollover on the main navigation: the whole item turns brand teal */
.nav > a:hover, .nav > a:focus-visible { background: var(--brand); color: #fff; box-shadow: inset 0 -3px 0 var(--brand-tint); }
.nav > a[aria-current="page"]:hover { color: #fff; }
.header__right { display: flex; align-items: center; gap: 10px; flex: none; }
.header-urgent { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--urgent); color: #fff; font-family: var(--font-display); font-size: 15px; font-weight: 500; text-decoration: none; }
.header.is-compact .header-urgent { display: flex; }
.burger { display: none; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--brand); background: #fff; color: var(--brand); font-family: var(--font-display); font-size: 16px; font-weight: 500; cursor: pointer; }
.burger[aria-expanded="true"] { background: var(--brand); color: #fff; }
.burger .i-close { display: none; }
.burger[aria-expanded="true"] .i-open { display: none; }
.burger[aria-expanded="true"] .i-close { display: block; }
.menu { border-top: 1px solid var(--line); background: #fff; }
.menu[hidden] { display: none; }
.menu .wrap { padding-top: 8px; padding-bottom: 24px; }
.menu nav { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 20px; }
.menu nav a { display: flex; align-items: center; justify-content: space-between; min-height: 60px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.menu nav a[aria-current="page"] { color: var(--brand); font-weight: 500; box-shadow: inset 4px 0 0 var(--brand); padding-left: 14px; }
.menu__ctas { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 20px; }
.menu__ctas .btn { flex: 1 1 200px; min-height: 52px; font-size: 16px; }

/* Dropdowns (desktop): "A propos" list + "Départements" full-width panel */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nav__item { display: flex; align-items: center; }
.nav__item--drop { position: relative; }
.nav .nav__item > a { padding-right: 4px; }
.nav__toggle { display: flex; align-items: center; justify-content: center; width: 34px; min-height: 48px; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.nav__toggle .icon { transition: transform .2s ease; }
.nav__item { transition: background-color .15s ease; }
.nav__item:hover, .nav__item.is-open { background: var(--brand); box-shadow: inset 0 -3px 0 var(--brand-tint); }
.nav__item:hover > a, .nav__item:hover > .nav__toggle, .nav__item.is-open > a, .nav__item.is-open > .nav__toggle { color: #fff; }
.nav__item:hover > a[aria-current="page"], .nav__item.is-open > a[aria-current="page"] { box-shadow: none; }
.nav__item.is-open > .nav__toggle .icon { transform: rotate(180deg); }
.subnav { display: none; position: absolute; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brand); box-shadow: 0 22px 40px rgba(34,64,75,.18); }
.nav__item.is-open > .subnav { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .nav__item.is-open > .subnav { animation: subnav-in .18s ease-out; }
}
@keyframes subnav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav__item--drop .subnav { left: 0; min-width: 310px; }
.subnav ul { list-style: none; margin: 0; padding: 8px 0; }
.nav .subnav a { min-height: 50px; padding: 0 22px; font-size: 16px; color: var(--ink); box-shadow: none; border-bottom: 1px solid var(--mist); }
.nav .subnav li:last-child a { border-bottom: 0; }
.nav .subnav a:hover { background: var(--mist); color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); padding-left: 26px; }
.nav__item--mega .subnav { left: 0; right: 0; border-left: 0; border-right: 0; background: #fff; }
.mega__in { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0 44px; padding-top: 30px; padding-bottom: 34px; }
.mega__intro { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-right: 36px; border-right: 1px solid var(--line); }
.mega__title { font-family: var(--font-display); font-weight: 300; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
.nav .mega__intro .text-link { min-height: 44px; padding: 0; font-size: 16px; color: var(--brand); text-decoration: underline; box-shadow: none; }
.nav .mega__urgent { gap: 8px; min-height: 44px; margin-top: auto; padding: 0 14px; background: var(--urgent); color: #fff; font-weight: 500; font-size: 15px; box-shadow: none; }
.nav .mega__urgent:hover { color: #fff; filter: brightness(1.08); }
.mega__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; }
.nav .mega__grid a { gap: 14px; min-height: 56px; padding: 6px 10px 6px 6px; border: 1px solid transparent; border-bottom-color: var(--line); font-size: 16px; line-height: 1.25; color: var(--ink); box-shadow: none; }
.nav .mega__grid a:hover, .nav .mega__grid a:focus-visible { background: var(--brand); border-color: var(--brand); color: #fff; padding-left: 6px; box-shadow: none; }
.mega__grid img { flex: none; width: 44px; height: 44px; object-fit: cover; }
.mega__grid a::after { content: ""; flex: none; width: 16px; height: 16px; margin-left: auto; opacity: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; transition: opacity .15s ease; }
.mega__grid a:hover::after, .mega__grid a:focus-visible::after { opacity: 1; }

/* Sub-lists in the small-screen Menu panel */
.menu { max-height: calc(100vh - 76px); overflow-y: auto; overscroll-behavior: contain; }
.menu__row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.menu nav .menu__row a { flex: 1 1 auto; border-bottom: 0; }
.menu__toggle { flex: none; display: flex; align-items: center; justify-content: center; width: 60px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--brand); cursor: pointer; }
.menu__toggle .icon { width: 20px; height: 20px; transition: transform .2s ease; }
.menu__toggle[aria-expanded="true"] { background: var(--mist); }
.menu__toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.menu__sub { list-style: none; margin: 0; padding: 6px 0 12px; background: var(--mist); border-bottom: 1px solid var(--line); }
.menu__sub[hidden] { display: none; }
.menu nav .menu__sub a { min-height: 48px; padding: 0 16px; border-bottom: 0; font-size: 17px; justify-content: flex-start; }
@media (min-width: 600px) { .menu__sub--cols { columns: 2; column-gap: 0; } .menu__sub--cols li { break-inside: avoid; } }

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

@media (max-width: 1040px) {
  .nav, .topctas { display: none; }
  .burger { display: flex; }
}

/* ---------- Hero slideshow ---------- */
.hero { position: relative; overflow: hidden; background: var(--brand-dark); min-height: clamp(560px, 50vw, 760px); display: flex; align-items: flex-end; }
.hero__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.hero__slide.is-active { opacity: 1; }
.hero__in { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(24px, 4vw, 64px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero__panel { flex: 0 1 640px; min-width: 0; background: rgba(52, 85, 98, var(--panel-opacity)); color: #fff; padding: clamp(28px, 3.4vw, 48px); display: flex; flex-direction: column; gap: 28px; border-top: 4px solid var(--brand-tint); animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero__names { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; font-size: 16px; color: #E4ECEC; }
.hero h1 { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(34px, 3.8vw, 54px); line-height: 1.1; letter-spacing: -0.02em; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.slider-ctrl { display: flex; align-items: center; gap: 6px; padding: 6px; background: rgba(34,64,75,.78); }
.slider-ctrl button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: #fff; cursor: pointer; padding: 0; }
.slider-ctrl .dots { display: flex; gap: 2px; }
.slider-ctrl .dots button { width: 28px; }
.slider-ctrl .dots span { display: block; height: 4px; width: 10px; background: #fff; opacity: .5; transition: width .3s ease; }
.slider-ctrl .dots button[aria-current="true"] span { width: 22px; opacity: 1; }
.slider-ctrl .play { border-left: 1px solid rgba(255,255,255,.25); }
.slider-ctrl .play .i-play { display: none; }
.slider-ctrl .play[data-paused="true"] .i-play { display: block; }
.slider-ctrl .play[data-paused="true"] .i-pause { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- About ---------- */
.about { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.about__row { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: stretch; }
.about__photo { flex: 5 1 380px; min-width: 0; position: relative; min-height: 300px; }
.about__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 42%; }
.about__text { flex: 6 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.about__lead { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 1.7vw, 23px); line-height: 1.4; }
.about__text p { margin: 0; }
.about__body { font-size: 17px; line-height: 1.65; color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; border-top: 1px solid var(--line); }
.facts div { padding: 16px 12px 0 16px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.facts div:first-child { padding-left: 0; border-left: 0; }
.facts strong { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--brand); }
.facts span { font-size: 15px; line-height: 1.35; color: var(--text); }

/* ---------- Departments ---------- */
.depts { background: var(--mist); }
.depts .wrap { padding-top: var(--section-pad); padding-bottom: var(--section-pad); display: flex; flex-direction: column; gap: 36px; }
.depts__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; }
.search { flex: 0 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.search label { font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.search__box { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 18px; background: #fff; border: 1.5px solid #9FB0B2; }
.search__box .icon { width: 20px; height: 20px; color: var(--brand); }
.search__box input { flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 18px; color: var(--ink); }
.dept-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dept-grid a { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 8px 14px 8px 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.dept-grid a:hover { border-color: var(--brand); }
.dept-grid img { flex: none; width: 56px; height: 56px; object-fit: cover; }
.dept-grid .name { flex: 1 1 auto; min-width: 0; font-family: var(--font-display); font-size: 17px; line-height: 1.3; }
.dept-grid .icon { color: var(--brand); }
.no-result { margin: 0; color: var(--text); }

/* ---------- News ---------- */
.news { padding-top: var(--section-pad); padding-bottom: var(--section-pad); display: flex; flex-direction: column; gap: 36px; }
.news__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 48px 32px; }
.card { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.card__img { aspect-ratio: 3 / 2; background: var(--mist); display: flex; align-items: flex-end; padding: 18px; font-size: 15px; color: #5A6C70; }
.card__date { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--brand); }
.card h3 { margin: 0; height: 84px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-family: var(--font-display); font-size: 21px; font-weight: 400; line-height: 1.33; }
.card p { margin: 0; height: 90px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 17px; line-height: 1.75; color: var(--text); }
.card .text-link { margin-top: auto; align-self: flex-start; min-height: 44px; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* ---------- Practical info ---------- */
.practical { background: var(--brand-dark); color: #fff; }
.practical .wrap { padding-top: var(--section-pad); padding-bottom: var(--section-pad); display: flex; flex-wrap: wrap; gap: 56px 72px; }
.hours { flex: 7 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.hours__rows { display: flex; flex-direction: column; gap: 28px; }
.hours__row { display: flex; flex-direction: column; gap: 12px; }
.hours__label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.hours__label b { font-family: var(--font-display); font-weight: 500; }
.hours__label span { color: #D6E1E1; }
.track { position: relative; height: 36px; background: rgba(255,255,255,.07); }
.track span { position: absolute; top: 0; bottom: 0; background: var(--brand-tint); }
.track--icu span { background: var(--brand-pale); }
.scale { display: flex; justify-content: space-between; font-size: 14px; color: #A9BDBF; border-top: 1px solid rgba(255,255,255,.18); padding-top: 8px; }
.rights { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-height: 56px; padding: 10px 22px; border: 1px solid rgba(255,255,255,.4); color: #fff; text-decoration: none; }
.rights:hover { color: #fff; background: rgba(255,255,255,.06); }
.rights .icon { width: 20px; height: 20px; }
.rights b { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.rights .ar { font-size: 17px; color: #D6E1E1; }
.contact { flex: 5 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; border-left: 1px solid rgba(255,255,255,.18); padding-left: clamp(20px, 2.8vw, 40px); }
.contact address { font-style: normal; font-family: var(--font-display); font-size: 22px; line-height: 1.4; }
.phones { display: flex; flex-direction: column; gap: 6px; line-height: 1.6; color: #E4ECEC; }
.phones a { color: #fff; text-decoration: none; }

/* ---------- Footer ---------- */
.footer { background: var(--brand); color: #D6E1E1; }
.footer .wrap { padding-top: 64px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 44px; }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 32px 48px; }
.footer__name { font-family: var(--font-display); font-size: 24px; color: #fff; }
.footer__ar { font-family: var(--font-display); font-size: 20px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0 8px; font-family: var(--font-display); font-size: 16px; }
.footer nav a { padding: 12px 10px; color: #fff; text-decoration: none; }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 24px; }
.social { display: flex; align-items: center; gap: 10px; }
.social > span { font-family: var(--font-display); font-size: 16px; color: #fff; padding-right: 6px; }
.social a { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.35); color: #fff; }
.social .icon { width: 18px; height: 18px; }
.copy { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 15px; color: #BFD0D1; }

/* Back to top */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(34,64,75,.3); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { color: #fff; }
.to-top .icon { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Inner pages: header band, in-page tabs, A propos ---------- */
.page-hero { background: var(--brand-dark); padding: clamp(36px, 4.5vw, 60px) 0 clamp(36px, 4.5vw, 56px); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-family: var(--font-display); font-size: 15px; color: #BFD3D9; }
.crumbs a { color: #BFD3D9; text-underline-offset: 4px; }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { color: #fff; }
.page-tabs { background: #fff; border-bottom: 1px solid var(--line); }
.page-tabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.page-tabs a { flex: none; display: flex; align-items: center; min-height: 54px; padding: 0 20px; font-family: var(--font-display); font-size: 16px; color: var(--text); text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.page-tabs a:hover, .page-tabs a:focus-visible { background: var(--brand); color: #fff; }

.about-sec { padding: var(--section-pad) 0; }
.about-sec--alt { background: var(--mist); }
.about-sec .sec-head { margin-bottom: 36px; }
.about-text { max-width: 780px; }
.about-text p { margin: 0 0 18px; font-size: 18px; line-height: 1.75; color: var(--text); }
.about-text p:last-child { margin-bottom: 0; }
.about-text .about-lead { font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2.3vw, 29px); line-height: 1.4; color: var(--ink); }
.about-band { width: 100%; margin-top: 44px; aspect-ratio: 1120 / 397; object-fit: cover; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__row { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 64px; padding: 0 0 48px; }
.timeline__row:last-child { padding-bottom: 0; }
/* the line and the square marker sit in the gap between the year and the text */
.timeline__row::before { content: ""; position: absolute; left: 231px; top: 22px; bottom: -22px; width: 2px; background: var(--brand-tint); }
.timeline__row:last-child::before { display: none; }
.timeline__row::after { content: ""; position: absolute; left: 223px; top: 11px; width: 18px; height: 18px; background: var(--brand); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--brand); box-sizing: border-box; }
.about-sec--alt .timeline__row::after { border-color: var(--mist); }
.timeline__year { padding-top: 0; text-align: right; font-family: var(--font-display); font-weight: 300; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -0.02em; color: var(--brand); white-space: nowrap; }
.timeline__body { padding-top: 4px; }
.timeline__body ul { margin: 0; padding-left: 20px; }
.timeline__body li { margin-bottom: 10px; font-size: 18px; line-height: 1.6; color: var(--text); }
.timeline__body li::marker { color: var(--brand); }
.timeline__body li:last-child { margin-bottom: 0; }
.timeline__body ul ul { margin-top: 10px; }
.timeline__body p { margin: 10px 0; font-size: 18px; line-height: 1.6; color: var(--text); }
.timeline__photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 48px; }
.timeline__photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.values li { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brand); padding: 26px 24px 28px; }
.values h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 500; font-size: 17px; line-height: 1.3; letter-spacing: .04em; color: var(--ink); }
.values p { margin: 0 0 12px; font-size: 17px; line-height: 1.65; color: var(--text); }
.values p:last-child { margin-bottom: 0; }
.values .values__note { margin-top: 16px; font-weight: 700; color: var(--brand); }

.policy { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }
.policy__list { margin: 0 0 18px; padding-left: 22px; }
.policy__list li { margin-bottom: 6px; font-size: 18px; line-height: 1.7; color: var(--text); }
.policy__list li::marker { color: var(--brand); }
.policy__sign { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink); }
.policy__photo { margin: 0; }
.policy__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

@media (max-width: 900px) {
  .timeline__row { grid-template-columns: 1fr; gap: 6px; padding: 0 0 36px 36px; }
  .timeline__row::before { left: 8px; top: 20px; bottom: -20px; }
  .timeline__row::after { left: 0; top: 9px; }
  .timeline__year { text-align: left; }
  .policy { grid-template-columns: 1fr; gap: 36px; }
  .policy__photo { max-width: 380px; }
  .about-band { aspect-ratio: 16 / 9; margin-top: 32px; }
}
@media (max-width: 720px) { .timeline__photos { grid-template-columns: 1fr; } }

/* ---------- Inner pages: content, news list, doctors, forms ---------- */
.page-hero__meta { margin: 14px 0 0; font-family: var(--font-display); font-size: 17px; color: #BFD3D9; }
.page-body { padding: clamp(40px, 5vw, 72px) 0 var(--section-pad); }
.page-body__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.h-block { margin: 0 0 28px; max-width: 760px; font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.lead { max-width: 820px; margin: 0 0 40px; font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 2.3vw, 29px); line-height: 1.4; color: var(--brand); }

/* Imported article / department text */
.prose { max-width: 780px; font-size: 18px; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 18px; }
.prose h2, .prose h3, .prose h4 { margin: 36px 0 14px; font-family: var(--font-display); font-weight: 400; line-height: 1.25; color: var(--ink); }
.prose h2 { font-size: 30px; font-weight: 300; }
.prose h3 { font-size: 24px; }
.prose h4 { font-size: 20px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--brand); }
.prose img { max-width: 100%; height: auto; margin: 8px 0 20px; }
.prose a { color: var(--brand); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 16px; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--mist); font-family: var(--font-display); font-weight: 500; }
.prose strong { color: var(--ink); }
.prose--article { max-width: 820px; }
.prose__lead-img { width: 100%; max-width: 820px; height: auto; margin: 0 0 24px; }
.prose[dir="rtl"] ul, .prose[dir="rtl"] ol { padding-left: 0; padding-right: 24px; }
.prose[dir="rtl"] th, .prose[dir="rtl"] td { text-align: right; }

/* Department side list */
.side { position: sticky; top: 96px; border-top: 3px solid var(--brand); background: var(--mist); padding: 22px 0 10px; }
.side__title { margin: 0 20px 10px; font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.side__list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 220px); overflow-y: auto; }
.side__list a { display: block; padding: 11px 20px; font-family: var(--font-display); font-size: 16px; line-height: 1.3; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); transition: background-color .15s ease, color .15s ease; }
.side__list a:hover, .side__list a:focus-visible { background: var(--brand); color: #fff; }
.side__list a[aria-current="page"] { background: #fff; color: var(--brand); font-weight: 500; box-shadow: inset 4px 0 0 var(--brand); }

/* News list page, pagination, article navigation */
.news--page { padding-top: clamp(40px, 5vw, 64px); }
.card__img--photo { display: block; padding: 0; overflow: hidden; }
.card__img--photo img { width: 100%; height: 100%; object-fit: cover; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--font-display); }
.pager__link { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--brand); color: var(--brand); font-size: 16px; font-weight: 500; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
a.pager__link:hover { background: var(--brand); color: #fff; }
.pager__link.is-disabled { border-color: var(--line); color: #8FA1A6; }
.pager__pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pager__pages a { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0 8px; color: var(--text); text-decoration: none; }
.pager__pages a:hover { background: var(--mist); color: var(--brand); }
.pager__pages a[aria-current="page"] { background: var(--brand); color: #fff; }
.pager__gap { padding: 0 6px; color: #8FA1A6; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-nav__link { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s ease, background-color .15s ease; }
.article-nav__link:hover { border-color: var(--brand); background: var(--mist); color: var(--ink); }
.article-nav__link--next { grid-column: 2; text-align: right; align-items: flex-end; }
.article-nav__label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 14px; letter-spacing: .04em; color: var(--brand); }
.article-nav__title { font-family: var(--font-display); font-size: 17px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Doctors */
.filters { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 360px); gap: 20px; margin-bottom: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--ink); }
.req { color: var(--urgent); }
.field input:not([type="file"]), .field select, .field textarea, .filters .search__box input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #9FB1B6; border-radius: 0; background: #fff; font-family: var(--font-body); font-size: 17px; color: var(--ink); }
.field textarea { min-height: 140px; resize: vertical; }
.field input[type="file"] { padding: 10px 0; font-size: 16px; font-family: var(--font-body); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-color: var(--brand); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.data-table th { padding: 14px 16px; text-align: left; font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: .04em; color: #fff; background: var(--brand); }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.data-table tbody tr:nth-child(even) { background: var(--mist); }
.data-table tbody tr:hover { background: var(--brand-pale); }
.data-table tr[hidden] { display: none; }

/* Forms (contact, recruitment) */
.contact-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; align-items: start; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; max-width: 760px; }
.field--full { grid-column: 1 / -1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0 0 24px; padding: 16px 20px; max-width: 760px; background: var(--mist); border-left: 4px solid var(--brand); font-family: var(--font-display); color: var(--ink); }
.form-errors { margin: 0 0 24px; padding: 16px 20px; max-width: 760px; border: 1.5px solid var(--urgent); background: #fff; color: var(--ink); }
.form-errors ul { margin: 0; padding-left: 20px; }
.info-box { margin-bottom: 24px; padding: 24px; background: var(--mist); border-top: 3px solid var(--brand); }
.info-box__title { margin: 0 0 14px; font-family: var(--font-display); font-weight: 500; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.info-box__row { margin: 0 0 8px; font-size: 17px; line-height: 1.5; }
.info-box__row strong { display: block; font-family: var(--font-display); font-weight: 500; color: var(--ink); }
.info-box address { margin: 0 0 12px; font-style: normal; font-size: 17px; line-height: 1.5; }
.info-box__phones { list-style: none; margin: 0 0 18px; padding: 0; font-size: 17px; line-height: 1.9; }
.info-box__phones a { color: var(--brand); }
.vacancies { list-style: none; margin: 0 0 48px; padding: 0; display: grid; gap: 20px; }
.vacancy { padding: 24px 26px; border: 1px solid var(--line); border-top: 3px solid var(--brand); }
.vacancy__title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--ink); }
.vacancy__date { margin: 0 0 14px; font-size: 16px; color: var(--text); }
.vacancy__desc { margin-bottom: 18px; }

@media (max-width: 1040px) {
  .page-body__grid, .contact-page { grid-template-columns: 1fr; gap: 40px; }
  .side { position: static; }
  .side__list { max-height: none; columns: 2; }
  .side__list li { break-inside: avoid; }
}
@media (max-width: 720px) {
  .filters, .form { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav__link--next { grid-column: 1; text-align: left; align-items: flex-start; }
  .side__list { columns: 1; }
  .pager { justify-content: center; }
  .pager__pages { order: 3; width: 100%; justify-content: center; }
}

/* Phones: Urgences, Laboratoire and Radiologie all on one row */
@media (max-width: 720px) {
  .topbar .wrap { flex-wrap: nowrap; align-items: stretch; gap: 0 10px; padding-right: 12px; }
  .urgent { flex: none; display: grid; grid-template-columns: auto auto; align-content: center; justify-content: start; gap: 0 8px; min-height: 0; margin-right: 0; padding: 8px 10px 8px 18px; font-size: 14px; line-height: 1.2; }
  .urgent > :nth-child(1) { grid-area: 1 / 1; }
  .urgent > :nth-child(3) { grid-area: 1 / 2; font-size: 13px; }
  .urgent__num { grid-area: 2 / 1 / 3 / 3; font-size: 17px; }
  .directlines { flex: 1 1 0; min-width: 0; flex-direction: row; align-items: center; gap: 8px; padding: 8px 0; font-size: clamp(10px, 3.1vw, 13px); line-height: 1.3; }
  .directlines span { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0; }
  .directlines .lbl { width: auto; font-size: clamp(10px, 3vw, 12px); }
}

/* News photos: portrait pictures keep their heads (the crop is anchored near the top) */
.card__img--photo img { object-position: 50% 15%; }
.card__img--photo { background: var(--mist); }
@media (max-width: 720px) {
  .card__img { aspect-ratio: 4 / 3; }
}

/* News card without a photo: the hospital logo, centred on the light background */
.card__img--logo { align-items: center; justify-content: center; padding: 24px; }
.card__img--logo img { width: auto; height: auto; max-width: 62%; max-height: 62%; object-fit: contain; }
