/* Bluelemon motion tokens and shared interaction polish.
   Keep motion decorative: all state and navigation changes remain event driven. */
:root {
    --motion-control-duration: 120ms;
    --motion-panel-duration: 160ms;
    --motion-dialog-open-duration: 240ms;
    --motion-dialog-open-easing: cubic-bezier(.2, 0, 0, 1);
    --motion-dialog-close-duration: 180ms;
    --motion-dialog-close-easing: ease-in;
    --motion-achievement-duration: 320ms;
    --motion-ease-out: ease-out;
}

/* Give existing controls a consistent timing without changing their geometry. */
:where(button, a, input, select, textarea, summary, .bl-btn, .bl-chip, .ed-chip, .ed-policy) {
    transition-duration: var(--motion-control-duration);
    transition-timing-function: var(--motion-ease-out);
}

:where(button, .bl-btn):active:not(:disabled) { filter: brightness(.96); }
:where(button, .bl-btn):disabled,
:where(button, .bl-btn)[aria-disabled="true"] { cursor: not-allowed; }
:where(button, .bl-btn)[aria-busy="true"] { cursor: progress; }
/* Reserve room for known short/long action labels before their state changes. */
.bk-pay { min-width: 100%; }
.bl-admin-reason-actions > button:last-child { min-width: 140px; }
.ed-dialog > div > button:last-child { min-width: 144px; }
.modal-footer > .btn-primary { min-width: 178px; }
.bl-confirm-actions > button { min-width: 96px; }

/* A hover affordance only exists where the input has real hover capability. */
@media (hover: hover) and (pointer: fine) {
    :where(.bl-tour-card, .bl-experience-card, .bl-passport-experience, .bl-passport-milestone, .ed-card) {
        transition: box-shadow var(--motion-panel-duration) ease-out, border-color var(--motion-panel-duration) ease-out;
    }
    :where(.bl-tour-card, .bl-experience-card, .bl-passport-experience, .bl-passport-milestone, .ed-card):hover {
        box-shadow: 0 12px 30px rgba(11, 24, 48, .08);
    }
}

/* Selected filters change color/border only, so their targets never shift. */
:where(.bl-discover-chips button, .bl-chip, .ed-chip, .ed-policy) {
    transition-property: color, background-color, border-color, box-shadow;
}

/* Shared entrance treatment for custom overlays. Components keep mounted through
   exit by toggling .is-closing before notifying their owner. */
:where(.bl-admin-backdrop, .bl-confirm-overlay, .bl-ts-modal, .ed-modal, .bl-ms-modal) {
    animation: bl-motion-overlay-in var(--motion-dialog-open-duration) var(--motion-dialog-open-easing) both;
}
:where(.bl-admin-reason, .bl-confirm-dialog, .bl-ts-dialog, .ed-dialog, .bl-ms-dialog, .bl-admin-drawer) {
    animation: bl-motion-dialog-in var(--motion-dialog-open-duration) var(--motion-dialog-open-easing) both;
}
.bl-admin-reason { animation-name: bl-motion-admin-dialog-in; }
.bl-admin-drawer { animation-name: bl-motion-drawer-in; }
:where(.bl-admin-backdrop, .bl-confirm-overlay, .bl-ts-modal, .ed-modal, .bl-ms-modal).is-closing {
    animation: bl-motion-overlay-out var(--motion-dialog-close-duration) var(--motion-dialog-close-easing) both;
    pointer-events: none;
}
:where(.bl-admin-reason, .bl-confirm-dialog, .bl-ts-dialog, .ed-dialog, .bl-ms-dialog, .bl-admin-drawer).is-closing {
    animation: bl-motion-dialog-out var(--motion-dialog-close-duration) var(--motion-dialog-close-easing) both;
}
.bl-admin-reason.is-closing { animation-name: bl-motion-admin-dialog-out; }
.bl-admin-drawer.is-closing { animation-name: bl-motion-drawer-out; }

@keyframes bl-motion-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bl-motion-dialog-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bl-motion-overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes bl-motion-dialog-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }
@keyframes bl-motion-admin-dialog-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes bl-motion-admin-dialog-out { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
@keyframes bl-motion-drawer-in { from { opacity: .8; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bl-motion-drawer-out { from { opacity: 1; transform: translateX(0); } to { opacity: .8; transform: translateX(8px); } }

/* Bootstrap owns modal lifetime and focus restoration; this only normalizes timing. */
.modal.fade .modal-dialog { transition-duration: var(--motion-dialog-open-duration); transition-timing-function: var(--motion-dialog-open-easing); }
.modal.fade:not(.show) .modal-dialog { transition-duration: var(--motion-dialog-close-duration); transition-timing-function: var(--motion-dialog-close-easing); }
.modal.is-closing { pointer-events: none; }

/* Mobile custom dialogs become bottom sheets with a shorter, gentler travel. */
@media (max-width: 600px) {
    .bl-ms-modal { align-items: end; padding: 0; }
    .bl-ms-dialog { transform-origin: bottom center; animation-name: bl-motion-sheet-in; }
    .bl-ms-dialog.is-closing { animation-name: bl-motion-sheet-out; }
    .ed-modal { align-items: end; padding: 0; }
    .ed-dialog { width: 100%; border-radius: 22px 22px 0 0; }
}
@keyframes bl-motion-sheet-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bl-motion-sheet-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(16px); } }

/* Reveals are attached only to server-confirmed achievement classes. */
.bl-customer-passport .bl-passport-mark.is-verified,
.bl-customer-passport .bl-passport-milestone.is-earned,
.bl-customer-medal.is-earned,
.bl-hp-honour-medal.is-earned,
.bl-guide-honours .is-earned {
    animation: bl-motion-achievement-in var(--motion-achievement-duration) ease-out both;
}
@keyframes bl-motion-achievement-in { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-control-duration: 0ms;
        --motion-panel-duration: 0ms;
        --motion-dialog-open-duration: 0ms;
        --motion-dialog-close-duration: 0ms;
        --motion-achievement-duration: 0ms;
    }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0ms !important;
    }
}

