/* =============================================
   Floating Header Bar – Final Design
   ============================================= */

/* ---- HIDE Default Blocksy Header ---- */
header[data-id="type-1"],
.ct-header,
#header,
.site-header {
    display: none !important;
}

/* Archive Header Clearance */
.archive .page-header,
.blog .page-header,
.search .page-header,
.ct-container-content>.page-header {
    margin-top: 4em !important;
}


body {
    padding-top: 0 !important;
}




/* ---- Glassmorphism Container ---- */
.glass-container {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 48px);
    max-width: 1152px;
    /* max-w-6xl equivalent */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.admin-bar .glass-container {
    top: 64px;
}

/* Stick as it is - No scroll animation disappearance */
.glass-container {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

/* Hover effect on container only when collapsed */
.glass-container:not(.is-expanded):hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
}

/* ---- Three Column Layout ---- */
.fm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    min-height: 80px;
    flex-shrink: 0;
}

/* 1. Logo Section */
.fm-logo-section {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.fm-logo-icon {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-logo-icon img {
    width: auto;
    height: 100%;
    max-width: 220px;
    object-fit: contain;
}

.fm-logo-icon .material-symbols-outlined {
    width: 44px;
    height: 44px;
    background: #4f46e5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
}

/* 2. Center Nav (Desktop) */
.fm-nav-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .fm-nav-desktop {
        display: block;
    }
}

.fm-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 32px;
}

.fm-nav-link {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fm-nav-link:hover {
    color: #4f46e5;
    transform: translateY(-2px);
}

/* 3. Right Actions */
.fm-right-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fm-contact-btn {
    display: none;
    background: #4f46e5;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .fm-contact-btn {
        display: block;
    }
}

.fm-contact-btn:hover {
    background-color: #4338ca;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.3);
}

.fm-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fm-toggle-btn:hover {
    background: #fff;
    color: #4f46e5;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1);
}

#fm-toggle {
    display: flex;
}

@media (min-width: 1024px) {
    #fm-toggle {
        display: none;
    }
}

/* Removed old burger lines/logic */

/* ---- Collapsible Content ---- */
.fm-content {
    max-height: 0;
    opacity: 0;
    padding: 0 32px;
    /* Side padding matching header */
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.glass-container.is-expanded .fm-content {
    max-height: 800px;
    /* Arbitrary large height */
    opacity: 1;
    padding-bottom: 32px;
}

/* Grid Section */
.fm-grid-section {
    padding-top: 8px;
}

.fm-section-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    /* Gray 400 */
    margin-bottom: 4px;
    padding-left: 16px;
}

.fm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Category Card */
.fm-card {
    background-color: #fafafa;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fm-card:hover {
    background-color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.fm-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fm-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-card-icon .material-symbols-outlined {
    font-size: 32px;
}

.fm-card-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fm-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    /* Gray 900 */
    line-height: 1.25;
}

.fm-card-desc {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #71717a;
    /* Zinc 500 */
    margin: 4px 0 0 0;
    line-height: 1.4;
    display: -webkit-box;

    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Scroll State ---- */
.glass-container.is-scrolled {
    padding: 0;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    top: 42px;
    /* Increased from 24px to be "down a bit" */
    width: calc(100% - 64px);
    max-width: 900px;
}

/* Adjust for Admin Bar */
body.admin-bar .glass-container.is-scrolled {
    top: 74px;
    /* 32px (Admin Bar) + 42px (Offset) */
}

/* ---- Entry Animations ---- */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* When Expanded: Animate items in */
.glass-container.is-expanded .fm-card {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-container.is-expanded .fm-footer {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
}

/* Stagger delays */
.glass-container.is-expanded .fm-card:nth-child(1) {
    animation-delay: 0.1s;
}

.glass-container.is-expanded .fm-card:nth-child(2) {
    animation-delay: 0.15s;
}

.glass-container.is-expanded .fm-card:nth-child(3) {
    animation-delay: 0.2s;
}

.glass-container.is-expanded .fm-card:nth-child(4) {
    animation-delay: 0.25s;
}

.glass-container.is-expanded .fm-card:nth-child(5) {
    animation-delay: 0.3s;
}

.glass-container.is-expanded .fm-card:nth-child(6) {
    animation-delay: 0.35s;
}

/* Reset when closed */
.glass-container:not(.is-expanded) .fm-card,
.glass-container:not(.is-expanded) .fm-footer {
    opacity: 0;
    transform: translateY(10px);
    transition: none;
    animation: none;
}

/* ---- Footer ---- */
.fm-footer {
    margin-top: auto;
    /* Push to bottom if height allows */
    border-top: 1px solid #e4e4e7;
    margin-top: 24px;
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Socials */
.fm-socials {
    display: flex;
    align-items: center;
    gap: 24px;
}

.fm-socials a {
    color: #9ca3af;
    /* Gray 400 */
    transition: color 0.2s;
}

.fm-socials a:hover {
    color: #111827;
    /* Gray 900 */
}

.fm-socials svg {
    width: 20px;
    height: 20px;
}

/* CTA */
.fm-cta-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fm-cta-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    /* Gray 500 */
    display: none;
}

@media (min-width: 640px) {
    .fm-cta-text {
        display: inline;
    }
}

.fm-cta-btn {
    background-color: #4f46e5;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 32px;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
}

.fm-cta-btn:hover {
    background-color: #4338ca;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2), 0 4px 6px -2px rgba(79, 70, 229, 0.1);
}

/* ---- Backdrop ---- */
#mega-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mega-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .fm-grid {
        grid-template-columns: 1fr;
    }

    .glass-container.is-expanded .fm-content {
        max-height: 1200px;
        /* Needs more height for stacked cards */
        overflow-y: auto;
    }

    .fm-footer {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 20px;
    }

    .fm-cta-area {
        width: 100%;
        justify-content: center;
    }

    .fm-cta-btn {
        width: 100%;
        text-align: center;
    }

    .glass-container {
        width: calc(100% - 32px);
    }

    .fm-header {
        padding: 0 20px;
        min-height: 72px;
    }

    .fm-logo-icon {
        height: 38px;
    }

    .fm-toggle-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .fm-toggle-btn .material-symbols-outlined {
        font-size: 20px;
    }
}