/* Généré automatiquement depuis custom.css par _build (rtlcss) — ne pas modifier directement. */
/*
   Custom styles — Cabinet d'Hépato-Gastro-Entérologie et de Proctologie
   Dr BENNANI Youssef — Casablanca
*/

/* Polices Google (Inter + Playfair Display) : chargées une seule fois dans includes/header.php */

:root {
  --bs-primary: #21325B; /* Bleu marine */
  --bs-primary-rgb: 33, 50, 91;
  --accent-color: #C9A96E; /* Gold accent */
  --body-bg: #F9F8F6; /* Off-white */
}

/* Bouton "retour en haut" (script natif dans footer.php), au-dessus du bouton localisation */
.go-to-top {
  left: 1.7rem;
  bottom: 6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.go-to-top.is-visible { opacity: .85; visibility: visible; transform: translateY(0); }
.go-to-top.is-visible:hover { opacity: 1; }

/* Carte Google Maps en façade (iframe chargée au clic, voir map_facade() et footer.php) */
.map-facade {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #e8eef6;
  background-image:
    linear-gradient(rgba(33, 50, 91, .06) 1px, transparent 1px),
    linear-gradient(-90deg, rgba(33, 50, 91, .06) 1px, transparent 1px),
    radial-gradient(circle at 30% 35%, rgba(201, 169, 110, .25), transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(33, 150, 212, .18), transparent 50%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
}
.map-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-facade-inner { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.5rem; max-width: 340px; }
.map-facade-pin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: #ea4335; color: #fff; font-size: 1.6rem;
  box-shadow: 0 8px 22px rgba(234, 67, 53, .35); margin-bottom: .35rem;
}
.map-facade-inner strong { color: var(--bs-primary); font-size: .95rem; }
.map-facade-address { color: #5b6475; font-size: .85rem; }
.map-facade-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .6rem; }
#contactsSection .map-facade { min-height: 360px; }

/* Domaines d'expertise (accueil) : carrousel CSS (défilement horizontal + aimantation), sans JavaScript */
.cards-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: 15px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 2px;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .35) transparent;
  -webkit-overflow-scrolling: touch;
}
.cards-scroller > * { scroll-snap-align: start; }
@media (min-width: 620px)  { .cards-scroller { grid-auto-columns: calc((100% - 15px) / 2); } }
@media (min-width: 1024px) { .cards-scroller { grid-auto-columns: calc((100% - 45px) / 4); overflow-x: visible; } }

/* Images avec width/height (ajoutés automatiquement contre le CLS) : garder les proportions */
img[width][height] { height: auto; }

/* Questions des accordéons en <h2> (structure SEO/AEO) : même apparence qu'avant */
h2.accordion-header {
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
}

/* Bloc "À lire aussi" des fiches médicales (maillage interne) */
.related-links .related-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  height: 100%;
  padding: .9rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(33, 50, 91, .1);
  border-radius: .75rem;
  color: var(--bs-primary);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.related-links .related-link:hover {
  border-color: rgba(33, 50, 91, .35);
  box-shadow: 0 6px 18px rgba(33, 50, 91, .08);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Protection du contenu : pas de sélection de texte ni de glisser d'images */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img {
  -webkit-user-drag: none;
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

a {
  color: var(--bs-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #009da2;
  text-decoration: underline;
}

.card-link {
  color: var(--bs-primary) !important;
}

.card-link:hover {
  color: #009da2 !important;
}

/* Pagination override */
.page-link {
  color: var(--bs-primary) !important;
}

.page-item.active .page-link {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

.page-link:hover {
  color: #009da2 !important;
}

.page-link:focus {
  box-shadow: 0 0 0 0.25rem rgba(0, 177, 183, 0.25) !important;
}

html {
  overflow-x: hidden;
}

body {
  background-color: var(--body-bg) !important;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif !important;
  color: var(--bs-primary) !important;
}

/* Primary Button color override */
.btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-primary:hover {
  background-color: #009da2 !important; /* Slightly darker teal */
  border-color: #009da2 !important;
}

/* Secondary/Accent styles */
.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-outline-primary:hover {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

/* Text color overrides */
.text-primary {
  color: var(--bs-primary) !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

/* Accent for highlights */
.text-accent {
  color: var(--accent-color) !important;
}

.bg-accent {
  background-color: var(--accent-color) !important;
}

/* Footer override */
footer.bg-dark {
  background-color: var(--bs-primary) !important;
}

footer.bg-dark h5, footer.bg-dark p, footer.bg-dark a, footer.bg-dark span {
  color: #fff !important;
}

footer.bg-dark .btn-primary {
  background-color: #fff !important;
  color: var(--bs-primary) !important;
  border-color: #fff !important;
}

footer.bg-dark .btn-primary:hover {
  background-color: #f8f9fa !important;
  color: var(--bs-primary) !important;
}

footer.bg-dark a:hover {
  text-decoration: underline;
}

/* Baseline + slogan à côté du logo du footer (même logique que le menu) */
footer .brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
footer .b-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: .02em; margin-bottom: .15rem; }
footer .b-sub { font-family: 'Inter', sans-serif; font-weight: 400; font-size: .6rem; line-height: 1.35; letter-spacing: .16em; text-transform: uppercase; }
footer.bg-dark .b-sub { color: rgba(255, 255, 255, .55) !important; }
footer .b-sub .b-sub-br { display: none; }
@media (max-width: 575.98px) {
  footer .b-sub .b-sub-br { display: inline; }
}

.navbar-collapse {
  flex-grow: 1 !important;
}

/* Response Fix: Only row on desktop */
@media (min-width: 992px) {
  .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
  }

  /* Center items between first and last */
  .navbar-nav > li:first-child {
    margin-right: auto !important;
  }

  .navbar-nav > li:nth-last-child(2) {
    margin-left: auto !important;
  }

  .navbar-nav > li:last-child {
    margin-right: auto !important;
  }
}

@media (max-width: 991.98px) {
  .navbar-nav {
    margin-top: 1rem;
    padding-bottom: 1rem;
  }
  .navbar-nav .nav-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  .navbar-nav .btn {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
  }
}

/* Quote Responsive Size */
blockquote.blockquote-lg {
    font-size: 1.25rem !important;
}

@media (max-width: 768px) {
    blockquote.blockquote-lg {
        font-size: 1.1rem !important;
    }
}

/* Global Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

footer .list-unstyled {
  margin-top: 0.5rem !important;
}

.navbar-brand {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  margin-left: 2rem !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0;
}

/* Fix for Rendez-vous button text on one line */
.btn-primary.btn-sm, .navbar-nav .btn {
  white-space: nowrap !important;
  padding-right: 1.2rem !important;
  padding-left: 1.2rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem;
}

/* Adjust nav links for visibility */
.navbar-nav .nav-link {
  padding-right: 1rem !important;
  padding-left: 1rem !important;
  font-size: 1rem;
}

/* Push to the far RIGHT in header */
.navbar-collapse {
  flex-grow: 1;
}

@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        padding-right: 0.5rem !important;
        padding-left: 0.5rem !important;
        font-size: 0.9rem;
    }
}

@media (max-width: 991.98px) {
  .navbar-collapse {
      flex-basis: 100%;
  }
}

/* ── Cartes : images d'en-tête toutes à la même hauteur, quel que soit leur ratio d'origine ── */
.card-img-top {
  height: 200px;
  object-fit: cover;
}
@media (max-width: 575.98px) {
  .card-img-top {
    height: 170px;
  }
}

/* ── Responsive: Dropdown menus (couvre tout l'intervalle où le menu est replié en hamburger) ── */
@media (max-width: 991.98px) {
  #header-overlay .dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    box-sizing: border-box;
  }
}

/* ── Responsive: Page hero / breadcrumb sections ── */
@media (max-width: 767.98px) {
  [style*="min-height:420px"],
  [style*="min-height: 420px"] {
    min-height: 260px !important;
  }
}

/* ── Responsive: Gallery image tiles ── */
.gallery-tile {
  height: 18rem;
  background-size: cover;
  background-position: center;
}
@media (max-width: 767.98px) {
  .gallery-tile {
    height: 12rem !important;
  }
}
@media (max-width: 575.98px) {
  .gallery-tile {
    height: 10rem !important;
  }
}

/* ── Responsive: Hero profile image ── */
.hero-profile-img {
  max-height: 520px;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}
@media (max-width: 767.98px) {
  .hero-profile-img {
    max-height: 320px !important;
  }
}
@media (max-width: 575.98px) {
  .hero-profile-img {
    max-height: 260px !important;
  }
}

/* ── Responsive: Decorative dots SVG ── */
.decorative-dots {
  width: 12rem;
}
@media (max-width: 767.98px) {
  .decorative-dots {
    width: 7rem !important;
  }
}

/* ── Responsive: Map iframe wrapper ── */
.map-responsive-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.map-responsive-wrapper iframe {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 575.98px) {
  .map-responsive-wrapper {
    padding-bottom: 75%; /* taller on small screens */
  }
}

/* ── Responsive: Contact section map on mobile ── */
@media (max-width: 767.98px) {
  #contactsSection .position-md-absolute {
    position: relative !important;
    height: 300px;
    width: 100%;
  }
  #contactsSection .position-md-absolute iframe {
    height: 100%;
    width: 100%;
  }
}

/* Bouton flottant WhatsApp */
.whatsapp-float {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9990;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #25d366;
  color: #fff !important;
  border-radius: 50%;
  font-size: 1.7rem;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
  color: #fff !important;
}
.whatsapp-float-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #25d366;
  opacity: .55;
  animation: whatsappPing 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes whatsappPing {
  0% { transform: scale(1); opacity: .55; }
  75%, 100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float-ping { animation: none; display: none; }
}
@media (max-width: 575.98px) {
  .whatsapp-float { width: 48px; height: 48px; font-size: 1.4rem; right: 1rem; bottom: 1rem; }
}

/* Bouton flottant "Itinéraire" (Google Maps), en bas à l'opposé du bouton WhatsApp.
   Le bouton "retour en haut" (.js-go-to) s'affiche au-dessus (voir footer.php). */
.maps-float {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 9990;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ea4335;
  color: #fff !important;
  border-radius: 50%;
  font-size: 1.6rem;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.maps-float:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
  color: #fff !important;
}
.maps-float:focus-visible,
.whatsapp-float:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
/* Animation : repère qui rebondit + halo qui s'étend (transform/opacity uniquement, sans coût CPU) */
.maps-float-icon {
  position: relative;
  display: inline-block;
  transform-origin: 50% 100%;
  animation: mapsPinBounce 2.4s cubic-bezier(.28, .84, .42, 1) infinite;
}
.maps-float-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #ea4335;
  opacity: .5;
  animation: mapsPing 2.4s cubic-bezier(0, 0, .2, 1) infinite;
}
.maps-float:hover .maps-float-icon,
.maps-float:hover .maps-float-ping { animation-play-state: paused; }
@keyframes mapsPinBounce {
  0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
  12%           { transform: translateY(0) scale(1.12, .86); }
  25%           { transform: translateY(-9px) scale(.94, 1.08); }
  38%           { transform: translateY(0) scale(1.08, .92); }
  46%           { transform: translateY(-3px) scale(1, 1); }
}
@keyframes mapsPing {
  0%       { transform: scale(1); opacity: .5; }
  70%, 100% { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .maps-float-icon { animation: none; }
  .maps-float-ping { animation: none; display: none; }
}

/* Étiquette au survol (ordinateur) */
.maps-float .maps-float-label {
  position: absolute;
  left: calc(100% + .75rem);
  white-space: nowrap;
  background: #fff;
  color: #1c2333;
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.maps-float:hover .maps-float-label,
.maps-float:focus-visible .maps-float-label {
  opacity: 1;
  transform: translateX(0);
}
@media (max-width: 575.98px) {
  .maps-float { width: 48px; height: 48px; font-size: 1.35rem; left: 1rem; bottom: 1rem; }
  .maps-float .maps-float-label { display: none; }
}

/* Cookie Banner Styles */
#cookie-banner {
  box-shadow: 0 -5px 25px rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.1);
}

#cookie-banner .btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

#cookie-banner .link-primary {
  color: var(--bs-primary) !important;
}
