/* =========================================================================
   APP FEEL (Nov 2026)

   How the site moves: pages cross-fade into one another, the menu opens
   softly, phones get a black bar of white quick links along the bottom, and
   things you press answer the press.

   Everything here sits under html.rw-app, a class the theme adds from
   library/app.php. Take that class away and none of this applies.

   Black and white only. The one font named is the site's own futura-pt,
   for the words under the icons.
   ========================================================================= */


/* ---- 1. Pages cross-fade into one another ------------------------------ */

@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.22s;
    animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }
}


/* ---- 2. A thin line across the top while the next page is on its way --- */

.rw-progress {
    position: fixed;
    z-index: 2147482000;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rw-progress::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: 0 50%;
}

.rw-progress.is-on {
    opacity: 1;
}

.rw-progress.is-on::before {
    transform: scaleX(0.86);
    transition: transform 9s cubic-bezier(0.05, 0.75, 0.1, 1);
}


/* ---- 3. Things you press answer the press ------------------------------ */

.rw-app a,
.rw-app button {
    -webkit-tap-highlight-color: transparent;
}

.rw-app .hamburger,
.rw-app .rw-tab {
    touch-action: manipulation;
}


/* ---- 4. The menu opens softly, the page behind stays put --------------- */

@keyframes rw-menu-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rw-menu-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes rw-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.rw-app #top_nav {
    background: #000 !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: rw-menu-in 0.22s ease both;
}

.rw-app.rw-menu-closing #top_nav {
    animation: rw-menu-out 0.17s ease both;
}

.rw-app #top_nav li {
    animation: rw-rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.rw-app #top_nav li:nth-child(1) { animation-delay: 0.04s; }
.rw-app #top_nav li:nth-child(2) { animation-delay: 0.07s; }
.rw-app #top_nav li:nth-child(3) { animation-delay: 0.10s; }
.rw-app #top_nav li:nth-child(4) { animation-delay: 0.13s; }
.rw-app #top_nav li:nth-child(5) { animation-delay: 0.16s; }
.rw-app #top_nav li:nth-child(6) { animation-delay: 0.19s; }
.rw-app #top_nav li:nth-child(7) { animation-delay: 0.22s; }
.rw-app #top_nav li:nth-child(n+8) { animation-delay: 0.25s; }

.rw-app #top_nav a {
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.rw-app #top_nav a:active {
    opacity: 0.6;
}

html.rw-menu-open,
html.rw-menu-open body {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .rw-app #top_nav,
    .rw-app #top_nav li {
        animation: none;
    }
}


/* ---- 5. Phones: a bar of quick links along the bottom ------------------ */

.rw-tabbar {
    display: none;
}

@media (max-width: 767px) {

    .rw-tabbar {
        position: fixed;
        z-index: 9000;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        margin: 0;
        padding: 0 4px env(safe-area-inset-bottom, 0px);
        background: rgba(0, 0, 0, 0.92);
        -webkit-backdrop-filter: saturate(120%) blur(16px);
        backdrop-filter: saturate(120%) blur(16px);
        box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.16);
        transition: transform 0.25s ease;
    }

    .rw-tabbar .rw-tab {
        position: relative;
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
        height: 58px;
        margin: 0;
        padding: 0;
        background: none;
        color: #fff !important;
        opacity: 0.72;
        border: 0 !important;
        border-radius: 0;
        font-family: "futura-pt", "Futura", "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 10.5px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0.14em;
        text-decoration: none !important;
        text-transform: uppercase;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        transition: opacity 0.2s ease, transform 0.16s ease;
    }

    .rw-tabbar .rw-tab:active {
        transform: scale(0.92);
    }

    .rw-tabbar .rw-tab svg {
        display: block;
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .rw-tabbar .rw-tab.is-on,
    .rw-tabbar .rw-tab[aria-expanded="true"] {
        opacity: 1;
    }

    /* which page you are on: a small white dot above the icon */
    .rw-tabbar .rw-tab.is-on::before {
        content: "";
        position: absolute;
        top: 5px;
        left: 50%;
        width: 4px;
        height: 4px;
        margin-left: -2px;
        background: #fff;
        border-radius: 50%;
    }

    /* Menu: the three lines turn into a cross while the menu is open */
    .rw-tabbar .rw-tab--menu svg path {
        transform-box: fill-box;
        transform-origin: 50% 50%;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    .rw-tabbar .rw-tab--menu[aria-expanded="true"] svg path:nth-child(1) { transform: translateY(5px) rotate(45deg); }
    .rw-tabbar .rw-tab--menu[aria-expanded="true"] svg path:nth-child(2) { opacity: 0; }
    .rw-tabbar .rw-tab--menu[aria-expanded="true"] svg path:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

    /* out of the way of the keyboard while something is being typed */
    html.rw-typing .rw-tabbar {
        transform: translateY(110%);
    }

    /* the bar has the Menu button now, so the floating one in the corner goes */
    body.rw-has-tabbar #expand_menu {
        display: none;
    }

    /* room for the bar under the footer, and in the menu */
    body.rw-has-tabbar {
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    }

    body.rw-has-tabbar #top_nav {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }

    /* the menu sits under the bar, so the bar's own Close button stays reachable */
    body.rw-has-tabbar #top_nav {
        z-index: 8990;
    }
}
