/* CLIK.ma - « Rechercher par photo » (includes/clik-photo-search.php, js/core/clik-photo-search.js; classes clik-ps-).
   The camera in the listings' search bars is the dictation microphone's own circle (the same size, the same gradient,
   4 px from it, on its middle); the window is the site's window (the title and its logo on one line, the round ×,
   the 8 px rhythm, a sheet above the bottom bar on phones). Every animation stops with "less motion". */

/* ---------- the camera in a bar ---------- */
.clik-ps-btn:not(#_) { position: absolute !important; z-index: 4; display: grid !important; place-items: center; box-sizing: border-box; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; min-width: 0 !important; min-height: 0 !important; max-width: none; line-height: 0; background: transparent !important; box-shadow: none !important; color: #fff !important; cursor: pointer; -webkit-tap-highlight-color: transparent; transform: none !important; }
.clik-ps-btn[hidden]:not(#_) { display: none !important; }
.clik-ps-btn .clik-ps-av, .clik-ps-res-go .clik-ps-av { width: var(--clik-ps-av, 30px); height: var(--clik-ps-av, 30px); border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #0866FF 0%, #7c4dff 100%); box-shadow: 0 2px 6px -2px rgba(76, 77, 255, .55); transition: filter .15s; }
.clik-ps-btn .clik-ps-av svg:not(#_) { position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; display: block; width: round(nearest, calc(var(--clik-ps-av, 30px) * .5), 2px) !important; height: round(nearest, calc(var(--clik-ps-av, 30px) * .5), 2px) !important; color: #fff !important; opacity: 1 !important; flex: none !important; pointer-events: none; }
.clik-ps-btn:hover .clik-ps-av { filter: brightness(1.08); }
.clik-ps-btn:active .clik-ps-av { filter: brightness(.94); }
.clik-ps-btn:focus { outline: none; }
.clik-ps-btn:focus-visible .clik-ps-av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0866FF; }
body.night-mode .clik-ps-btn:focus-visible .clik-ps-av { box-shadow: 0 0 0 2px #18191a, 0 0 0 4px #4C9AFF; }

/* a field with the camera and the microphone keeps less room: its words end with « … », never cut mid-letter */
input.has-clik-ps:not(#_) { text-overflow: ellipsis; }

/* /search on a phone: the words' box had a third of the row (« villa » squeezed beside the × and the microphone) - it
   takes the whole first row, the place, the search and the filters share the second */
@media (max-width: 668px) {
  form.clik-sx-form:has(input.has-clik-ps):not(#_) { grid-template-columns: minmax(0, 1fr) auto auto; }
  form.clik-sx-form:has(input.has-clik-ps) .clik-sx-field.is-q:not(#_) { grid-column: 1 / -1; }
  form.clik-sx-form:has(input.has-clik-ps) .clik-sx-field.is-where:not(#_) { grid-column: 1; }
  form.clik-sx-form:has(input.has-clik-ps) .clik-sx-go:not(#_) { grid-column: 2; }
  form.clik-sx-form:has(input.has-clik-ps) .clik-sx-advbtn:not(#_) { grid-column: 3; }
}

/* ---------- the window ---------- */
html.clik-ps-open { overflow: hidden; scrollbar-gutter: stable; }
.clik-ps { position: fixed; inset: 0; z-index: 1063; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; background: rgba(9, 12, 24, .55); opacity: 0; transition: opacity .18s ease; }
.clik-ps[hidden] { display: none; }
.clik-ps.is-in { opacity: 1; }
.clik-ps-card { position: relative; box-sizing: border-box; width: min(480px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 16px; background: #fff; color: #050505; box-shadow: 0 24px 64px -12px rgba(0, 0, 0, .45); transform: translateY(10px) scale(.98); transition: transform .24s cubic-bezier(.2, .9, .3, 1.2); outline: none; scrollbar-width: none; }
.clik-ps-card::-webkit-scrollbar { display: none; }
.clik-ps.is-in .clik-ps-card { transform: none; }
/* 23 Nov (the owner: « remove the colored line on top »): no line along the window's top - the ring round it is enough */
.clik-ps-card::before { content: none; display: none; }
body.night-mode .clik-ps-card { background: #242526; color: #e4e6eb; }

.clik-ps-head { display: flex; align-items: center; gap: 10px; min-height: 36px; padding-inline-start: 8px; }
.clik-ps-t:not(#_) { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; white-space: nowrap; font-size: clamp(15px, 4.4vw, 20px); line-height: 1.2; font-weight: 800; color: inherit; }
.clik-ps-t .clik-ps-tw { min-width: 0; }
.clik-ps-t .clik-brand.is-inline:not(#_) { flex: none; margin: 0; gap: .3em; }
/* the logo follows the title's size: the cube as tall as the capitals and a little more, the logo's letters as tall as them */
.clik-ps-t .clik-brand.is-inline .clik-brand-cube:not(#_) { height: 1.2em; width: auto; }
.clik-ps-t .clik-brand.is-inline .clik-brand-word:not(#_) { height: 1em; width: auto; }
.clik-ps-x:not(#_) { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #e4e6eb; color: #606770; cursor: pointer; transition: transform .2s, background .15s; }
.clik-ps-x svg { width: 18px; height: 18px; }
.clik-ps-x:hover, .clik-ps-x:focus-visible { transform: rotate(90deg); }
.clik-ps-x:active { transform: rotate(90deg) scale(.92); }
.clik-ps-x:focus { outline: none; }
.clik-ps-x:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0866FF; }
body.night-mode .clik-ps-x:not(#_) { background: #3a3b3c; color: #e4e6eb; }

/* the drop zone */
.clik-ps-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px 16px; border: 2px dashed #c3d3ff; border-radius: 14px; background: linear-gradient(180deg, #f6f9ff, #eef2ff); text-align: center; cursor: pointer; }
.clik-ps-drop[hidden] { display: none; }
body.night-mode .clik-ps-drop { border-color: #3b4a7a; background: linear-gradient(180deg, #232a3d, #1d2232); }
.clik-ps-big { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #0866FF 0%, #7c4dff 100%); box-shadow: 0 10px 24px -8px rgba(76, 77, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .35); }
.clik-ps-big i { display: grid; place-items: center; }
.clik-ps-big svg { width: 34px; height: 34px; display: block; }
.clik-ps-big::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(124, 77, 255, .45); animation: clik-ps-ping 2.4s ease-out infinite; }
@keyframes clik-ps-ping { 0% { transform: scale(.9); opacity: .9; } 70%, 100% { transform: scale(1.25); opacity: 0; } }
.clik-ps-h { margin: 4px 0 0; font-size: 17px; font-weight: 800; line-height: 1.25; }
.clik-ps-or { margin: 0; width: 100%; max-width: 240px; display: flex; align-items: center; gap: 8px; color: #65676b; font-size: 13px; }
.clik-ps-or::before, .clik-ps-or::after { content: ""; flex: 1; height: 1px; background: #d5dcef; }
body.night-mode .clik-ps-or { color: #b0b3b8; }
body.night-mode .clik-ps-or::before, body.night-mode .clik-ps-or::after { background: #3e4560; }
.clik-ps-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.clik-ps-go:not(#_) { height: 44px; padding: 0 18px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: transform .12s, filter .15s, box-shadow .15s; }
.clik-ps-go[hidden]:not(#_) { display: none; }
.clik-ps-go svg { width: 20px; height: 20px; flex: none; }
.clik-ps-go.is-pick:not(#_) { color: #fff; background: linear-gradient(135deg, #0866FF 0%, #7c4dff 100%); box-shadow: 0 6px 16px -8px rgba(76, 77, 255, .8); }
.clik-ps-go.is-take:not(#_) { color: #0866FF; background: #fff; box-shadow: inset 0 0 0 1.5px #0866FF; }
body.night-mode .clik-ps-go.is-take:not(#_) { color: #8AB8FF; background: #1d2232; box-shadow: inset 0 0 0 1.5px #4C9AFF; }
.clik-ps-go:hover { filter: brightness(1.06); }
.clik-ps-go:active { transform: scale(.97); }
.clik-ps-go:focus { outline: none; }
.clik-ps-go:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0866FF; }
.clik-ps-paste { margin: 0; font-size: 12.5px; color: #65676b; }
.clik-ps-paste[hidden] { display: none; }
body.night-mode .clik-ps-paste { color: #b0b3b8; }
.clik-ps-over { position: absolute; inset: -2px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff; font-size: 16px; background: rgba(8, 102, 255, .93); opacity: 0; transition: opacity .15s; pointer-events: none; }
.clik-ps-over svg { width: 36px; height: 36px; }
.clik-ps-drop.is-over .clik-ps-over { opacity: 1; }

/* reading the photo */
.clik-ps-read { display: flex; flex-direction: column; gap: 8px; }
.clik-ps-read[hidden] { display: none; }
.clik-ps-shot { position: relative; overflow: hidden; border-radius: 14px; background: #0d1222; display: grid; place-items: center; min-height: 180px; }
.clik-ps-shot img { display: block; width: 100%; height: auto; max-height: min(48vh, 340px); object-fit: contain; }
.clik-ps-beam { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent 36%, rgba(124, 77, 255, .22) 45%, rgba(120, 190, 255, .55) 49%, rgba(255, 255, 255, .85) 50%, rgba(120, 190, 255, .55) 51%, rgba(8, 102, 255, .22) 55%, transparent 64%); transform: translateY(-55%); }
.clik-ps.is-busy .clik-ps-beam { opacity: 1; animation: clik-ps-scan 1.5s ease-in-out infinite alternate; }
@keyframes clik-ps-scan { from { transform: translateY(-55%); } to { transform: translateY(55%); } }
.clik-ps-cn { position: absolute; width: 22px; height: 22px; border: 3px solid #0A5CFF; pointer-events: none; transition: transform .3s; }
.clik-ps-cn.is-tl { top: 10px; inset-inline-start: 10px; border-inline-end: 0; border-bottom: 0; border-start-start-radius: 8px; }
.clik-ps-cn.is-tr { top: 10px; inset-inline-end: 10px; border-inline-start: 0; border-bottom: 0; border-start-end-radius: 8px; border-color: #F5104F; }
.clik-ps-cn.is-bl { bottom: 10px; inset-inline-start: 10px; border-inline-end: 0; border-top: 0; border-end-start-radius: 8px; border-color: #FFD200; }
.clik-ps-cn.is-br { bottom: 10px; inset-inline-end: 10px; border-inline-start: 0; border-top: 0; border-end-end-radius: 8px; border-color: #7B3FE4; }
.clik-ps.is-busy .clik-ps-cn { animation: clik-ps-snap 1.5s ease-in-out infinite alternate; }
@keyframes clik-ps-snap { from { transform: scale(1); } to { transform: scale(.86); } }
.clik-ps.is-done .clik-ps-cn { transform: scale(.8); border-color: #16A34A; }
.clik-ps-st { margin: 0; min-height: 28px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; text-align: center; }
.clik-ps-st[hidden] { display: none; }
.clik-ps-cube { flex: none; width: 26px; height: 26px; background: var(--clik-cube-load, var(--clik-cube)) center / contain no-repeat; }
.clik-ps.is-done .clik-ps-cube { border-radius: 50%; background: #16A34A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; animation: clik-ps-pop .32s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes clik-ps-pop { from { transform: scale(.4); } to { transform: scale(1); } }
.clik-ps-err { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.clik-ps-err[hidden] { display: none; }
.clik-ps-err p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: #b42318; }
body.night-mode .clik-ps-err p { color: #ff8a80; }
.clik-ps.is-err .clik-ps-shot img { filter: grayscale(.6) brightness(.75); }

.clik-ps-priv { margin: 0; display: block; font-size: 12.5px; line-height: 1.4; color: #65676b; text-align: center; padding: 0 8px 4px; text-wrap: balance; }
.clik-ps-priv svg { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 5px; }
body.night-mode .clik-ps-priv { color: #b0b3b8; }

/* phones: a sheet from the bottom, above the bottom bar */
@media (max-width: 575px) {
  .clik-ps { align-items: flex-end; padding: 0; }
  .clik-ps-card { width: 100%; max-height: calc(100vh - 45px - env(safe-area-inset-bottom, 0px) - 24px); max-height: calc(100dvh - 45px - env(safe-area-inset-bottom, 0px) - 24px); margin-bottom: calc(45px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; transform: translateY(24px); }
  .clik-ps-go:not(#_) { flex: 1 1 auto; padding: 0 14px; }
}

/* ---------- the results' banner ---------- */
.clik-ps-res { box-sizing: border-box; display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #e4e6eb; animation: clik-ps-in .26s ease-out; }
.clik-ps-res.is-gone { opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
@keyframes clik-ps-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
body.night-mode .clik-ps-res { background: #242526; box-shadow: inset 0 0 0 1px #3a3b3c; }
.clik-ps-res-img { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #e4e6eb; }
.clik-ps-res-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.clik-ps-res-tx b { font-size: 12.5px; font-weight: 600; color: #65676b; }
body.night-mode .clik-ps-res-tx b { color: #b0b3b8; }
.clik-ps-res-q { font-size: 15px; font-weight: 800; color: #050505; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: start; }
body.night-mode .clik-ps-res-q { color: #e4e6eb; }
.clik-ps-res-go:not(#_) { flex: none; height: 36px; padding: 0 12px 0 4px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 700; color: #0866FF; background: #eaf2ff; cursor: pointer; }
html[dir="rtl" i] .clik-ps-res-go:not(#_) { padding: 0 4px 0 12px; }
.clik-ps-res-go .clik-ps-av { --clik-ps-av: 28px; }
.clik-ps-res-go .clik-ps-av svg { width: 14px; height: 14px; }
body.night-mode .clik-ps-res-go:not(#_) { color: #8AB8FF; background: #263450; }
.clik-ps-res-x:not(#_) { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #e4e6eb; color: #606770; cursor: pointer; }
.clik-ps-res-x svg { width: 16px; height: 16px; }
body.night-mode .clik-ps-res-x:not(#_) { background: #3a3b3c; color: #e4e6eb; }
@media (max-width: 420px) {
  .clik-ps-res-go span:last-child { display: none; }
  .clik-ps-res-go:not(#_), html[dir="rtl" i] .clik-ps-res-go:not(#_) { padding: 0 4px; }
}

/* ---------- extra 1: a photo dragged onto a bar ---------- */
.clik-ps-drag:not(#_) { box-shadow: 0 0 0 2px #0866FF, 0 0 0 6px rgba(8, 102, 255, .18) !important; background-color: #eef4ff !important; transition: box-shadow .15s, background-color .15s; }
body.night-mode .clik-ps-drag:not(#_) { box-shadow: 0 0 0 2px #4C9AFF, 0 0 0 6px rgba(76, 154, 255, .22) !important; background-color: #1f2a40 !important; }
/* the camera keeps exactly the microphone's size while a photo is dragged over its bar (17 Nov, the owner: « big button not like others ») */

/* ---------- extra 3: the last photos searched, in the window ---------- */
.clik-ps-recent { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.clik-ps-recent[hidden] { display: none; }
.clik-ps-recent-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.clik-ps-recent-h b { font-size: 13px; font-weight: 700; color: #65676b; }
body.night-mode .clik-ps-recent-h b { color: #b0b3b8; }
.clik-ps-recent-x:not(#_) { padding: 0 4px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: #0866FF; cursor: pointer; }
body.night-mode .clik-ps-recent-x:not(#_) { color: #8AB8FF; }
.clik-ps-recent-l { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.clik-ps-rt:not(#_) { min-width: 0; padding: 0; border: 0; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; background: #f0f2f5; color: #050505; text-align: start; cursor: pointer; transition: transform .12s, box-shadow .15s; }
.clik-ps-rt img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e4e6eb; }
.clik-ps-rt-q { display: block; padding: 6px 8px; font-size: 12.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.clik-ps-rt:hover { box-shadow: 0 0 0 2px #0866FF; }
.clik-ps-rt:active { transform: scale(.97); }
.clik-ps-rt:focus { outline: none; }
.clik-ps-rt:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0866FF; }
body.night-mode .clik-ps-rt:not(#_) { background: #3a3b3c; color: #e4e6eb; }

/* ---------- extra 2: « La même annonce » under the results' banner ---------- */
.clik-ps-same { box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; padding: 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #e4e6eb; animation: clik-ps-in .26s ease-out; }
.clik-ps-same.is-gone { opacity: 0; transition: opacity .2s; }
body.night-mode .clik-ps-same { background: #242526; box-shadow: inset 0 0 0 1px #3a3b3c; }
.clik-ps-same-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #16A34A; }
.clik-ps-same-h::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; background: #16A34A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
body.night-mode .clik-ps-same-h { color: #4ADE80; }
.clik-ps-same-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.clik-ps-same-it:not(#_) { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 10px; background: #f0f2f5; color: #050505; text-decoration: none; }
.clik-ps-same-it:hover { box-shadow: 0 0 0 2px #16A34A; }
.clik-ps-same-it img { flex: none; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #e4e6eb; }
.clik-ps-same-tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.clik-ps-same-t { font-size: 14px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: start; }
.clik-ps-same-p { font-size: 13px; font-weight: 800; color: #0866FF; }
body.night-mode .clik-ps-same-it:not(#_) { background: #3a3b3c; color: #e4e6eb; }
body.night-mode .clik-ps-same-p { color: #8AB8FF; }

@media (prefers-reduced-motion: reduce) {
  .clik-ps-same { animation: none !important; }
  .clik-ps, .clik-ps-card, .clik-ps-x, .clik-ps-go, .clik-ps-cn { transition: none !important; }
  .clik-ps-big::after, .clik-ps.is-busy .clik-ps-beam, .clik-ps.is-busy .clik-ps-cn, .clik-ps.is-done .clik-ps-cube, .clik-ps-res { animation: none !important; }
  .clik-ps.is-busy .clik-ps-beam { transform: none; opacity: .5; }
  .clik-ps-cube { background-image: var(--clik-cube); }
}
