/* =====================================================
   NOTESREALM — RESPONSIVE GLASS HEADER
   Wordmark-only branding: NotesRealm
   Palette: Navy + Cyan
===================================================== */

/* HEADER */
.site-header {
    --header-height: 72px;
    --header-radius: 22px;

    --glass-bg: rgba(255, 255, 255, 0.84);
    --glass-border: rgba(255, 255, 255, 0.75);

    --header-shadow:
        0 10px 35px rgba(15, 23, 42, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.06);

    position: sticky;
    top: 16px;
    z-index: 1000;

    width: min(calc(100% - 32px), 1280px);
    height: var(--header-height);

    margin: 16px auto 0;

    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--header-radius);

    box-shadow: var(--header-shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

/* HEADER CONTAINER */
.header-container {
    width: 100%;
    height: 100%;

    padding: 0 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* =====================================================
   BRAND WORDMARK
===================================================== */

.site-brand {
    display: flex;
    align-items: center;

    flex: 0 0 auto;
    height: 100%;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.site-brand:hover {
    opacity: 0.88;
}

.site-brand:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
    border-radius: 5px;
}

/* Single text-based wordmark */
.site-brand img.logo {
    display: block;

    width: 200px;
    height: 36px;
    max-width: 100%x;

    object-fit: contain;
    flex:0 0 auto;
}

/* =====================================================
   MAIN NAVIGATION
===================================================== */

.main-navigation {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.navigation-list {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 4px;

    list-style: none;
    margin: 0;
    padding: 0;
}

.navigation-item {
    display: flex;
    align-items: center;
}

.navigation-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 13px;

    border-radius: 12px;

    color: var(--text);
    text-decoration: none;

    font-size: 0.92rem;
    font-weight: 600;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.navigation-link:hover {
    color: var(--primary);
    background: rgba(8, 145, 178, 0.08);
}

.navigation-link:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

/* Active navigation link */
.navigation-link.active,
.navigation-link[aria-current="page"] {
    color: var(--secondary);
    background: rgba(8, 145, 178, 0.12);
}

/* =====================================================
   HEADER ACTIONS
===================================================== */

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex-shrink: 0;
    gap: 12px;
}

/* Search */
.header-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 42px;
    padding: 0 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--primary);
    background: rgba(255, 255, 255, 0.65);

    font-size: 0.9rem;
    font-weight: 600;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.header-search:hover {
    background: rgba(8, 145, 178, 0.08);
    border-color: var(--secondary);
}

.search-icon {
    font-size: 1.05rem;
}

/* =====================================================
   LOGIN BUTTON
===================================================== */

.header-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 0 20px;

    background: var(--primary);
    color: #ffffff;

    border: 1px solid var(--primary);
    border-radius: 12px;

    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;

    white-space: nowrap;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.header-login:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
}

.header-login:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.login-icon {
    font-size: 1.05rem;
}


/* =====================================================
   MOBILE MENU BUTTON
===================================================== */

.menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
    cursor: pointer;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 5px;

    width: 20px;
}

.menu-icon span {
    display: block;

    width: 20px;
    height: 2px;

    border-radius: 2px;
    background: var(--primary);

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

/* Hamburger to close icon */
.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =====================================================
   TABLET RESPONSIVE
===================================================== */

@media (max-width: 1099px) {

    .site-header {
        width: min(calc(100% - 24px), 1000px);

        top: 12px;
        margin-top: 12px;

        height: 68px;
    }

    .header-container {
        padding: 0 18px;
        gap: 12px;
    }

    .site-brand img.logo {
        width: 180px;
        height: 34px;
    }

    .navigation-list {
        gap: 1px;
    }

    .navigation-link {
        padding: 0 9px;
        font-size: 0.85rem;
    }

    .header-search {
        padding: 0 11px;
    }

    .header-login {
        padding: 0 15px;
    }
}

/* =====================================================
   MOBILE RESPONSIVE
===================================================== */

@media (max-width: 767px) {

    .site-header {
        width: calc(100% - 20px);

        top: 10px;
        margin-top: 10px;

        height: 62px;
        border-radius: 18px;
    }

    .header-container {
        padding: 0 14px;
        gap: 10px;
    }

    /* Keep full NotesRealm wordmark on mobile */
    .site-brand img.logo {
        width: 155px;
        height: 30px;
    }

    .main-navigation {
        position: absolute;

        top: calc(100% + 10px);
        left: 0;
        right: 0;

        display: block;

        padding: 10px;

        background: rgba(255, 255, 255, 0.97);
        border: 1px solid var(--border);
        border-radius: 18px;

        box-shadow: var(--header-shadow);

        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(-8px);

        transition:
            opacity 0.2s ease,
            visibility 0.2s ease,
            transform 0.2s ease;
    }
       
    .header-login {
        min-height: 40px;
        padding: 0 14px;
        font-size: 0.85rem;
    }

    .header-actions {
        gap: 8px;
    }

    .main-navigation.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translateY(0);
    }

    .navigation-list {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 4px;
    }

    .navigation-item {
        width: 100%;
    }

    .navigation-link {
        width: 100%;
        min-height: 46px;

        justify-content: flex-start;

        padding: 0 15px;

        font-size: 0.95rem;
    }

    .header-actions {
        gap: 8px;
    }

    .header-search {
        width: 42px;
        height: 42px;
        min-height: 42px;

        padding: 0;

        justify-content: center;
    }

    .search-label {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 379px) {

    .site-header {
        width: calc(100% - 14px);
        height: 58px;

        border-radius: 16px;
    }

    .header-container {
        padding: 0 10px;
        gap: 6px;
    }

    .site-brand img.logo {
         width: 140px;
        height: 27px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-search,
    .menu-toggle {
        width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .header-login {
        min-height: 38px;
        padding: 0 11px;
        font-size: 0.82rem;
    }
}

/* =====================================================
   ACCESSIBILITY
===================================================== */

@supports not (backdrop-filter: blur(18px)) {
    .site-header {
        background: rgba(255, 255, 255, 0.97);
    }
}

@media (prefers-reduced-motion: reduce) {

    .site-header,
    .site-brand,
    .navigation-link,
    .header-search,
    .menu-icon span,
    .main-navigation {
        transition: none;
    }
}

@media (prefers-contrast: more) {

    .site-header {
        border: 2px solid var(--primary);
    }

    .navigation-link,
    .header-search,
    .menu-toggle {
        border: 1px solid var(--primary);
    }
}