/* Charte graphique Baanabaana — annuaire public (docs/design/00-charte-graphique.md) */

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --color-sand:       #F5F0E8;
  --color-teal:       #1A6B7A;
  --color-teal-dark:  #135460;
  --color-ochre:      #E8A020;
  --color-ivory:      #FAFAF6;
  --color-brown:      #2D1F14;
  --color-brown-soft: #6B5E54;
  --color-border:     #DDD5C8;
  --color-green:      #2E7D5A;
  --radius-card:      12px;
  --shadow-card:      0 2px 12px rgba(45, 31, 20, 0.08);
  --font-title:       'Playfair Display', Georgia, serif;
  --font-body:        'DM Sans', system-ui, sans-serif;
}

/* ─── Reset minimal ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--color-sand);
  color: var(--color-brown);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-teal); text-decoration: none; }
a:hover { color: var(--color-teal-dark); text-decoration: underline; }

/* ─── Typographie ────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-title); line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 400; }
h3 { font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 500; font-family: var(--font-body); }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px)  { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem;   } }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--color-ivory);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-teal);
  text-decoration: none;
}

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-teal) 0%, #0D4A56 100%);
  min-height: clamp(260px, 40vh, 420px);
  display: flex;
  align-items: center;
}

/* Canvas Three.js — plein fond du hero */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Repli visuel quand WebGL absent ou prefers-reduced-motion actif */
.hero__fallback {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1A6B7A 0%, #F5F0E8 60%, #E8A020 100%);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__fallback { animation: none; background-position: 50% 50%; }
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 2.5rem 0;
  color: white;
}
.hero__title { color: white; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.hero__subtitle { color: rgba(255,255,255,.85); margin-top: .5rem; font-size: 1.1rem; }

/* ─── Formulaire de recherche ────────────────────────────────────────────────── */
.search-form {
  background: var(--color-ivory);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  margin-top: 1.5rem;
}
.search-form label { font-size: .875rem; font-weight: 500; color: var(--color-brown-soft); display: block; margin-bottom: .25rem; }
.search-form select, .search-form input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--color-brown);
  background: white;
  transition: border-color .15s;
}
.search-form select:focus, .search-form input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(26, 107, 122, .12);
}
.search-form__field { flex: 1 1 180px; }
.search-form__btn {
  padding: .6rem 1.5rem;
  background: var(--color-teal);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .9375rem;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.search-form__btn:hover { background: var(--color-teal-dark); }

/* ─── Section boutiques ─────────────────────────────────────────────────────── */
.section { padding: 2rem 0; }
.section__title { margin-bottom: 1.25rem; color: var(--color-brown); }

.shops-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 480px)  { .shops-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .shops-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .shops-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─── Carte boutique ────────────────────────────────────────────────────────── */
.shop-card {
  background: var(--color-ivory);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(45, 31, 20, .12);
}
.shop-card__photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  aspect-ratio: 4/3;
  background: var(--color-sand);
}
.shop-card__photos img {
  width: 100%; height: 100%; object-fit: cover;
}
.shop-card__photo-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-border) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--color-border);
}
.shop-card__body { padding: 1rem; flex: 1; }
.shop-card__name { font-weight: 600; font-size: 1rem; margin-bottom: .25rem; }
.shop-card__desc { font-size: .875rem; color: var(--color-brown-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card__badge {
  display: inline-block; margin-top: .5rem;
  background: var(--color-sand);
  color: var(--color-brown-soft);
  font-size: .75rem;
  padding: .2rem .6rem;
  border-radius: 99px;
}
/* Un badge par catégorie : espacement horizontal quand il y en a plusieurs. */
.shop-card__badge + .shop-card__badge { margin-left: .35rem; }

/* ─── Accès à la vitrine ─────────────────────────────────────────────────────── */
/* Bloc pleine largeur et cible tactile confortable : la grille passe à une colonne
   sous 480 px et la majorité des visiteurs consultent l'annuaire au téléphone. */
.shop-card__cta {
  display: block;
  margin-top: .75rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  text-align: center;
  font-size: .875rem;
  text-decoration: none;
  background: var(--color-brown-soft);
  color: #fff;
}
.shop-card__cta:hover,
.shop-card__cta:focus-visible { filter: brightness(1.08); }

/* Boutique sans sous-domaine : on l'annonce plutôt que d'offrir un lien mort. */
.shop-card__cta--absent {
  background: transparent;
  color: var(--color-brown-soft);
  border: 1px dashed var(--color-sand);
  cursor: default;
}

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; padding: 2rem 0; }
.pagination__btn {
  padding: .4rem .9rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-ivory);
  color: var(--color-teal);
  cursor: pointer;
  font-size: .875rem;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.pagination__btn:hover { background: var(--color-sand); border-color: var(--color-teal); }
.pagination__btn--active { background: var(--color-teal); color: white; border-color: var(--color-teal); }

/* ─── État vide ──────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-brown-soft); }
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: .875rem;
  color: var(--color-brown-soft);
}

/* ─── Accessibilité — prefers-reduced-motion global ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
