/* Floating glass navigation (spec p.9). */

.ss-nav {
    --ss-nav-top: 16px;
    --ss-nav-item-height: 46px;
    --ss-nav-item-padding: 16px;

    position: fixed;
    inset: calc(var(--ss-nav-top) + var(--wp-admin--admin-bar--height, 0px)) var(--ss-nav-top) auto;
    z-index: 999;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.ss-nav__bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 60px;
    max-width: 100%;
    padding: 6px 6px 6px 8px;
    border: 1px solid color-mix(in srgb, var(--ss-white) 55%, transparent);
    border-radius: var(--ss-radius-pill);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--ss-white) 66%, transparent),
        color-mix(in srgb, var(--ss-cream) 54%, transparent)
    );
    -webkit-backdrop-filter: blur(20px) saturate(165%);
    backdrop-filter: blur(20px) saturate(165%);
    box-shadow:
        0 14px 44px -14px color-mix(in srgb, var(--ss-emerald-shadow) 40%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--ss-white) 72%, transparent);
    color: var(--ss-ink);
    pointer-events: auto;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .ss-nav__bar {
        background: color-mix(in srgb, var(--ss-cream) 95%, transparent);
    }
}

/* The parish seal: the way home from every page. */
.ss-nav__home {
    display: grid;
    flex: none;
    place-items: center;
    width: var(--ss-nav-item-height);
    height: var(--ss-nav-item-height);
    border-radius: 50%;
    transition: transform var(--ss-duration-hover) var(--ss-ease);
}

.ss-nav__home:hover {
    transform: scale(1.06);
}

.ss-nav__home img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.ss-nav__links,
.ss-nav__actions {
    display: flex;
    align-items: center;
}

.ss-nav__links {
    gap: 2px;
}

.ss-nav__actions {
    gap: var(--ss-space-1);
    margin-left: var(--ss-space-1);
    padding-left: 12px;
    border-left: 1px solid color-mix(in srgb, var(--ss-ink) 16%, transparent);
}

.ss-nav__phone {
    display: none;
}

.ss-nav__link,
.ss-church-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--ss-space-1);
    min-height: var(--ss-nav-item-height);
    padding: 10px var(--ss-nav-item-padding);
    border-radius: var(--ss-radius-pill);
    color: var(--ss-ink);
    font-size: 1rem;
    font-weight: var(--ss-weight-medium);
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--ss-duration-hover) var(--ss-ease);
}

.ss-nav__link:hover,
.ss-church-menu__toggle:hover,
.ss-church-menu[open] > .ss-church-menu__toggle {
    background: color-mix(in srgb, var(--ss-cream) 62%, transparent);
}

.ss-nav .ss-button {
    min-height: var(--ss-nav-item-height);
    padding: 10px 22px;
    white-space: nowrap;
}

.ss-nav .ss-button--outline {
    background: color-mix(in srgb, var(--ss-white) 34%, transparent);
}

.ss-nav .ss-button--outline:hover {
    background: var(--ss-gold-highlight);
}

.ss-nav a[hidden] {
    display: none;
}

/* Dropdowns: Follow us and the phone Menu. */
.ss-nav__dropdown {
    position: relative;
}

.ss-nav__popover {
    position: absolute;
    top: calc(100% + 12px);
    z-index: 10;
    min-width: 210px;
    padding: 10px;
    border: 1px solid var(--ss-hairline);
    border-radius: 24px;
    background: var(--ss-cream);
    box-shadow: var(--ss-shadow-panel);
}

.ss-nav__popover--end {
    right: 0;
}

.ss-nav__popover--start {
    left: 0;
}

.ss-nav__popover-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ss-space-2);
    min-height: 44px;
    padding: 12px;
    border-radius: 12px;
    color: var(--ss-ink);
    font-weight: var(--ss-weight-regular);
    text-decoration: none;
}

.ss-nav__popover-link:hover {
    background: var(--ss-cream-secondary);
}

/* Our church: a table of the church pages. */
.ss-church-menu {
    position: relative;
}

.ss-church-menu__toggle {
    list-style: none;
}

.ss-church-menu__toggle::-webkit-details-marker {
    display: none;
}

.ss-church-menu__chevron {
    flex: none;
    transition: transform 0.25s var(--ss-ease);
}

.ss-church-menu[open] .ss-church-menu__chevron {
    transform: rotate(180deg);
}

.ss-church-menu__table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.ss-church-menu__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-height: 68px;
    margin: 4px;
    padding: 10px 16px;
    border-radius: var(--ss-radius-row);
    color: var(--ss-ink);
    font-weight: var(--ss-weight-regular);
    text-decoration: none;
}

a.ss-church-menu__item:hover {
    background: color-mix(in srgb, var(--ss-gold-highlight) 30%, transparent);
}

.ss-church-menu__item.is-current {
    background: color-mix(in srgb, var(--ss-gold-highlight) 42%, transparent);
}

.ss-church-menu__item.is-current .ss-church-menu__name::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 10px;
    border-radius: 50%;
    background: var(--ss-maroon);
    vertical-align: middle;
}

.ss-church-menu__name {
    font-size: 1.0625rem;
    line-height: 1.3;
}

.ss-church-menu__status {
    color: var(--ss-muted);
    font-size: 0.75rem;
    font-weight: var(--ss-weight-medium);
    line-height: 1.3;
    letter-spacing: 0.04em;
}

.ss-church-menu__item.is-pending {
    cursor: default;
}

.ss-church-menu__item.is-pending .ss-church-menu__name {
    color: var(--ss-caption);
}

.ss-church-menu--bar .ss-church-menu__panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    z-index: 10;
    width: min(560px, 100vw - 32px);
    padding: 10px;
    border: 1px solid var(--ss-hairline);
    border-radius: 24px;
    background: var(--ss-cream);
    box-shadow: var(--ss-shadow-panel);
}

.ss-church-menu--bar .ss-church-menu__table li:nth-child(n + 3) {
    border-top: 1px solid color-mix(in srgb, var(--ss-gold) 38%, transparent);
}

.ss-church-menu--bar .ss-church-menu__table li:nth-child(odd):not(:last-child) {
    border-right: 1px solid color-mix(in srgb, var(--ss-gold) 38%, transparent);
}

/* Unrolls from the bar; rows follow 35ms apart. Reduced motion shows it at once (base.css). */
.ss-church-menu--bar[open] .ss-church-menu__panel {
    animation: ss-unroll 0.34s var(--ss-ease) both;
}

.ss-church-menu[open] .ss-church-menu__table li {
    animation: ss-unroll-row 0.42s var(--ss-ease) both;
    animation-delay: calc(var(--ss-row, 0) * 35ms + 70ms);
}

@keyframes ss-unroll {
    from {
        opacity: 0;
        transform: translateY(-8px);
        clip-path: inset(0 0 100% 0 round 24px);
    }

    to {
        opacity: 1;
        transform: none;
        clip-path: inset(0 0 0 0 round 24px);
    }
}

@keyframes ss-unroll-row {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* In the phone menu the table becomes one column that expands in place. */
.ss-church-menu--panel {
    display: block;
}

.ss-church-menu--panel > .ss-church-menu__toggle {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 12px;
    border-radius: 12px;
    font-weight: var(--ss-weight-regular);
}

.ss-church-menu--panel .ss-church-menu__panel {
    margin: 0 0 6px 12px;
    padding-left: 4px;
    border-left: 1px solid var(--ss-hairline);
}

.ss-church-menu--panel .ss-church-menu__table {
    grid-template-columns: minmax(0, 1fr);
}

.ss-church-menu--panel .ss-church-menu__item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
}

.ss-church-menu--panel .ss-church-menu__name {
    font-size: 0.9375rem;
}

.ss-church-menu--panel .is-current .ss-church-menu__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Tablet: the bar tightens. */
@media (max-width: 900px) {
    .ss-nav {
        --ss-nav-item-padding: 12px;
    }

    .ss-nav .ss-button {
        padding-inline: 18px;
    }
}

/* Phone: a full-width pill with Menu and Donate. */
@media (max-width: 767px) {
    .ss-nav {
        --ss-nav-top: 12px;
    }

    .ss-nav__bar {
        width: 100%;
        min-height: 58px;
        padding: 5px;
    }

    .ss-nav__links,
    .ss-nav__actions {
        display: none;
    }

    .ss-nav__phone {
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: space-between;
        gap: var(--ss-space-1);
    }

    .ss-nav__phone .ss-nav__popover {
        width: min(320px, 100vw - 24px);
        max-height: calc(100dvh - 160px);
        overflow-y: auto;
    }
}
