/* Leave the @layer declarations to prevent conflicts with editor defined styles */
@layer theme, base, components, utilities;

@layer components {
    :root {
        --page-bg: #ffffff;
        --page-bg-dark: #030620;
        --theme-text-color: #1b1b1c;
        --theme-text-color-dark: #a8acb3;
        --theme-heading-color: #101010;
        --theme-heading-color-dark: #F7F8F8;
        --theme-subtitle-color: #6b7280;
        --theme-subtitle-color-dark: #9ca3af;
        --theme-divider-color: #e5e7eb;
        --theme-divider-color-dark: #374151;
        --theme-nav-color: #101010;
        --theme-nav-color-dark: #ffffff;
        --theme-subnav-anim-duration: 500ms;
        --theme-link-color: var(--color-primary-main);
        --theme-link-hover-color: var(--color-primary-dark);
        --theme-link-underline-color: var(--color-primary-main);
        --theme-link-hover-underline-color: var(--color-primary-dark);
        --theme-site-title-size: 24px;
        --theme-site-title-font-weight: 700;
        --theme-transition-timing-funtion: cubic-bezier(0.4, 0, 0.2, 1);
    }

    body,
    .outer-container {
        background-color: var(--site-bg-color, var(--page-bg));
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        letter-spacing: -0.4px;
    }

    body.dark,
    .dark .outer-container {
        background-color: var(--page-bg-dark);
    }

    .no-header .component:has(.main-header) {
        display: none;
    }

    .no-footer .main-footer {
        display: none;
    }

    .main-footer {
        position: relative;
        border-top: 1px solid #e5e7eb;

        &:where(.dark, .dark *) {
            border-color: #1e293b;
        }
    }

    .main-footer .footer-inner {
        display: flex;
        flex-direction: column;

        &:where(.dark, .dark *) {
            color: var(--theme-text-color-dark);
        }
    }

    .splash-page .component:has(.main-header) {
        display: none;
    }

    /* Start text styles. These correspond to the Site Design: Text Styles options in the editor  */
    html, html.dark .contrast, .text-light-bg {
        color: var(--theme-text-color);
    }

    .text-option, .art-text {
        font-size: 16px;
        line-height: 24px;
        letter-spacing: 0;
        font-weight: 400;
        text-transform: none;
    }

    .text-option a, .art-text a, .link-container a {
        color: var(--color-primary-main);
        text-decoration: none;
    }

    .text-option a:hover, .text-option a.active, .art-text a:hover, .art-text a.active, .link-container a:hover {
        color: var(--color-primary-light);
        text-decoration: none;
    }

    .heading-light-bg, h1:not(.custom-text-color), h2:not(.custom-text-color), h3:not(.custom-text-color), h4:not(.custom-text-color), h5:not(.custom-text-color), h6:not(.custom-text-color) {
        color: var(--theme-heading-color);
    }

    h1 .text-option , h1 {
        font-size: 60px;
        font-weight: 700;
        line-height: 60px;
        letter-spacing: -1.5px;
        text-transform: none;
    }

    h2 .text-option, h2 {
        font-size: 36px;
        line-height: 40px;
        letter-spacing: 0;
        font-weight: 700;
        text-transform: none;
    }

    h3 .text-option, h3 {
        font-size: 30px;
        line-height: 36px;
        letter-spacing: 0;
        font-weight: 700;
        text-transform: none;
    }

    .art-button {
        font-family: var(--font-button);
        font-size: 16px;
        letter-spacing: 0;
        font-weight: 700;
        text-transform: none;
    }

    blockquote {
        font-family: var(--font-quote);
        color: var(--theme-text-color);
        font-size: 16px;
        line-height: 24px;
        letter-spacing: 0;
        font-weight: 400;
        text-transform: none;
        font-style: italic;
    }

    /* End text styles */

    /* Button Styles */
    .art-button.button-standard {
        color: var(--theme-heading-color-dark);
        background-color: var(--color-primary-main);
        border-radius: var(--shape);
        transition-property: all;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 150ms;

        &:hover {
            background-color: var(--color-primary-light);
        }
    }

    .art-button.button-highlight {
        color: var(--theme-heading-color-dark);
        background-color: var(--color-secondary-main);
        border-radius: var(--shape);
        transition-property: all;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 150ms;

        &:hover {
            background-color: var(--color-secondary-light);
        }
    }

    .art-button.button-small {
        padding: 4px 8px;
    }

    .art-button.button-medium {
        padding: 8px 16px;
    }

    .art-button.button-large {
        padding: 16px 32px;
    }

    .art-button.button-xl {
        padding: 32px 64px;
    }

    .art-button.button-2xl {
        padding: 64px 128px;
    }

    .art-button.md\:button-small {
        @media (width >=768px) {
            padding: 4px 8px;
        }
    }

    .art-button.md\:button-medium {
        @media (width >=768px) {
            padding: 8px 16px;
        }
    }

    .art-button.md\:button-large {
        @media (width >=768px) {
            padding: 16px 32px;
        }
    }

    .art-button.md\:button-xl {
        @media (width >=768px) {
            padding: 32px 64px;
        }
    }

    .art-button.md\:button-2xl {
        @media (width >=768px) {
            padding: 64px 128px;
        }
    }

    .art-button.lg\:button-small {
        @media (width >=1024px) {
            padding: 4px 8px;
        }
    }

    .art-button.lg\:button-medium {
        @media (width >=1024px) {
            padding: 8px 16px;
        }
    }

    .art-button.lg\:button-large {
        @media (width >=1024px) {
            padding: 16px 32px;
        }
    }

    .art-button.lg\:button-xl {
        @media (width >=1024px) {
            padding: 32px 64px;
        }
    }

    .art-button.lg\:button-2xl {
        @media (width >=1024px) {
            padding: 64px 128px;
        }
    }

    /* End Button Styles */

    .component:has(.sticky-header) {
        position: sticky !important;
        z-index: 40;
        top: 0;
        width: 100%;
        margin-inline: auto;
        border-bottom: 1px solid transparent;
    }

    .sticky-header .header-backdrop {
        position: absolute;
        inset: 0;
        transition-property: opacity;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 150ms;


        &:where(.scrolled *) {
            background: #ffffff;
            opacity: 95%;
            -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
            box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

            &:where(.dark, .dark *) {
                background: #030621;
                box-shadow: none;
                border-bottom: 1px solid #6b728033
            }
        }
    }

    .sticky-header .header-outer {
        position: relative;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
        width: 100%;
        margin-inline: auto;
        padding-block: 12px;
        padding-inline: 24px;

        &:where(.mobile-nav *) {
            display: block;
            padding-inline: 12px;
        }
    }

    .sticky-header .header-buttons {
        display: flex;
        justify-content: space-between;
    }

    .sticky-header .logo-link {
        display: flex;
        align-items: center;
    }

    .sticky-header .logo-link span {
        font-weight: 700;
        margin-left: 8px;
        align-self: center;
        color: #111827;
        white-space: nowrap;

        @media (width >=768px) {
            padding-left: 144px;
        }

        &:where(.dark, .dark *) {
            color: var(--theme-heading-color-dark);
        }
    }

    .sticky-header .logo-link .text-logo {
        max-width: 288px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow-x: auto;
        height: auto;
        font-size: var(--option-site-title-size, var(--theme-site-title-size));
        font-weight: var(--theme-site-title-font-weight);

        &:where(.dark, .dark *) {
            color: #ffffff;
        }
    }

    .logo-auto {
        max-width: 200px;
        max-height: 46px;
    }

    .logo-large {
        height: 64px;

        @media (width >=768px) {
            height: 96px;
        }
    }

    .logo-medium, .logo-standard {
        height: 48px;
    }

    .logo-small {
        height: 32px;
    }

    .logo-x-small {
        height: 16px;
    }

    .logo-custom {
        max-width: 200px;
        max-height: 46px;

        @media (width >=768px) {
            max-width: 200px;
            max-height: 46px;
        }

        @media (width >=1024px) {
            max-width: 220px;
            max-height: none;
            height: auto;
            width: var(--logo-width, 200px) !important;
        }
    }

    .light-bg-logo {
        &:where(.dark, .dark *) {
            display: none;
        }
    }

    .dark-bg-logo {
        display: none;

        &:where(.dark, .dark *) {
            display: block;
        }
    }

    .mobile-menu-button-container {
        display: none;
        position: relative;
        align-items: center;

        &:where(.mobile-nav *) {
            display: flex;
        }
    }

    .mobile-menu-button {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        height: 48px;
        width: 48px;
    }

    .mobile-cart-alert {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        top: 0;
        right: -4px;
        height: 20px;
        width: 20px;
        margin: 4px;
        background-color: var(--color-primary-main);
        border-radius: calc(infinity * 1px);
        font-size: 10px;
        font-weight: 700;
        z-index: 10;
    }

    .mobile-cart-alert span {
        color: #ffffff;
    }

    .mobile-menu-button-piece {
        display: none;
        margin-block: 4px;
        height: 2px;
        width: 24px;
        background-color: var(--theme-divider-color-dark);
        border-radius: 4px;
        transition-property: translate, rotate;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 300ms;

        &:where(.dark, .dark *) {
            background-color: #d1d5db;
        }

        &:where(.mobile-nav *) {
            display: block;
        }
    }

    .mobile-nav-open .mobile-piece-top {
        rotate: 45deg;
        translate: 0 10px;
    }

    .mobile-nav-open .mobile-piece-middle {
        opacity: 0;
    }

    .mobile-nav-open .mobile-piece-bottom {
        rotate: calc(45deg * -1);
        translate: 0 -10px;
    }

    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    .sticky-header nav {
        align-items: center;
        color: var(--theme-heading-color);

        &:where(.desktop-nav *) {
            grid-column: span 2 / span 2;
            width: auto;
            justify-self: center;
            margin-inline: 20px;
            overflow: visible;
        }

        &:where(.mobile-nav *) {
            display: none;
            width: 100%;
            overflow-x: hidden;
            overflow-y: auto;

            &:where(.mobile-nav-open *) {
                display: block;
                position: fixed;
                top: 70px;
                left: 0;
                right: 0;
                bottom: 70px;
                padding-inline: 6px;
            }
        }

        &:where(.dark, .dark *) {
            color: var(--theme-heading-color-dark);
        }
    }

    .sticky-header nav ul {
        display: flex;
        flex-wrap: wrap;

        &:where(.desktop-nav *) {
            width: auto;
            font-size: 15px;
            flex-direction: row;
            justify-content: center;
            align-self: center;
        }

        &:where(.mobile-nav *) {
            font-size: 20px;
            flex-direction: column;
            background: #ffffff;

            &:where(.dark, .dark *) {
                border-color: #374151;
                background: #1f2937;
            }
        }
    }

    .mobile-nav .nav-link,
    .subnav .nav-link {
        color: var(--theme-nav-color) !important;
    }

    .dark .mobile-nav .nav-link,
    .dark .subnav .nav-link {
        color: var(--theme-nav-color-dark) !important;
    }

    .nav-link {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        font-family: var(--font-nav_link);
        color: var(--theme-nav-color);
        font-size: 15px;
        letter-spacing: 0;
        font-weight: 400;
        text-transform: none;
        text-underline-offset: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        transition-property: all;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 150ms;

        &:hover {
            color: var(--color-primary-main);
            text-decoration-line: underline;
        }

        &.active {
            color: var(--color-primary-main);
            text-decoration-line: underline;
        }

        &:where(.mobile-nav *) {
            line-height: 1.2em;
        }

        &:where(.dark, .dark *) {
            color: var(--theme-nav-color-dark);
        }
    }

    .dark .nav-link:hover {
        color: #ffffff;
    }

    ul.subnav {
        display: flex;
        flex-direction: column;

        &:where(.dark, .dark *) {
            border-color: #374151;
            background-color: #1f2937;
            box-shadow: none;
        }

        &:where(.mobile-nav *) {
            border: none;
            margin-left: 40px;
        }
    }

    body > ul.subnav {
        position: absolute;
        width: 200px;
        max-height: 100vh;
        overflow-y: auto;
        z-index: 20;
        padding-block: 8px;
        border-radius: 4px;
        border: 1px solid #f3f4f6;
        background-color: #ffffff;
        box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 25px 50px -12px color-mix(in oklab, color-mix(in oklab, oklch(44.6% 0.03 256.802) 10%, transparent) 100%, transparent);
    }

    ul.subnav .nav-link {
        display: block;
        overflow: auto;
        text-wrap: wrap;
        padding: 0 16px;

        &:where(.mobile-nav *) {
            padding: 16px 0;
        }
    }

    .subnav li {
        padding-block: 8px;

        &:where(.mobile-nav *) {
            padding-block: 0;
        }
    }

    .subnav li:hover {
        background: #fafafa;
    }

    .mobile-nav .subnav li:hover {
        background: transparent;
    }

    .subnav .nav-link .subnav-label {
        width: 100%;
        display: inline-flex;
        justify-content: space-between;
    }

    /* Subnav animation helpers */
    .subnav-anim {
        transition-property: transform, opacity;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: var(--theme-subnav-anim-duration, 500ms);
        will-change: transform, opacity;
    }

    .subnav-anim.from-below {
        transform: translateY(-10px);
        opacity: 0;
    }

    .subnav-anim.from-left {
        transform: translateX(10px);
        opacity: 0;
    }

    .subnav-anim.from-right {
        transform: translateX(-10px);
        opacity: 0;
    }

    .subnav-anim.is-open {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }

    .mobile-cart-button-list {
        margin-top: 24px;
    }

    .mobile-nav-button {
        display: none;

        &:where(.mobile-nav *) {
            display: list-item;
        }
    }

    .desktop-buttons {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 8px;

        &:where(.mobile-nav *) {
            display: none;
        }
    }

    .sticky-header .nav-button {
        position: relative;
        display: flex;
        width: auto;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 10px 24px;
        border: 1px solid var(--color-primary-main);
        border-radius: calc(infinity * 1px);
        background-color: var(--color-primary-main);
        transition-property: all;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 300ms;
        font-size: 14px;
        font-weight: 700;
        text-wrap: nowrap;
        color: var(--theme-heading-color-dark);

        &:hover {
            border-color: var(--color-primary-light);
            background-color: var(--color-primary-light);
        }
    }

    .sticky-header .nav-button.highlight-button {
        background-color: #ffffff;
        color: var(--text-color);
        border: 1px solid #9ca3af;
    }

    .nav-avatar {
        display: flex;
    }

    .nav-avatar img {
        width: 48px;
        height: 48px;
        border-radius: calc(infinity * 1px);
    }

    .nav-avatar span {
        display: inline-flex;
        width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        border-radius: calc(infinity * 1px);
        border: 1px solid var(--color-primary-main);
    }

    .nav-avatar span svg {
        width: 24px;
    }

    .post-list {
        max-width: 896px;
        margin-inline: auto;
        padding: 48px 24px;

        @media (width >=768px) {
            padding-block: 64px;
        }

        @media (width >=1024px) {
            padding-block: 80px;
        }
    }

    .post-list .post-item {
        margin-bottom: 48px;

        @media (width >=768px) {
            margin-bottom: 80px;
        }
    }

    .post-list .post-item article {
        margin-inline: auto;
        display: grid;
        gap: 24px;
        max-width: 448px;

        @media (width >=768px) {
            gap: 32px;
            max-width: none;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .post-item .cover-image-link {
        display: block;
        position: relative;
    }

    .post-item .cover-image-link div {
        position: relative;
        height: 0;
        border-radius: 4px;
        background: #9ca3af;
        box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
        overflow: hidden;
        padding-bottom: 56.25%;

        @media (width >=768px) {
            height: 288px;
            padding-bottom: 75%;
        }

        @media (width >=1024px) {
            padding-bottom: 56.25%;
        }

        &:where(.dark, .dark *) {
            background: #334155;
        }
    }

    .post-item .cover-image-link img {
        position: absolute;
        border-radius: 4px;
        background: #9ca3af;
        box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
        height: 100%;
        width: 100%;
        inset: 0;
        margin-bottom: 24px;
        object-fit: cover;
        object-position: center;

        &:where(.dark, .dark *) {
            background: #334155;
        }
    }

    .post-item .post-content-container {
        margin-top: 8px;
    }

    .post-item .post-topbar {
        margin-bottom: 4px;
    }

    .post-item .post-topbar-text {
        font-size: 14px;
    }

    .post-item .date-icon,
    section.post .date-icon {
        display: inline-block;
        margin-top: -2px;
        height: 14px;
        width: 14px;

        &:where(.dark, .dark *) {
            color: #9ca3af;
        }
    }

    .post-item time,
    section.post time,
    section.post .author-name {
        display: inline-block;
    }

    .post-item .post-avatar,
    section.post .post-avatar {
        display: inline-block;
        margin-top: -2px;
        height: 14px;
        width: 14px;
        border-radius: calc(infinity * 1px);
        object-fit: cover;
    }

    section.post .date-icon,
    section.post .post-avatar {
        height: 16px;
        width: 16px;
    }

    .post-item header h2 {
        margin-bottom: 8px;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.25em;

        @media (width >=640px) {
            font-size: 24px;
        }

        &:where(.dark, .dark *) {
            color: #cbd5e1;
        }
    }

    .post-item header h2 a {
        display: inline-block;
        transition-property: color;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 200ms;

        &:hover {
            color: var(--color-primary-main);
        }
    }

    .post-item .post-content {
        font-size: 18px;
        line-height: 1.55em;
    }

    .post-item footer {
        margin-top: 20px;
    }

    .post-item .post-tags {
        font-size: 14px;
    }

    .post-item .post-tags li,
    section.post .post-tags li {
        display: inline-block;
        margin-bottom: 8px;
        background: #f3f4f6;
        text-transform: lowercase;
        padding: 2px 8px;
        margin-right: 8px;

        &:where(.dark, .dark *) {
            background: #334155;
        }
    }

    .post-item .post-tags li a,
    section.post .post-tags li a {
        &:where(.dark, .dark *) {
            color: #cbd5e1;
        }

        &:hover {
            color: var(--color-primary-main);
        }
    }

    .posts-pagination {
        margin-top: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .posts-pagination nav {
        isolation: isolate;
        display: inline-flex;
        border-radius: 6px;
        box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05);
    }

    .posts-pagination a {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #ffffff;
        border: 1px solid #d1d5db;
        font-size: 14px;
        color: #6b7280;

        &:hover {
            background: #f9fafb;
        }

        &:where(.dark, .dark *) {
            border-color: #6b7280;
            background: #1f2937;
            color: #d1d5db;
        }
    }

    .posts-pagination a.disabled {
        pointer-events: none;
        opacity: 40%;
    }

    .posts-pagination .pagination-button-left {
        padding: 8px 16px 8px 12px;
        border-top-left-radius: 6px;
        border-bottom-left-radius: 6px;
    }

    .posts-pagination .pagination-button-right {
        padding: 8px 12px 8px 16px;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
    }

    .posts-pagination svg {
        width: 12px;
        height: 12px;
    }

    section.post {
        margin-inline: auto;
        padding-block: 32px;

        @media (width >=640px) {
            padding-block: 64px;
        }

        @media (width >=1024px) {
            padding-block: 80px;
        }
    }

    section.post .post-topbar {
        margin: 0 auto 8px;
        padding: 0 16px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        max-width: 768px;

        @media (width >=640px) {
            flex-direction: row;
            align-items: center;
            padding-inline: 24px;
        }
    }

    section.post header h1 {
        margin-inline: auto;
        padding-inline: 16px;
        max-width: 768px;
        font-weight: 700;
        font-size: 36px;
        letter-spacing: -0.8px;

        @media (width >=640px) {
            padding-inline: 24px;
        }

        @media (width >=768px) {
            font-size: 48px;
        }
    }

    section.post header p.subtitle {
        max-width: 768px;
        margin: 16px auto 32px;
        padding-inline: 16px;
        font-size: 20px;
        line-height: 1.4em;
        text-align: justify;

        @media (width >=640px) {
            padding-inline: 24px;
        }

        @media (width >=768px) {
            font-size: 24px;
            line-height: 1.33em;
        }

        &:where(.dark, .dark *) {
            color: #94a3b8;
        }
    }

    section.post .cover-image {
        object-fit: cover;
        object-position: center;
        max-height: 506px;
        aspect-ratio: 1.7786561264822134;
        width: 100%;
        max-width: 100%;
        background: #9ca3af;
        margin-inline: auto;
        margin-bottom: 24px;

        @media (width >=640px) {
            border-radius: 6px;
        }

        @media (width >=1024px) {
            max-width: 900px;
        }

        &:where(.dark, .dark *) {
            background: #334155;
        }
    }

    section.post .post-content-container {
        margin: 32px auto 0;
        padding-inline: 24px;
        max-width: 768px;
    }

    section.post .post-footer {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        max-width: 768px;
        margin: 32px auto 0;
        padding-inline: 24px;

        @media (width >=640px) {
            flex-direction: row;
        }
    }

    section.post .post-social {
        display: flex;
        gap: 8px;
        margin-top: 20px;

        @media (width >=640px) {
            margin-top: 4px;
        }
    }

    section.post .post-social a {
        color: var(--color-secondary-main);
        transition-property: scale;
        transition-timing-function: var(--theme-transition-timing-funtion);
        transition-duration: 150ms;

        &:hover {
            scale: 105% 105%;
        }
    }

    section.post .post-social a svg {
        width: 24px;
    }

    section.post .comments-container {
        max-width: 768px;
        margin: 16px auto 32px;
        padding-inline: 16px;
    }
}



/* =====================  Ape Forge Glass Navigation  ===================== */

:root {
  --af-top-gap: 12px;
  --af-nav-closed: 64px;
}

/* Fixed/sticky wrapper — centered without transform (iOS scroll fix) */
.card-nav-sticky {
  position: fixed;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  top: var(--af-top-gap);
  width: min(92%, 1050px);
  max-width: 1050px;
  z-index: 9999;
}

.card-nav-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Glassy bar */
.card-nav {
  display: block;
  height: 64px;
  padding: 0;
  border-radius: .75rem;
  position: relative;
  overflow: hidden;
  background: rgba(58, 35, 62, .8);          /* #3a233e glass */
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  color: #f7f4fb;
}

.card-nav.scrolled {
  box-shadow: 0 12px 38px rgba(0, 0, 0, .35);
}

/* Top row */
.card-nav-top {
  position: absolute;
  inset: 0 0 auto 0;
  height: 64px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 1rem;
}

/* Logo (left) */
.logo-container {
  display: flex;
  align-items: center;
  min-width: 0;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo {
  height: 40px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
}

/* Right controls: Menu + CTA on the right */
.right-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

/* Text toggle (Menu/Close) */
.menu-toggle {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: #f7f4fb;
  user-select: none;
  transition: opacity .2s ease;
}

.menu-toggle:hover {
  opacity: .8;
}

.menu-toggle.open::after {
  content: "Close";
}

.menu-toggle:not(.open)::after {
  content: "Menu";
}

/* CTA (desktop) */
.card-nav-cta-button {
  background: #82916a;
  color: #fff;
  border: none;
  border-radius: calc(.75rem - .35rem);
  padding: 0 1rem;
  height: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.card-nav-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  opacity: .95;
}

/* Dropdown content area (JS will cap/scroll on mobile when open) */
.card-nav-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  bottom: 0;
  padding: .6rem;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.card-nav.open .card-nav-content {
  visibility: visible;
  pointer-events: auto;
}

/* Cards */
.nav-card {
  height: 100%;
  flex: 1 1 0;
  min-width: 0;
  border-radius: calc(.75rem - .2rem);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 10px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
}

.nav-card-label {
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  opacity: .95;
}

.nav-card-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-card-link {
  font-size: 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #fff;
  opacity: .95;
  transition: opacity .2s ease, transform .15s ease;
}

.nav-card-link:hover {
  opacity: 1;
  transform: translateX(2px);
}

/* Anchor offset so in-page links aren't hidden by the fixed bar */
[id],
:target {
  scroll-margin-top: calc(var(--af-top-gap) + var(--af-nav-closed) + 8px);
}

/* Mobile */
@media (max-width: 768px) {
  .card-nav-sticky {
    width: min(96%, 900px);
  }

  .card-nav-top {
    padding: 0 .9rem;
  }

  .right-controls {
    margin-left: auto;
    gap: .75rem;
  }

  /* Hide top-row CTA on mobile; we show a mobile CTA inside the dropdown instead */
  .card-nav-cta-button {
    display: none;
  }

  /* Stack sections and let the dropdown itself scroll within the viewport. */
  .card-nav-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: .6rem;
    bottom: 0;
    justify-content: flex-start;
    overflow: hidden;
  }

  /* Compact cards: size to content, no stretching */
  .nav-card {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    background: rgba(255, 255, 255, .07);
  }

  /* Let links sit under label naturally (remove big push) */
  .nav-card-links {
    margin-top: 6px;
  }

  /* Mobile CTA injected at the very top of the menu */
  .mobile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    border-radius: 10px;
    background: #82916a;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  }

  /* Prevent background page from scrolling while menu scrolls */
  .af-lock-scroll {
    overflow: hidden;
    touch-action: none;
  }
}