/* Canonical site header shared by the directory, rankings, blog, and tool pages. */
.header.site-header {
    padding: 0 !important;
    min-height: 88px;
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
    position: sticky;
    top: 0;
    z-index: 9999 !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header.site-header .header-content {
    width: 100% !important;
    max-width: none !important;
    height: 88px !important;
    margin: 0 !important;
    padding: 0 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    box-sizing: border-box;
}

.header.site-header .logo {
    display: flex;
    align-items: center;
    flex: 0 1 230px;
    min-width: 148px;
    margin: 0 !important;
}

.header.site-header .logo a,
.header.site-header .logo picture {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header.site-header .logo-image {
    display: block;
    width: auto !important;
    height: 48px !important;
    max-width: 100% !important;
    object-fit: contain;
    border-radius: 0 !important;
    opacity: 1 !important;
}

.header.site-header .search-container {
    display: block !important;
    flex: 1 1 400px !important;
    width: auto !important;
    max-width: 400px !important;
    margin: 0 !important;
}

.header.site-header .search-box {
    width: 100%;
    min-width: 0 !important;
    height: 48px;
    padding: 6px 8px 6px 14px !important;
    display: flex;
    align-items: center;
    gap: 10px !important;
    background: #fff !important;
    border: 1px solid #dfe3e8 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
    box-sizing: border-box;
    position: relative;
}

.header.site-header .search-box:focus-within {
    border-color: #64748b !important;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.12) !important;
}

.header.site-header .search-box > i {
    position: static !important;
    margin: 0 !important;
    transform: none !important;
    color: #64748b !important;
    font-size: 18px !important;
}

.header.site-header .search-box input {
    width: auto !important;
    min-width: 0;
    flex: 1;
    padding: 0 !important;
    color: #1f2937 !important;
    font-family: inherit;
    font-size: 16px !important;
    line-height: 1.4;
    border: 0 !important;
    background: transparent !important;
    outline: 0;
}

.header.site-header .search-box input::placeholder {
    color: #6b7280 !important;
    opacity: 1;
}

.header.site-header .search-btn,
.header.site-header .clear-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    cursor: pointer;
}

.header.site-header .search-btn:hover {
    color: #fff;
    background: #1f2937 !important;
    border-color: #1f2937 !important;
}

.header.site-header .clear-btn:hover {
    color: #fff;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

.header.site-header .search-btn i,
.header.site-header .clear-btn i {
    position: static !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: 14px !important;
    transform: none !important;
}

.header.site-header .main-nav {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 8px !important;
    margin: 0 0 0 auto !important;
}

.header.site-header .nav-link {
    min-height: 40px;
    padding: 8px 12px !important;
    display: inline-flex !important;
    align-items: center;
    color: #4b5563 !important;
    font-size: 15px;
    font-weight: 600 !important;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 9px;
    box-sizing: border-box;
}

.header.site-header .nav-link:hover,
.header.site-header .nav-link.active {
    color: #111827 !important;
    background: #f3f4f6;
}

.header.site-header .nav-link.active {
    box-shadow: inset 0 -2px 0 #111827;
}

.header.site-header .nav-link.submit-btn {
    margin-left: 4px;
    padding: 10px 14px !important;
    color: #fff !important;
    background: #1f2937 !important;
    border: 1px solid #1f2937;
    border-radius: 9px;
}

.header.site-header .nav-link.submit-btn:hover {
    color: #fff !important;
    background: #374151 !important;
}

.header.site-header > .header-content > .mobile-menu-toggle {
    display: none;
}

@media (max-width: 1120px) {
    .header.site-header .header-content {
        gap: 16px !important;
    }

    .header.site-header .logo {
        flex-basis: 190px;
    }

    .header.site-header .search-container {
        max-width: 330px !important;
    }

    .header.site-header .main-nav {
        gap: 2px !important;
    }

    .header.site-header .nav-link {
        padding-inline: 9px !important;
    }
}

@media (max-width: 768px) {
    .header.site-header {
        min-height: 112px;
    }

    .header.site-header .header-content {
        height: auto !important;
        min-height: 112px;
        padding: 8px 12px !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "logo nav burger"
            "search search search";
        column-gap: 8px !important;
        row-gap: 8px !important;
    }

    .header.site-header .logo {
        grid-area: logo;
        min-width: 0;
        max-width: 150px;
    }

    .header.site-header .logo-image {
        height: 36px !important;
    }

    .header.site-header .search-container {
        grid-area: search;
        width: 100% !important;
        max-width: none !important;
    }

    .header.site-header .search-box {
        height: 44px;
    }

    .header.site-header .main-nav {
        grid-area: nav;
    }

    .header.site-header .main-nav .nav-link:not(.submit-btn) {
        display: none !important;
    }

    .header.site-header .nav-link.submit-btn {
        min-height: 40px;
        margin: 0;
        padding: 9px 12px !important;
        font-size: 14px;
    }

    .header.site-header > .header-content > .mobile-menu-toggle {
        grid-area: burger;
        width: 40px;
        height: 40px;
        padding: 9px;
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        background: #f8fafc;
        border: 1px solid #dfe3e8;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
        cursor: pointer;
    }

    .header.site-header > .header-content > .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 0;
        display: block;
        background: #374151;
        border-radius: 2px;
        transform-origin: center;
    }

    .header.site-header .main-nav.is-open {
        position: absolute;
        top: 56px;
        right: 12px;
        z-index: 20;
        width: min(240px, calc(100vw - 24px));
        padding: 8px;
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 4px !important;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    }

    .header.site-header .main-nav.is-open .nav-link {
        width: 100%;
        min-height: 44px;
        display: flex !important;
        justify-content: flex-start;
    }

    .header.site-header .main-nav.is-open .submit-btn {
        margin-top: 4px;
        justify-content: center;
    }
}
