/*
Theme Name: SOS Médecins Aix-en-Provence Gardanne
Description: Thème sur mesure pour SOS Médecins Aix-en-Provence Gardanne (visites, consultations Doctolib, pharmacie de garde, actualités).
Author: Proposition
Version: 1.0.0
Requires PHP: 7.4
Text Domain: sos-medecins-aix
*/

:root {
  --sos-red: #c8232a;
  --sos-blue: #17356e;
  --sos-green: #2f7d34;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  color: #1c1c1c;
  background: #f4f6f8;
}

header.hero {
  position: relative;
  padding: 48px 20px 64px;
  text-align: center;
  background-image: linear-gradient(180deg, rgba(10,26,58,0.55), rgba(10,26,58,0.78)),
    url('https://www.sos-medecins-aix.fr/wp-content/uploads/2015/02/voiture-sos-panoramique.jpg');
  background-size: cover;
  background-position: center;
  color: #fff;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 8px 20px;
  background: var(--sos-blue);
  font-size: 12.5px;
}

.topbar a {
  color: #dce6f2;
  text-decoration: none;
}

.topbar a:hover { color: #fff; text-decoration: underline; }

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 16px);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.brand-logo {
  height: clamp(42px, 11vw, 78px);
  width: auto;
  flex-shrink: 0;
  /* logo natif en bleu marine -> converti en blanc puis ombre portée, pour rester lisible sur la photo de fond */
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

.subtitle {
  margin-top: 12px;
  font-size: clamp(15px, 2vw, 20px);
  color: #eaf0f7;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Barre d'ancres rapides : une seule ligne, sous le header, collante en haut au scroll (mobile uniquement) */
nav.tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-wrap: nowrap;
}

nav.tabs a {
  text-decoration: none;
  color: #fff;
  background: #99a3ad;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(10px, 3.2vw, 12.5px);
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}

nav.tabs a:hover { transform: translateY(-2px); }

nav.tabs a.active.visites, nav.tabs a.visites { background: var(--sos-red); }
nav.tabs a.active.consultations, nav.tabs a.consultations { background: var(--sos-blue); }
nav.tabs a.active.pharmacie, nav.tabs a.pharmacie { background: var(--sos-green); }

/* Accès rapide par ancre utile uniquement sur mobile : sur desktop les 3 blocs sont déjà visibles côte à côte */
@media (min-width: 901px) {
  nav.tabs { display: none; }
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* --- Bandeau dernière actualité --- */
.news-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border-left: 5px solid var(--sos-blue);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  text-decoration: none;
  color: #1c1c1c;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transition: transform .15s ease;
}

.news-banner:hover { transform: translateY(-2px); }

.news-banner .news-badge {
  background: var(--sos-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.news-banner .news-date {
  color: #6b7280;
  font-size: 13px;
  flex-shrink: 0;
}

.news-banner .news-title { font-weight: 700; flex: 1 1 220px; }

.news-banner .news-cta {
  color: var(--sos-blue);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

/* --- Les 3 blocs (one-page) --- */
.blocks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

/* Ordre mobile (empilé) : visites, communes desservies, consultations, pharmacie */
#visites { order: 1; }
#communes-desservies { order: 2; }
#consultations { order: 3; }
#pharmacie { order: 4; }

@media (max-width: 900px) {
  .blocks-grid { grid-template-columns: 1fr; }
}

/* Ordre desktop : les 3 blocs côte à côte, communes desservies en pleine largeur en dessous */
@media (min-width: 901px) {
  #visites { order: 1; }
  #consultations { order: 2; }
  #pharmacie { order: 3; }
  #communes-desservies { order: 4; grid-column: 1 / -1; }
}

.block {
  scroll-margin-top: 90px;
  border-radius: 14px;
  padding: 32px 24px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}

.block.red { background: var(--sos-red); }
.block.blue { background: var(--sos-blue); }
.block.green { background: var(--sos-green); }

.block .icon { width: 56px; height: 56px; margin: 0 auto 14px; display: block; }

.block h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: 0.5px;
  text-align: center;
}

.block hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.5);
  width: 50px;
  margin: 0 auto 18px;
}

.block > p.lead { margin: 0 0 16px; font-size: 15px; line-height: 1.5; text-align: center; }

.block .actions { text-align: center; margin-top: auto; }

.phone-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.phone-plain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0;
  color: #fff;
}

.phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0;
}

#visites .phone-pill { color: var(--sos-red); }
#pharmacie .phone-pill { color: var(--sos-green); }

.price-row {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
  margin: 6px 0;
}

.price-row .phone-pill { margin: 0; }

.price-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  padding: 6px 12px;
}

#visites .price-badge { color: var(--sos-red); border-color: var(--sos-red); }
#pharmacie .price-badge { color: var(--sos-green); border-color: var(--sos-green); }

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  opacity: 0.85;
  margin: 8px auto;
  max-width: 160px;
}

.or-divider::before, .or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.5);
}

.small-label { font-size: 13px; opacity: 0.9; margin-top: 4px; }

.white-panel {
  background: #fff;
  color: #1c1c1c;
  border-radius: 10px;
  padding: 18px;
  margin-top: 20px;
}

.white-panel h3 {
  margin-top: 0;
  color: var(--sos-blue);
  font-size: 16px;
}

/* QR code : visible uniquement sur desktop, pour permettre de scanner et poursuivre la prise de RDV sur mobile */
.qr-desktop { display: none; }

@media (min-width: 901px) {
  .qr-desktop {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    background: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    text-align: left;
  }

  .qr-desktop img { width: 64px; height: 64px; flex-shrink: 0; }

  .qr-desktop span {
    font-size: 12px;
    color: #1c1c1c;
    max-width: 160px;
  }
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.zone-grid div {
  background: #f0f4f8;
  border-left: 4px solid var(--sos-red);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  border: 2px solid #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.3);
}

.cta-btn.on-color { background: #fff; }
.cta-btn.on-color.red { color: var(--sos-red); }
.cta-btn.on-color.blue { color: var(--sos-blue); }
.cta-btn.on-color.green { color: var(--sos-green); }

.note {
  background: #fff8e1;
  border-left: 4px solid #f0ad2b;
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 20px;
  color: #1c1c1c;
}

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #eaf3fb;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 20px;
  color: #1c3d5e;
}

.info-banner .info-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #4a90c4;
  margin-top: 2px;
}

.info-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

section.content {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  margin-bottom: 28px;
}

section.content h2 {
  margin-top: 0;
  color: var(--sos-blue);
}

/* --- Actualités (listing + article) --- */
.news-item {
  border-bottom: 1px solid #eee;
  padding: 16px 0;
}

.news-item:last-child { border-bottom: none; }

.news-item .news-item-date {
  color: var(--sos-blue);
  font-weight: 700;
  font-size: 13px;
}

.news-item h3 { margin: 6px 0; }
.news-item h3 a { color: #1c1c1c; text-decoration: none; }
.news-item h3 a:hover { color: var(--sos-blue); }

.news-item p { margin: 0; color: #4b5563; }

.pagination { margin-top: 24px; text-align: center; }
.pagination a, .pagination span { margin: 0 6px; color: var(--sos-blue); text-decoration: none; font-weight: 600; }

footer.site-footer {
  text-align: center;
  padding: 24px;
  color: #6b7280;
  font-size: 13px;
}

footer.site-footer strong { color: var(--sos-blue); }

.footer-links {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--sos-blue);
  text-decoration: none;
  font-weight: 600;
  margin: 0 10px;
}

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

#zone-map {
  width: 100%;
  height: 380px;
  border-radius: 10px;
  z-index: 1;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #33475b;
}

.map-legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sos-red);
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--sos-red);
}

.commune-label {
  background: rgba(255,255,255,0.92);
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sos-blue);
}

.commune-label::before { display: none; }
