/* ============================================================
   style.css - Taigo
   Design: vert toundra en dominante (fraicheur), vert foret pour
   le texte / logo / boutons (contraste), orange feu de camp en
   accent chaud pour tout ce qui doit attirer l'oeil (notifs).
   ============================================================ */

/* --- Variables ------------------------------------------------ */
:root {
  /* Palette de base
     forest  #1e4d34  texte fort, logo, boutons principaux
     toundra #7fa88f  vert doux de surface, etats actifs
     feu     #d2601c  accent chaud, notifications
  */

  /* Fonds: lavis vert tres pale = la "fraicheur" toundra */
  --bg:          #eef3ef;   /* fond general */
  --bg2:         #e5ece7;   /* fond secondaire */
  --bg3:         #dbe6de;   /* survols, zones actives */
  --card:        #ffffff;   /* cartes blanches */
  --border:      #c9dacf;   /* bordures vertes discretes */

  /* Vert foret: primaire, lisible sur blanc (ratio ~9:1) */
  --primary:     #1e4d34;
  --primary-h:   #2b6a48;
  --primary-soft: rgba(30,77,52,.09);

  /* Vert toundra: dominante de surface */
  --tundra:      #7fa88f;
  --tundra-deep: #5b8a6f;
  --tundra-soft: rgba(127,168,143,.18);

  /* Orange feu de camp: accent chaud */
  --accent:      #d2601c;   /* fonds de badge, pastilles, CTA chaud */
  --accent-h:    #e87c34;
  --accent-ink:  #9c440f;   /* version foncee pour texte sur fond pale */
  --accent-soft: rgba(210,96,28,.12);
  --accent2:     #c94162;   /* coeurs / reactions */

  /* Texte */
  --text:        #15251c;   /* vert tres fonce plutot que noir */
  --text-muted:  #57705f;

  --success:     #2f7d51;
  --warning:     #c97a12;
  --danger:      #b3302b;

  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 2px rgba(21,37,28,.10), 0 2px 12px rgba(21,37,28,.07);
  --shadow-lg:   0 8px 32px rgba(21,37,28,.16);
  --transition:  0.22s cubic-bezier(.4,0,.2,1);
  --font-body:   'Nunito', 'Segoe UI', sans-serif;
  --font-display:'Sora', 'Nunito', sans-serif;
}

/* --- Reset & Base --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-h); }

img { max-width: 100%; height: auto; display: block; }

/* Focus clavier visible partout (accessibilite) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Typography ----------------------------------------------- */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

/* --- Scrollbar ------------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--tundra); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--tundra-deep); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -3px 0 var(--tundra-soft);
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-header .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: .42rem 1rem .42rem 2.4rem;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition);
}
.header-search input:focus { border-color: var(--primary); }
.header-search .search-icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .9rem; pointer-events: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .7rem;
  gap: .18rem;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
  position: relative;
}
.nav-btn i { font-size: 1.25rem; }
.nav-btn:hover, .nav-btn.active { background: var(--tundra-soft); color: var(--primary); }
/* Pastille de notification: orange feu de camp */
.nav-btn .badge {
  position: absolute; top: 3px; right: 8px;
  background: var(--accent); color: #fff;
  font-size: .6rem; padding: 1px 5px;
  border-radius: 10px; line-height: 1.4;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--card);
}

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
}
.nav-avatar:hover { border-color: var(--primary); }

/* Dropdown menu */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 190px;
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  z-index: 999;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; animation: fadeDown .18s ease; }

/* Pont invisible qui couvre l'espace entre le declencheur et le menu.
   Sans lui, le curseur "tombe" dans le vide et le menu se ferme. */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -12px;
  height: 12px;
}

/* Marge d'erreur horizontale: le menu est aligne a droite, on tolere
   un leger debordement du curseur sur les cotes. */
.nav-dropdown::after {
  content: '';
  position: absolute;
  right: 0; top: 100%;
  width: 190px; height: 12px;
  display: none;
}
.nav-dropdown:hover::after { display: block; }

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

.nav-dropdown-menu a,
.nav-dropdown-menu button {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .9rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  width: 100%;
  background: none; border: none; cursor: pointer;
  transition: background var(--transition);
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu button:hover { background: var(--tundra-soft); color: var(--primary); }

/* Lang switcher */
.lang-switcher { display: flex; gap: .3rem; align-items: center; }
.lang-btn {
  font-size: .75rem; font-weight: 600;
  padding: .25rem .55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.lang-btn:hover, .lang-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.site-main { flex: 1; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

/* 3 colonnes pour le feed */
.feed-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 1.25rem;
  padding: 1.25rem 0;
}
@media (max-width: 960px) {
  .feed-layout { grid-template-columns: 1fr; }
  .sidebar-left, .sidebar-right { display: none; }
}
@media (max-width: 1100px) {
  .feed-layout { grid-template-columns: 240px 1fr; }
  .sidebar-right { display: none; }
}

/* Sidebar */
.sidebar { position: sticky; top: 76px; height: fit-content; }

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.sidebar-card h4 { font-size: .8rem; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .75rem; }

.sidebar-menu { list-style: none; }
.sidebar-menu li a {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: .93rem;
  transition: background var(--transition), color var(--transition);
}
.sidebar-menu li a:hover { background: var(--bg3); color: var(--primary); }
.sidebar-menu li a.active {
  background: var(--tundra-soft); color: var(--primary); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-menu li a i { width: 20px; text-align: center; color: var(--tundra-deep); }
.sidebar-menu li a.active i { color: var(--primary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-body { padding: 1.25rem; }
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--bg3); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
/* Bouton chaud: a garder pour l'action qui doit attirer l'oeil */
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-h); color: #fff; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.12); }
.btn-success { background: var(--success); color: #fff; font-weight: 700; }
.btn-success:hover { filter: brightness(1.1); color: #fff; }
.btn-sm { padding: .35rem .85rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .4rem; font-weight: 600; }

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2357705f' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }

.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
}
.input-group .form-control { padding-left: 2.5rem; }
.input-group .input-icon-right {
  position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer;
}

/* Erreur champ */
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: .8rem; color: var(--danger); margin-top: .25rem; }
.valid-feedback   { font-size: .8rem; color: var(--success); margin-top: .25rem; }

/* Alerts — versions claires lisibles (l'ancien jeu venait du theme sombre) */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex; align-items: center; gap: .6rem;
  border-left: 4px solid transparent;
}
.alert-danger  { background: rgba(179,48,43,.10);  border: 1px solid rgba(179,48,43,.28);  border-left-width: 4px; border-left-color: var(--danger);  color: #8c221e; }
.alert-success { background: rgba(47,125,81,.10);  border: 1px solid rgba(47,125,81,.28);  border-left-width: 4px; border-left-color: var(--success); color: #1f5a38; }
.alert-info    { background: var(--tundra-soft);   border: 1px solid rgba(91,138,111,.30); border-left-width: 4px; border-left-color: var(--tundra-deep); color: #2b5741; }
.alert-warning { background: var(--accent-soft);   border: 1px solid rgba(210,96,28,.30);  border-left-width: 4px; border-left-color: var(--accent);  color: var(--accent-ink); }

/* ============================================================
   POST (MUR)
   ============================================================ */
.post-composer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}
.post-composer-top {
  display: flex; align-items: center; gap: .85rem; margin-bottom: .85rem;
}
.post-composer-top .avatar { flex-shrink: 0; }
.post-composer-textarea {
  flex: 1;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: .65rem 1.1rem;
  color: var(--text); font-size: .95rem;
  outline: none; resize: none;
  font-family: var(--font-body);
  transition: border-color var(--transition), height .2s;
  overflow: hidden;
  min-height: 44px;
}
.post-composer-textarea:focus { border-color: var(--primary); }
.post-composer-actions {
  display: flex; align-items: center; gap: .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-action-btn {
  display: flex; align-items: center; gap: .35rem;
  padding: .4rem .8rem;
  border-radius: 8px;
  background: none; border: none;
  color: var(--text-muted); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.post-action-btn:hover { background: var(--tundra-soft); color: var(--primary); }
.post-action-btn.photo  i { color: var(--tundra-deep); }
.post-action-btn.video  i { color: var(--accent); }
.post-action-btn.link   i { color: var(--primary); }

.post-composer-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .75rem;
}

/* Post card */
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.post-header {
  display: flex; align-items: center; gap: .85rem;
  padding: 1rem 1.1rem .75rem;
}
.post-header .post-info { flex: 1; }
.post-header .post-author { font-weight: 700; font-size: .95rem; color: var(--primary); }
.post-header .post-meta {
  font-size: .78rem; color: var(--text-muted);
  display: flex; gap: .4rem; align-items: center;
}
.post-header .post-options {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; padding: .3rem; border-radius: 6px;
  transition: background var(--transition);
}
.post-header .post-options:hover { background: var(--bg3); color: var(--text); }

.post-content { padding: 0 1.1rem .85rem; font-size: .96rem; line-height: 1.65; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { color: var(--accent-ink); }

.post-media { width: 100%; }
.post-media img { width: 100%; max-height: 520px; object-fit: contain; background: #10201a; cursor: pointer; transition: filter var(--transition); }
.post-media img:hover { filter: brightness(.92); }
.post-media video { width: 100%; }

.post-stats {
  padding: .5rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .82rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.post-reactions-display { display: flex; gap: .2rem; align-items: center; }
.post-reactions-display span { font-size: 1rem; }

.post-actions {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}
.post-action {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .65rem;
  background: none; border: none;
  color: var(--text-muted); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background var(--transition), color var(--transition);
  position: relative;
}
.post-action:hover { background: var(--tundra-soft); color: var(--primary); }
.post-action.liked { color: var(--primary); }

/* Reaction picker */
.reaction-picker {
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%) scale(.85);
  transform-origin: bottom center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: .5rem .8rem .8rem; /* padding bas extra = pont invisible */
  display: flex; gap: .25rem;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 100;
  /* Empecher le crop a gauche sur le premier bouton */
  min-width: max-content;
  white-space: nowrap;
}
/* Pont invisible entre le bouton et le picker pour garder le hover */
.reaction-picker::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 12px;
  transform: translateY(100%);
}
.post-action:hover .reaction-picker,
.reaction-picker:hover,
.reaction-picker.visible {
  opacity: 1; pointer-events: all;
  transform: translateX(-50%) scale(1);
}
.reaction-emoji {
  font-size: 1.45rem;
  cursor: pointer;
  padding: .25rem .3rem;
  border-radius: 50%;
  transition: transform .18s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.reaction-emoji:hover { transform: scale(1.45); }

/* Commentaires */
.comments-section { padding: 0 1.1rem 1rem; display: none; }
.comments-section.open { display: block; }
.comment-input-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .75rem; }
.comment-input {
  flex: 1; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 22px; padding: .5rem 1rem;
  color: var(--text); font-family: var(--font-body);
  outline: none; font-size: .9rem;
  transition: border-color var(--transition);
}
.comment-input:focus { border-color: var(--primary); }
.comment {
  display: flex; gap: .6rem; margin-bottom: .6rem;
}
.comment .comment-bubble {
  background: var(--bg3); border-radius: 14px;
  padding: .55rem .9rem; font-size: .88rem;
  flex: 1;
}
.comment .comment-author { font-weight: 700; font-size: .82rem; margin-bottom: .15rem; color: var(--primary); }
.comment .comment-time { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar {
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0; display: block;
  background: var(--bg3);
}
.avatar-xs { width: 28px;  height: 28px; }
.avatar-sm { width: 36px;  height: 36px; }
.avatar-md { width: 48px;  height: 48px; }
.avatar-lg { width: 72px;  height: 72px; }
.avatar-xl { width: 100px; height: 100px; border: 3px solid var(--card); }
.avatar-xxl{ width: 140px; height: 140px; border: 4px solid var(--card); }

.avatar-online { position: relative; }
.avatar-online::after {
  content: ''; position: absolute; bottom: 2px; right: 2px;
  width: 10px; height: 10px; background: var(--success);
  border-radius: 50%; border: 2px solid var(--bg);
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 62px);
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 700px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-sidebar.show { display: flex; }
}

.chat-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--primary);
}
.chat-list { flex: 1; overflow-y: auto; }
.chat-list-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.chat-list-item:hover { background: var(--bg3); }
.chat-list-item.active { background: var(--tundra-soft); border-left: 3px solid var(--primary); }
.chat-list-item .chat-info { flex: 1; min-width: 0; }
.chat-list-item .chat-name { font-weight: 600; font-size: .9rem; }
.chat-list-item .chat-preview {
  font-size: .78rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-list-item .chat-time { font-size: .72rem; color: var(--text-muted); }
/* Non lus: orange feu de camp */
.unread-count {
  background: var(--accent); color: #fff;
  border-radius: 12px; padding: 1px 7px;
  font-size: .7rem; font-weight: 700;
}

.chat-main {
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  min-width: 0;
  width: 100%;
}
.chat-header {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .85rem;
  background: var(--bg2);
}
.chat-messages {
  flex: 1; overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .6rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.message { display: flex; gap: .5rem; max-width: 70%; min-width: 0; }
.message.sent { flex-direction: row-reverse; margin-left: auto; max-width: 70%; }
.message-bubble {
  padding: .6rem 1rem;
  border-radius: 18px;
  font-size: .9rem; line-height: 1.5;
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}
.message.received .message-bubble {
  background: var(--card); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.message.sent .message-bubble {
  background: var(--primary); color: #fff; border-bottom-right-radius: 4px;
}
.message.sent .message-bubble a { color: #cfe8d9; }
.message-time { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; text-align: right; }
.message.received .message-time { text-align: left; }

.chat-input-area {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .75rem; align-items: center;
  background: var(--bg2);
}
.chat-input {
  flex: 1; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 25px; padding: .6rem 1.1rem;
  color: var(--text); font-family: var(--font-body); font-size: .93rem;
  outline: none; transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn {
  width: 42px; height: 42px;
  background: var(--primary); border: none;
  border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--primary-h); transform: scale(1.06); }

/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 60% 40%, rgba(127,168,143,.30) 0%, transparent 60%),
              radial-gradient(ellipse at 10% 80%, rgba(210,96,28,.10) 0%, transparent 52%),
              var(--bg);
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 800; margin-bottom: .3rem;
  color: var(--primary);
}
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: .95rem; }
.auth-divider {
  text-align: center; position: relative;
  margin: 1.25rem 0; color: var(--text-muted); font-size: .82rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 43%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* Captcha honeypot + timing */
.hp-field { display: none !important; }

/* ============================================================
   PROFIL
   ============================================================ */
.profile-cover {
  height: 220px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--tundra-deep) 55%, var(--tundra) 100%);
  position: relative; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.profile-cover img { width:100%; height:100%; object-fit:cover; }
.profile-cover-edit {
  position: absolute; bottom: .75rem; right: .75rem;
}
.profile-info-bar {
  background: var(--card); border: 1px solid var(--border);
  padding: 0 1.5rem 1.25rem;
  border-top: none; border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
}
.profile-avatar-wrap {
  position: absolute; top: -48px; left: 1.5rem;
}
.profile-avatar-wrap img {
  width: 96px; height: 96px;
  border: 4px solid var(--card); border-radius: 50%;
  object-fit: cover; display: block;
}
.profile-actions { margin-left: auto; display: flex; gap: .5rem; }
.profile-name-row {
  padding-top: 56px;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.profile-name { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.profile-username { color: var(--text-muted); font-size: .9rem; }
.profile-bio { color: var(--text-muted); font-size: .9rem; margin-top: .35rem; }
.profile-stats {
  display: flex; gap: 1.5rem; margin-top: .85rem;
}
.profile-stat { text-align: center; cursor: pointer; }
.profile-stat .stat-val { font-weight: 800; font-size: 1.1rem; display: block; color: var(--primary); }
.profile-stat .stat-lbl { font-size: .78rem; color: var(--text-muted); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: .3rem 1rem;
  margin-bottom: .7rem;
}
.footer-links a { color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--primary); }

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(16,32,25,.60);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .22s ease;
}
@keyframes slideUp {
  from { opacity:0; transform: translateY(30px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; } to { opacity:1; }
}
.modal-header {
  padding: 1.2rem 1.4rem .9rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; color: var(--primary); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.3rem; cursor: pointer; padding: .2rem .4rem;
  border-radius: 6px; transition: background var(--transition);
}
.modal-close:hover { background: var(--bg3); }
.modal-body { padding: 1.4rem; }
.modal-footer {
  padding: .9rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .6rem;
}

/* ============================================================
   NOTIFICATIONS PANEL — l'orange feu de camp vit ici
   ============================================================ */
.notif-panel {
  position: fixed; right: 1rem; top: 70px;
  width: 340px; max-height: 500px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 1500; display: none;
}
.notif-panel.show { display: block; animation: fadeDown .18s ease; }
.notif-item {
  display: flex; gap: .75rem; align-items: center;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg3); }
.notif-item.unread {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.notif-item.unread::before {
  content: ''; display: block;
  width: 7px; height: 7px; min-width: 7px;
  background: var(--accent); border-radius: 50%;
}
.notif-text { font-size: .85rem; flex: 1; }
.notif-text strong { color: var(--text); }
.notif-time { font-size: .72rem; color: var(--text-muted); }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent-ink); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-center  { text-align: center; }
.text-sm      { font-size: .82rem; }
.fw-bold      { font-weight: 700; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-1        { gap: .5rem; }
.gap-2        { gap: 1rem; }
.mt-1         { margin-top: .5rem; }
.mt-2         { margin-top: 1rem; }
.mt-3         { margin-top: 1.5rem; }
.mb-1         { margin-bottom: .5rem; }
.mb-2         { margin-bottom: 1rem; }
.p-2          { padding: 1rem; }
.divider      { height: 1px; background: var(--border); margin: .75rem 0; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Toast */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: .75rem 1.1rem;
  font-size: .9rem; min-width: 220px; max-width: 320px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: .6rem;
  animation: toastIn .3s ease;
}
@keyframes toastIn {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }

/* Progress bar */
.progress { background: var(--bg3); border-radius: 10px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--tundra), var(--primary)); border-radius: 10px; transition: width .4s; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent  { background: var(--accent-soft); color: var(--accent-ink); }
.badge-success { background: rgba(47,125,81,.14); color: var(--success); }
.badge-danger  { background: rgba(179,48,43,.14); color: var(--danger); }
.badge-warning { background: rgba(201,122,18,.16); color: #8c540b; }


/* ============================================================
   NAVIGATION MOBILE BAS D'ECRAN
   ============================================================ */
.mobile-bottom-nav {
  display: none; /* cache sur desktop */
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 14px rgba(21,37,28,.08);
    z-index: 1001;
    padding: .4rem 0 calc(.4rem + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
    min-height: 58px;
  }
  .mob-nav-btn {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    color: var(--text-muted); text-decoration: none;
    font-size: .62rem; font-weight: 600;
    padding: .25rem .5rem;
    border-radius: 10px;
    transition: color var(--transition);
    position: relative;
    min-width: 52px;
  }
  .mob-nav-btn i { font-size: 1.3rem; }
  .mob-nav-btn.active { color: var(--primary); }
  .mob-nav-btn.active i { font-weight: 700; }
  .mob-badge {
    position: absolute; top: 0; right: 6px;
    background: var(--accent); color: #fff;
    font-size: .55rem; padding: 1px 4px;
    border-radius: 10px; font-weight: 700;
  }

  /* Simplifier la nav header sur mobile - garder notif + avatar */
  .header-nav { gap: .15rem; }
  .header-nav .nav-btn:not(#notifToggle) { display: none; }

  /* Pousser le contenu principal au-dessus de la nav */
  /* calc: 64px nav + env() safe area iPhone + 8px marge */
  .site-main {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 8px) !important;
  }
  .chat-layout { height: calc(100vh - 52px - 64px); }

  /* Footer site aussi pousse au-dessus de la nav */
  .site-footer {
    margin-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ============================================================
   FIXES MOBILE — PAGES SPECIFIQUES
   ============================================================ */
@media (max-width: 768px) {

  /* Page Explore */
  .explore-layout,
  [style*="grid-template-columns:280px 1fr"],
  [style*="grid-template-columns: 280px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .explore-sidebar { display: none !important; }

  /* Page Profil */
  [style*="grid-template-columns:280px 1fr"],
  [style*="grid-template-columns: 280px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .profile-about-sidebar { order: -1; }

  /* Page Admin */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Page Chat */
  .chat-layout {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 56px - 64px);
  }
  .chat-sidebar {
    display: flex !important;
    position: relative !important;
    transform: none !important;
    height: calc(100vh - 56px - 64px);
    width: 100%;
  }
  .chat-main { display: none; }
  .chat-main.active { display: flex; }

  /* Page Amis */
  .friends-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Page Groupes */
  [style*="grid-template-columns:repeat(auto-fill,minmax(260px"] {
    grid-template-columns: 1fr !important;
  }

  /* Profil — grille vue groupe */
  [style*="grid-template-columns:1fr 280px"],
  [style*="grid-template-columns: 1fr 280px"] {
    grid-template-columns: 1fr !important;
  }

  /* Onglets profil — scroll horizontal */
  .profile-tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .25rem;
  }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .profile-tabs .btn { white-space: nowrap; flex-shrink: 0; }

  /* Padding contenu general */
  .container { padding: 0 .5rem !important; }

  [style*="padding-top:1.25rem"],
  [style*="padding-top: 1.25rem"] { padding-top: .75rem !important; }
  [style*="padding-top:1.5rem"],
  [style*="padding-top: 1.5rem"]  { padding-top: .75rem !important; }
}

@media (max-width: 480px) {
  /* Grille photos profil */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3,1fr)"] {
    grid-template-columns: repeat(3,1fr) !important;
    gap: .15rem !important;
  }

  [style*="grid-template-columns:repeat(auto-fill,minmax(200px"] {
    grid-template-columns: repeat(2,1fr) !important;
  }

  [style*="grid-template-columns:repeat(auto-fill,minmax(180px"] {
    grid-template-columns: repeat(2,1fr) !important;
  }

  [style*="grid-template-columns:repeat(auto-fill,minmax(190px"] {
    grid-template-columns: repeat(2,1fr) !important;
  }

  .post-header { gap: .5rem; padding: .65rem .75rem .5rem; }
  .post-content { padding: 0 .75rem .65rem; }
  .post-stats { padding: .35rem .75rem; }
  .comments-section { padding: 0 .75rem .75rem; }

  .btn-sm { padding: .3rem .65rem; font-size: .78rem; }
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */

/* Tablette (max 768px) */
@media (max-width: 768px) {
  .site-header { padding: 0 .75rem; gap: .5rem; height: 56px; }
  .site-header .logo { font-size: 1.2rem; }
  .header-search { max-width: 160px; }
  .header-search input { font-size: .82rem; padding: .35rem .75rem .35rem 2rem; }

  .nav-btn span { display: none; }
  .nav-btn { min-width: 38px; padding: .35rem .4rem; }
  .nav-btn i { font-size: 1.2rem; }

  .lang-switcher { display: none; }

  .feed-layout {
    grid-template-columns: 1fr;
    padding: .75rem 0;
    gap: .75rem;
  }
  .sidebar-left, .sidebar-right { display: none; }
  .container { padding: 0 .6rem; }
}

/* Mobile (max 480px) */
@media (max-width: 480px) {
  .site-header { padding: 0 .6rem; gap: .35rem; height: 52px; }
  .site-header .logo { font-size: 1.1rem; }
  .header-search { max-width: 130px; }
  .header-search input { font-size: .8rem; }

  .nav-btn { min-width: 34px; padding: .3rem .35rem; }
  .nav-btn i { font-size: 1.15rem; }

  .auth-card { padding: 1.5rem 1rem; }
  .auth-logo { font-size: 1.6rem; }

  .post-composer { padding: .85rem .75rem; }
  .post-composer-top { gap: .6rem; }
  .post-composer-textarea { font-size: .9rem; }
  .post-composer-actions { gap: .2rem; flex-wrap: nowrap; }
  .post-action-btn span { display: none; }
  .post-action-btn { padding: .35rem .55rem; }

  .post-card { border-radius: 10px; }
  .post-header { padding: .75rem .85rem .6rem; gap: .6rem; }
  .post-header .post-author { font-size: .88rem; }
  .post-content { padding: 0 .85rem .75rem; font-size: .9rem; }
  .post-stats { padding: .4rem .85rem; }

  .post-actions { grid-template-columns: repeat(3,1fr); }
  .post-action { padding: .55rem .3rem; font-size: .78rem; gap: .3rem; }
  .post-action i { font-size: .95rem; }

  .comments-section { padding: 0 .85rem .85rem; }

  .profile-cover { height: 140px; }
  .profile-name { font-size: 1.2rem; }
  .profile-name-row { padding-top: 48px; flex-direction: column; align-items: flex-start; gap: .6rem; }
  .profile-actions { margin-left: 0; }
  .profile-stats { gap: 1rem; }

  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { position: fixed; left: 0; top: 52px; bottom: 0; width: 85vw; z-index: 500;
                   transform: translateX(-100%); transition: transform .3s; }
  .chat-sidebar.show { transform: translateX(0); }

  .modal { border-radius: 16px 16px 0 0; position: fixed; bottom: 0; left: 0; right: 0;
           max-width: 100%; max-height: 92vh; margin: 0; }
  .modal-overlay { align-items: flex-end; }

  .sidebar-card { padding: .75rem; }

  .container { padding: 0 .4rem; }
  .feed-layout { gap: .6rem; padding: .6rem 0; }

  .toast-container { bottom: .75rem; right: .4rem; left: .4rem; }
  .toast { min-width: unset; max-width: 100%; }

  .groups-grid { grid-template-columns: 1fr 1fr !important; }

  .admin-layout { grid-template-columns: 1fr; }
}

/* Tres petit (max 360px) */
@media (max-width: 360px) {
  .site-header .logo { font-size: 1rem; }
  .header-search { display: none; }
  .post-action { font-size: .72rem; padding: .5rem .25rem; }
}

/* Menu options post */
.post-menu-btn {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; padding: .55rem .9rem;
  background: transparent; border: none;
  color: var(--text); cursor: pointer;
  font-size: .88rem; border-radius: 8px;
  transition: background var(--transition), color var(--transition);
  text-align: left; font-family: var(--font-body);
}
.post-menu-btn:hover { background: var(--tundra-soft); color: var(--primary); }
.post-menu-danger { color: var(--danger) !important; }
.post-menu-danger:hover { background: rgba(179,48,43,.10); color: var(--danger) !important; }

/* Premier bouton action (J'aime) — aligner le picker a gauche */
.post-actions .post-action:first-child .reaction-picker {
  left: 0;
  transform: translateX(0) scale(.85);
  transform-origin: bottom left;
}
.post-actions .post-action:first-child:hover .reaction-picker {
  transform: translateX(0) scale(1);
}

/* Profile grid mobile */
@media (max-width: 768px) {
  .profile-content-grid {
    grid-template-columns: 1fr !important;
  }
  .explore-layout {
    grid-template-columns: 1fr !important;
  }
  .explore-sidebar {
    display: none !important;
  }
  .chat-input-area { padding: .6rem .75rem; }
}

.explore-mobile-search { display: none; }
@media (max-width: 768px) {
  .explore-mobile-search { display: block !important; }
}
/* chatInputBar cache par defaut, affiche seulement sur mobile via @media */
#chatInputBar { display: none; }

/* Chat mobile */
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 56px - 64px) !important;
    overflow: hidden !important;
    position: relative !important;
  }
  .chat-sidebar {
    display: flex !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    transform: translateX(0) !important;
    transition: transform .28s !important;
    z-index: 2 !important;
    flex-direction: column !important;
  }
  .chat-sidebar.hidden { transform: translateX(-100%) !important; }
  .chat-main {
    position: absolute !important;
    inset: 0 !important;
    display: none !important;
    flex-direction: column !important;
    z-index: 2 !important;
    overflow: hidden !important;
  }
  .chat-main.active { display: flex !important; }
  .chat-header { flex-shrink: 0 !important; }
  .chat-messages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 140px !important;
  }
  .chat-input-area { display: none !important; }
  .mob-chat-back { display: block !important; }
  #chatInputBar {
    display: flex !important;
    position: fixed !important;
    bottom: 72px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1002 !important;
    background: var(--bg2) !important;
    border-top: 1px solid var(--border) !important;
    padding: .6rem .75rem !important;
    gap: .75rem !important;
    align-items: center !important;
    min-height: 56px !important;
  }
  .site-footer { display: none !important; }
}

/* Desktop: chatInputBar cache, chat-input-area visible */
@media (min-width: 769px) {
  #chatInputBar { display: none !important; }
  .chat-input-area { display: flex !important; }
  .chat-main { min-width: 0; overflow: hidden; }
  .chat-messages { min-width: 0; overflow-x: hidden; }
  .message, .message.sent { max-width: 70%; }
}

/* Typing dots */
.typing-dots {
  display: flex; align-items: center; gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: .5rem .8rem;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}
.typing-dots span {
  width: 7px; height: 7px;
  background: var(--tundra-deep);
  border-radius: 50%; display: block;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* ============================================================
   RECHERCHE — items
   ============================================================ */
.search-item-name { font-weight: 600; font-size: .9rem; }
.search-item-user { font-size: .78rem; color: var(--text-muted); }

/* ============================================================
   LANDING PUBLIQUE (SEO)
   ============================================================ */
.landing { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.landing-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.landing-hero-text h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--primary); margin-bottom: .75rem; }
.landing-tagline { font-size: 1.25rem; font-weight: 700; margin-bottom: .75rem; }
.landing-desc { color: var(--text-muted); margin-bottom: 1.5rem; max-width: 460px; }
.landing-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.landing-features { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feature-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
  border-top: 3px solid var(--tundra);
}
.feature-card i { font-size: 1.6rem; color: var(--tundra-deep); }
.feature-card h3 { font-size: 1rem; margin: .4rem 0 .3rem; color: var(--primary); }
.feature-card p { font-size: .85rem; color: var(--text-muted); }
@media (max-width: 860px) {
  .landing-hero { grid-template-columns: 1fr; }
  .landing-features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .landing-features { grid-template-columns: 1fr; } }

/* ============================================================
   EVENEMENTS
   ============================================================ */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.event-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.event-card-date {
  background: linear-gradient(135deg, var(--primary), var(--tundra-deep));
  color: #fff; padding: 1rem 1.25rem; font-family: var(--font-display);
}
.event-card-date .ev-day { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.event-card-date .ev-month { font-size: .8rem; letter-spacing: .06em; opacity: .92; }
.event-card-body { padding: 1rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.event-card-body h3 { font-size: 1.05rem; }
.event-meta { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: .35rem; }
.event-card-actions { padding: .75rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; }
.rsvp-count { margin-left: auto; font-size: .8rem; color: var(--text-muted); }
.btn-rsvp.active { background: var(--success); border-color: var(--success); color: #fff; }

/* ============================================================
   MARCHE / PETITES ANNONCES
   ============================================================ */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.market-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
  display: block; color: var(--text);
}
.market-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.market-card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg3); }
.market-card-img-placeholder {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: var(--bg3); color: var(--tundra-deep); font-size: 2rem;
}
.market-card-body { padding: .85rem 1rem 1rem; }
/* Le prix est l'info chaude de la carte: orange feu de camp */
.market-price { font-weight: 800; font-size: 1.05rem; color: var(--accent-ink); }
.market-title { font-size: .92rem; font-weight: 600; margin: .15rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-loc { font-size: .78rem; color: var(--text-muted); }
.market-badge-sold {
  display: inline-block; background: var(--danger); color: #fff; font-size: .7rem;
  font-weight: 700; padding: .15rem .5rem; border-radius: 20px;
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; color: var(--primary); }

/* Formulaire modal simple */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,32,25,.45); z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 1.5rem;
}
.modal-box h2 { font-size: 1.15rem; margin-bottom: 1rem; color: var(--primary); }

/* Bouton logout en POST dans le dropdown */
.logout-form { margin: 0; }
.logout-btn {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem; font: inherit; color: var(--danger); font-size: .9rem;
  transition: background var(--transition); text-align: left;
}
.logout-btn:hover { background: var(--bg3); }


/* ============================================================
   HEADER — styles extraits des inline
   ============================================================ */
.search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 999; max-height: 320px; overflow-y: auto;
}
.search-result-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1rem; color: var(--text); transition: background var(--transition);
}
.search-result-item:hover { background: var(--tundra-soft); color: var(--text); }
.notif-panel-head {
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem; color: var(--primary);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-readall-btn {
  background: none; border: none; color: var(--accent-ink);
  cursor: pointer; font-size: .8rem; font-family: inherit; font-weight: 700;
}
.notif-readall-btn:hover { color: var(--accent); }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .9rem; }
.lang-switcher { margin-left: .5rem; }


/* ============================================================
   PAGES STATIQUES (a propos, confidentialite, aide...)
   ============================================================ */
.static-page {
  max-width: 760px; margin: 2rem auto; padding: 2rem 2.25rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.static-page h1 { font-size: 1.6rem; margin-bottom: 1rem; color: var(--primary); }
.static-page h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; color: var(--primary); }
.static-page p  { color: var(--text); line-height: 1.65; margin-bottom: .6rem; max-width: 68ch; }
.static-page a  { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 600px) { .static-page { margin: 1rem; padding: 1.25rem; } }

/* ============================================================
   MODE MAINTENANCE + ANNONCE (parametres admin)
   ============================================================ */
.maintenance-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(127,168,143,.28) 0%, transparent 60%), var(--bg);
  padding: 1.5rem;
}
.maintenance-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2.5rem 3rem; text-align: center; max-width: 440px;
}
.maintenance-icon { font-size: 2.6rem; font-style: normal; display: block; margin-bottom: .75rem; }
.maintenance-box h1 { color: var(--primary); font-size: 1.7rem; margin-bottom: .6rem; }
.maintenance-box p { color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.6; }

/* Annonce du site: c'est une notification globale, donc orange */
.site-announcement {
  background: linear-gradient(135deg, var(--accent), #b0500f);
  color: #fff; text-align: center; padding: .55rem 1rem;
  font-size: .88rem; font-weight: 600;
}
.site-announcement i { margin-right: .35rem; }
.site-announcement a { color: #fff; text-decoration: underline; }


/* Selecteur de visibilite en mode edition de publication */
.edit-privacy-select {
  width: auto; margin-right: auto; padding: .35rem .6rem;
  font-size: .82rem; border-radius: 8px;
}


/* Logo header */
.logo-img { height: 36px; width: auto; display: block; }
@media (max-width: 768px) { .logo-img { height: 30px; } }


/* ============================================================
   LOGO - marque Taigo dans l'en-tete, les pages auth et l'admin
   ============================================================ */
.site-header .logo { gap: 8px; }
.logo-icon { height: 30px; width: auto; display: block; flex-shrink: 0; }
@media (max-width: 768px) { .logo-icon { height: 26px; } }
@media (max-width: 480px) { .logo-icon { height: 24px; } }

.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.auth-logo img { height: 34px; width: auto; }

.admin-sidebar-logo img { height: 26px; width: auto; }

/* Logo complet (marque + mot), pour une page vitrine ou un courriel */
.logo-full { height: 38px; width: auto; display: block; }
