/* =====================================================
   KOJIJI.CSS — Magazine Territoire
   Normes graphiques: Guide de normes Territoire (nov. 2025)
   Palette: Lichen #D9FF50 · Crème #FCFFE9 · Kaki #3B4900 · Cacao #1F1A03
   Typographie: Averia Serif Libre Italic (titres) · Lora (corps) · Urbanist (UI)
   ===================================================== */

/* --- Polices Territoire --- */
@import url('https://fonts.googleapis.com/css2?family=Averia+Serif+Libre:ital,wght@1,400;1,700&family=Lora:ital,wght@0,400;0,600;1,400&family=Urbanist:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Typographie Territoire */
  --font-titre:     'Averia Serif Libre', Georgia, serif;   /* titres en italique */
  --font-corps:     'Lora', Georgia, serif;                  /* corps, sous-titres */
  --font-ui:        'Urbanist', system-ui, sans-serif;       /* interface, labels */

  /* Type scale fluide — plancher 12px */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);

  /* Espacement (base 4px) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Palette primaire Territoire */
  --lichen:           #D9FF50;  /* vert lichen — accent principal */
  --lichen-dim:       rgba(217, 255, 80, 0.15);
  --lichen-border:    rgba(217, 255, 80, 0.35);
  --creme:            #FCFFE9;  /* crème — fond principal */
  --kaki:             #3B4900;  /* kaki foncé */
  --cacao:            #1F1A03;  /* brun cacao — presque noir */

  /* Tokens sémantiques */
  --color-primary:        #0d6efd;
  --color-primary-hover:  #0b5ed7;
  --color-primary-light:  rgba(13, 110, 253, 0.08);
  --color-bg:             var(--creme);
  --color-surface:        #ffffff;
  --color-surface-2:      #f8f9fa;
  --color-border:         rgba(0, 0, 0, 0.1);
  --color-divider:        #dee2e6;
  --color-text:           var(--cacao);
  --color-text-muted:     #5a5840;
  --color-text-faint:     #adb5bd;
  --color-success:        #198754;
  --color-danger:         #dc3545;

  /* Rayon */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* Ombres chaleureuses */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);

  /* Transition */
  --t: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset ciblé --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--color-bg);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--color-text);
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* --- Classes typographiques Territoire --- */
.font-titre  { font-family: var(--font-titre); font-style: italic; }
.font-corps  { font-family: var(--font-corps); }
.font-ui     { font-family: var(--font-ui); }

h1, h2, h3 { font-family: var(--font-titre); font-style: italic; }
h4, h5, h6 { font-family: var(--font-corps); font-weight: 600; }

/* -----------------------------------------------------------------------
   Layout principal
----------------------------------------------------------------------- */

.page-wrap {
  padding-top: var(--space-4);
  padding-bottom: 5.5rem;
}

@media (min-width: 768px) {
  .page-wrap { padding-bottom: var(--space-8); }
}

/* -----------------------------------------------------------------------
   Header
----------------------------------------------------------------------- */

header h1 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
  line-height: 1.2;
}

#userMsg {
  font-size: var(--text-sm);
  min-height: 1.4em;
  color: var(--color-text-muted);
}

.user-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.google-linked-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #0a58ca;
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem;
  line-height: 1.25;
}

.google-linked-badge.is-linked {
  color: #0a58ca;
  background: rgba(13, 110, 253, 0.08);
  border-color: rgba(13, 110, 253, 0.2);
}

.google-linked-badge.is-unlinked {
  color: #5f6368;
  background: rgba(95, 99, 104, 0.12);
  border-color: rgba(95, 99, 104, 0.28);
}

/* -----------------------------------------------------------------------
   Boîte de recherche
----------------------------------------------------------------------- */

.search-box {
  min-width: 0;
  flex: 1 1 auto;
}

.search-box .form-control {
  font-size: var(--text-base);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
}

.search-box .btn {
  padding: 0 0.85rem;
  font-size: var(--text-base);
  min-width: 2.75rem;
  min-height: 44px;
}

/* -----------------------------------------------------------------------
   Boutons toggle Vue Liste / Carte
----------------------------------------------------------------------- */

/* Séparer les boutons : annuler la fusion des bordures de Bootstrap */
.view-toggle {
  gap: var(--space-1);
}

/* Réinitialiser la marge négative de Bootstrap qui écrase les bordures adjacentes */
.view-toggle > .btn + .btn {
  margin-left: 0;
}

/* Redonner un border-radius individuel à chaque bouton (annule l'aplatissement du btn-group) */
.view-toggle > .btn {
  border-radius: var(--radius-sm) !important;
}

.view-toggle .btn {
  font-size: var(--text-sm);
  min-height: 44px;
  padding: 0.5rem 0.85rem;
}

/* Fix desktop : forcer la couleur active (bleu rempli) sur le bouton sélectionné */
.view-toggle .btn.active,
.view-toggle .btn[aria-pressed="true"] {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}

/* -----------------------------------------------------------------------
   Bouton Ajouter
----------------------------------------------------------------------- */

.show-submit-link.btn,
.show-submit-link {
  font-size: var(--text-sm);
  font-weight: 600;
  min-height: 44px;
  border-radius: var(--radius-md);
}

/* -----------------------------------------------------------------------
   Panneau Géolocalisation
----------------------------------------------------------------------- */

#geo-panel {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f4fd 100%);
  border: 1px solid #c5d8f8;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  animation: slideDown 0.2s var(--t);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

#geo-rayon { cursor: pointer; accent-color: var(--color-primary); }

.geo-preset-btn {
  font-size: var(--text-xs);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  transition: all var(--t);
  white-space: nowrap;
  min-height: 44px;
}

.geo-preset-btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

#geo-status-badge {
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  max-width: 100%;
  word-break: break-word;
  background: rgba(13, 110, 253, 0.08);
  color: #0a58ca;
  border: 1px solid rgba(13, 110, 253, 0.18);
}

/* -----------------------------------------------------------------------
   Spinner inline bouton
----------------------------------------------------------------------- */

.btn-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  border: 0.15em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  margin-right: 0.4em;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

/* -----------------------------------------------------------------------
   Overlay auth
----------------------------------------------------------------------- */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  z-index: 1000;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}

.auth-overlay.visible { opacity: 1; pointer-events: auto; }
.auth-forms { position: relative; z-index: 1001; }

.auth-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1002;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-forms .form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.auth-forms .form-control {
  font-size: var(--text-base);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  min-height: 48px;
}

/* -----------------------------------------------------------------------
   Formulaire d'annonce
----------------------------------------------------------------------- */

#annonce-auth-banner .btn,
#annonce-email-banner .btn {
  white-space: nowrap;
}

.link-form .form-label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.link-form .form-control {
  font-size: var(--text-base);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  min-height: 48px;
}

.link-form textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* -----------------------------------------------------------------------
   Adresse autocomplete
----------------------------------------------------------------------- */

.mapbox-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mapbox-suggestions li {
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-size: var(--text-sm);
  line-height: 1.4;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 48px;
}

.mapbox-suggestions li:last-child { border-bottom: none; }
.mapbox-suggestions li:hover,
.mapbox-suggestions li.active { background: #f0f4ff; }
.mapbox-suggestions li .sug-icon { color: var(--color-text-muted); margin-top: 2px; flex-shrink: 0; }
.mapbox-suggestions li .sug-main { font-weight: 600; font-size: var(--text-sm); }
.mapbox-suggestions li .sug-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.address-wrap { position: relative; }
.address-verified-icon {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-success);
  font-size: 1rem;
  pointer-events: none;
  display: none;
}
#linkAddress.is-verified { padding-right: 2rem; border-color: var(--color-success); }

#geoBtn {
  min-width: 2.75rem;
  min-height: 44px;
  transition: all var(--t);
}
#geoBtn.active { box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.25); }
#geoBtn i.bi-crosshair { transition: transform 0.3s var(--t); }
#geoBtn:hover i.bi-crosshair { transform: scale(1.15); }

/* -----------------------------------------------------------------------
   Liste des annonces
----------------------------------------------------------------------- */

#annonces-list { padding: 0; }

#annonces-list .list-group-item,
.annonce-item {
  padding: var(--space-4);
  border-color: var(--color-divider);
  transition: background var(--t), box-shadow var(--t);
}

#annonces-list .list-group-item:hover,
.annonce-item:hover {
  background: var(--color-surface-2);
}

.annonce-list-item {
  cursor: pointer;
}

.annonce-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  line-height: 1.3;
}

.annonce-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

/* -----------------------------------------------------------------------
   Texte tronqué avec « Lire la suite »
----------------------------------------------------------------------- */

.annonce-description-wrap {
  position: relative;
}

.annonce-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  word-break: break-word;
  margin: 0;
}

/* État tronqué : 3 lignes max */
.annonce-description.is-truncated {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Bouton Lire la suite */
.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: none;
  border: none;
  padding: 0.5rem 0;
  margin-top: 0.15rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--t), opacity var(--t);
  min-height: 44px;
  line-height: 1;
}

.btn-read-more:hover  { color: var(--color-primary-hover); opacity: 0.85; }
.btn-read-more:active { opacity: 0.7; }

.btn-read-more i {
  font-size: 0.85em;
  transition: transform var(--t);
}

.btn-read-more.expanded i {
  transform: rotate(180deg);
}

/* -----------------------------------------------------------------------
   Carte Mapbox
----------------------------------------------------------------------- */

#map-container {
  width: 100%;
  /* Mobile : soustraire la bottom-nav (~56 px) en plus du reste */
  height: calc(100vh - 240px);
  min-height: 400px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

@media (min-width: 768px) {
  #map-container {
    /* Desktop : pas de bottom-nav, on revient à l'offset d'origine */
    height: calc(100vh - 180px);
  }
}

.map-popup { max-width: 240px; }

.map-popup h6 {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.map-popup p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

.map-popup .popup-email { font-size: var(--text-xs); }

.map-marker {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--t), background var(--t);
}

.map-marker:hover {
  background: var(--color-primary-hover);
  transform: rotate(-45deg) scale(1.15);
}

.map-marker-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  color: #fff;
  font-size: 0.85rem;
}

/* -----------------------------------------------------------------------
   Modale commentaires (Deftform)
----------------------------------------------------------------------- */

.feedback-modal-body {
  min-height: 12rem;
}

.feedback-modal-body .deftform {
  width: 100%;
}

/* -----------------------------------------------------------------------
   Bottom Nav Bar
----------------------------------------------------------------------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  padding: 0 var(--space-1) env(safe-area-inset-bottom, 0);
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color var(--t), background var(--t);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
  position: relative;
}

.bottom-nav-btn i { font-size: 1.45rem; line-height: 1; }

.bottom-nav-btn.active { color: var(--color-primary); }

.bottom-nav-btn:hover:not(.active) {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.bottom-nav-btn:active { background: rgba(13,110,253,0.13); }

/* Indicateur actif : barre en haut */
.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--color-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .page-wrap  { padding-bottom: var(--space-8); }
}

/* -----------------------------------------------------------------------
   Message vide
----------------------------------------------------------------------- */

#empty-msg {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  padding: var(--space-10) var(--space-4);
}

/* -----------------------------------------------------------------------
   Responsive : ajustements fins
----------------------------------------------------------------------- */

@media (max-width: 575px) {
  header {
    padding-bottom: var(--space-2) !important;
    margin-bottom: var(--space-3) !important;
  }
  .show-submit-link.btn-primary.ms-md-auto {
    width: 100%;
    justify-content: center;
  }
}

/* Entre 576 px et 991 px : "Ajouter" occupe toute la largeur disponible */
@media (min-width: 576px) and (max-width: 991px) {
  .show-submit-link.btn-primary {
    width: 100%;
    justify-content: center;
  }
}

@media (hover: none) {
  .bottom-nav-btn:hover:not(.active) {
    background: initial;
    color: initial;
  }
  .mapbox-suggestions li:hover {
    background: initial;
  }
}

/* =======================================================================
   Badges — Statut des annonces
======================================================================= */

.badge-statut {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-statut--attente  { background: #fff3cd; color: #856404; border: 1px solid #ffc10740; }
.badge-statut--approuvee { background: #d1e7dd; color: #0a3622; border: 1px solid #19875440; }
.badge-statut--refusee  { background: #f8d7da; color: #58151c; border: 1px solid #dc354540; }
.badge-statut--archivee { background: #e2e3e5; color: #495057; border: 1px solid #adb5bd40; }

/* =======================================================================
   Badges — Vérification Territoire (Guide)
======================================================================= */

.badge-verif {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Vérifié Territoire — lichen sur cacao */
.badge-verif--ok {
  background: var(--lichen);
  color: var(--cacao);
  border: 1px solid var(--cacao);
}

/* Non vérifié — neutre discret */
.badge-verif--no {
  background: var(--creme);
  color: var(--kaki);
  border: 1px solid var(--lichen-border);
}

/* Pastille type d'organisation */
.badge-type-org {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--lichen-dim);
  color: var(--kaki);
  border: 1px solid var(--lichen-border);
  white-space: nowrap;
}

/* Puces mots-clés */
.guide-motcle {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--creme);
  color: var(--kaki);
  border: 1px solid var(--lichen-border);
  white-space: nowrap;
}

/* =======================================================================
   Publicités Guide Territoire
======================================================================= */

.guide-pub {
  display: block;
  margin: 0 auto;
  text-align: center;
  text-decoration: none;
}

.guide-pub__img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--lichen-border);
}

.guide-pub__label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kaki);
  opacity: 0.55;
  margin-bottom: 0.2rem;
}

.guide-pub--haut,
.guide-pub--bas {
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}

.guide-pub-slot:empty {
  display: none;
}

/* Placeholder « Espace publicitaire disponible » */
.guide-pub-placeholder {
  border: 1.5px dashed var(--lichen-border);
  border-radius: var(--radius, 8px);
  background: var(--lichen-dim);
  text-align: center;
  color: var(--kaki);
  opacity: 0.7;
  padding: 0.75rem 0.5rem;
}

.guide-pub-placeholder__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-family: var(--font-ui, 'Urbanist', sans-serif);
}

.guide-pub-placeholder__inner .bi {
  font-size: 1.5rem;
  opacity: 0.5;
}

/* Dimensions selon emplacement */
.guide-pub-placeholder--haut  { min-height: 60px; }
.guide-pub-placeholder--bas   { min-height: 80px; }
.guide-pub-placeholder--droite { min-height: 300px; width: 100%; }
.guide-pub-placeholder--liste  { min-height: 120px; }

/* Sidebar collée à droite — responsive */
.guide-pub-sidebar {
  position: sticky;
  top: 1rem;
}

/* Carte pub insérée dans la liste des résultats */
.guide-pub-card {
  border: 1px dashed var(--lichen-border);
  background: var(--lichen-dim);
}

/* =======================================================================
   Badges — Catégories
======================================================================= */

.badge-categorie {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(13,110,253,.18);
  white-space: nowrap;
}

/* Filtre catégorie */
#categorie-filter-wrap { overflow-x: auto; padding-bottom: 2px; }
.categorie-filter-btn {
  font-size: var(--text-xs);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  min-height: 36px;
  transition: all var(--t);
}
.categorie-filter-btn.active {
  background-color: var(--color-primary) !important;
  border-color:     var(--color-primary) !important;
  color: #fff !important;
}

/* =======================================================================
   Note admin dans "Mes annonces"
======================================================================= */

.annonce-note-admin {
  font-size: var(--text-sm);
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.75rem;
  color: #664d03;
}

/* =======================================================================
   Section titre dans le formulaire
======================================================================= */

.form-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-divider);
}

/* =======================================================================
   Infos privées dans le détail
======================================================================= */

.annonce-contact-prive {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.annonce-contact-prive h3 {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.annonce-contact-prive p { font-size: var(--text-sm); color: var(--color-text); }

/* =======================================================================
   Badge email non confirmé
======================================================================= */

.badge-email-unverified {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc10760;
  white-space: nowrap;
}

/* =======================================================================
   Upload d'images
======================================================================= */

.image-upload-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.image-thumb-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  flex-shrink: 0;
}

.image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb-del {
  position: absolute;
  top: 2px; right: 2px;
  width: 22px; height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t);
}
.image-thumb-del:hover { background: rgba(220,53,69,.85); }

.image-thumb-badge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  font-size: 0.6rem;
  text-align: center;
  background: rgba(13,110,253,.75);
  color: #fff;
  padding: 1px 0;
}

.image-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 88px; height: 88px;
  border: 2px dashed var(--color-divider);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
  flex-shrink: 0;
  user-select: none;
}
.image-add-btn i { font-size: 1.4rem; }
.image-add-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

.image-upload-counter {
  width: 100%;
  flex-basis: 100%;
}

/* =======================================================================
   Galerie d'images dans les annonces
======================================================================= */

.annonce-list-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.image-gallery {
  display: grid;
  gap: 4px;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 320px;
  cursor: pointer;
}
.image-gallery--single { grid-template-columns: 1fr; }
.image-gallery--multi  { grid-template-columns: repeat(2, 1fr); }

.image-gallery-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: opacity var(--t);
}
.image-gallery-img:hover { opacity: .92; }

.image-gallery--single .image-gallery-img { height: 240px; }

/* =======================================================================
   Lightbox
======================================================================= */

.lightbox {
  position: fixed; inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  max-width: 90vw; max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: block;
}
.lightbox-close {
  position: absolute; top: -2rem; right: 0;
  background: none; border: none;
  color: #fff; font-size: 1.5rem; cursor: pointer;
  padding: 0.25rem;
}
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 1.4rem; cursor: pointer;
  padding: 0.5rem 0.65rem; border-radius: 50%;
  transition: background var(--t);
  z-index: 1;
}
.lightbox-prev { left: -3rem; }
.lightbox-next { right: -3rem; }
.lightbox-prev:hover:not(:disabled), .lightbox-next:hover:not(:disabled) {
  background: rgba(255,255,255,.3);
}
.lightbox-prev:disabled, .lightbox-next:disabled { opacity: .35; cursor: default; }
.lightbox-counter {
  position: absolute; bottom: -1.8rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: var(--text-xs);
}

/* Lightbox : contrôles dans la zone visible (portrait mobile) */
@media (max-width: 767px) {
  .lightbox {
    touch-action: pan-y pinch-zoom;
  }
  .lightbox-content {
    max-width: 100%;
    width: 100%;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
             env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    box-sizing: border-box;
  }
  .lightbox-img {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 6rem);
    touch-action: pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
  }
  .lightbox-close {
    top: max(0.5rem, env(safe-area-inset-top, 0));
    right: max(0.5rem, env(safe-area-inset-right, 0));
    z-index: 2;
  }
  .lightbox-prev {
    left: max(0.35rem, env(safe-area-inset-left, 0));
  }
  .lightbox-next {
    right: max(0.35rem, env(safe-area-inset-right, 0));
  }
  .lightbox-prev, .lightbox-next {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
  }
  .lightbox-counter {
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0));
  }
}

/* =======================================================================
   Vignette dans la liste
======================================================================= */

.annonce-list-item .min-width-0 { min-width: 0; }

/* Bouton "Lire dans le magazine" sur les cartes annonce */
.btn-mag-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  flex-shrink: 0;
  font-size: 0.95rem;
  transition: background var(--t), color var(--t);
}
.btn-mag-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Paysage mobile : carte quasi-plein écran, bottom-nav masquée */
@media (max-height: 500px) and (orientation: landscape) {
  #map-container {
    height: calc(100vh - 60px); /* juste le header de la card */
    min-height: 200px;
  }
  .bottom-nav {
    display: none;
  }
  .page-wrap {
    padding-bottom: var(--space-4);
  }
}

/* =====================================================
   APP NAV — navigation unifiée style « landing »
   Barre cacao, logo à gauche, pilule centrale glassy,
   actions à droite. Cohérent avec index.html.
   ===================================================== */
.app-nav {
  background: #1f1a03;                 /* Cacao plein */
  color: #fcffe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  border-radius: .85rem;
  box-shadow: 0 2px 12px rgba(31, 26, 3, .12);
}

/* Logo / marque à gauche */
.app-nav-logo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  flex-shrink: 0;
}
.app-nav-logo img { height: 26px; width: auto; display: block; }
.app-nav-logo .app-nav-logo-txt {
  font-family: 'Urbanist', system-ui, sans-serif;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #D9FF50;
}

/* Groupe de liens central (pilule glassy) */
.app-nav-center {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 4px;
  gap: 2px;
  background: rgba(252, 255, 233, .12);
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.app-nav-center a {
  font-family: 'Urbanist', system-ui, sans-serif;
  font-weight: 400;
  font-size: .82rem;
  color: #fcffe9;
  text-decoration: none;
  letter-spacing: .02em;
  padding: .4rem 1.1rem;
  border-radius: 9999px;
  white-space: nowrap;
  transition: background .18s, color .2s;
}
.app-nav-center a:hover { background: rgba(252, 255, 233, .15); }
.app-nav-center a.active { background: #D9FF50; color: #1f1a03; }

.app-nav-user {
  font-family: 'Urbanist', system-ui, sans-serif;
  font-size: .78rem;
  color: rgba(252, 255, 233, .6);
  white-space: nowrap;
}

/* Actions à droite */
.app-nav-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Bouton d'action — pilule outline (style nav-login landing) */
.app-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(252, 255, 233, .12);
  border: 1px solid rgba(252, 255, 233, .35);
  color: #fcffe9 !important;
  border-radius: 9999px;
  font-family: 'Urbanist', system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 500;
  padding: .45rem 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.app-nav-btn:hover {
  background: rgba(252, 255, 233, .22);
  color: #fcffe9 !important;
}
.app-nav-btn.active {
  background: #D9FF50;
  border-color: #D9FF50;
  color: #1f1a03 !important;
}

/* CTA lichen (style nav-cta landing) */
.app-nav-btn--cta {
  background: #D9FF50;
  border-color: #D9FF50;
  color: #1f1a03 !important;
}
.app-nav-btn--cta:hover {
  background: #ceff00;
  border-color: #ceff00;
  color: #1f1a03 !important;
  transform: translateY(-1px);
}
.app-nav-btn--danger:hover {
  background: rgba(220, 53, 69, .9);
  border-color: rgba(220, 53, 69, .95);
  color: #fff !important;
}

@media (max-width: 575px) {
  .app-nav { justify-content: center; }
  .app-nav-center { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; }
}
