/* Place autocomplete (see /js/places.js). Tokens come from site.css with fallbacks; logical properties only. */
.places {
  --pl-accent: var(--bleu, #0666b9);
  --pl-ring: var(--ring, var(--bleu, #0666b9));
  --pl-ink: var(--encre, #161412);
  --pl-muted: var(--encre-2, #5b5247);
  --pl-bg: var(--jasmin, #fff);
  --pl-hover: var(--chaux, #fbf8f2);
  --pl-line: var(--filet-fort, #857a6b);
  --pl-radius: var(--r, 3px);
  position: relative;
}
/* room for the clear button at the inline end */
.places > input[role="combobox"] { padding-inline-end: 3rem; text-overflow: ellipsis; }

.places-clear {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 100%;
  min-block-size: 44px;
  max-block-size: 48px;
  padding: 0;
  border: 0;
  border-radius: var(--pl-radius);
  background: transparent;
  color: var(--pl-muted);
  font: 400 1.5rem/1 var(--f-text, system-ui, sans-serif);
  cursor: pointer;
}
.places-clear:hover { color: var(--pl-ink); }
.places-clear:focus-visible { outline: 2px solid var(--pl-ring); outline-offset: -4px; }

.places-list {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 0;
  max-block-size: min(60vh, 22rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--pl-bg);
  color: var(--pl-ink);
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-radius);
  box-shadow: var(--shadow, 0 18px 40px -20px rgba(10, 53, 88, 0.35));
  text-align: start;
}
.places-list[hidden] { display: none; }

.places-opt,
.places-none {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-block-size: 44px;
  padding: 0.4rem 0.9rem;
  line-height: 1.35;
}
.places-opt { cursor: pointer; border-inline-start: 3px solid transparent; }
.places-opt + .places-opt { border-block-start: 1px solid rgba(133, 122, 107, 0.2); }
.places-opt[aria-selected="true"] {
  background: var(--pl-hover);
  border-inline-start-color: var(--pl-accent);
  outline: 2px solid var(--pl-ring);
  outline-offset: -2px;
}
.places-label { font-weight: 600; overflow-wrap: anywhere; }
.places-label mark {
  background: transparent;
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--pl-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
/* Arabic: a weight change inside a word breaks the letter joining, so the match is shown by the underline alone */
:lang(ar) .places-label mark,
[dir="rtl"] .places-label mark { font-weight: inherit; text-underline-offset: 0.3em; }
.places-sub { color: var(--pl-muted); font-size: var(--fs-sm, 0.875rem); overflow-wrap: anywhere; }
.places-none { color: var(--pl-muted); cursor: default; }

/* screen-reader-only live region (self-contained: does not depend on .sr) */
.places-sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (hover: none) {
  .places-opt { min-block-size: 48px; }
}
@media (forced-colors: active) {
  .places-opt[aria-selected="true"] { outline-color: Highlight; }
  .places-label mark { text-decoration-color: currentColor; }
}
