/*
 * Fiche médecin (cabinets/cabinet_profile.jsp et cabinet_profile_arab.jsp).
 * Tout est préfixé .dp / .dp-* pour ne pas entrer en conflit avec Bootstrap,
 * header.jsp et footer.jsp. Propriétés logiques (inline-start/end) => OK en RTL.
 */
/* Couleurs partagées : la barre mobile est en dehors de .dp (après le footer),
   elle doit donc avoir ses propres variables. */
.dp, .dp-mobile-booking {
  --dp-brand: #00767a; --dp-brand-dark: #005c60; --dp-ink: #173538; --dp-muted: #4c666a;
  --dp-paper: #fff; --dp-surface: #f4f8f8; --dp-line: #dce8e8; --dp-mint: #e8f5f4;
}
.dp {
  color: var(--dp-ink);
  font: 1rem/1.55 "Inter", "Segoe UI", system-ui, sans-serif;
  width: min(1140px, calc(100% - 48px));
  margin-inline: auto;
  padding-bottom: 32px;
}
.dp *, .dp *::before, .dp *::after { box-sizing: border-box; }
/* Le header/footer du site débordent de quelques px sur mobile : on coupe sans casser position: sticky */
html:has(body.dp-page), body.dp-page { overflow-x: clip; }
.dp a { color: var(--dp-brand-dark); text-decoration: none; }
.dp a:focus-visible { outline: 3px solid var(--dp-brand); outline-offset: 4px; }
.dp img { max-width: 100%; display: block; }
.dp h1, .dp h2, .dp h3, .dp p { margin: 0; }
.dp h2 { font-size: clamp(1.3rem, 2.5vw, 1.65rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: var(--dp-ink); }
.dp h3 { font-size: 1rem; font-weight: 700; line-height: 1.35; }
.dp[dir="rtl"] { font-family: "tajawal", "Segoe UI", system-ui, sans-serif; }
.dp[dir="rtl"] h1, .dp[dir="rtl"] h2 { letter-spacing: 0; }

/* Fil d'Ariane */
.dp-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; padding: 22px 0 17px; font-size: .86rem; color: var(--dp-muted); }
.dp-breadcrumb span[aria-hidden] { color: #678186; }

/* En-tête du profil */
.dp-hero { padding: 34px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 35px; align-items: center; border: 1px solid #cce3e3; border-radius: 24px; overflow: hidden; position: relative; isolation: isolate; background: linear-gradient(105deg, #f7fcfc 18%, #e0f2f0 100%); }
.dp[dir="rtl"] .dp-hero { background: linear-gradient(-105deg, #f7fcfc 18%, #e0f2f0 100%); }
.dp-hero::before { content: ""; position: absolute; z-index: -1; width: 400px; height: 400px; inset-inline-end: -142px; bottom: -270px; border: 1px solid #bddeda; border-radius: 50%; box-shadow: 0 0 0 31px #d1eae6, 0 0 0 32px #c4e2df, 0 0 0 63px #dbefec, 0 0 0 64px #cde7e3; opacity: .86; }
.dp-portrait { width: 190px; height: 200px; object-fit: cover; object-position: 50% 31%; border-radius: 18px; box-shadow: 0 10px 24px #214e5031; border: 4px solid #fff; background: #d5e7e7; }
.dp-location { font-size: .88rem; font-weight: 700; color: var(--dp-brand-dark); display: flex; align-items: center; gap: 7px; }
.dp-pin { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; border: 1.6px solid currentColor; rotate: -45deg; display: inline-grid; place-items: center; margin: 0 3px 3px; flex: none; }
.dp-pin::after { content: ""; border-radius: 50%; width: 3px; height: 3px; background: currentColor; }
.dp h1 { font-size: clamp(2rem, 4.4vw, 3.5rem); font-weight: 800; letter-spacing: -.052em; line-height: 1.05; margin: 10px 0 9px; color: var(--dp-ink); }
.dp-specialty { font-size: clamp(1rem, 2.2vw, 1.25rem); color: #34595d; }
.dp-actions { margin-top: 23px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Boutons */
.dp-button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid #cbdede; border-radius: 10px; font-size: .9rem; font-weight: 700; background: var(--dp-paper); color: var(--dp-brand-dark); transition: background .15s, color .15s; }
.dp-button:hover { background: #f0f9f8; color: var(--dp-brand-dark); }
.dp-button.dp-primary { border-color: var(--dp-brand); background: var(--dp-brand); color: #fff; }
.dp-button.dp-primary:hover { background: var(--dp-brand-dark); color: #fff; }
.dp-icon { font-family: "Segoe UI Symbol", sans-serif; font-size: 1.08em; line-height: 1; }
.dp-calendar { display: inline-block; flex: none; width: 19px; height: 17px; border: 1.7px solid currentColor; border-radius: 3px; position: relative; }
.dp-calendar::before { content: ""; position: absolute; inset: 4px 0 auto; border-top: 1.5px solid currentColor; }
.dp-calendar::after { content: ""; position: absolute; top: -4px; left: 3px; width: 7px; height: 5px; border-inline: 1.5px solid currentColor; }

/* Navigation entre sections */
.dp-section-nav { display: flex; align-items: center; gap: 25px; padding: 0 5px; border-bottom: 1px solid var(--dp-line); margin: 8px 0 23px; overflow-x: auto; }
.dp-section-nav a { display: block; flex: none; padding: 15px 1px 12px; border-bottom: 3px solid transparent; font-size: .91rem; font-weight: 700; color: var(--dp-muted); }
.dp-section-nav a:hover, .dp-section-nav a[aria-current] { color: var(--dp-brand-dark); border-color: var(--dp-brand); }

/* Colonnes et cartes */
.dp-columns { display: grid; grid-template-columns: minmax(0, 1fr) 345px; gap: 22px; align-items: start; }
.dp-stack { display: grid; gap: 18px; min-width: 0; }
.dp-card { background: var(--dp-paper); border: 1px solid var(--dp-line); border-radius: 18px; padding: 23px; min-width: 0; scroll-margin-top: 18px; }
.dp-card > p, .dp-bio { margin-top: 11px; color: var(--dp-muted); }
.dp-bio p + p { margin-top: 10px; }
.dp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 17px 0 0; }
.dp-fields li { background: #f3f8f8; border: 1px solid #e6efef; border-radius: 11px; padding: 13px 15px; }
.dp-credentials { margin: 13px 0 0; padding-inline-start: 20px; }
.dp-credentials li { padding: 4px 0; padding-inline-start: 3px; color: var(--dp-muted); }
.dp-credentials li::marker { color: var(--dp-brand); }
.dp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 17px; }
.dp-photos a { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #e6efef; }
.dp-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.dp-photos a:hover img { transform: scale(1.03); }

/* Carte rendez-vous */
.dp-booking { border-color: #cce2e0; box-shadow: 0 8px 24px #1735380a; }
.dp-booking-title { display: flex; align-items: center; gap: 12px; }
.dp-booking-icon { display: grid; place-items: center; background: var(--dp-mint); color: var(--dp-brand-dark); width: 40px; height: 40px; border-radius: 11px; flex: none; }
.dp-booking h2 { font-size: 1.22rem; }
.dp-booking .dp-primary { margin-top: 17px; width: 100%; min-height: 48px; }
.dp-hero .dp-primary { min-height: 48px; padding-inline: 20px; font-size: .95rem; }

/* Infos pratiques */
.dp-practical h2 { font-size: 1.25rem; }
.dp-group { padding: 15px 0; border-bottom: 1px solid #e6eeee; }
.dp-group:last-child { padding-bottom: 0; border-bottom: 0; }
.dp-group > p { margin-top: 5px; color: var(--dp-muted); }
.dp-hours { margin: 6px 0 0; font-size: .9rem; }
.dp-hours div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.dp-hours dt { font-weight: 600; }
.dp-hours dd { margin: 0; text-align: end; color: var(--dp-muted); font-variant-numeric: tabular-nums; }
.dp-hours .dp-hours-line { display: block; color: var(--dp-muted); }
.dp-hours .dp-hours-times { white-space: nowrap; }
.dp-hours-gap { display: inline-block; width: 1.4em; }
/* Jour en cours (ajouté par le script de la page) */
.dp-hours > div.dp-today { background: var(--dp-mint); border-radius: 8px; padding: 6px 8px; margin-inline: -8px; }
.dp-hours > div.dp-today dt,
.dp-hours > div.dp-today dd { color: var(--dp-brand-dark); font-weight: 700; }
/* style2.css impose « svg { width: 100px } » à tout le site : taille explicite de l'icône */
.dp-globe { flex: none; width: 16px; height: 16px; overflow: hidden; }
.dp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.dp-tag { padding: 3px 9px; font-size: .82rem; font-weight: 700; border-radius: 999px; background: var(--dp-mint); color: var(--dp-brand-dark); }
.dp-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; }
.dp-text-link { font-weight: 700; font-size: .91rem; text-decoration: underline !important; text-underline-offset: 3px; }
.dp-ltr { direction: ltr; unicode-bidi: isolate; }

/* Barre de rendez-vous mobile */
.dp-mobile-booking { display: none; font: 1rem/1.55 "Inter", "Segoe UI", system-ui, sans-serif; }
.dp-mobile-booking[dir="rtl"] { font-family: "tajawal", "Segoe UI", system-ui, sans-serif; }
.dp-mobile-booking a { text-decoration: none; }
.dp-mobile-booking *, .dp-mobile-booking *::before, .dp-mobile-booking *::after { box-sizing: border-box; }

@media (max-width: 820px) {
  .dp-columns { grid-template-columns: minmax(0, 1fr) 290px; gap: 15px; }
  .dp-card { padding: 19px; }
  .dp-hero { grid-template-columns: 160px minmax(0, 1fr); gap: 23px; padding: 25px; }
  .dp-portrait { width: 160px; height: 176px; }
}
@media (max-width: 700px) {
  .dp { width: min(100% - 28px, 520px); }
  .dp-breadcrumb { padding: 15px 0 12px; }
  .dp-hero { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; border-radius: 17px; padding: 16px; }
  .dp-portrait { width: 82px; height: 95px; border-width: 3px; border-radius: 12px; }
  .dp-profile-copy { display: contents; }
  .dp h1 { font-size: clamp(1.36rem, 5.4vw, 2rem); margin: 4px 0 5px; }
  .dp-specialty { font-size: .91rem; line-height: 1.35; }
  .dp-actions { grid-column: 1 / -1; margin-top: 2px; gap: 8px; }
  .dp-actions .dp-button { padding-inline: 8px; flex: 1 1 auto; font-size: .84rem; }
  .dp-actions .dp-primary { flex: 1 1 100%; min-height: 48px; font-size: .95rem; }
  .dp-section-nav { gap: 17px; margin: 4px 0 15px; padding-inline: 0; }
  .dp-section-nav a { font-size: .84rem; padding-top: 11px; }
  .dp-columns { display: flex; flex-direction: column; gap: 14px; }
  .dp-columns > * { width: 100%; }
  .dp-stack { gap: 14px; }
  .dp-booking { display: none; }
  .dp-mobile-booking { display: flex; position: fixed; inset: auto 0 0; z-index: 1030; justify-content: center; background: #fff; border-top: 1px solid var(--dp-line); padding: 9px 14px calc(9px + env(safe-area-inset-bottom)); box-shadow: 0 -5px 22px #17353813; }
  .dp-mobile-booking .dp-button { flex: 0 1 520px; }
  .dp-mobile-booking { transition: transform .25s ease, visibility .25s; }
  .dp-mobile-booking.dp-mobile-booking--hidden { transform: translateY(110%); visibility: hidden; }
  body.dp-has-mobile-booking { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 375px) { .dp-fields { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dp-button, .dp-photos img, .dp-mobile-booking { transition: none; } }
