/* Bara.ci — navigation partagée (header public, barre latérale admin, colonne d'annonces) */

:root {
  --bn-green: #007A4D;
  --bn-green-hover: #006E45;
  --bn-green-text: #007549;
  --bn-green-bright: #4FD19A;
  --bn-tint: #E8F6F0;
  --bn-tint-border: #BFE3D2;
  --bn-hover: #F4FAF7;
  --bn-ink: #0F1D16;
  --bn-body: #16241D;
  --bn-nav: #3D4A43;
  --bn-muted: #5A675F;
  --bn-faint: #7A8B81;
  --bn-border: #E9EDEA;
  --bn-danger: #C0391A;
  --bn-dark: #0F1D16;
  --bn-dark-deep: #0B1F18;
  --bn-dark-text: #C7D4CD;
  --bn-dark-muted: #8FA39A;
  --bn-ease: cubic-bezier(.16, 1, .3, 1);
  --bn-side-w: 256px;
}

.bn-header, .bn-drawer, .bn-side, .bn-adminbar, .bn-rail {
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bn-header *, .bn-drawer *, .bn-side *, .bn-adminbar *, .bn-rail * { box-sizing: border-box; }
.bn-svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bn-header a:focus-visible, .bn-header button:focus-visible,
.bn-drawer a:focus-visible, .bn-drawer button:focus-visible,
.bn-rail a:focus-visible {
  outline: 2px solid var(--bn-green);
  outline-offset: 2px;
}
.bn-side a:focus-visible, .bn-side button:focus-visible,
.bn-adminbar button:focus-visible {
  outline: 2px solid var(--bn-green-bright);
  outline-offset: 2px;
}

/* ─── Logo ─────────────────────────────────────────────────────────────── */
.bn-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; border-radius: 12px; }
.bn-logo-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--bn-green); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }
.bn-logo-mark .bn-svg { width: 20px; height: 20px; }
.bn-logo-word { font-family: 'Poppins', 'DM Sans', sans-serif; font-weight: 700; font-size: 21px; color: #142019; letter-spacing: -.02em; }
.bn-logo-word span { color: var(--bn-green-hover); }

/* ─── Header public ────────────────────────────────────────────────────── */
.bn-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--bn-border);
}
.bn-bar { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 8px; }

.bn-menu { display: flex; align-items: center; gap: 2px; margin: 0 0 0 28px; padding: 0; list-style: none; }
.bn-item { position: relative; }

.bn-trigger, .bn-link {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 15px/1 'DM Sans', system-ui, sans-serif; color: var(--bn-nav); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.bn-trigger:hover, .bn-link:hover, .bn-trigger[aria-expanded="true"] { background: var(--bn-hover); color: var(--bn-ink); }
.bn-trigger.is-current, .bn-link.is-current { color: var(--bn-green-text); font-weight: 600; }
.bn-trigger.is-current::after, .bn-link.is-current::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; border-radius: 2px; background: var(--bn-green);
}
.bn-chev { width: 15px; height: 15px; transition: transform .22s var(--bn-ease); opacity: .7; }
[aria-expanded="true"] > .bn-chev { transform: rotate(180deg); }

/* Panneau déroulant */
.bn-panel {
  position: absolute; top: calc(100% + 8px); left: -8px; min-width: 330px;
  background: #fff; border: 1px solid var(--bn-border); border-radius: 16px; padding: 8px;
  box-shadow: 0 22px 44px -14px rgba(16, 40, 30, .24), 0 3px 8px rgba(16, 40, 30, .05);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease-out, transform .24s var(--bn-ease), visibility 0s linear .24s;
  z-index: 5;
}
.bn-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.bn-panel.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.bn-panel--right { left: auto; right: 0; min-width: 280px; }

.bn-entry {
  display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 11px; text-decoration: none; color: var(--bn-ink);
  transition: background .14s;
}
.bn-entry:hover, .bn-entry:focus-visible { background: var(--bn-hover); }
.bn-entry.is-current { background: var(--bn-tint); }
.bn-entry-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--bn-tint); color: var(--bn-green-hover); display: grid; place-items: center; transition: background .14s, color .14s; }
.bn-entry:hover .bn-entry-ico { background: var(--bn-green); color: #fff; }
.bn-entry-t { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.3; color: var(--bn-ink); }
.bn-entry-d { display: block; font-size: 13px; line-height: 1.4; color: var(--bn-muted); margin-top: 2px; }

/* Actions à droite */
.bn-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bn-btn {
  height: 42px; padding: 0 18px; border-radius: 11px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font: 600 14.5px/1 'DM Sans', system-ui, sans-serif; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.bn-btn:active { transform: translateY(1px); }
.bn-btn .bn-svg { width: 16px; height: 16px; }
.bn-btn--primary { background: var(--bn-green); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }
.bn-btn--primary:hover { background: var(--bn-green-hover); }
.bn-btn--dark { background: var(--bn-dark); color: #fff; }
.bn-btn--dark:hover { background: #1E3525; }
.bn-btn--ghost { background: none; color: var(--bn-body); padding: 0 12px; }
.bn-btn--ghost:hover { background: var(--bn-hover); }

.bn-iconbtn {
  width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--bn-border); background: #fff; color: var(--bn-nav);
  display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; position: relative;
  transition: border-color .15s, color .15s, background .15s;
}
.bn-iconbtn:hover { border-color: var(--bn-tint-border); color: var(--bn-green-text); background: var(--bn-hover); }
.bn-iconbtn.is-current { color: var(--bn-green-text); border-color: var(--bn-tint-border); background: var(--bn-tint); }

.bn-user {
  height: 42px; padding: 0 10px 0 5px; border-radius: 999px; border: 1px solid var(--bn-border); background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 'DM Sans', system-ui, sans-serif; color: var(--bn-body);
  transition: border-color .15s, background .15s;
}
.bn-user:hover, .bn-user[aria-expanded="true"] { border-color: var(--bn-tint-border); background: var(--bn-hover); }
.bn-user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bn-tint); color: var(--bn-green-text);
  display: inline-grid; place-items: center; flex-shrink: 0;
  font: 700 13px/1 'Poppins', 'DM Sans', sans-serif; border: 1.5px solid var(--bn-tint-border);
}

.bn-usercard { display: flex; align-items: center; gap: 12px; padding: 10px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--bn-border); }
.bn-usercard .bn-avatar { width: 40px; height: 40px; font-size: 15px; }
.bn-usercard-name { font-weight: 700; font-size: 15px; color: var(--bn-ink); line-height: 1.25; }
.bn-usercard-role { font-size: 13px; color: var(--bn-muted); margin-top: 2px; }

.bn-row {
  display: flex; align-items: center; gap: 11px; padding: 0 12px; height: 42px; border-radius: 10px; width: 100%;
  font: 500 14.5px/1 'DM Sans', system-ui, sans-serif; color: var(--bn-body); text-decoration: none;
  background: none; border: 0; cursor: pointer; text-align: left; transition: background .14s, color .14s;
}
.bn-row .bn-svg { color: var(--bn-faint); transition: color .14s; }
.bn-row:hover, .bn-row:focus-visible { background: var(--bn-hover); }
.bn-row:hover .bn-svg { color: var(--bn-green-text); }
.bn-row.is-current { color: var(--bn-green-text); font-weight: 600; background: var(--bn-tint); }
.bn-row.is-current .bn-svg { color: var(--bn-green-text); }
.bn-row--danger { color: var(--bn-danger); }
.bn-row--danger .bn-svg, .bn-row--danger:hover .bn-svg { color: var(--bn-danger); }
.bn-row--danger:hover { background: #FFF0EB; }
.bn-sep { height: 1px; background: var(--bn-border); margin: 6px 4px; }

.bn-burger { display: none; }

/* ─── Tiroir mobile ────────────────────────────────────────────────────── */
.bn-scrim {
  position: fixed; inset: 0; z-index: 95; background: rgba(11, 31, 24, .44);
  opacity: 0; visibility: hidden; transition: opacity .24s ease-out, visibility 0s linear .24s;
}
.bn-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 96; width: min(390px, 90vw);
  background: #fff; display: flex; flex-direction: column;
  transform: translateX(104%); visibility: hidden;
  transition: transform .34s var(--bn-ease), visibility 0s linear .34s;
  box-shadow: -24px 0 48px -24px rgba(11, 31, 24, .35);
  overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bn-is-open .bn-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
.bn-is-open .bn-drawer { transform: none; visibility: visible; transition: transform .34s var(--bn-ease), visibility 0s; }
.bn-lock { overflow: hidden; }

.bn-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px 20px; height: 64px; border-bottom: 1px solid var(--bn-border); flex-shrink: 0; }
.bn-drawer-body { padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 22px; }
.bn-drawer-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bn-drawer-auth .bn-btn { justify-content: center; width: 100%; }
.bn-drawer-auth .bn-btn--ghost { border: 1.5px solid var(--bn-border); }
.bn-drawer .bn-usercard { border: 1px solid var(--bn-border); border-radius: 14px; padding: 12px 14px; margin: 0; background: var(--bn-hover); }

.bn-dgroup-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--bn-muted); margin: 0 4px 10px; }
.bn-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bn-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 74px; padding: 12px 14px;
  border: 1px solid var(--bn-border); border-radius: 14px; text-decoration: none; color: var(--bn-ink);
  font-weight: 600; font-size: 14.5px; line-height: 1.25; transition: border-color .15s, background .15s;
}
.bn-tile .bn-svg { width: 20px; height: 20px; color: var(--bn-green-hover); }
.bn-tile:hover, .bn-tile:active { border-color: var(--bn-tint-border); background: var(--bn-hover); }
.bn-tile.is-current { border-color: var(--bn-green); background: var(--bn-tint); color: var(--bn-green-text); }
.bn-list { display: flex; flex-direction: column; gap: 2px; }
.bn-list .bn-row { height: 44px; }

/* ─── Responsive header public ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .bn-cta-role { display: none; }
  .bn-menu { margin-left: 12px; }
}
@media (max-width: 960px) {
  .bn-menu, .bn-user, .bn-signin { display: none; }
  .bn-burger { display: inline-grid; }
  .bn-bar { padding: 0 16px; }
}
@media (max-width: 400px) {
  .bn-signup { display: none; }
  .bn-logo-word { font-size: 19px; }
}

/* ─── Administration : barre latérale ─────────────────────────────────── */
body.bn-admin { padding-left: var(--bn-side-w); }

.bn-side {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: var(--bn-side-w);
  background: var(--bn-dark); color: var(--bn-dark-text);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.bn-side-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px; height: 60px; flex-shrink: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.bn-side-head .bn-logo-word { color: #fff; font-size: 19px; }
.bn-side-head .bn-logo-word span { color: var(--bn-green-bright); }
.bn-side-head .bn-logo-mark { width: 32px; height: 32px; border-radius: 10px; box-shadow: none; }
.bn-side-head .bn-logo-mark .bn-svg { width: 17px; height: 17px; }
.bn-side-site {
  margin-left: auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--bn-dark-muted); text-decoration: none; transition: background .15s, color .15s;
}
.bn-side-site:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.bn-side-site .bn-svg { width: 17px; height: 17px; }

.bn-side-user { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); flex-shrink: 0; }
.bn-side-user .bn-avatar { width: 30px; height: 30px; font-size: 12px; background: rgba(79, 209, 154, .14); color: var(--bn-green-bright); border-color: rgba(79, 209, 154, .3); }
.bn-side-user-txt { min-width: 0; flex: 1; }
.bn-side-user-name { display: block; font-size: 13.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-side-user-role { display: block; font-size: 12px; color: var(--bn-dark-muted); margin-top: 1px; }
.bn-side-out {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--bn-dark-muted);
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.bn-side-out:hover { background: rgba(255, 107, 53, .14); color: #FF9A73; }
.bn-side-out .bn-svg { width: 16px; height: 16px; }

.bn-side-nav { flex: 1; overflow-y: auto; padding: 12px 10px 16px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.bn-side-group-title { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--bn-dark-muted); padding: 0 10px; margin: 0 0 4px; }
.bn-side-list { display: flex; flex-direction: column; gap: 1px; }
.bn-side-link {
  position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--bn-dark-text); text-decoration: none;
  transition: background .14s, color .14s;
}
.bn-side-link .bn-svg { width: 17px; height: 17px; color: var(--bn-dark-muted); transition: color .14s; }
.bn-side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.bn-side-link:hover .bn-svg { color: #fff; }
.bn-side-link.is-current { background: rgba(0, 168, 107, .16); color: #fff; font-weight: 600; }
.bn-side-link.is-current .bn-svg { color: var(--bn-green-bright); }

@media (max-height: 760px) {
  .bn-side-nav { gap: 9px; padding-top: 8px; }
  .bn-side-link { height: 32px; font-size: 13.5px; }
  .bn-side-group-title { margin-bottom: 2px; }
  .bn-side-user { padding-top: 9px; padding-bottom: 9px; }
}

/* Barre admin mobile */
.bn-adminbar { display: none; }

@media (max-width: 1023px) {
  body.bn-admin { padding-left: 0; }
  .bn-adminbar {
    position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px;
    background: var(--bn-dark); color: #fff;
  }
  .bn-adminbar .bn-logo-word { color: #fff; font-size: 18px; }
  .bn-adminbar .bn-logo-word span { color: var(--bn-green-bright); }
  .bn-adminbar-title { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--bn-dark-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bn-adminbar-burger { width: 42px; height: 42px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .07); color: #fff; display: grid; place-items: center; cursor: pointer; }
  .bn-side { transform: translateX(-104%); visibility: hidden; transition: transform .32s var(--bn-ease), visibility 0s linear .32s; z-index: 96; width: min(290px, 86vw); box-shadow: 24px 0 48px -24px rgba(0, 0, 0, .5); }
  .bn-is-open .bn-side { transform: none; visibility: visible; transition: transform .32s var(--bn-ease), visibility 0s; }
}

/* ─── Colonne d'annonces ───────────────────────────────────────────────── */
.bn-with-rail { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 36px; }
.bn-with-rail > main { max-width: none !important; margin: 0 !important; padding-left: 0 !important; padding-right: 0 !important; min-width: 0; }
.bn-with-rail > .bn-rail { padding-bottom: 48px; }

@media (min-width: 1180px) {
  .bn-with-rail { grid-template-columns: minmax(0, 1fr) 296px; }
  .bn-with-rail > .bn-rail { padding-top: 40px; }
  .bn-with-rail > .bn-rail .bn-rail-inner { position: sticky; top: 84px; }
}

.bn-rail-inner { display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 640px) and (max-width: 1179px) {
  .bn-with-rail > .bn-rail .bn-rail-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; align-items: start; }
}
.bn-rail--compact .bn-rail-inner { margin-top: 28px; }

.bn-rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.bn-rail-title { font-family: 'Poppins', 'DM Sans', sans-serif; font-size: 16px; font-weight: 700; color: var(--bn-ink); margin: 0; letter-spacing: -.01em; }
.bn-rail-more { font-size: 13px; font-weight: 600; color: var(--bn-green-text); text-decoration: none; white-space: nowrap; }
.bn-rail-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.bn-sponso { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bn-muted); }

.bn-ads { display: flex; flex-direction: column; gap: 12px; }
.bn-ad { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid #EAEFEC; border-radius: 16px; overflow: hidden; transition: border-color .15s, box-shadow .2s, transform .2s var(--bn-ease); }
.bn-ad:hover { border-color: var(--bn-tint-border); box-shadow: 0 12px 26px -12px rgba(16, 40, 30, .22); transform: translateY(-2px); }
.bn-ad-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bn-tint); }
.bn-ad-body { padding: 13px 15px 14px; }
.bn-ad-type { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-bottom: 8px; }
.bn-ad-t { font-family: 'Poppins', 'DM Sans', sans-serif; font-weight: 700; font-size: 14.5px; line-height: 1.35; color: var(--bn-ink); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bn-ad-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--bn-muted); margin-top: 6px; }

.bn-feat { display: flex; flex-direction: column; border: 1px solid #EAEFEC; border-radius: 16px; background: #fff; overflow: hidden; }
.bn-feat a { display: block; padding: 12px 15px; text-decoration: none; color: inherit; border-top: 1px solid #EEF2F0; transition: background .14s; }
.bn-feat a:first-child { border-top: 0; }
.bn-feat a:hover { background: var(--bn-hover); }
.bn-feat-t { font-weight: 700; font-size: 14px; line-height: 1.35; color: var(--bn-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bn-feat-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--bn-muted); }
.bn-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }

.bn-promo { background: var(--bn-dark-deep); border-radius: 18px; padding: 20px; color: var(--bn-dark-text); position: relative; overflow: hidden; }
.bn-promo::after { content: ''; position: absolute; right: -46px; top: -46px; width: 140px; height: 140px; border-radius: 50%; border: 26px solid rgba(0, 168, 107, .16); pointer-events: none; }
.bn-promo-t { font-family: 'Poppins', 'DM Sans', sans-serif; font-weight: 700; font-size: 17px; line-height: 1.25; color: #fff; margin: 0 0 8px; position: relative; text-wrap: balance; }
.bn-promo-d { font-size: 13.5px; line-height: 1.55; color: #A8C4B5; margin: 0 0 16px; position: relative; }
.bn-promo .bn-btn { height: 40px; font-size: 14px; position: relative; }

.bn-skel { border-radius: 16px; background: linear-gradient(90deg, #F0F4F2 0%, #F7FAF8 50%, #F0F4F2 100%); background-size: 200% 100%; animation: bnShimmer 1.4s ease-in-out infinite; }
@keyframes bnShimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .bn-panel, .bn-drawer, .bn-side, .bn-scrim, .bn-chev, .bn-ad { transition: none !important; }
  .bn-skel { animation: none; }
}

@media print {
  .bn-header, .bn-side, .bn-adminbar, .bn-drawer, .bn-scrim, .bn-rail { display: none !important; }
  body.bn-admin { padding-left: 0; }
}
