/* css/annuaire.css
   The directory of the restaurants (directory.html; resto-one.com/restaurants
   and /restaurants/{town}, answered by the API from its copy
   Infrastructure/Website/DirectoryShell.html), rewritten with lot R7d
   (rewrite plan 27.10.2026). The page wears the showcase's look and its
   bar (css/presentation.css, loaded before this sheet); here, what is the
   directory's own: the towns' trail, the filters, the map's box, the cards,
   the towns' list. Values through css/tokens.css. Layers pages and
   utilitaires, declared in css/tokens.css. */

@layer pages {
  /* The page as it was before the rewrite, not the console: the boxes
     measured without their padding, the links underlined, the browser's
     own lists (public pages, 28.09.2026). Zero weight: every rule below
     still decides. */
  :where(body.dir-page, body.dir-page *, body.dir-page *::before, body.dir-page *::after) { box-sizing: content-box; }
  :where(body.dir-page a) { text-decoration: revert; }
  :where(body.dir-page select) { appearance: auto; display: block; min-width: auto; min-height: auto; gap: normal; white-space: pre; overflow: clip; cursor: default; user-select: auto; vertical-align: baseline; }
  :where(body.dir-page select)::picker(select) { appearance: auto; }

  /* ---- the showcase's look on the directory ---- */
  html body.ro-ui:is(.vp-style, .dir-page).dir-page:not(.tl-mode) .h-bar a.h-btn-filled { color: var(--cs-gold-ink); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode).dir-page { color: var(--cs-fg); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-title { font-size: clamp(26px, 3vw, 36px); font-weight: 600; }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) :is(.dir-intro, .dir-card-place, .dir-hours, .dir-terrace) { color: var(--cs-fg-2); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) :is(.dir-count, .dir-crumbs) { color: var(--cs-fg-3); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode).dir-page .dir-crumbs a { color: var(--cs-gold); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-filter label { font-weight: 600; color: var(--cs-fg-2); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-filter .select { color: var(--cs-fg); border-radius: 4px; border: var(--cs-lw) solid transparent; background-image: linear-gradient(var(--cs-bg), var(--cs-bg)), var(--cs-line-grad); background-origin: padding-box, border-box; background-clip: padding-box, border-box; background-color: transparent; font-family: var(--cs-sans); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-card { overflow: hidden; }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-card-photo { background: var(--cs-panel-2); border-radius: 5px 5px 0 0; }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-card-initial { color: var(--cs-gold); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode).dir-page .dir-card-name a { color: var(--cs-fg); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-chips li { color: var(--cs-fg-2); border-radius: 3px; background: var(--cs-panel-2); border: 1px solid var(--cs-line); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-closed { color: var(--cs-crit); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-terrace.is-open { color: var(--cs-ok); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-book { font-weight: 600; border-radius: 4px; background: var(--cs-sheen); font-family: var(--cs-sans); }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-map { border-radius: 5px; }
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-cities-list a { color: var(--cs-gold); }
  @media (max-width: 1000px) {
    html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .h-bar .h-nav { display: none; }
  }
  @media (max-width: 440px) {
    html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .h-bar .h-login { padding: 0 12px; font-size: 13px; }
  }

  /* ---- the feature pages' bar ---- */
  .h-lang button { padding: 8px 10px; }
  @media (max-width: 640px) {
    .h-lang button { padding: 8px 7px; }
  }
  @media (max-width: 480px) {
    .h-bar .h-lang { display: none; }
  }

  /* ---- the directory ---- */
  body.dir-page { overflow-x: hidden; margin: 0; padding-bottom: 28px; }
  body.dir-page.ro-footer-inflow { padding-bottom: 0; }
  body.dir-page a { color: var(--cs-gold); }
  body.dir-page .h-bar a { color: var(--cs-fg-2); }
  body.dir-page .h-bar a:hover { color: var(--cs-fg); }
  body.dir-page .h-bar, body.dir-page .h-bar * { box-sizing: border-box; }
  .dir-main { max-width: 1180px; box-sizing: border-box; margin: 0 auto; padding: 16px 16px 32px; }
  .dir-crumbs { display: flex; flex-wrap: wrap; font-size: 13px; gap: 6px; }
  .dir-crumb-sep { opacity: .6; }
  .dir-title { overflow-wrap: anywhere; margin: 12px 0 6px; line-height: 32px; }
  .dir-intro { font-size: 15px; line-height: 22px; max-width: 760px; margin: 0 0 16px; }
  .dir-filters { display: flex; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; gap: 12px 16px; }
  .dir-filter { display: flex; flex-direction: column; min-width: 0; gap: 4px; flex: 1 1 150px; }
  .dir-filter label { font-size: 12px; letter-spacing: .03em; }
  .dir-filter .select { width: 100%; max-width: 100%; box-sizing: border-box; height: 44px; padding: 0 12px; background: var(--cs-panel-2); font: 400 15px var(--cs-sans); }
  .dir-filter .select:focus-visible { outline: 2px solid var(--cs-gold); outline-offset: 1px; }
  .dir-count { font-size: 13px; margin: 0 0 10px; flex: 1 1 100%; }
  .dir-layout { display: flex; gap: 16px; flex-direction: column; }
  .dir-map-box { min-width: 0; }
  .dir-map { height: 260px; border: 1px solid var(--cs-line); background: var(--cs-panel-2); }
  .dir-list { display: grid; min-width: 0; gap: 12px; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 640px) {
    .dir-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dir-title { line-height: 40px; }
  }
  @media (min-width: 900px) {
    .dir-layout { flex-direction: row; align-items: flex-start; }
    .dir-map-box { position: sticky; top: 76px; flex: 0 0 38%; }
    .dir-map { height: calc(100vh - 110px); max-height: 640px; min-height: 360px; }
    .dir-list { flex: 1 1 auto; }
  }
  .dir-card { display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 76px; }
  .dir-card-photo { display: block; aspect-ratio: 16 / 9; position: relative; overflow: hidden; }
  .dir-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .dir-card-initial { position: absolute; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 500; inset: 0; background: var(--cs-panel-2); }
  .dir-card-body { display: flex; flex-direction: column; padding: 12px 14px 14px; gap: 6px; flex: 1 1 auto; }
  .dir-card-name { font-size: 18px; line-height: 24px; font-weight: 500; overflow-wrap: anywhere; margin: 0; }
  body.dir-page .dir-card-name a { text-decoration: none; }
  .dir-card-name a:hover { text-decoration: underline; }
  .dir-card-place, .dir-hours, .dir-terrace { font-size: 14px; line-height: 20px; margin: 0; }
  .dir-chips { display: flex; flex-wrap: wrap; list-style: none; margin: 2px 0; padding: 0; gap: 6px; }
  .dir-chips li { font-size: 12px; line-height: 16px; max-width: 100%; text-overflow: ellipsis; padding: 4px 10px; overflow: hidden; white-space: nowrap; }
  .dir-book { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; font-size: 14px; padding: 0 22px; text-decoration: none; }
  .dir-book:hover { filter: brightness(1.05); }
  .dir-book:focus-visible { outline: 2px solid var(--cs-fg); outline-offset: 2px; }
  .dir-empty { color: var(--cs-fg-2); margin: 16px 0; }
  .dir-cities { margin-top: 28px; }
  .dir-cities-title { font-size: 18px; font-weight: 500; margin: 0 0 8px; }
  .dir-cities-list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: 6px 16px; }
  .dir-cities-n { color: var(--cs-fg-2); font-size: 13px; }
  .dmap { position: relative; overflow: hidden; }
}

@layer utilitaires {
  /* ---- the showcase's look on the directory, over the page's rules ---- */
  html body.ro-ui:is(.vp-style, .dir-page):not(.tl-mode) .dir-book { color: var(--cs-gold-ink); }
}
