/* CLIK.ma - the language window (js/core/clik-lang.js): « Choisir la langue [cube]CLIK.ma », one card a language - the
   flag big and sharp, its own name, the way it reads, the language shown ringed in the cube's colours. 8 px grid. */
.clik-lw { position: fixed; inset: 0; z-index: 1064; 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-lw[hidden] { display: none; }
.clik-lw.is-in { opacity: 1; }
html.clik-lw-open { overflow: hidden; }
.clik-lw-card { position: relative; box-sizing: border-box; width: min(460px, 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 8px 16px; border-radius: 20px; background: #fff; color: #050505; box-shadow: 0 24px 64px -12px rgba(0, 0, 0, .45); transform: translateY(12px) scale(.97); transition: transform .26s cubic-bezier(.2, .9, .3, 1.15); outline: none; scrollbar-width: none; }
.clik-lw-card::-webkit-scrollbar { display: none; }
.clik-lw.is-in .clik-lw-card { transform: none; }
body.night-mode .clik-lw-card { background: #242526; color: #e4e6eb; }

/* the title row: 8 px around the round 36 px ×, the title and its logo on its middle */
.clik-lw-head { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 0 0 8px; }
html[dir="rtl"] .clik-lw-head { padding: 0 8px 0 0; }
.clik-lw-t { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; margin: 0; font-size: 20px; font-weight: 800; line-height: 1.2; color: inherit; }
.clik-lw-t .clik-brand.is-inline { flex: none; margin: 0; }
.clik-lw-x { 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 ease, background-color .2s ease; }
.clik-lw-x svg { width: 20px; height: 20px; }
.clik-lw-x:hover { transform: rotate(90deg); }
.clik-lw-x:active { transform: rotate(90deg) scale(.92); }
.clik-lw-x:focus-visible { outline: 2px solid #0866FF; outline-offset: 2px; }
body.night-mode .clik-lw-x { background: #3a3b3c; color: #e4e6eb; }

.clik-lw-sub { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 8px; font-size: 14px; line-height: 1.35; color: #65676b; }
body.night-mode .clik-lw-sub { color: #b0b3b8; }
.clik-lw-globe { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: conic-gradient(from 200deg, #0A5CFF, #7B3FE4, #F5104F, #FFD200, #0A5CFF); }
.clik-lw-globe svg { width: 18px; height: 18px; }
.clik-lw.is-in .clik-lw-globe svg { animation: clik-lw-spin 6s linear infinite; }
@keyframes clik-lw-spin { to { transform: rotate(360deg); } }

/* the cards: two a row (one under 360 px), 8 px apart */
.clik-lw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 196px), 1fr)); gap: 8px; padding: 0; }
.clik-lw-it { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 16px 16px 12px; border-radius: 16px; background: #f5f7fb; border: 1.5px solid #e4e8f0; color: inherit; text-decoration: none !important; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease; }
.clik-lw-it:hover { transform: translateY(-2px); border-color: #b9cdf7; box-shadow: 0 10px 24px -12px rgba(8, 102, 255, .45); }
.clik-lw-it:active { transform: translateY(0) scale(.98); }
.clik-lw-it:focus-visible { outline: 2px solid #0866FF; outline-offset: 2px; }
body.night-mode .clik-lw-it { background: #2f3031; border-color: #3e4042; }
body.night-mode .clik-lw-it:hover { border-color: #3b5b9a; }
/* the language shown: a ring in the cube's colours, the tick, « Langue actuelle » */
.clik-lw-it.is-on { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #0A5CFF, #7B3FE4 40%, #F5104F 70%, #FFD200) border-box; border-width: 2px; padding: 15.5px 15.5px 11.5px; }
body.night-mode .clik-lw-it.is-on { background: linear-gradient(#2f3031, #2f3031) padding-box, linear-gradient(120deg, #3B82F6, #8B5CF6 40%, #FB3B6B 70%, #FFD84D) border-box; }
.clik-lw-ok { position: absolute; top: 12px; inset-inline-end: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #16A34A, #0E8A3D); box-shadow: 0 4px 10px -4px rgba(22, 163, 74, .7); }
.clik-lw-ok svg { width: 18px; height: 18px; }
.clik-lw.is-in .clik-lw-it.is-on .clik-lw-ok { animation: clik-lw-pop .45s cubic-bezier(.2, .9, .3, 1.5) .25s both; }
@keyframes clik-lw-pop { from { transform: scale(0); } to { transform: none; } }
.clik-lw-cur { align-self: flex-start; margin-top: 4px; padding: 0 8px; height: 22px; line-height: 22px; border-radius: 11px; font-size: 11px; font-weight: 700; color: #0866FF; background: #e7f0ff; }
body.night-mode .clik-lw-cur { color: #8ab8ff; background: #1c2a42; }

/* the flag: big, sharp, its own thin edge and a light running over it under the mouse */
.clik-lw-flag { position: relative; display: block; align-self: flex-start; width: 72px; height: 48px; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 6px 14px -6px rgba(0, 0, 0, .35); transform-origin: left center; }
html[dir="rtl"] .clik-lw-flag { transform-origin: right center; }
.clik-lw-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.clik-lw-flag::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, .1)); pointer-events: none; }
.clik-lw-sheen { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-120%); }
.clik-lw-it:hover .clik-lw-sheen, .clik-lw-it:focus-visible .clik-lw-sheen { transition: transform .7s ease; transform: translateX(120%); }
.clik-lw-it:hover .clik-lw-flag { animation: clik-lw-wave .9s ease; }
@keyframes clik-lw-wave { 0%, 100% { transform: none; } 30% { transform: perspective(200px) rotateY(-14deg) skewY(-2deg); } 65% { transform: perspective(200px) rotateY(8deg) skewY(1deg); } }

.clik-lw-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; width: 100%; }
.clik-lw-nat { font-size: 20px; font-weight: 800; line-height: 1.2; text-align: start; }
.clik-lw-nm { font-size: 13px; color: #65676b; }
body.night-mode .clik-lw-nm { color: #b0b3b8; }
.clik-lw-dir { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 1.3; color: #65676b; }
.clik-lw-dir i { display: grid; place-items: center; width: 16px; height: 16px; }
.clik-lw-dir svg { width: 14px; height: 14px; }
.clik-lw-dir i { flex: none; }
/* the arrow shows the way the language reads: → left to right, ← right to left, whatever the page */
.clik-lw-dir.is-rtl i { transform: scaleX(-1); }
body.night-mode .clik-lw-dir { color: #b0b3b8; }

/* going to the language: the cube turns over the card */
.clik-lw-busy { display: none; }
.clik-lw-it.is-going .clik-lw-busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: inherit; font-size: 13px; font-weight: 700; color: #0866FF; background: rgba(255, 255, 255, .88); }
.clik-lw-it.is-going .clik-lw-busy::before { content: ""; width: 44px; height: 44px; background: var(--clik-cube-load, var(--clik-cube)) center / contain no-repeat; animation: clik-feed-cube 1.1s ease-in-out infinite; filter: none); }
body.night-mode .clik-lw-it.is-going .clik-lw-busy { background: rgba(36, 37, 38, .9); color: #8ab8ff; }
.clik-lw.is-going .clik-lw-it:not(.is-going) { opacity: .5; pointer-events: none; }

/* the cards come in one after the other */
.clik-lw.is-in .clik-lw-it { animation: clik-lw-in .34s cubic-bezier(.2, .9, .3, 1.1) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
@keyframes clik-lw-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* phones: a sheet above the bottom bar, edge to edge */
@media (max-width: 575px) {
  .clik-lw { align-items: flex-end; padding: 0; }
  .clik-lw-card { width: 100%; max-height: calc(100dvh - 45px - env(safe-area-inset-bottom, 0px) - 24px); margin-bottom: calc(45px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; transform: translateY(24px); }
  .clik-lw-t { font-size: clamp(17px, 5vw, 20px); }
}
@media (max-width: 359px) { .clik-lw-list { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .clik-lw, .clik-lw-card, .clik-lw-it, .clik-lw-x { transition: none !important; }
  .clik-lw.is-in .clik-lw-it, .clik-lw.is-in .clik-lw-it.is-on .clik-lw-ok, .clik-lw-it:hover .clik-lw-flag, .clik-lw.is-in .clik-lw-globe svg { animation: none !important; }
  .clik-lw-it:hover .clik-lw-sheen { transition: none; }
}
