/* ═══════════════════════════════════════════════
   style.css — Côté Fermes — CSS complet
   ═══════════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --bleu:       #5BAAB8;
  --bleu-fonce: #bcdf77;
  --bleu-clair: #D6EEF2;
  --bleu-pale:  #EEF8FA;
  --vert:       #8DC63F;
  --vert-fonce: #6BA030;
  --gris:       #3A3A3A;
  --gris-clair: #F7F7F7;
  --shadow:     0 2px 16px rgba(0,0,0,0.08);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ── BODY ── */
body {
  font-family: 'Open Sans', sans-serif;
  color: var(--gris);
  background: #fff;
}

/* Utilisé uniquement sur fiche.php pour coller le footer en bas */
body.page-fiche {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--bleu-fonce);
  font-size: 0.8rem;
  padding: 0.5rem 0;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
.topbar-inner {
  width: 100%; max-width: 1100px;
  padding: 0 1.5rem;
  display: flex; gap: 2rem;
  align-items: center;
  justify-content: flex-end;
}
.topbar a { color: #164d3c; text-decoration: none; font-weight: bold;}
.topbar a:hover { opacity: 0.8; }

/* ── HEADER ── */
header {
  background: white;
  padding: 0;
  height: 100px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 0 #e8e8e8;
  position: sticky; top: 0; z-index: 1000;
}
.header-inner {
  width: 100%; max-width: 1100px;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo img { height: 50px; width: auto; max-width: 200px; object-fit: contain; }
.logo-nom { font-family: 'Architects Daughter', cursive; font-size: 1.3rem; color: var(--gris); }
nav { display: flex; gap: 1.8rem; }
nav a {
  font-size: 0.88rem; font-weight: 600;
  color: var(--gris); text-decoration: none;
  transition: color 0.2s;
}
nav a:hover, nav a.active { color: #0f4837; }

/* ── FOOTER ── */
footer {
  background: #f0f0f0;
  border-top: 1px solid #e0e0e0;
  padding: 1rem 0;
  display: flex; justify-content: center;
  margin-top: auto;
}
footer span { font-size: 0.72rem; color: #818181; }
footer a { color: #999; text-decoration: none; }

/* ══════════════════════════════
   INDEX — HERO
══════════════════════════════ */
.hero { background: #174d3d; overflow: hidden; position: relative; }
.hero-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 4rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; min-height: 340px;
}
.hero-text { flex: 0 0 auto; max-width: 460px; }
.hero-text h1 {
  font-family: 'Architects Daughter', cursive;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #a7daa0; line-height: 1.2; margin-bottom: 0.9rem;
}
.hero-text p { font-size: 0.95rem; color: rgba(255,255,255,0.9); line-height: 1.8; margin-bottom: 1.5rem; }
.stat-pill {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px; padding: 0.9rem 1.4rem;
  color: white; text-align: center; min-width: 110px;
}
.stat-pill strong { display: block; font-size: 1.8rem; font-family: 'Architects Daughter', cursive; line-height: 1; }
.stat-pill span { font-size: 0.7rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-img { flex: 1; display: flex; align-items: center; justify-content: center; max-width: 500px; }
.hero-img img { max-width: 100%; max-height: 300px; object-fit: contain; display: block; }

/* ══════════════════════════════
   INDEX — CARTE
══════════════════════════════ */
.map-wrapper { max-width: 1100px; margin: -2.5rem auto 0; padding: 0 1.5rem; position: relative; z-index: 10; }
.map-container { border-radius: 16px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,0.15); border: 4px solid white; }
#map { height: 500px; width: 100%; }
.map-badge {
  position: absolute; top: 16px; right: 30px; z-index: 500;
  background: white; border-radius: 10px; padding: 0.5rem 0.9rem;
  box-shadow: var(--shadow); font-size: 0.75rem; font-weight: 700;
  color: var(--bleu-fonce); pointer-events: none;
}

/* ══════════════════════════════
   INDEX — LISTE
══════════════════════════════ */
.liste-section { max-width: 1100px; margin: 3.5rem auto 4rem; padding: 0 1.5rem; }
.section-head { display: flex; font-weight: bold; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title { font-family: 'Architects Daughter', cursive; font-size: 1.6rem; color: var(--bleu-fonce); }
.section-count { font-size: 0.82rem; color: #aaa; }
.lieux-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.lieu-card {
  background: white; border-radius: 14px; overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow); border: 1px solid #e8f4f7;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.lieu-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.lieu-photo {
  height: 170px;
  background: linear-gradient(135deg, var(--bleu-clair), #b8dfe8);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; overflow: hidden;
}
.lieu-photo img { width: 100%; height: 100%; object-fit: cover; }
.lieu-body { padding: 1.2rem 1.3rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.lieu-nom { font-family: 'Architects Daughter', cursive; font-size: 1.1rem; color: #174d3d; margin-bottom: 0.4rem; }
.lieu-desc { font-size: 0.82rem; line-height: 1.65; color: #777; margin-bottom: 0.8rem; flex: 1; }
.lieu-footer { border-top: 1px solid #f0f0f0; padding-top: 0.75rem; display: flex; align-items: center; justify-content: flex-end; }
.voir-fiche { color: var(--vert-fonce); font-weight: 700; font-size: 0.82rem; }

/* ══════════════════════════════
   INDEX — POPUP LEAFLET
══════════════════════════════ */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important; padding: 0 !important; overflow: hidden;
  min-width: 240px; max-width: 280px;
  border: none !important; box-shadow: 0 12px 40px rgba(0,0,0,0.15) !important;
}
.leaflet-popup-tip { background: white !important; }
.leaflet-popup-content { width: auto !important; }
.leaflet-popup-close-button { display: none !important; }
.popup-inner { padding: 1.1rem 1.2rem 0.8rem; background: white; }
.popup-nom {
  font-family: 'Architects Daughter', cursive;
  font-size: 1rem; color: #174d3d;
  margin-bottom: 0.6rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.popup-nom::before { content: '📍'; font-size: 0.9rem; }
.popup-body {
  font-size: 0.82rem; color: #666; line-height: 1.6; margin-bottom: 0.9rem;
  border-left: 3px solid var(--bleu-clair); padding-left: 0.7rem;
}
.popup-lien {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--bleu-fonce); color: white;
  padding: 0.65rem 1rem; text-decoration: none;
  font-weight: 700; font-size: 0.82rem;
  transition: background 0.2s; letter-spacing: 0.02em;
}
.popup-lien:hover { background: var(--bleu); }
.popup-lien::after { content: '→'; }
.leaflet-container a { color: #ffffff !important; }

/* ══════════════════════════════
   LEAFLET ZOOM (commun)
══════════════════════════════ */
.leaflet-control-zoom { border: none !important; }
.leaflet-control-zoom a {
  border-radius: 8px !important; border: 1px solid #ddd !important;
  background: white !important; color: var(--bleu-fonce) !important;
  font-weight: 700 !important; margin-bottom: 4px !important;
}
.leaflet-control-zoom a:hover { background: var(--bleu-clair) !important; }

/* ══════════════════════════════
   INDEX — MESSAGE QR CODE
══════════════════════════════ */
.qr-section {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(160deg, #f7fafb 0%, #edf6f8 100%);
}

.qr-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 4px 6px rgba(61, 138, 151, 0.06),
    0 20px 60px rgba(61, 138, 151, 0.12);
  border: 1.5px solid rgba(91, 170, 184, 0.18);
  position: relative;
  overflow: hidden;
}

.qr-card::before { content: none; }

.qr-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #edf7f9, #d0edf2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.4rem;
  box-shadow: 0 6px 20px rgba(91, 170, 184, 0.2);
}

.qr-card h2 {
  font-family: 'Architects Daughter', cursive;
  font-size: 1.55rem;
  color: #2c5f6a;
  margin: 0 0 0.9rem;
  line-height: 1.3;
}

.qr-card p {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.97rem;
  color: #5a7a82;
  line-height: 1.7;
  margin: 0 0 2rem;
}

.qr-card p strong {
  color: #3D8A97;
  font-weight: 700;
}

.qr-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto 1.8rem;
  max-width: 340px;
}

.qr-divider::before,
.qr-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(91, 170, 184, 0.25);
}

.qr-divider span {
  font-size: 0.78rem;
  font-family: 'Open Sans', sans-serif;
  color: #a8c6cc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.qr-steps {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 2rem;
}

.qr-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: #f5fafb;
  border-radius: 12px;
  border: 1px solid rgba(91, 170, 184, 0.12);
}

.qr-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5BAAB8, #3D8A97);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Open Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-step-text {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  color: #4a7079;
  line-height: 1.5;
  padding-top: 3px;
}

.qr-contact {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.82rem;
  color: #a0b8bc;
  margin-top: 0.5rem;
}

.qr-contact a {
  color: #5BAAB8;
  text-decoration: none;
  font-weight: 600;
}

.qr-contact a:hover { text-decoration: underline; }

/* ══════════════════════════════
   FICHE — BREADCRUMB
══════════════════════════════ */
.breadcrumb {
  padding: 0 0 1.5rem 0;
}
.breadcrumb a { color: var(--bleu-fonce); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-title {
  font-family: 'Architects Daughter', cursive;
  font-size: 1.7rem; color: var(--bleu-fonce);
  margin: 0 0 0.6rem;
}
.breadcrumb-desc {
  font-size: 0.88rem; color: #555;
  line-height: 1.6; margin: 0;
  max-width: 880px;
}

/* ══════════════════════════════
   FICHE — MAIN
══════════════════════════════ */
main {
  flex: 1;
  max-width: 1100px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
  width: 100%;
}

/* ══════════════════════════════
   FICHE — BLOC HAUT photo + carte
══════════════════════════════ */
.bloc-top {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.photo-card {
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, var(--bleu-clair), #b8dfe8);
  min-height: 320px;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; box-shadow: var(--shadow);
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 320px; }
.map-card {
  border-radius: 16px; overflow: visible;
  box-shadow: var(--shadow); border: 1px solid #e0f0f4;
  display: flex; flex-direction: column;
}
.map-card #mini-map { border-radius: 0 0 16px 16px; overflow: hidden; }
.map-card-title {
  padding: 0.8rem 1.2rem;
  font-weight: 700; font-size: 0.85rem;
  color: var(--bleu-fonce);
  border-bottom: 1px solid #f0f0f0;
  background: white;
  display: flex; align-items: center; gap: 0.4rem;
}
#mini-map { flex: 1; min-height: 260px; }

/* ══════════════════════════════
   FICHE — BLOC BAS info + animaux
══════════════════════════════ */
.bloc-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.info-card {
  background: white; border-radius: 16px;
  padding: 1.5rem; box-shadow: var(--shadow);
  border: 1px solid #e0f0f4;
}
.lieu-titre {
  font-family: 'Architects Daughter', cursive;
  font-size: 1.1rem; color: var(--bleu-fonce);
  margin-bottom: 0.8rem;
}
.lieu-description { font-size: 0.92rem; line-height: 1.8; color: #666; }
.contenu-card {
  background: white; border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid #e0f0f4;
  overflow: hidden; display: flex; flex-direction: column;
}
.contenu-header {
  background: #174d3d; padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.contenu-header-title {
  font-family: 'Architects Daughter', cursive;
  font-size: 1.1rem; color: white;
}
.contenu-body {
  padding: 1.2rem 1.5rem; flex: 1;
  font-size: 0.95rem; line-height: 1.9;
  color: var(--gris); white-space: pre-wrap;
}
.contenu-vide {
  padding: 1.5rem; text-align: center;
  color: #bbb; font-style: italic; font-size: 0.88rem;
}

/* ══════════════════════════════
   FICHE — BOUTON RETOUR
══════════════════════════════ */
.btn-retour {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--vert); color: white;
  padding: 0.7rem 1.4rem; border-radius: 30px;
  font-weight: 700; font-size: 0.88rem;
  text-decoration: none; transition: background 0.2s;
  margin-top: 1.5rem;
}
.btn-retour:hover { background: var(--vert-fonce); }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 768px) {
  nav { display: none; }
  .header-inner, .topbar-inner { padding: 0 1rem; }
  .hero-inner { padding: 2.5rem 1.2rem; flex-direction: column; }
  .hero-img { display: none; }
  #map { height: 360px; }
  .map-wrapper, .liste-section { padding: 0 1rem; }
  main { padding: 0 1rem; margin-bottom: 2rem; }
  .bloc-top { grid-template-columns: 1fr; }
  .bloc-bottom { grid-template-columns: 1fr; }
  .photo-card { min-height: 220px; }
  #mini-map { min-height: 200px; }
}

@media (max-width: 500px) {
  .qr-card {
    padding: 2.2rem 1.5rem;
    border-radius: 18px;
  }
  .qr-card h2 { font-size: 1.3rem; }
}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
  box-shadow: none;
  display: none !important;
}
