/* ───────────────────────────────────────────────
   Zizania — Back to Top Button (reusable component)
   Design system: "The Curated Earth"
   ─────────────────────────────────────────────── */

.zz-back-to-top {
    /* Positioning */
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;

    /* Size — WCAG touch target ≥ 44px */
    width: 48px !important;
    height: 48px !important;

    /* Shape — fully rounded per design system (primary buttons) */
    border-radius: var(--radius-full);
    border: 0;
    padding: 0 !important;
    box-sizing: border-box;
    line-height: 1;

    /* Surface — primary lime with accessible dark icon */
    background-color: var(--primary);
    color: var(--on-primary);

    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    /* Ambient shadow per design system — 5% opacity of on-surface */
    box-shadow: 0 10px 25px rgba(29, 27, 23, 0.12);

    /* Hidden by default — JS toggles .is-visible */
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
        opacity 300ms ease-in-out,
        visibility 300ms ease-in-out,
        transform 300ms ease-in-out,
        background-color var(--transition-base);
}

/* Visible state (toggled by JS after scroll threshold) */
.zz-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Icon (SVG arrow) — inherits color from button */
.zz-back-to-top svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Hover / focus — matches zz-btn--primary pattern */
.zz-back-to-top:hover,
.zz-back-to-top:focus-visible {
    background-color: #c5c853;
    color: var(--on-primary);
}

/* Active — subtle press feedback */
.zz-back-to-top:active {
    transform: translateY(0) scale(0.95);
}

/* Accessibility — keyboard focus ring */
.zz-back-to-top:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Mobile — tighter margins */
@media (max-width: 768px) {
    .zz-back-to-top {
        bottom: 16px;
        right: 16px;
        width: 44px !important;
        height: 44px !important;
    }
    .zz-back-to-top svg {
        width: 18px;
        height: 18px;
    }
}

/* Reduced motion — no fade, no transform */
@media (prefers-reduced-motion: reduce) {
    .zz-back-to-top {
        transition: opacity 0ms, visibility 0ms;
        transform: none;
    }
    .zz-back-to-top.is-visible {
        transform: none;
    }
    .zz-back-to-top:active {
        transform: none;
    }
}
