@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600&display=swap');
/* ─── Renaissance en français — So Châteaux ─────────────────────────────────
   Design: patrimonial, raffiné, editorial. Gold sur charbon.
   Fonts: Cormorant Garamond (titres) + DM Sans (corps)
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:wght@300;400;500&display=swap');

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --gold: #B78A4E;
  --gold-light: #d4a96a;
  --gold-pale: #f5efe4;
  --charcoal: #1a1a18;
  --charcoal-mid: #2c2c2a;
  --charcoal-soft: #444441;
  --stone: #8a8780;
  --stone-light: #c8c4bc;
  --parchment: #f7f3ed;
  --parchment-mid: #ede7dc;

  --bg: #f7f3ed;
  --bg-card: #ffffff;
  --bg-subtle: #ede7dc;
  --text-primary: #1a1a18;
  --text-secondary: #5c5a55;
  --text-muted: #9a9690;
  --border: rgba(26,26,24,0.10);
  --border-mid: rgba(26,26,24,0.18);

  --font-serif: 'Plus Jakarta Sans', sans-serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 3px rgba(26,26,24,0.08), 0 4px 16px rgba(26,26,24,0.05);
}

[data-theme="dark"] {
  --bg: #131311;
  --bg-card: #1e1e1c;
  --bg-subtle: #252522;
  --text-primary: #e8e4dc;
  --text-secondary: #a09c94;
  --text-muted: #6a6660;
  --border: rgba(232,228,220,0.08);
  --border-mid: rgba(232,228,220,0.15);
  --parchment: #1e1e1c;
  --gold-pale: #2a2318;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sans); cursor: pointer; }
input, textarea, select { font-family: var(--font-sans); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--charcoal);
  border-bottom: 1px solid rgba(183,138,78,0.2);
  padding: 0 1.5rem;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  height: 64px; display: flex; align-items: center; gap: 1.5rem;
}
.site-logo { flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.site-logo img { height: 36px; width: auto; }
.logo-text {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.logo-text span { display: block; font-size: 11px; font-weight: 300; color: rgba(183,138,78,0.6); letter-spacing: 0.12em; text-transform: uppercase; }

.header-nav { flex: 1; display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 6px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,0.55);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover, .nav-link.active { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.06); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 400; transition: all 0.15s; border: 1px solid transparent; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.75); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); color: white; }
.btn-gold { background: var(--gold); color: white; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn-outline { background: transparent; border-color: var(--border-mid); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-pale); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
  border: 1px solid rgba(183,138,78,0.3);
  cursor: pointer;
}

/* ─── Main layout ────────────────────────────────────────────────────────── */
.main-content { flex: 1; padding: 2rem 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }
.sidebar { position: sticky; top: 80px; align-self: flex-start; max-height: calc(100vh - 100px); overflow-y: auto; }
@media (max-width: 900px) { .content-grid { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ─── Filter bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  background: transparent; border: 1px solid var(--border-mid);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.filter-chip:hover { border-color: var(--gold); color: var(--gold); }
.filter-chip.active { background: var(--charcoal); color: var(--gold); border-color: var(--charcoal); }
[data-theme="dark"] .filter-chip.active { background: var(--gold-pale); }
.filter-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.filter-select {
  padding: 6px 12px; border-radius: 20px; font-size: 13px;
  background: transparent; border: 1px solid var(--border-mid);
  color: var(--text-secondary); cursor: pointer;
  appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9690'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* ─── Post card ──────────────────────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 2px 8px rgba(26,26,24,0.1), 0 8px 24px rgba(26,26,24,0.08); }

.post-header {
  padding: 1rem 1.25rem 0.75rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.post-author-info { flex: 1; }
.post-author-name { font-size: 14px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.post-date { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* Badges profil */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 500;
  padding: 2px 7px; border-radius: 10px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-admin    { background: #1a1a18; color: var(--gold); }
.badge-passionne { background: #e8f0fc; color: #2d5fd6; }
.badge-futur    { background: #fef3e2; color: #b5620a; }
.badge-proprio  { background: #e8f8ee; color: #1a7a3c; }
.badge-pro      { background: #f0e8fc; color: #6b2fa0; }
[data-theme="dark"] .badge-admin { background: var(--gold-pale); }
[data-theme="dark"] .badge-passionne { background: #1a2540; color: #7aa0f0; }
[data-theme="dark"] .badge-futur { background: #2a1e0a; color: #e89040; }
[data-theme="dark"] .badge-proprio { background: #0a2018; color: #50c878; }
[data-theme="dark"] .badge-pro { background: #1e0a2a; color: #b060f0; }

.post-visibility-badge {
  margin-left: auto; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; display: flex; align-items: center; gap: 4px;
}
.visibility-public { background: #e8f8ee; color: #1a7a3c; }
.visibility-members { background: var(--gold-pale); color: #8a5c1a; }
[data-theme="dark"] .visibility-public { background: #0a2018; color: #50c878; }
[data-theme="dark"] .visibility-members { background: #2a1e0a; color: #d4a96a; }

/* Post body */
.post-body { padding: 1rem 1.25rem; }
.post-title {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35; margin-bottom: 0.5rem;
  cursor: pointer;
}
.post-title:hover { color: var(--gold); }
.disc-excerpt { word-break: break-word; overflow-wrap: break-word; }
.post-excerpt { margin-bottom: 4px; }
.post-excerpt { font-size: 14px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 0.75rem; }

/* Media */
.media-wrap { border-radius: var(--radius); overflow: hidden; margin-bottom: 0.75rem; position: relative; }
.video-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  overflow: hidden; border-radius: var(--radius);
}
.video-thumb-placeholder { color: rgba(255,255,255,0.12); font-family: var(--font-serif); font-size: 15px; text-align: center; padding: 1.5rem; }
.vimeo-embed { width: 100%; aspect-ratio: 16/9; border: none; }

/* Lock overlay */
.lock-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20,18,14,0.6);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  text-align: center;
  padding: 1.25rem 1.5rem;
  max-width: 88%;
}
.lock-icon-wrap {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(183,138,78,0.15); border: 1px solid rgba(183,138,78,0.3);
  display: flex; align-items: center; justify-content: center;
}
.lock-icon-wrap svg { width: 22px; height: 22px; fill: var(--gold); }
.lock-title { font-family: var(--font-serif); font-size: 17px; font-weight: 500; color: #f0ebe3; }
.lock-sub { font-size: 13px; color: rgba(240,235,227,0.8); }
.lock-cta {
  margin-top: 4px; padding: 8px 22px;
  background: var(--gold); color: white; border: none;
  border-radius: 4px; font-size: 13px; cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s;
}
.lock-cta:hover { background: var(--gold-light); }

/* ─── Lock-overlay mobile : compact card to fit inside 16:9 thumbnail ─── */
@media (max-width: 600px) {
  .lock-overlay {
    padding: 0.6rem 0.9rem;
    gap: 4px;
    max-width: 88%;
    max-height: 92%;
    border-radius: 10px;
  }
  .lock-icon-wrap { width: 32px; height: 32px; }
  .lock-icon-wrap svg { width: 14px; height: 14px; }
  .lock-title { font-size: 13px; line-height: 1.2; }
  .lock-sub { display: none; }
  .lock-cta { padding: 5px 14px; font-size: 11px; margin-top: 0; }

  /* Feed cards only: widen card so texts fit on a single line, re-show sub */
  .post-card .lock-overlay {
    max-width: 95%;
    padding: 0.65rem 1rem;
  }
  .post-card .lock-overlay .lock-sub { display: block; }
  .post-card .lock-overlay .lock-title,
  .post-card .lock-overlay .lock-sub { white-space: nowrap; }
}

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; border-radius: var(--radius); overflow: hidden; margin-bottom: 0.75rem; }
.gallery-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.gallery-cell { aspect-ratio: 4/3; background: var(--bg-subtle); overflow: hidden; cursor: pointer; }
.gallery-cell:first-child:not(:only-child) { grid-column: 1 / -1; aspect-ratio: 16/7; }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-cell:hover img { transform: scale(1.03); }

/* Post footer */
.post-footer {
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; overflow: hidden;
}
.action-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--text-muted); white-space: nowrap;
  background: none; border: none; padding: 4px 0;
  cursor: pointer; transition: color 0.15s;
}
.action-btn:hover { color: var(--text-primary); }
.action-btn.liked { color: #c0392b; }
.action-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── Comments ───────────────────────────────────────────────────────────── */
.comments-section { border-top: 1px solid var(--border); }
.comments-toggle {
  padding: 0.75rem 1.25rem; font-size: 13px; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  background: none; border: none; width: 100%; text-align: left;
}
.comments-toggle:hover { color: var(--gold); }
.comments-list { padding: 0 1.25rem; }
.comment-item { display: flex; gap: 10px; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.comment-item.comment-hidden { background: rgba(248, 215, 218, 0.35); border-radius: 6px; padding: 0.65rem 0.5rem; margin: 0 -0.5rem; }
.comment-item:last-child { border-bottom: none; }
.comment-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; }
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.comment-name { font-size: 13px; font-weight: 500; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 13px; color: var(--text-secondary); line-height: 1.55; word-break: break-word; overflow-wrap: break-word; white-space: pre-wrap; }
.comment-text.truncated { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.comment-read-more { font-size: 12px; color: var(--gold); cursor: pointer; display: inline-block; margin-top: 2px; }
.comment-read-more:hover { text-decoration: underline; }
.comment-replies { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 0; }
.comment-reply { border-bottom: 1px solid var(--border); }
.comment-reply:last-child { border-bottom: none; }
.comment-actions { display: flex; align-items: center; gap: 10px; margin-top: 5px; flex-wrap: wrap; }
.comment-action-link { background: none; border: none; font-size: 11px; color: var(--text-muted); cursor: pointer; padding: 0; }
.comment-action-link:hover { color: var(--text-secondary); }
.comment-like-btn { background: none; border: none; font-size: 11px; color: var(--text-muted); cursor: pointer; padding: 0; display: flex; align-items: center; gap: 3px; transition: color 0.15s; }
.comment-like-btn:hover { color: #c0392b; }
.comment-like-btn.liked { color: #c0392b; }
.like-count { font-size: 14px; min-width: 16px; }

.comment-input-row { display: flex; gap: 8px; align-items: flex-end; padding: 0.75rem 1.25rem 1rem; }
.comment-input-row .comment-avatar { flex-shrink: 0; }
.comment-field {
  flex: 1; padding: 8px 14px;
  border: 1px solid var(--border-mid); border-radius: 12px;
  font-size: 13px; background: var(--bg-subtle); color: var(--text-primary);
  outline: none; transition: border-color 0.15s;
  resize: none; overflow: hidden; min-height: 36px; max-height: 200px;
  line-height: 1.4; font-family: var(--font-sans);
}
.comment-field:focus { border-color: var(--gold); }
.comment-send {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: white; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.comment-send:hover { background: var(--gold-light); }
.comment-send svg { width: 14px; height: 14px; fill: white; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.widget-title { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }

.stats-row { display: flex; justify-content: space-around; text-align: center; }
.stat-val { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--text-primary); }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.about-text { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 0.75rem; }

/* Donation widget */
.don-intro { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 1rem; }
.don-amounts { display: flex; gap: 6px; margin-bottom: 8px; }
.don-pill {
  flex: 1; padding: 7px 4px; text-align: center;
  border: 1px solid var(--border-mid); border-radius: 6px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  color: var(--text-secondary); background: transparent;
}
.don-pill:hover { border-color: var(--gold); color: var(--gold); }
.don-pill.active { background: var(--charcoal); color: var(--gold); border-color: var(--charcoal); }
[data-theme="dark"] .don-pill.active { background: var(--gold-pale); border-color: var(--gold); }
.don-custom-wrap { display: flex; align-items: center; gap: 6px; margin-bottom: 1rem; }
.don-custom-label { font-size: 14px; color: var(--text-muted); white-space: nowrap; white-space: nowrap; }
.don-custom-input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border-mid); border-radius: 6px;
  font-size: 13px; background: var(--bg-subtle); color: var(--text-primary);
  outline: none;
}
.don-custom-input:focus { border-color: var(--gold); }
.don-stripe-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 4px; }

/* ─── Auth modal ─────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,18,14,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 2rem; max-width: 440px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: translateY(12px); transition: transform 0.2s;
  max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-logo { text-align: center; margin-bottom: 1.5rem; }
.modal-logo-text { font-family: var(--font-serif); font-size: 22px; color: var(--gold); letter-spacing: 0.04em; }
.modal-logo-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px; }
.modal-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; margin-bottom: 0.25rem; }
.modal-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-mid); border-radius: 6px;
  font-size: 14px; background: var(--bg); color: var(--text-primary);
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--gold); }
.form-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-mid); border-radius: 6px;
  font-size: 14px; background: var(--bg); color: var(--text-primary);
  outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239a9690'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-select:focus { border-color: var(--gold); }
.profile-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-option {
  padding: 10px 8px; border: 1px solid var(--border-mid); border-radius: 8px;
  text-align: center; cursor: pointer; transition: all 0.15s;
  font-size: 12px; color: var(--text-secondary);
}
.profile-option-icon { font-size: 20px; margin-bottom: 4px; }
.profile-option.selected { border-color: var(--gold); background: var(--gold-pale); color: var(--charcoal); }
[data-theme="dark"] .profile-option.selected { color: var(--gold); }
.form-error { font-size: 12px; color: #c0392b; margin-top: 4px; }
.modal-footer { text-align: center; font-size: 14px; color: var(--text-muted); white-space: nowrap; margin-top: 1rem; }
.modal-link { color: var(--gold); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; }
.modal-divider { text-align: center; font-size: 12px; color: var(--text-muted); margin: 1rem 0; }

/* ─── Toast notifications ─────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 80px; right: 1.5rem; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 16px; border-radius: 8px;
  font-size: 14px; color: white;
  display: flex; align-items: center; gap: 8px;
  max-width: 320px; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.25s ease;
}
.toast-success { background: #1a7a3c; }
.toast-error { background: #a32020; }
.toast-info { background: var(--charcoal); border: 1px solid rgba(183,138,78,0.3); }
@keyframes toastIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:none; } }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1.5rem; color: var(--text-muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-family: var(--font-serif); font-size: 20px; color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ─── Loading ────────────────────────────────────────────────────────────── */
.spinner { width: 24px; height: 24px; border: 2px solid var(--border-mid); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-skeleton { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-card) 50%, var(--bg-subtle) 75%); background-size: 200%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 0 1rem; }
  .main-content { padding: 1.25rem 1rem; }
  .header-nav { display: none; }
  .post-body { padding: 0.875rem 1rem; }
  .post-header { padding: 0.875rem 1rem 0.6rem; }
  .post-footer { padding: 0.6rem 1rem; }
  .post-title { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .don-amounts { flex-wrap: wrap; }
  .filter-bar { gap: 6px; }
}

/* ─── Admin indicator ────────────────────────────────────────────────────── */
.admin-bar {
  background: var(--charcoal-mid); color: rgba(255,255,255,0.6);
  font-size: 11px; padding: 4px 1.5rem; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(183,138,78,0.15);
}
.admin-bar a { color: var(--gold); text-decoration: none; }
.admin-bar a:hover { text-decoration: underline; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.theme-toggle { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; padding: 6px; border-radius: 50%; transition: color 0.15s; }
.theme-toggle:hover { color: rgba(255,255,255,0.8); }


/* ─── Desktop/mobile visibility helpers ─────────────────────────────────── */
.desktop-only { display: inline-flex; }
.mobile-only  { display: none; }
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: flex !important; }
}

/* ─── Hamburger button ───────────────────────────────────────────────────── */
.hamburger {
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; width: 36px; height: 36px; padding: 6px;
  background: none; border: none; cursor: pointer; border-radius: 6px;
}
.hamburger span {
  display: block; height: 2px; background: rgba(255,255,255,0.7);
  border-radius: 2px; transition: all 0.2s;
}
.hamburger:hover span { background: white; }

/* ─── Mobile menu overlay ────────────────────────────────────────────────── */
.mobile-menu-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.5);
}
.mobile-menu-overlay.open { display: block; }

/* ─── Mobile menu panel ──────────────────────────────────────────────────── */
.mobile-menu {
  position: fixed; top: 0; right: -100%; z-index: 160;
  width: min(300px, 85vw); height: 100vh;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
  transition: right 0.25s ease;
  overflow-y: auto;
}
.mobile-menu.open { right: 0; }

.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-title { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.mobile-menu-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px; border-radius: 4px;
}
.mobile-menu-close:hover { color: var(--text-primary); background: var(--bg-subtle); }

.mobile-menu-nav { padding: 0.75rem; flex: 1; }
.mobile-menu-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 15px; color: var(--text-secondary);
  text-decoration: none; margin-bottom: 2px;
  transition: all 0.15s;
}
.mobile-menu-link:hover, .mobile-menu-link.active {
  background: var(--bg-subtle); color: var(--text-primary);
}
.mobile-menu-link.active { color: var(--gold); }

.mobile-menu-auth {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.mobile-menu-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.mobile-theme-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text-muted); white-space: nowrap; padding: 6px 0;
  font-family: var(--font-sans);
}
.mobile-theme-btn:hover { color: var(--text-primary); }

/* ─── Mobile stats widget (carte sous header) ────────────────────────────── */
.mobile-stats-widget {
  display: none;
  margin: 0.875rem 1rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.msw-stats { display: flex; align-items: stretch; width: 100%; }
.msw-stat { display: flex; flex-direction: column; align-items: center; flex: 1; padding: 4px 0; }
.msw-val { font-size: 18px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.msw-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-align: center; }
.msw-sep { width: 1px; background: var(--border); margin: 4px 0; flex-shrink: 0; }
@media (max-width: 900px) { .mobile-stats-widget { display: flex; } }

/* ─── Mobile don widget (dans le feed, avant footer) ─────────────────────── */
.mobile-don-widget {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-card);
  align-items: center; justify-content: space-between; gap: 1rem;
}
.mdw-title { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--text-primary); margin-bottom: 3px; }
.mdw-text { font-size: 13px; color: var(--text-secondary); }
@media (max-width: 900px) { .mobile-don-widget { display: flex; } }
@media (max-width: 480px) { .mobile-don-widget { flex-direction: column; align-items: flex-start; } }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--charcoal);
  border-top: 1px solid rgba(183,138,78,0.15);
  margin-top: 3rem;
}
.footer-don {
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-don-title { font-family: var(--font-serif); font-size: 18px; color: rgba(255,255,255,0.85); font-weight: 500; }
.footer-don-sub { font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 3px; }
.footer-bottom {
  max-width: 1100px; margin: 0 auto;
  padding: 1rem 1.5rem 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  font-size: 12px; color: rgba(255,255,255,0.3);
}
.footer-bottom a { color: rgba(255,255,255,0.4); text-decoration: none; }
.footer-bottom a:hover { color: var(--gold); }
.footer-sep { opacity: 0.3; }
@media (max-width: 640px) {
  .footer-don { flex-direction: column; text-align: center; padding: 1.5rem 1rem; gap: 1rem; }
  .footer-bottom { flex-wrap: wrap; padding: 0.875rem 1rem 1.25rem; }
}

/* ─── Feed switcher Publications / Discussions / Tout ───────────────────── */
.feed-switcher {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 3px;
  border: 0.5px solid var(--border);
}
.feed-switch-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: var(--font-sans);
}
.feed-switch-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ─── Filter bar améliorée ───────────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.filter-row-controls {
  justify-content: space-between;
}
.filter-row-controls .filter-select {
  flex: 0 0 auto;
}

/* Tags filter */
.tags-filter-wrap { position: relative; }
.tags-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.tags-toggle-btn.has-active {
  border-color: var(--gold);
  background: #fef3da;
  color: #8a5e0a;
}
.tags-chevron { transition: transform 0.15s; flex-shrink: 0; }
.tags-toggle-btn.open .tags-chevron { transform: rotate(180deg); }

.tags-panel {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 6px;
}
.tags-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tags-panel-hint { font-size: 11px; color: var(--text-muted); }
.tags-clear-btn {
  font-size: 11px;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}
.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-card);
  white-space: nowrap;
  transition: all 0.12s;
  font-family: var(--font-sans);
}
.tag-chip.active {
  background: #fef3da;
  border-color: var(--gold);
  color: #8a5e0a;
  font-weight: 500;
}
.tag-chip-count { font-size: 10px; opacity: 0.65; }

.active-tags-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.active-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #fef3da;
  color: #8a5e0a;
  border: 0.5px solid var(--gold);
}
.active-tag-pill button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: #8a5e0a;
  padding: 0;
  font-family: var(--font-sans);
}

/* ─── Discussion card ────────────────────────────────────────────────────── */
.discussion-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.discussion-card .post-header { padding: 12px 14px 8px; }
.discussion-card .disc-body { padding: 0 14px 10px; }
.discussion-card .disc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; margin-top: 10px; }
.disc-tag-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #fef3da;
  color: #8a5e0a;
  border: 0.5px solid var(--gold);
}
.discussion-card .disc-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 4px;
}
.discussion-card .post-footer { border-top: 0.5px solid var(--border); padding: 8px 14px; }

/* Modal nouvelle discussion */
.new-discussion-modal { max-width: 560px; }
.new-discussion-modal .form-group { margin-bottom: 14px; }
.new-discussion-modal label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.new-discussion-modal input,
.new-discussion-modal textarea,
.new-discussion-modal select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-primary);
}
.new-discussion-modal textarea { resize: vertical; min-height: 100px; }

/* ─── Bottom nav mobile ──────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  box-sizing: content-box; /* height = zone icônes uniquement; padding-bottom s'ajoute en dessous */
  height: 60px;
  background: #1a1a1a;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  z-index: 100;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); font-size: 10px;
  position: relative; padding: 6px 0;
  transition: color 0.15s;
}
.bottom-nav-item.active { color: #c9a96e; }
.bottom-nav-item svg { flex-shrink: 0; }
.bnav-badge {
  position: absolute; top: 4px; right: calc(50% - 16px);
  background: #e53e3e; color: #fff;
  font-size: 9px; font-weight: 600;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 900px) {
  .bottom-nav { display: flex; }
  .main-content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* Empêche le zoom auto iOS sur les champs de saisie (déclenché si font-size < 16px) */
  input, textarea, select { font-size: 16px !important; }
}

/* ─── Search bar ─────────────────────────────────────────────────────────── */
.search-bar-wrap { padding: 0 0 0.5rem; }
#search-results-badge { font-size: 12px; color: var(--text-muted); padding: 4px 2px 6px; min-height: 22px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--gold); }
.search-bar svg { flex-shrink: 0; color: var(--text-muted); }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 14px; color: var(--text-primary); min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
#search-clear-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; line-height: 1; padding: 0 2px;
}
#search-clear-btn:hover { color: var(--text-primary); }

/* ─── Liked posts (profil membre) ───────────────────────────────────────── */
.liked-posts-list { display:flex;flex-direction:column;gap:2px; }
.liked-post-item {
  display:flex;align-items:center;gap:10px;padding:8px 10px;
  border-radius:var(--radius);text-decoration:none;color:var(--text-primary);
  transition:background 0.15s;
}
.liked-post-item:hover { background:var(--bg-subtle); }
.liked-post-type { font-size:16px;flex-shrink:0; }
.liked-post-title { flex:1;font-size:13px;line-height:1.4; }
.liked-post-meta { font-size:12px;color:var(--text-muted);flex-shrink:0; }

/* ─── reCAPTCHA badge ────────────────────────────────────────────────────── */
.grecaptcha-badge { visibility: hidden !important; opacity: 0 !important; }
.grecaptcha-badge.visible { visibility: visible !important; opacity: 1 !important; }

/* ─── Fix responsive global ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; height: auto; }
.app-shell { max-width: 100%; overflow-x: hidden; }
.main-content { max-width: 100%; overflow-x: hidden; }
pre, code { white-space: pre-wrap; word-break: break-word; }
input, textarea, select { max-width: 100%; }
@media (max-width: 900px) {
  .site-header .header-inner { max-width: 100%; overflow: hidden; }
  .feed-switcher { max-width: 100%; }
  .filter-bar { max-width: 100%; flex-wrap: wrap; }
  .post-card, .discussion-card { max-width: 100%; overflow: hidden; }
  .soutenir-wrap { padding: 0 1rem 3rem; }
  .slider-wrap { max-width: 100%; }
}

/* ─── TEMP — masquage feed-switcher + chips type ─────────────────────── */
/* Réversible : supprimer ce bloc pour réactiver les filtres tels quels. */
/* Ajouté 2026-05-08 en prod (déjà fait sur staging le même jour). */
.feed-switcher,
.filter-bar .filter-row:not(.filter-row-controls) {
  display: none !important;
}

/* ─── TEMP — masquage feed-switcher + chips type ─────────────────────── */
/* Réversible : supprimer ce bloc pour réactiver les filtres tels quels. */
/* Ajouté 2026-05-08 en prod (déjà fait sur staging le même jour). */
.feed-switcher,
.filter-bar .filter-row:not(.filter-row-controls) {
  display: none !important;
}


/* ─── Avatar nudge banner ─────────────────────────────────────────────── */
.avatar-nudge {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(245,235,213,0.85) 0%, rgba(253,250,242,0.95) 100%);
  border: 1px solid rgba(183,138,78,0.28);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 1rem;
}
.avatar-nudge-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(183,138,78,0.15);
  border: 1px solid rgba(183,138,78,0.35);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); flex-shrink: 0;
}
.avatar-nudge-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.avatar-nudge-text strong { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.avatar-nudge-text span { font-size: 12px; color: var(--text-secondary); }
.avatar-nudge-cta {
  background: var(--gold); color: white;
  padding: 7px 14px; border-radius: 6px;
  font-size: 13px; text-decoration: none; font-weight: 500;
  transition: background 0.15s; flex-shrink: 0;
}
.avatar-nudge-cta:hover { background: var(--gold-light); color: white; }
.avatar-nudge-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-muted);
  padding: 0 4px; flex-shrink: 0;
}
.avatar-nudge-close:hover { color: var(--text-primary); }
@media (max-width: 600px) {
  .avatar-nudge { padding: 10px 12px; gap: 10px; }
  .avatar-nudge-icon { width: 32px; height: 32px; }
  .avatar-nudge-icon svg { width: 18px; height: 18px; }
  .avatar-nudge-text strong { font-size: 13px; }
  .avatar-nudge-text span { display: none; }
  .avatar-nudge-cta { padding: 6px 12px; font-size: 12px; }
}


/* ─── Feed lock badge (small pill in top-right of feed video thumbnails) ── */
.feed-lock-badge {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: rgba(20,18,14,0.78);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  color: rgba(240,235,227,0.95);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 100px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.feed-lock-badge svg { width: 11px; height: 11px; opacity: 0.9; }
@media (max-width: 600px) {
  .feed-lock-badge { top: 8px; right: 8px; padding: 4px 9px; font-size: 10px; gap: 4px; }
  .feed-lock-badge svg { width: 10px; height: 10px; }
}
