/* =====================================================================
   Voisin — petites annonces de quartier. DM Serif Display / Inter.
   Composition de gazette : filets, colonnes, annonces en lignes et non en
   cartes. Papier froid vert-de-gris ; le vert sapin est réservé aux actions.
   ===================================================================== */
:root {
  --bg: #f3f5f1; --surface: #ffffff; --surface-2: #e8ece6;
  --ink: #17211d; --muted: #56635c; --line: #d3dad2;
  --accent: #0b6e5a; --accent-ink: #ffffff; --danger: #b42318; --ok: #2f6b2a;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-text: 'Inter', system-ui, sans-serif;
  --radius: 10px; --radius-sm: 6px;
  --head-h: 64px;
}
body { font-size: 16px; }
.h2 { font-size: clamp(34px, 4vw, 52px); font-weight: 400; letter-spacing: -.01em; line-height: 1.02; }
.fine { font-size: 13px; color: var(--muted); }

/* ---------- En-tête ---------- */
.top { position: sticky; top: var(--demobar-h); z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 28px; height: var(--head-h); }
.logo { display: inline-flex; align-items: center; min-height: 44px; font: 400 30px/1 var(--font-display); text-decoration: none; letter-spacing: -.01em; }
.top__nav { display: flex; gap: 4px; }
.top__nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 14px; color: var(--muted); text-decoration: none; }
.top__nav a:hover { color: var(--ink); }
.top__post { margin-left: auto; min-height: 44px; font-size: 15px; }

/* ---------- Manchette ---------- */
.mast { padding: clamp(36px, 6vw, 72px) 0 0; }
.mast__in { display: grid; gap: 22px; padding-bottom: 34px; position: relative; }
.mast__in::before, .mast__in::after { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); background: var(--ink); }
.mast__in::before { bottom: 5px; height: 3px; }
.mast__in::after { bottom: 0; height: 1px; }
.mast__line { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.mast__t { font-size: clamp(44px, 7vw, 104px); font-weight: 400; line-height: .96; letter-spacing: -.02em; max-width: 13ch; }
.mast__t em { font-style: italic; }
.mast__foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 24px 64px; align-items: end; }
.mast__lede { color: var(--muted); max-width: 56ch; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search__input { padding-left: 44px; min-height: 52px; font-size: 16px; }
.search__input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Tableau des annonces ---------- */
.board { padding: 48px 0 clamp(72px, 9vw, 120px); }
.board__in { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.facets { position: sticky; top: calc(var(--demobar-h) + var(--head-h) + 24px); display: grid; gap: 32px; }
.facet__t { font: 600 12px/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.facet__list { display: grid; }
.fopt { position: relative; display: block; }
.fopt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.fopt span {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 10px 0 14px;
  border-left: 2px solid var(--line); font-size: 15px; color: var(--muted);
  transition: color var(--t-out), border-color var(--t-out), background-color var(--t-out);
}
.fopt em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 13px; }
.fopt input:hover + span { color: var(--ink); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.fopt input:checked + span { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }
.fopt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -2px; }
.fopt.is-zero span { opacity: .55; }
.fopt.is-zero input:checked + span { opacity: 1; }
.facets__reset { justify-self: start; padding-left: 0; font-size: 14px; }
.facets__reset[hidden] { display: none; }

.results { min-height: 720px; }
.results__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.results__t { font-size: clamp(26px, 2.6vw, 34px); font-weight: 400; }
.results__t small { font: 400 15px/1 var(--font-text); color: var(--muted); margin-left: 6px; }
.results__sort .select { min-height: 44px; padding-block: 8px; font-size: 14px; width: 170px; border-color: transparent; background-color: transparent; }
.results__sort .select:hover { border-color: var(--line); }

/* Une annonce = une ligne de gazette */
.ad { border-bottom: 1px solid var(--line); }
.ad__row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 20px; align-items: start; width: 100%;
  padding: 20px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.ad__row:hover .ad__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ad__thumb { display: block; width: 112px; height: 112px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.ad__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad__thumb--type { display: grid; place-items: center; font: italic 400 30px/1 var(--font-display); color: var(--muted); }
.ad__body { display: grid; gap: 6px; min-width: 0; }
.ad__kick { font-size: 13px; color: var(--muted); }
.ad__title { font: 400 clamp(21px, 1.9vw, 25px)/1.15 var(--font-display); }
.ad__desc { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60ch; }
.ad__price { font: 400 clamp(22px, 2vw, 28px)/1.1 var(--font-display); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ad__price small { display: block; font: 400 12px/1.4 var(--font-text); color: var(--muted); }
.ad__more { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; }
.ad__more .i { width: 16px; height: 16px; transition: transform var(--t-in) var(--ease-out); }
.ad.is-open .ad__more .i { transform: rotate(90deg); }
.ad__detail { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0 20px; padding: 0 0 24px; }
.ad__detail[hidden] { display: none; }
.ad__detail > div { grid-column: 2; display: grid; gap: 16px; max-width: 62ch; animation: open var(--t-in) var(--ease-out); }
@keyframes open { from { opacity: 0; translate: 0 -6px; } }
.ad__full { white-space: pre-line; }
.ad__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.ad__facts span { display: inline-flex; align-items: center; gap: 6px; }
.ad__facts .i { width: 16px; height: 16px; }
.interest { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 10px; }
.interest .field { flex: 1 1 200px; max-width: 260px; }
.interest .field label { font-size: 13px; }
.interest .btn { margin-top: 25px; }
.interest__ok { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* Vos annonces en attente : bord pointillé, statut explicite */
.mine { margin-top: 20px; padding: 6px 18px 4px; border: 1.5px dashed color-mix(in srgb, var(--ink) 35%, var(--line)); border-radius: var(--radius); background: var(--surface); }
.mine[hidden] { display: none; }
.mine__t { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 4px; font-size: 13px; color: var(--muted); }
.mine__t b { color: var(--ink); font-weight: 600; }
.mine .ad:last-child { border-bottom: 0; }
.mine .ad__row { cursor: default; }
.mine .ad__row:hover .ad__title { text-decoration: none; }
.status { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.status .i { width: 14px; height: 14px; }
.status--err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }

/* Chargement : la place est tenue par des lignes fantômes (R10, R27) */
.ad--skel .ad__row { cursor: default; }
.skel-line { display: block; height: 14px; }
.ad--skel .ad__thumb { animation: skel 1.4s ease-in-out infinite; }
.load-note { margin-top: 16px; }
.load-note .btn { min-height: 36px; padding: 0 6px; margin-left: 4px; font-size: 14px; }

.empty { display: grid; gap: 14px; justify-items: start; padding: 48px 0 32px; }
.empty[hidden] { display: none; }
.empty__t { font: 400 clamp(32px, 3.6vw, 48px)/1.05 var(--font-display); max-width: 18ch; }
.empty__txt { color: var(--muted); }
.empty__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* ---------- Déposer ---------- */
.post { padding: clamp(72px, 9vw, 120px) 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post__in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.post__side { display: grid; gap: 32px; position: sticky; top: calc(var(--demobar-h) + var(--head-h) + 32px); }
.howto { margin: 0; padding: 0; list-style: none; counter-reset: h; display: grid; gap: 22px; }
.howto li { counter-increment: h; display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; color: var(--muted); font-size: 15px; }
.howto li::before { content: counter(h); font: 400 40px/1 var(--font-display); color: var(--ink); }
.howto b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.howto a { text-underline-offset: 3px; }
.post__main { min-height: 720px; }
.post__main .form[hidden] { display: none; }
.legend { margin-bottom: 4px; }
.price { position: relative; }
.price .input { padding-right: 40px; font-variant-numeric: tabular-nums; }
.price__unit { position: absolute; right: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.price .input:disabled { background: var(--surface-2); color: var(--muted); }
.desc-help { display: flex; justify-content: space-between; gap: 12px; }
.desc-help span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.form__foot { display: grid; gap: 14px; margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.form__foot .btn { justify-self: start; }
.preview__t { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.preview { border-block: 1px dashed var(--line); }
.preview .ad { border: 0; }
.preview .ad__row { cursor: default; padding: 14px 0; }
.preview .ad__row:hover .ad__title { text-decoration: none; }
.preview .is-empty { color: var(--muted); }
.post__done { animation: open var(--t-in) var(--ease-out); }
.post__done:focus { outline: none; }
.done__mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); }
.done__mark .i { width: 24px; height: 24px; }
.done__act { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Charte ---------- */
.rules { padding: clamp(72px, 9vw, 120px) 0; }
.rules__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.rules__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.rules__h { font-size: 28px; font-weight: 400; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.rules__list { margin: 0; padding: 0; list-style: none; }
.rules__list li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }

/* ---------- Tablette, mobile ---------- */
@media (max-width: 960px) {
  .board__in { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .facets { position: static; gap: 10px; }
  .facet { display: grid; grid-template-columns: 1fr; }
  .facet__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .facet__list { display: flex; gap: 8px; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); scrollbar-width: none; }
  .facet__list::-webkit-scrollbar { display: none; }
  .fopt { flex: none; }
  .fopt span { border: 1.5px solid var(--line); border-radius: 999px; padding: 0 14px; gap: 8px; background: var(--surface); white-space: nowrap; }
  .fopt input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }
  .fopt input:hover + span { background: var(--surface); }
  .fopt input:checked:hover + span { background: var(--ink); }
  .post__in, .rules__in { grid-template-columns: 1fr; }
  .post__side { position: static; }
  .mast__foot { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --head-h: 56px; }
  .logo { font-size: 26px; }
  .mast { padding-top: 28px; }
  .mast__t { font-size: clamp(40px, 11.5vw, 52px); }
  .mast__lede { font-size: 15px; }
  .board { padding-top: 28px; }
  .results { min-height: 560px; }
  .results__t small { display: block; margin: 6px 0 0; }
  .results__sort .select { width: 150px; padding-right: 32px; }
  .ad__row { grid-template-columns: 84px minmax(0, 1fr); gap: 4px 14px; padding: 16px 0; }
  .ad__thumb { width: 84px; height: 84px; grid-row: span 2; }
  .ad__price { grid-column: 2; text-align: left; font-size: 21px; }
  .ad__price small { display: inline; margin-left: 6px; }
  .ad__desc { display: none; }
  .ad__title { font-size: 20px; }
  .ad__detail { grid-template-columns: 1fr; padding-bottom: 20px; }
  .ad__detail > div { grid-column: 1; }
  .rules__cols { grid-template-columns: 1fr; }
  .form__foot .btn { justify-self: stretch; }
  .mine { padding-inline: 14px; }
}
