/* «للأعلى» arrow (inc/back-to-top.php): opposite corner to the language switch, same frosted look. */
.sanam-totop {
    position: fixed;
    bottom: calc(22px + env(safe-area-inset-bottom));
    inset-inline-start: 22px;
    z-index: 990;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(250 250 252 / .8);
    color: #662627;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 0 0 1px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .14);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.9);
    transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .45s, background-color .25s ease, box-shadow .25s ease;
}
.sanam-totop[hidden] { display: grid; } /* shown/hidden with the classes below (keeps the animation) */
.sanam-totop.is-shown {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1), visibility 0s, background-color .25s ease, box-shadow .25s ease;
}
.sanam-totop:hover { background: rgb(255 255 255 / .92); transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 12px 28px rgb(0 0 0 / .18); }
.sanam-totop:hover svg { transform: translateY(-2px); }
.sanam-totop svg { transition: transform .25s ease; }
.sanam-totop:focus-visible { outline: 2px solid #291f1e; outline-offset: 3px; }
/* Desktop homepage: the section timeline bar runs down that side (fixed, 64px, z-index 1000), so
   the arrow sits just beside it, above it in the stack. */
@media (min-width: 1025px) {
    body:has(.cedkw-sidebar) .sanam-totop { inset-inline-start: 104px; z-index: 1001; }
}
html.sanam-menu-open .sanam-totop { opacity: 0; visibility: hidden; }
@media print { .sanam-totop { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .sanam-totop { transition: none; } }
