:root {
  --brand: #1d4e89;
  --brand-dark: #143a66;
  --accent: #e8a33d;
  --ink: #1c2430;
  --muted: #5d6878;
  --line: #e2e6ec;
  --bg: #ffffff;
  --soft: #f5f7fa;
  --ok: #1f7a4d;
  --err: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: .3em 0 .4em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.05rem; margin: 0 0 .3em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 520px; }
.section { margin-top: 2.5rem; margin-bottom: 2.5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.ok-text { color: var(--ok); font-weight: 600; }
.error-text { color: var(--err); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Boutons */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: .7rem 1.2rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-small { padding: .45rem .9rem; font-size: .925rem; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-ghost:hover { background: var(--soft); color: var(--brand-dark); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.linkbtn.danger { color: var(--err); }

/* En-tête */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--brand) 0 60%, var(--accent) 60%); }
.main-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.main-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.main-nav a:not(.btn):hover { color: var(--brand); }

/* Messages */
.flashes { margin-top: 1rem; }
.flash { padding: .8rem 1rem; border-radius: 8px; margin: .75rem 0; background: var(--soft); border-left: 4px solid var(--brand); }
.flash ul { margin: 0; padding-left: 1.1rem; }
.flash-ok { background: #eaf6ef; border-color: var(--ok); }
.flash-error { background: #fdecea; border-color: var(--err); }

/* Accueil */
.hero { position: relative; color: #fff; padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7.5rem); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(10, 24, 44, .68) 0%, rgba(10, 24, 44, .45) 50%, rgba(10, 24, 44, .05) 85%), #23415f url(/assets/photo-quebec.jpg) 30% 40% / cover no-repeat; }
.hero h1 { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.hero .lead { color: #e6edf5; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.hero .hero-search { color: var(--ink); }
.photo-credit { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 8px; font-size: .7rem; color: rgba(255, 255, 255, .75); }
.photo-credit a { color: inherit; }
@media (max-width: 700px) { .hero { background: linear-gradient(180deg, rgba(10, 24, 44, .72), rgba(10, 24, 44, .5)), #23415f url(/assets/photo-quebec-960.jpg) 22% 40% / cover no-repeat; } }
.hero h1 { max-width: 40rem; }
.hero-search { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .5rem; margin-top: 1.25rem; background: #fff; padding: .5rem; border-radius: 12px; box-shadow: var(--shadow); max-width: 820px; }
.hero-search input, .hero-search select { border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; font: inherit; min-width: 0; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.region-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.region-card h3 a { text-decoration: none; }
.cta { position: relative; overflow: hidden; border-radius: var(--radius); padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; text-align: center; color: #fff;
  background: linear-gradient(0deg, rgba(10, 24, 44, .72), rgba(10, 24, 44, .45)), #4a2a2a url(/assets/photo-rue.jpg) center 55% / cover no-repeat; }
.cta h2 { color: #fff; }
.cta p { color: #f0f3f7; max-width: 38rem; margin-inline: auto; }
.cta .btn { background: #fff; color: var(--brand); }
.cta .btn:hover { background: #eef3f9; color: var(--brand-dark); }
.cta h2 { margin-top: 0; }

/* Puces */
.chips { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips a { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .925rem; background: #fff; }
.chips a:hover { border-color: var(--brand); color: var(--brand); }
.chips .count { background: var(--soft); border-radius: 999px; padding: 0 .45rem; font-size: .8rem; color: var(--muted); }
.chips-alt a { background: var(--soft); }
.chips-line { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips-line a { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.chips-line a.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Bandeau des pages de lieux */
.loc-band { position: relative; background: linear-gradient(180deg, #eef3f8, #f7f4ef); border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; margin-bottom: .5rem; overflow: hidden; }
.loc-band::after { content: ""; position: absolute; inset: auto 0 0 0; height: 100%; background: url(/assets/photo-quebec-960.jpg) right 45% / cover no-repeat; opacity: .28; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%); mask-image: linear-gradient(90deg, transparent 0, #000 45%); }
.loc-band .wrap { position: relative; z-index: 1; }
@media (max-width: 700px) { .loc-band::after { opacity: .12; } }

/* Fil d'Ariane */
.crumbs ol { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .3rem; color: #9aa3b0; }
.crumbs a { color: var(--muted); }

/* En-tête de page */
.page-head { margin-bottom: 1rem; }
.badge { display: inline-block; margin: 1rem 0 0; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.context { color: var(--muted); margin: 0; }
.intro { max-width: 48rem; margin-top: 1rem; }
.h-small { font-size: 1rem; margin: 1.2rem 0 .3rem; color: var(--muted); font-weight: 600; }

/* Filtres */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; align-items: end; background: var(--soft); padding: 1rem; border-radius: var(--radius); margin: 1.25rem 0; }
.filters label { min-width: 0; display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters .f-wide { grid-column: span 2; }
.filters input, .filters select { font: inherit; font-weight: 400; color: var(--ink); padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; width: 100%; }
.f-actions { display: flex; gap: .75rem; align-items: center; }
.link-reset { font-size: .9rem; }

/* Résultats */
.results-title { font-size: 1.15rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card-link { color: inherit; text-decoration: none; display: block; }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; height: 100%; color: #9aa3b0; font-size: .9rem; }
.card-price { position: absolute; left: .6rem; bottom: .6rem; background: rgba(255, 255, 255, .95); padding: .2rem .55rem; border-radius: 6px; font-weight: 700; }
.card-price small { font-weight: 500; color: var(--muted); }
.card-body { padding: .8rem .9rem 1rem; }
.card-title { margin: 0; }
.card-loc { margin: .15rem 0; color: var(--muted); font-size: .925rem; }
.card-meta { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .15rem .75rem; font-size: .85rem; color: var(--muted); }
.card-meta span { white-space: nowrap; }
.empty { background: var(--soft); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.empty p { margin: .3rem 0; }
.pager { display: flex; gap: .35rem; flex-wrap: wrap; margin: 1.5rem 0; }
.pager a, .pager span { padding: .4rem .75rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.stats-table { border-collapse: collapse; min-width: 300px; }
.stats-table th, .stats-table td { text-align: left; padding: .45rem 1rem .45rem 0; border-bottom: 1px solid var(--line); }
.nearby { margin-top: 2.5rem; padding-top: .5rem; border-top: 2px dashed var(--line); }
.nearby h2 { margin-top: 1.25rem; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 2rem 0 3rem; }

/* Annonce */
.listing-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin-top: .5rem; }
.headline { font-size: 1.1rem; margin: 0 0 .3rem; }
.price-box { display: grid; text-align: right; }
.price { font-size: 1.8rem; font-weight: 800; }
.per { color: var(--muted); font-size: .9rem; }
.avail { margin-top: .3rem; font-weight: 600; color: var(--ok); }
.gallery { margin: 1.25rem 0; }
.gallery-main { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--soft); aspect-ratio: 3 / 2; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .5rem 0; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 6px; overflow: hidden; cursor: pointer; flex: 0 0 auto; background: none; }
.thumbs button.on { border-color: var(--brand); }
.thumbs img { width: 120px; height: 90px; object-fit: cover; }
.listing-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem 1.5rem; margin: 0; }
.facts dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.facts dd { margin: 0; font-weight: 600; }
.amenities { columns: 2; padding-left: 1.1rem; }
.description { max-width: 46rem; }
.contact-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; position: sticky; top: 80px; }
.contact-box h2 { margin-top: 0; font-size: 1.15rem; }
.phone a { font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.hp { position: absolute; left: -5000px; }

/* Formulaires */
.stack { display: grid; gap: .85rem; }
.stack label, .listing-form label { display: grid; gap: .3rem; font-weight: 600; font-size: .925rem; }
.card-pad { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
input, select, textarea { font: inherit; }
.stack input:not([type=checkbox]), .stack textarea, .listing-form input:not([type=checkbox]):not([type=file]), .listing-form select, .listing-form textarea { padding: .6rem .7rem; border: 1px solid #cfd6df; border-radius: 8px; font-weight: 400; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
label.check { display: flex !important; gap: .5rem; align-items: flex-start; font-weight: 400 !important; }
label.check input { margin-top: .3rem; }
.listing-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin: 0 0 1.25rem; display: grid; gap: .9rem; }
.listing-form legend { font-weight: 700; padding: 0 .4rem; }
.listing-form small { font-weight: 400; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .4rem 1rem; }
.form-page { max-width: 900px; }
.input-small { max-width: 200px; }
.multi { min-height: 14rem; }
.photo-admin { display: flex; flex-wrap: wrap; gap: .75rem; }
.photo-item { position: relative; width: 160px; }
.photo-item img { width: 160px; height: 120px; object-fit: cover; border-radius: 6px; }
.photo-item .tag { position: absolute; top: .3rem; left: .3rem; background: var(--brand); color: #fff; font-size: .75rem; padding: .1rem .4rem; border-radius: 4px; }
.photo-actions { display: flex; justify-content: space-between; font-size: .85rem; padding-top: .25rem; }

/* Tableaux / admin */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table .actions form { display: inline-flex; gap: .75rem; margin-left: .75rem; }
.tree-table tr.inactive td { opacity: .5; }
.status { font-size: .8rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.status-published { background: #eaf6ef; color: var(--ok); }
.status-pending { background: #fff5e0; color: #8a5a00; }
.status-rejected { background: #fdecea; color: var(--err); }
.admin-nav { display: flex; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .75rem; margin-bottom: 1.5rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--muted); font-size: .9rem; }
.kpi span { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.moderate { display: inline-flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.moderate input { padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 6px; }
.seo-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.seo-preview p { margin: .15rem 0; }
.sp-url { color: #1a7f37; font-size: .875rem; }
.sp-title { color: #1a0dab; font-size: 1.15rem; }
.sp-desc { color: #4d5156; font-size: .925rem; }
.message { margin-bottom: 1rem; }
.directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.tree ul { list-style: none; padding-left: 1rem; margin: .2rem 0; border-left: 1px solid var(--line); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: .2rem 0; }

/* Pied de page */
.site-footer { background: #0f1e33; color: #c9d3e0; margin-top: 4rem; padding: 2.5rem 0 1.5rem; font-size: .9rem; }
.site-footer a { color: #c9d3e0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; columns: 2; }
.footer-grid li { margin: .15rem 0; break-inside: avoid; }
.footer-grid li.sub { padding-left: .6rem; font-size: .85rem; }
.footer-title { font-size: 1rem; margin: 0 0 .6rem; }
.footer-title a { color: #fff; }
.footer-bottom { display: flex; gap: 1.25rem; flex-wrap: wrap; border-top: 1px solid #243651; margin-top: 2rem; padding-top: 1rem; }

@media (max-width: 860px) {
  .listing-body { grid-template-columns: 1fr; }
  .contact-box { position: static; }
  .hero-search { grid-template-columns: 1fr 1fr; }
  .hero-search input[type=search] { grid-column: 1 / -1; }
  .price-box { text-align: left; }
}
@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .f-wide { grid-column: 1 / -1; }
  .amenities { columns: 1; }
  .main-nav { gap: .75rem; font-size: .925rem; }
  .footer-grid ul { columns: 1; }
}
