/* 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: var(--text-color, #111827);
        --theme-text-color-dark: var(--text-color-dark, #d1d5db);
        --theme-heading-color: var(--heading-color, #111827);
        --theme-heading-color-dark: var(--heading-color-dark, #ffffff);
        --theme-subtitle-color: var(--subtitle-color, #6b7280);
        --theme-subtitle-color-dark: var(--subtitle-color-dark, #9ca3af);
        --theme-divider-color: #e5e7eb;
        --theme-divider-color-dark: #374151;
        --theme-nav-color: #101010;
        --theme-nav-color-dark: #ffffff;
        --theme-link-color: var(--link-color, var(--color-primary-main));
        --theme-link-hover-color: var(--link-hover-color, var(--color-primary-dark));
        --theme-link-underline-color: var(--link-underline-color, var(--color-primary-main));
        --theme-link-hover-underline-color: var(--link-hover-underline-color, var(--color-primary-dark));
        --theme-site-title-size: var(--site-title-size, 24px);
        --theme-site-title-font-weight: var(--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);
    }

    .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);
        }
    }

    .component:has(.sticky-header) {
        position: sticky;
        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-large {
        height: 64px;

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

    .logo-medium {
        height: 48px;
    }

    .logo-small {
        height: 32px;
    }

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

    .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;

        &: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;
            border: 1px solid #f3f4f6;
            background: #ffffff;
            border-radius: 4px;

            &: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 {
        max-width: 200px;
        display: flex;
        align-items: center;
        padding: 12px 16px;
        font-family: var(--font-nav_link);
        color: var(--nav-link-color, var(--theme-nav-color));
        font-size: var(--nav-link-font-size, 15px);
        letter-spacing: var(--nav-link-letter-spacing, 0);
        font-weight: var(--nav-link-font-weight, 400);
        text-transform: var(--nav-link-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 {
            text-decoration-line: underline;
        }

        &.active {
            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;
    }

    .sticky-header nav ul.subnav {
        display: flex;
        flex-direction: column;

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

        &:where(.desktop-nav *) {
            position: absolute;
            gap: 16px;
            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);
        }

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

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

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

    .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;
    }
}
