/* Pages publiques Thymeleaf (annuaire, session 9). CSP : aucun style inline. Palette « Terre et Lagune » (session 8),
   miroir de design-tokens.scss ; thème 3 états : système (prefers-color-scheme), puis [data-theme] posé par
   site-theme.js depuis la préférence enregistrée par l'application Angular. Polices système, aucune police web. */
:root {
  color-scheme: light dark;
  --bg: #fbf7f2; --surface: #ffffff; --surface-2: #f4ede5; --surface-3: #e6dacd;
  --ink: #1f1a17; --ink-2: #5e534c; --outline: #dccfc3; --outline-strong: #8a7b70;
  --primary: #a8401a; --on-primary: #ffffff; --primary-container: #ffdbcb; --on-primary-container: #3d1606;
  --link: #1b4f72; --success: #2e7d4f; --error: #8c1d18; --warning: #8a5a00; --warning-container: #fbebc4;
  --header-bg: #a8401a; --header-fg: #ffffff; --brand-mark: #ffdbcb;
  --whatsapp: #25d366; --on-whatsapp: #062e16;
  --star: #c98a00;
  --radius: 12px; --pill: 999px; --wrap: 1100px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171311; --surface: #211c19; --surface-2: #2a2421; --surface-3: #3d3531;
    --ink: #f1ebe6; --ink-2: #bfb3aa; --outline: #3f3733; --outline-strong: #8a7b70;
    --primary: #f2a27e; --on-primary: #3d1606; --primary-container: #7a2e10; --on-primary-container: #ffdbcb;
    --link: #8fc1e3; --success: #8fd3a9; --error: #f2b8b5; --warning: #e6c46a; --warning-container: #4a3a10;
    --header-bg: #211c19; --header-fg: #f1ebe6; --brand-mark: #f2a27e;
    --star: #f0c24b;
  }
}
:root[data-theme="dark"] {
  --bg: #171311; --surface: #211c19; --surface-2: #2a2421; --surface-3: #3d3531;
  --ink: #f1ebe6; --ink-2: #bfb3aa; --outline: #3f3733; --outline-strong: #8a7b70;
  --primary: #f2a27e; --on-primary: #3d1606; --primary-container: #7a2e10; --on-primary-container: #ffdbcb;
  --link: #8fc1e3; --success: #8fd3a9; --error: #f2b8b5; --warning: #e6c46a; --warning-container: #4a3a10;
  --header-bg: #211c19; --header-fg: #f1ebe6; --brand-mark: #f2a27e;
  --star: #f0c24b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 15px; }
a { color: var(--link); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; vertical-align: middle; }
.ic.big { width: 56px; height: 56px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 16px; }
main.wrap { display: grid; gap: 22px; }
.t { font-size: 17px; margin-bottom: 10px; }

/* En-tête */
.hdr { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--header-bg); color: var(--header-fg); min-height: 52px; }
.hdr .brand { font-weight: 800; font-size: 20px; letter-spacing: -.01em; text-decoration: none; color: inherit; }
.hdr .brand b { color: var(--brand-mark); }
.hdr .sp { flex: 1; }
.hdr .pro { color: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.hdr-nav { display: none; gap: 18px; font-size: 14px; margin-left: 12px; }
.hdr-nav a { color: inherit; text-decoration: none; }

/* Accueil */
.hero { padding: 22px 16px 20px; background: var(--header-bg); color: var(--header-fg); }
.hero .wrap { padding: 0; }
.hero h1 { font-size: 24px; margin-bottom: 6px; }
.hero p { margin: 0 0 14px; opacity: .92; font-size: 14px; }
.hero .btn.ghost { background: rgba(255, 255, 255, .14); color: var(--header-fg); border-color: rgba(255, 255, 255, .55); }
:root[data-theme="dark"] .hero .btn.ghost { background: var(--surface-2); border-color: var(--outline-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .btn.ghost { background: var(--surface-2); border-color: var(--outline-strong); } }

/* Recherche */
.search-form { display: grid; gap: 10px; }
.field { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: var(--pill); background: var(--surface); color: var(--ink); border: 1.5px solid var(--outline-strong); }
.field .ic { color: var(--ink-2); }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 15px; outline: none; }
.field input::placeholder { color: var(--ink-2); }
.field:focus-within { outline: 3px solid var(--primary-container); outline-offset: 1px; }
.search-form--compact .btn.ghost { display: none; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--pill); background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none; font: inherit; font-weight: 700; border: 0; cursor: pointer; }
.btn:focus-visible, .chip:focus-visible, .card:focus-visible, a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.btn.block { width: 100%; }
.btn.outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--outline-strong); }
.btn.wa { background: var(--whatsapp); color: var(--on-whatsapp); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.cta { min-height: 50px; font-size: 16px; }
.btn .ic { width: 20px; height: 20px; }

/* Secteurs */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cats a { display: grid; place-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--radius); background: var(--surface-2); font-size: 12px; text-align: center; min-height: 76px; color: var(--ink); text-decoration: none; line-height: 1.2; }
.cats .ic { color: var(--primary); width: 26px; height: 26px; }

/* Cartes */
.cards { display: grid; gap: 12px; }
.card { display: grid; grid-template-columns: 96px 1fr; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; }
.card .ph { min-height: 112px; display: grid; place-items: center; color: #fff; background: var(--ph, #7a4f3a); }
.card .ph .ic { width: 34px; height: 34px; opacity: .85; }
.card .ph--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px; display: grid; gap: 3px; align-content: start; }
.card .name { font-size: 15.5px; font-weight: 700; }
.card .meta { font-size: 13px; color: var(--ink-2); }
.card .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.card .line .meta { white-space: nowrap; }
[data-ph="coiffure"] { --ph: #7a4f3a; } [data-ph="auto-moto"] { --ph: #3b4a5a; } [data-ph="beaute-ongles"] { --ph: #8c4f6e; }
[data-ph="sante-non-medicale"], [data-ph="bien-etre-massage"] { --ph: #3f6b5a; } [data-ph="sport-fitness"] { --ph: #4a5a3b; }
[data-ph="formation-cours"], [data-ph="administratif-conseil"] { --ph: #4a4a6b; } [data-ph="restauration-traiteur"] { --ph: #8a5a2a; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); width: fit-content; }
.badge.open { color: var(--success); font-weight: 600; background: transparent; padding: 0; }
.badge.slot { color: var(--link); font-weight: 600; background: transparent; padding: 0; }
.price { color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.quote { color: var(--ink-2); font-weight: 600; }
.price-lg { font-size: 22px; }

/* Résultats */
.crumbs { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--link); text-decoration: none; }
.results-head { display: grid; gap: 6px; }
.results-head h1 { font-size: 20px; }
.results-head .sub, .intro { font-size: 14px; color: var(--ink-2); margin: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--pill); border: 1.5px solid var(--outline-strong); background: var(--surface); font-size: 13.5px; color: var(--ink); white-space: nowrap; text-decoration: none; }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: transparent; font-weight: 700; }
.chip .ic { width: 18px; height: 18px; }
.results { display: grid; gap: 22px; }
.results-main { display: grid; gap: 22px; }
.filters { display: none; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 16px; gap: 12px; font-size: 14px; align-content: start; }
.filters h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-top: 4px; }
.filters label { display: flex; align-items: center; gap: 8px; }
.filters .select-label { flex-direction: column; align-items: flex-start; gap: 4px; }
.filters select { font: inherit; padding: 8px; border-radius: 8px; border: 1.5px solid var(--outline-strong); background: var(--surface); color: var(--ink); max-width: 100%; }
.subzones { display: flex; flex-wrap: wrap; gap: 8px; }
.subzones a { font-size: 13px; padding: 6px 12px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.subzones small { color: var(--ink-2); }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.pager a { padding: 8px 14px; border-radius: var(--pill); border: 1.5px solid var(--outline-strong); color: var(--ink); text-decoration: none; }
.pager a.on { background: var(--primary); color: var(--on-primary); border-color: transparent; font-weight: 700; }
.empty { text-align: center; padding: 28px 16px; display: grid; gap: 10px; justify-items: center; color: var(--ink-2); }
.empty .ic.big { color: var(--outline-strong); }
.empty h2 { color: var(--ink); font-size: 18px; }
.empty p { margin: 0; max-width: 40ch; }
.pro-foot { padding: 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 13.5px; text-align: center; }
.pro-foot a { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Fiche */
.fiche { display: grid; gap: 22px; padding-bottom: 96px; }
.fiche-main { display: grid; gap: 22px; }
.cover { height: 200px; position: relative; color: #fff; display: grid; place-items: center; background: var(--ph, #7a4f3a); border-radius: var(--radius); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .ic.big { opacity: .85; }
.cover .cnt { position: absolute; right: 12px; bottom: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: var(--pill); display: inline-flex; gap: 4px; align-items: center; }
.cover .cnt .ic { width: 16px; height: 16px; }
.ident h1 { font-size: 22px; }
.ident .kind { color: var(--ink-2); font-size: 14px; margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ident .slot { margin: 0 0 8px; }
.addr { display: flex; gap: 8px; font-size: 14px; color: var(--ink-2); align-items: flex-start; font-style: normal; margin: 0; }
.addr .ic { color: var(--ink); }
.addr b { color: var(--ink); }
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.acts .btn { padding: 0 6px; font-size: 13.5px; }
.acts--column { grid-template-columns: 1fr; margin: 0; }
.svc { list-style: none; margin: 0; padding: 0; }
.svc li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--outline); }
.svc li.svc-cat { display: block; padding: 14px 0 2px; border: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.svc b { display: block; font-size: 15px; font-weight: 600; }
.svc small { color: var(--ink-2); font-size: 12.5px; }
.more-details summary { list-style: none; cursor: pointer; }
.more-details summary::-webkit-details-marker { display: none; }
.more { display: block; padding: 10px 0; color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.more-details[open] .more { display: none; }
.team { display: flex; gap: 14px; flex-wrap: wrap; }
.team div { display: grid; place-items: center; gap: 4px; font-size: 12.5px; text-align: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--primary-container); color: var(--on-primary-container); }
.hours { font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 5px 18px; margin: 0; }
.hours dd { margin: 0; }
.hours .off { color: var(--ink-2); }
.hours .today { font-weight: 700; }
.info { display: grid; gap: 8px; font-size: 14px; }
.info div { display: flex; gap: 8px; align-items: flex-start; }
.info .ic { color: var(--link); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery img { aspect-ratio: 1; width: 100%; height: auto; object-fit: cover; border-radius: 8px; display: block; }
.aside { display: none; }
.aside .lbl { display: block; font-size: 12px; color: var(--ink-2); }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--outline); box-shadow: 0 -4px 12px rgba(0, 0, 0, .08); }
.sticky .lbl { font-size: 12px; color: var(--ink-2); display: block; }
.sticky .val { font-size: 16px; display: block; }
.sticky .btn { flex: 1; min-height: 50px; font-size: 16px; }

/* Avis (session 12) : étoiles en glyphe texte, valeur toujours en chiffres */
.rating { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 14.5px; width: fit-content; }
.rating .st { color: var(--star); font-size: 17px; line-height: 1; }
.rating small { font-weight: 500; color: var(--ink-2); font-size: 13px; }
.rating--link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--outline-strong); margin: 0 0 8px; }
.card .rating { font-size: 13px; }
.card .rating .st { font-size: 15px; }
.stars { display: inline-flex; gap: 1px; font-size: 17px; letter-spacing: 1px; line-height: 1; }
.stars .f { color: var(--star); }
.stars .e { color: var(--outline); }
.rev-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rev-head .avg { font-size: 30px; font-weight: 800; line-height: 1; }
.rev-head .cnt { color: var(--ink-2); font-size: 13.5px; }
.review { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--outline); font-size: 14px; }
.review .who { display: flex; align-items: center; gap: 8px; }
.review .who .avatar { width: 32px; height: 32px; font-size: 12px; }
.review .who b { font-size: 14.5px; }
.review .who small { color: var(--ink-2); font-size: 12.5px; margin-left: auto; }
.review .val { font-size: 12.5px; color: var(--ink-2); margin-left: 6px; }
.review p { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.review .reply { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--primary); display: grid; gap: 4px; }
.review .reply b { font-size: 13px; }
.review .reply small { color: var(--ink-2); font-size: 12px; }
.rev-foot { font-size: 12.5px; color: var(--ink-2); margin: 6px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.rev-foot .ic { width: 17px; height: 17px; color: var(--link); }

/* Erreur */
.err { min-height: calc(100vh - 52px); display: grid; place-items: center; text-align: center; padding: 40px 24px; gap: 14px; align-content: center; }
.err .big { font-size: 72px; font-weight: 800; color: var(--primary); line-height: 1; }
.err h1 { font-size: 22px; }
.err p { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 32ch; }
.err .link { font-size: 14px; }

/* Pages légales (session 14) : texte long, sommaire en tête sur téléphone et collant à gauche sur grand écran. */
.legal-draft { margin: 0; padding: 12px 16px; background: var(--warning-container); border-left: 4px solid var(--warning); font-size: 14px; line-height: 1.4; }
.legal-draft b { color: var(--warning); }
.legal { width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 32px; }
.legal h1 { font-size: 26px; line-height: 1.15; margin: 0 0 6px; }
.legal h2 { font-size: 18px; margin: 26px 0 8px; scroll-margin-top: 12px; }
.legal p, .legal li, .legal dd { font-size: 15.5px; line-height: 1.6; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal a { color: var(--link); }
.legal .legal-meta { color: var(--ink-2); font-size: 13.5px; margin-bottom: 18px; }
.legal .todo { background: var(--warning-container); border-radius: 4px; padding: 0 4px; font-style: italic; }
.legal-toc { display: grid; gap: 2px; background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.legal-toc b { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 4px; }
.legal-toc a { padding: 5px 0; font-size: 14.5px; text-decoration: none; }
.legal-id { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; margin: 0 0 12px; }
.legal-id dt { color: var(--ink-2); font-size: 14px; }
.legal-id dd { margin: 0; }
.legal-others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--outline); }
.legal-others a { border: 1px solid var(--outline-strong); border-radius: var(--pill); padding: 7px 14px; font-size: 14px; text-decoration: none; color: var(--ink); }
.legal-others a.cur { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); font-weight: 700; }

/* Pied de page */
footer.site { padding: 18px 16px 24px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--outline); display: grid; gap: 6px; max-width: var(--wrap); margin: 0 auto; }
footer.site .legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin-bottom: 4px; }
footer.site .legal-links a { color: var(--ink); }
.page-establishment footer.site { padding-bottom: 96px; }

/* Desktop */
@media (min-width: 760px) {
  .legal { max-width: var(--wrap); padding: 32px 16px 48px; display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 40px; align-items: start; }
  .legal-toc { position: sticky; top: 16px; margin-bottom: 0; }
  body { font-size: 16px; }
  .hdr { padding: 12px 32px; }
  .hdr-nav { display: flex; }
  .hero { padding: 48px 32px 40px; text-align: center; }
  .hero h1 { font-size: 36px; }
  .hero .search-form { max-width: 760px; margin: 0 auto; grid-template-columns: 1fr 1fr auto; }
  .hero .search-form .btn.ghost { grid-column: 1 / -1; justify-self: center; background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; }
  .search-form--compact { grid-template-columns: 1fr 1fr auto; }
  .t { font-size: 20px; }
  .cats { grid-template-columns: repeat(7, 1fr); gap: 12px; }
  .cats a { font-size: 13px; min-height: 96px; }
  .cards--grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cards--grid .card { grid-template-columns: 120px 1fr; }
  .chips { display: none; }
  .results { grid-template-columns: 260px 1fr; align-items: start; }
  .filters { display: grid; }
  .results-head h1 { font-size: 26px; }
  .card { grid-template-columns: 160px 1fr; }
  .fiche { grid-template-columns: 1fr 340px; align-items: start; padding-bottom: 32px; }
  .cover { height: 320px; }
  .ident h1 { font-size: 30px; }
  .ident .acts, .fiche-hours { display: none; }
  .aside { display: grid; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); position: sticky; top: 16px; }
  .sticky { display: none; }
  .page-establishment footer.site { padding-bottom: 24px; }
  .gallery { grid-template-columns: repeat(6, 1fr); }
}
