/* ═══════════════════════════════════════════════════════════════════════
   CLINIOS One Premium — UX/UI additive layer (v55)
   Mobile drawer · scroll progress · footer brand lockup · button polish
   · coherent gold focus · skip link · reduced-motion. Charte préservée.
   Couche purement additive : aucun fichier existant n'est modifié.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── 1 · SKIP LINK (accessibility) ─── */
.ux-skip {
  position: fixed;
  top: -120%;
  left: 16px;
  z-index: 2000;
  background: var(--ink-deep);
  color: var(--bg-ivory);
  padding: 12px 20px;
  border-radius: 0 0 4px 4px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-luxe);
  transition: top 0.25s var(--ease-out-expo);
}
.ux-skip:focus { top: 0; }

/* ─── 2 · COHERENT GOLD KEYBOARD FOCUS (site-wide) ─── */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-warm);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── 3 · SCROLL PROGRESS BAR (gold) ─── */
.ux-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 1001;
  background: linear-gradient(90deg, var(--gold-deep) 0%, var(--gold-warm) 38%, var(--gold-pale) 74%, var(--bg-ivory) 100%);
  box-shadow: 0 0 12px rgba(212, 184, 106, 0.65);
  pointer-events: none;
  will-change: width;
}
[dir="rtl"] .ux-progress { left: auto; right: 0; }

/* ─── 4 · BUTTON POLISH — light sweep + press feedback ─── */
.btn:not(.btn-ghost)::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease-out-expo);
  pointer-events: none;
  z-index: 2;
}
.btn:not(.btn-ghost):hover::after { left: 145%; }
.btn:not(.btn-ghost):active { transform: translateY(0) scale(0.985); }

/* ─── 5 · FOOTER — brand lockup recentered & professionally sized ─── */
.footer .footer-brand {
  align-self: center;            /* vertically balanced against link columns */
}
.footer .footer-brand-row {
  justify-content: center;        /* recentered emblem + wordmark unit */
  align-items: center;
  gap: var(--space-4);
  margin-bottom: 0;
}
.footer .footer-emblem {
  width: 64px;
  height: 64px;
}
.footer .footer-logo { text-align: left; }

/* ─── 6 · MOBILE NAV — animated hamburger ─── */
.ux-burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: var(--border-fine);
  border-radius: 2px;
  background: transparent;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  transition: border-color var(--duration-quick) var(--ease-out-expo),
              background var(--duration-quick) var(--ease-out-expo);
}
.ux-burger:hover { border-color: var(--gold-warm); background: rgba(184, 146, 62, 0.08); }
.ux-burger-box { position: relative; width: 22px; height: 14px; display: block; }
.ux-burger-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--ink-deep);
  border-radius: 2px;
  transition: transform var(--duration-quick) var(--ease-out-expo),
              opacity 0.2s var(--ease-out-expo),
              background var(--duration-quick) var(--ease-out-expo);
}
.ux-burger-line:nth-child(1) { top: 0; }
.ux-burger-line:nth-child(2) { top: 50%; transform: translateY(-50%); }
.ux-burger-line:nth-child(3) { bottom: 0; }
.ux-burger[aria-expanded="true"] .ux-burger-line:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); background: var(--gold-warm); }
.ux-burger[aria-expanded="true"] .ux-burger-line:nth-child(2) { opacity: 0; }
.ux-burger[aria-expanded="true"] .ux-burger-line:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); background: var(--gold-warm); }

/* ─── 7 · MOBILE NAV — overlay + lateral drawer ─── */
.ux-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-quick) var(--ease-out-expo),
              visibility var(--duration-quick) var(--ease-out-expo);
  z-index: 1100;
}
.ux-overlay.ux-open { opacity: 1; visibility: visible; }

.ux-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(86vw, 360px);
  background: var(--ink-deep);
  color: var(--bg-ivory);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-6) var(--space-7);
  overflow-y: auto;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
}
.ux-drawer.ux-open { transform: translateX(0); }
.ux-drawer::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-warm) 40%, var(--red-swiss) 50%, var(--gold-warm) 60%, transparent);
}
/* RTL (Arabic) — drawer enters from the left */
[dir="rtl"] .ux-drawer { right: auto; left: 0; transform: translateX(-100%); box-shadow: 24px 0 60px rgba(0,0,0,0.45); }
[dir="rtl"] .ux-drawer.ux-open { transform: translateX(0); }

.ux-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.ux-drawer-brand { display: flex; align-items: center; gap: var(--space-3); }
.ux-drawer-brand .ux-drawer-emblem {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-ivory);
  overflow: hidden;
  flex: 0 0 auto;
}
.ux-drawer-brand .ux-drawer-emblem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ux-drawer-brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--bg-ivory);
  line-height: 1;
}
.ux-drawer-brand-name sup { font-size: 0.42em; vertical-align: super; color: var(--gold-pale); }

.ux-close {
  width: 42px; height: 42px;
  border: 1px solid rgba(212, 184, 106, 0.4);
  border-radius: 2px;
  background: transparent;
  color: var(--gold-pale);
  font-size: 1.2rem;
  line-height: 1;
  flex: 0 0 auto;
  transition: border-color var(--duration-quick) var(--ease-out-expo),
              background var(--duration-quick) var(--ease-out-expo),
              transform 0.2s var(--ease-out-expo);
}
.ux-close:hover { border-color: var(--gold-warm); background: rgba(212, 184, 106, 0.1); }
.ux-close:active { transform: scale(0.94); }

.ux-drawer-nav { display: flex; flex-direction: column; }
.ux-drawer-nav a {
  position: relative;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  color: rgba(250, 248, 243, 0.82);
  padding: var(--space-4) 0;
  border-bottom: 1px solid rgba(212, 184, 106, 0.15);
  transition: color var(--duration-quick) var(--ease-out-expo),
              padding-left var(--duration-normal) var(--ease-out-expo);
}
.ux-drawer-nav a::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 50%;
  width: 0;
  height: 1.5px;
  background: var(--gold-warm);
  transform: translateY(-50%);
  transition: width var(--duration-normal) var(--ease-out-expo);
}
.ux-drawer-nav a:hover,
.ux-drawer-nav a:focus-visible { color: var(--gold-pale); padding-left: 16px; }
.ux-drawer-nav a:hover::before,
.ux-drawer-nav a:focus-visible::before { width: 16px; }
[dir="rtl"] .ux-drawer-nav a::before { left: auto; right: -22px; }
[dir="rtl"] .ux-drawer-nav a:hover,
[dir="rtl"] .ux-drawer-nav a:focus-visible { padding-left: 0; padding-right: 16px; }

.ux-drawer-cta { margin-top: var(--space-5); }
.ux-drawer-cta .btn { width: 100%; }

.ux-drawer-langs {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(212, 184, 106, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}
.ux-drawer-langs button {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 248, 243, 0.6);
  background: none;
  padding: 4px 2px;
  transition: color var(--duration-quick) var(--ease-out-expo);
}
.ux-drawer-langs button:hover,
.ux-drawer-langs button:focus-visible { color: var(--gold-pale); }
.ux-drawer-langs button.ux-lang-active { color: var(--gold-pale); border-bottom: 1px solid var(--gold-warm); }

body.ux-nav-open { overflow: hidden; }

/* ─── 8 · RESPONSIVE — reveal burger where the inline menu disappears ─── */
@media (max-width: 800px) {
  .topnav-menu { display: none; }
  .ux-burger { display: inline-flex; }
}
@media (max-width: 520px) {
  /* keep header breathable: compact the inline CTA, drawer carries full nav */
  .topnav .topnav-actions .btn-primary { padding: var(--space-3) var(--space-4); }
}

/* Footer brand: fully centered on small screens (single-column grid) */
@media (max-width: 880px) {
  .footer .footer-brand { align-self: start; text-align: center; }
  .footer .footer-brand-row { justify-content: center; }
}

/* ─── 9 · REDUCED MOTION — content visible instantly, no movement ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal-fade,
  .reveal-slow,
  .reveal-left,
  .reveal-right,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .ux-progress,
  .ux-drawer,
  .ux-overlay,
  .ux-burger-line,
  .ux-skip,
  .btn::after,
  .footer-emblem {
    transition: none !important;
  }
}
