/* Babel Office — motion and hover layer.
   Loaded on every page (public site, back office, client portal) right after components.css.

   Rules of the layer:
   - Only colour, shadow, opacity, filter and transform change, so nothing moves the layout.
   - Movement (lifts, nudges) only happens on devices with a real pointer (hover: hover)
     and when the visitor hasn't asked for reduced motion.
   - Base transitions use :where() so they have zero specificity: any page that already
     sets its own transition keeps it. */

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: .15s;
  --dur-base: .22s;
  --dur-slow: .35s;
  --lift-shadow: 0 8px 20px -8px rgba(11, 59, 44, .28);
}

/* ---------- 1. Smooth state changes everywhere ---------- */
:where(a, button, summary, [role="button"], input, select, textarea, label) {
  transition:
    color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-standard),
    filter var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-out);
}
:where(tbody tr, tbody td) { transition: background-color var(--dur-fast) var(--ease-standard); }
:where(button, [role="button"], a[class*="btn"], a[class*="button"]) svg,
:where(button, [role="button"], a[class*="btn"], a[class*="button"]) .ico {
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-standard);
}

/* ---------- 2. Text links that had no hover state ---------- */
:where(td, .breadcrumb, .nav-breadcrumb, .input-hint) a:not([class]):hover,
a[onclick]:not([class]):hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- 3. Back office shell ---------- */
.menu-item .ico { transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-standard), opacity var(--dur-fast); }
.menu-item:hover .ico { opacity: 1; color: var(--gold-light); }

a.user-box:hover {
  background: var(--bg-surface);
  border-color: var(--gold-hairline);
  box-shadow: var(--shadow-card);
}
.user-avatar { transition: box-shadow var(--dur-base) var(--ease-out); }
a.user-box:hover .user-avatar { box-shadow: 0 0 0 3px var(--gold-subtle), var(--shadow-gold); }

.modal-close:hover { border-color: var(--border-subtle); }

/* Older page-level buttons that only had a resting style.
   Listed here because dashboard.css gives every link a colour-only transition. */
a.user-box, .light-button, .dark-button, .back-button, .btn-alert-action {
  transition:
    color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-out),
    filter var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-out);
}
.light-button:hover,
.back-button:hover { background: #e5e7eb; color: #111827; }
.dark-button:hover { background: #1f2937; }
.cred-btn:hover { filter: brightness(1.06) saturate(1.05); box-shadow: 0 3px 10px -4px rgba(11, 59, 44, .35); }
.btn-alert-action:hover { filter: brightness(1.06); }

/* ---------- 4. Movement: real pointers only, never with reduced motion ---------- */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .menu-item:not(.active):not([aria-current="page"]):hover .ico { transform: scale(1.1); }

  .light-button:hover,
  .dark-button:hover,
  .back-button:hover,
  .cred-btn:hover,
  .btn-alert-action:hover { transform: translateY(-1px); }
  .dark-button:hover { box-shadow: var(--lift-shadow); }

  /* Service tiles on the client file */
  a.service:hover { transform: translateY(-2px); box-shadow: var(--lift-shadow); }
}

/* Touch screens: a short press feedback instead of hover */
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  :where(.light-button, .dark-button, .back-button, .cred-btn, .btn-alert-action):active { transform: scale(.97); }
}
