/* =============================================================
   CARTES POSTALES DE FRANCE — Page publique
   ============================================================= */

.postcards-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px 20px 60px;  /* padding-top suffisamment haut pour passer sous la nav fixe */
}
@media (max-width: 768px) {
  .postcards-page { padding-top: 100px; }
}

.postcards-header {
  text-align: center;
  margin-bottom: 28px;
}
.postcards-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 42px;
  margin: 0 0 12px;
  color: var(--c-text, #1B4332);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
[data-theme="dark"] .postcards-header h1 {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.postcards-tagline {
  margin: 0 auto 18px;
  max-width: 720px;
  color: var(--c-text-soft, #495057);
  font-size: 16px;
  line-height: 1.5;
}
[data-theme="dark"] .postcards-tagline {
  color: rgba(255,255,255,0.85);
}
.postcards-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
  color: #6c757d;
}
.postcards-stat {
  background: rgba(199, 144, 30, 0.12);
  border: 1px solid rgba(199, 144, 30, 0.4);
  padding: 6px 16px;
  border-radius: 16px;
  font-weight: 600;
  color: #8B6914;
}

.postcards-map-wrapper {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 520px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.postcards-map {
  position: absolute;
  inset: 0;
}

.postcards-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.postcards-zoom-hint {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.1);
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #1B4332;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  white-space: nowrap;
}

.postcards-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1B4332, #0F5F3F);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.postcards-back-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0,0,0,0.35);
}

/* ===== Barre de recherche (en haut a droite) ===== */
.pc-search-wrap {
  position: absolute;
  top: 14px;
  right: 60px;       /* place pour les boutons +/- de la nav */
  width: 280px;
  z-index: 11;
}
.pc-search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 22px;
  padding: 0 8px 0 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}
.pc-search-icon {
  font-size: 14px;
  margin-right: 6px;
  opacity: 0.65;
}
.pc-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 9px 6px;
  font-size: 13px;
  color: #1B4332;
}
.pc-search-clear {
  background: rgba(0,0,0,0.08);
  color: #495057;
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.pc-search-clear:hover {
  background: rgba(255,59,48,0.4);
  color: #fff;
}
.pc-search-results {
  margin-top: 6px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.pc-search-results.active { display: block; }
.pc-search-result {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  color: #1B4332;
  transition: background 0.15s ease;
}
.pc-search-result:last-child { border-bottom: none; }
.pc-search-result:hover {
  background: rgba(199, 144, 30, 0.12);
}
.pc-search-result-meta {
  display: block;
  font-size: 11px;
  color: #6c757d;
  margin-top: 1px;
}
.pc-search-result-badge {
  display: inline-block;
  margin-left: 8px;
  background: #1B4332;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 8px;
  vertical-align: middle;
}
.pc-search-no-result {
  padding: 14px;
  color: #6c757d;
  font-style: italic;
  font-size: 13px;
  text-align: center;
}

/* ===== Bloc texte SEO ===== */
.postcards-seo-text {
  max-width: 880px;
  margin: 38px auto 0;
  padding: 0 8px;
  color: var(--c-text, #1B4332);
}
.postcards-seo-text h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  margin: 26px 0 10px;
  color: #1B4332;
}
[data-theme="dark"] .postcards-seo-text h2 { color: #fff; }
.postcards-seo-text p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text-soft, #495057);
  margin: 0 0 12px;
}
[data-theme="dark"] .postcards-seo-text p { color: rgba(255,255,255,0.85); }
.postcards-seo-text a {
  color: #C7901E;
  text-decoration: none;
  font-weight: 600;
}
.postcards-seo-text a:hover { text-decoration: underline; }

/* Mobile : la search bar passe en dessous du toolbar */
@media (max-width: 600px) {
  .pc-search-wrap {
    position: static;
    width: auto;
    margin-top: 10px;
  }
}

/* ===== Empty state invite (commune sans contribution) ===== */
.pc-empty-invite {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 30px;
  background: rgba(199, 144, 30, 0.06);
  border: 2px dashed rgba(199, 144, 30, 0.4);
  border-radius: 14px;
}
.pc-empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.7;
}
.pc-empty-invite p {
  margin: 6px 0;
  color: #495057;
  font-size: 15px;
}
.pc-empty-invite strong { color: #1B4332; }

/* ===== Bandeau "derniers ajouts" entre header et carte ===== */
.recent-strip {
  margin: 0 auto 18px;
  max-width: 1280px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(199, 144, 30, 0.10), rgba(27, 67, 50, 0.06));
  border: 1px solid rgba(199, 144, 30, 0.3);
  border-radius: 12px;
}
[data-theme="dark"] .recent-strip {
  background: linear-gradient(135deg, rgba(199, 144, 30, 0.18), rgba(255,255,255,0.04));
  border-color: rgba(199, 144, 30, 0.5);
}

.recent-strip-header {
  margin-bottom: 10px;
}
.recent-strip-title {
  font-size: 14px;
  font-weight: 700;
  color: #1B4332;
  letter-spacing: 0.3px;
}
[data-theme="dark"] .recent-strip-title { color: #FFD700; }

.recent-strip-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.recent-strip-list::-webkit-scrollbar { height: 7px; }
.recent-strip-list::-webkit-scrollbar-thumb {
  background: rgba(199, 144, 30, 0.5);
  border-radius: 4px;
}

.recent-card {
  flex: 0 0 auto;
  width: 110px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}
[data-theme="dark"] .recent-card {
  background: rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.1);
}
.recent-card:hover {
  transform: translateY(-3px);
  border-color: #C7901E;
  box-shadow: 0 4px 14px rgba(199, 144, 30, 0.4);
}
.recent-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ddd;
  overflow: hidden;
  position: relative;
}
.recent-card-img.portrait {
  aspect-ratio: 3 / 4;
}
.recent-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.recent-card-meta {
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
}
.recent-card-name {
  font-weight: 700;
  color: #1B4332;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .recent-card-name { color: #fff; }
.recent-card-sub {
  margin-top: 2px;
  color: #6c757d;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .recent-card-sub { color: rgba(255,255,255,0.55); }

/* ===== Liste SEO ===== */
.postcards-seo-list {
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text-soft, #495057);
}
[data-theme="dark"] .postcards-seo-list { color: rgba(255,255,255,0.85); }
.postcards-seo-list li {
  margin-bottom: 10px;
}

/* ===== Marqueurs / clusters =====
   IMPORTANT : pas de transition sur .pc-cluster — MapLibre applique
   un transform: translate(...) en continu pour positionner le marker
   au bon endroit pendant le panning. Toute transition ferait laguer.
   On utilise un wrapper <span> interne pour la mise a l'echelle au hover. */
.pc-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pc-cluster .pc-cluster-inner {
  background: linear-gradient(135deg, #C7901E, #8B6914);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  width: 100%;
  height: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pc-cluster:hover .pc-cluster-inner {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.pc-cluster.region   { width: 64px; height: 64px; font-size: 18px; }
.pc-cluster.dept     { width: 48px; height: 48px; font-size: 16px; }
.pc-cluster.commune  { width: 40px; height: 40px; font-size: 14px; }
.pc-cluster.commune .pc-cluster-inner {
  background: linear-gradient(135deg, #1B4332, #0F5F3F);
}

/* ===== Modal commune ===== */
.pc-commune-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pc-commune-modal.active { display: flex; }

.pc-commune-card {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.pc-commune-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, #1B4332, #0F5F3F);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pc-commune-header h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
}
.pc-commune-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.pc-commune-close:hover {
  background: rgba(255,59,48,0.6);
  transform: rotate(90deg);
}

.pc-commune-actions {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: #f8f9fa;
}
.pc-contrib-btn {
  background: linear-gradient(135deg, #C7901E, #8B6914);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(139, 105, 20, 0.3);
}
.pc-contrib-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 105, 20, 0.45);
}
.pc-commune-count {
  font-size: 13px;
  color: #495057;
  font-weight: 600;
}

.pc-commune-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-content: start;
}
.pc-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: #6c757d;
  font-style: italic;
}

/* Toast login */
.pc-login-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #1B4332;
  color: #fff;
  padding: 14px 22px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 100005;
  font-size: 14px;
  transition: transform 0.4s ease;
}
.pc-login-toast.show {
  transform: translateX(-50%) translateY(0);
}
.pc-login-btn {
  background: #C7901E;
  color: #fff;
  padding: 6px 16px;
  border-radius: 18px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s ease;
}
.pc-login-btn:hover { background: #8B6914; }

/* Responsive */
@media (max-width: 768px) {
  .postcards-header h1 { font-size: 30px; }
  .postcards-map-wrapper { height: 55vh; min-height: 380px; }
  .pc-commune-grid { grid-template-columns: 1fr; }
}
