/* Friendnom header search — standalone, private-member-aware autocomplete. */
.fn-header-search {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    z-index: 25;
}

.fn-header-search > input[type="search"] {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    /* Search is entered directly; no detached search button. */
}

.fn-header-search-results {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    right: 0;
    z-index: 3000;
    padding: 6px;
    max-height: min(440px, 65vh);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #dfe6f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 13px 38px rgba(20, 45, 83, .16);
    color: #1f3047;
}
.fn-header-search-results[hidden] { display: none !important; }

.fn-header-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
}
.fn-header-search-result:hover,
.fn-header-search-result:focus-visible,
.fn-header-search-result.is-active {
    background: #ecf3ff;
    outline: none;
}
.fn-header-search-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: cover;
    border-radius: 50%;
    background: #edf1f6;
}
.fn-header-search-copy { min-width: 0; display: grid; gap: 3px; }
.fn-header-search-name {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fn-header-search-detail {
    font-size: 11px;
    line-height: 1.3;
    color: #687892;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fn-header-search-message {
    padding: 13px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #657790;
}
.fn-header-search-all {
    display: block;
    padding: 11px 10px;
    border-top: 1px solid #e8edf5;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
    color: #1369e9;
    border-radius: 0 0 8px 8px;
}
.fn-header-search-all:hover,
.fn-header-search-all:focus-visible { background: #edf4ff; }

html[data-friendnom-theme="dark"] .fn-header-search-results {
    background: #242526;
    color: #e4e6eb;
    border-color: #404246;
    box-shadow: 0 15px 40px rgba(0,0,0,.55);
}
html[data-friendnom-theme="dark"] .fn-header-search-result:hover,
html[data-friendnom-theme="dark"] .fn-header-search-result:focus-visible,
html[data-friendnom-theme="dark"] .fn-header-search-result.is-active,
html[data-friendnom-theme="dark"] .fn-header-search-all:hover { background: #3a3b3c; }
html[data-friendnom-theme="dark"] .fn-header-search-detail,
html[data-friendnom-theme="dark"] .fn-header-search-message { color: #b0b3b8; }
html[data-friendnom-theme="dark"] .fn-header-search-all { border-color: #3e4042; color: #8bbcff; }

@media (max-width: 760px) {
    .fn-header-search { width: 100%; }
    .fn-header-search-results {
        max-height: min(400px, 55vh);
        top: calc(100% + 6px);
    }
    .fn-header-search-result { min-height: 60px; }
}


/* Friendnom top navigation — icon-only Activity/Members/Groups/About Us. */
.fn-header-nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.fn-header-nav .fn-header-nav-icon {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border-radius: 12px;
    color: #667488;
    text-decoration: none;
    position: relative;
}
.fn-header-nav .fn-header-nav-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: currentColor;
    pointer-events: none;
}
.fn-header-nav .fn-header-nav-icon:hover,
.fn-header-nav .fn-header-nav-icon:focus-visible {
    background: #f0f5ff;
    color: #1666e7;
}
.fn-header-nav .fn-header-nav-icon[aria-current="page"] {
    background: #edf4ff;
    color: #146ef5;
}
.fn-header-nav .fn-header-nav-icon[aria-current="page"]::after {
    content: '';
    position: absolute;
    height: 3px;
    left: 8px;
    right: 8px;
    bottom: 1px;
    border-radius: 3px;
    background: currentColor;
}
html[data-friendnom-theme="dark"] .fn-header-nav .fn-header-nav-icon {
    color: #b5c1d0;
}
html[data-friendnom-theme="dark"] .fn-header-nav .fn-header-nav-icon:hover,
html[data-friendnom-theme="dark"] .fn-header-nav .fn-header-nav-icon:focus-visible,
html[data-friendnom-theme="dark"] .fn-header-nav .fn-header-nav-icon[aria-current="page"] {
    background: #283e60;
    color: #82b6ff;
}
@media (min-width: 761px) and (max-width: 1100px) {
    .fn-header { height: auto; }
    .fn-header-inner {
        height: auto;
        min-height: 72px;
        padding-top: 8px;
        padding-bottom: 8px;
        flex-wrap: wrap;
        column-gap: 14px;
        row-gap: 2px;
    }
    .fn-header-search { flex: 1 1 170px; max-width: none; }
    .fn-header-nav { order: 4; flex: 0 0 100%; justify-content: center; }
}
@media (max-width: 760px) {
    .fn-header-inner { row-gap: 7px; }
    .fn-header-nav {
        display: flex;
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    .fn-header-nav .fn-header-nav-icon {
        flex-basis: 48px;
        width: 48px;
        height: 44px;
        min-height: 44px;
    }
    .fn-header-search { order: 4; }
}
@media (max-width: 340px) {
    .fn-header-nav { gap: 4px; }
    .fn-header-nav .fn-header-nav-icon { flex-basis: 42px; width: 42px; }
}
