:root {
    --navy: #17313d;
    --teal: #167d70;
    --teal-light: #8fd0c6;
    --paper: #eef4f2;
    --paper-blue: #f2f7f8;
    --white: #fff;
    --muted: #6a7b81;
    --line: #d9e1df;
    --soft: #f7faf9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(
            180deg,
            var(--paper-blue) 0,
            var(--paper) 100%
        );
    color: var(--navy);
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

a {
    color: inherit;
}


/* HEADER */

.community-header {
    background:
        linear-gradient(
            135deg,
            #17313d 0%,
            #0e5960 58%,
            #167d70 100%
        );
    color: #fff;
}

.community-header-inner {
    width:
        min(
            1220px,
            calc(100% - 40px)
        );
    min-height: 112px;
    margin: 0 auto;
    display: grid;
    grid-template-columns:
        minmax(320px, 1fr)
        minmax(320px, 1.15fr)
        minmax(220px, .75fr);
    gap: 28px;
    align-items: center;
}

.brand {
    font-size:
        clamp(
            30px,
            4.5vw,
            54px
        );
    font-weight: 900;
    letter-spacing: 3px;
    line-height: .92;
}

.brand span {
    color: var(--teal-light);
}

.community-name {
    margin-top: 7px;
    color: rgba(255,255,255,.92);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.community-search {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        170px
        auto;
    width: min(100%, 560px);
    justify-self: end;
}

.community-search input,
.community-search select,
.community-search button {
    min-height: 44px;
    border: 0;
    font: inherit;
}

.community-search input {
    min-width: 0;
    padding: 0 13px;
    border-radius: 7px 0 0 7px;
}

.community-search select {
    padding: 0 10px;
    border-left: 1px solid #d5dedb;
    border-radius: 0;
    background: #fff;
    color: var(--navy);
    font-size: 13px;
}

.community-search button {
    padding: 0 17px;
    border-radius: 0 7px 7px 0;
    background: var(--teal-light);
    color: var(--navy);
    font-weight: 900;
    cursor: pointer;
}

.member-area {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 11px;
}

.member-area a {
    color: #fff;
    text-decoration: none;
}

.notification-link {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 50%;
    font-size: 18px;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    color: var(--teal);
    font-size: 10px;
    font-weight: 900;
}

.member-menu {
    position: relative;
}

.member-menu-button {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 40px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
}

.member-avatar {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    font-size: 13px;
}

.member-dropdown {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    padding: 7px;
    display: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.member-menu.open
.member-dropdown {
    display: block;
}

.member-dropdown a {
    display: block;
    padding: 10px 11px;
    border-radius: 6px;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.logged-out-links {
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
}


/* NAV */

.community-nav-wrap {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.community-nav {
    width:
        min(
            1220px,
            calc(100% - 40px)
        );
    min-height: 58px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.community-nav a {
    padding: 11px 13px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.community-nav a:hover {
    background: var(--soft);
}


/* MOBILE DRAWER */

.mobile-menu-button {
    display: none;
}

.mobile-drawer-backdrop {
    position: fixed;
    z-index: 998;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    background: rgba(0,0,0,.48);
    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.mobile-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: min(86vw, 340px);
    height: 100vh;
    overflow-y: auto;
    background: var(--navy);
    color: #fff;
    transform: translateX(-100%);
    transition: transform .28s ease;
    box-shadow: 10px 0 28px rgba(0,0,0,.30);
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-head {
    min-height: 67px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.14);
}

.mobile-drawer-head button {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 29px;
    cursor: pointer;
}

.drawer-section-label {
    padding: 17px 18px 7px;
    color: var(--teal-light);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.mobile-drawer nav {
    display: grid;
}

.mobile-drawer nav a {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}


/* PAGE */

.page {
    width:
        min(
            1220px,
            calc(100% - 40px)
        );
    margin: 0 auto;
    padding: 34px 0 70px;
}

.page-head {
    margin-bottom: 20px;
}

.page-head .label {
    display: block;
    margin-bottom: 7px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.page-head h1 {
    margin: 0;
    font-size:
        clamp(
            32px,
            4vw,
            46px
        );
}

.page-head p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.search-panel {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.search-panel form {
    display: grid;
    width: 100%;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(230px, 270px)
        auto;
}

.search-panel input,
.search-panel select,
.search-panel button {
    min-height: 46px;
    border: 1px solid #cbd6d2;
    font: inherit;
}

.search-panel input {
    min-width: 0;
    padding: 0 13px;
    border-radius: 7px 0 0 7px;
}

.search-panel select {
    min-width: 0;
    padding: 0 12px;
    border-left: 0;
    border-radius: 0;
    background: #fff;
    color: var(--navy);
}

.search-panel button {
    padding: 0 18px;
    border-color: var(--teal);
    border-radius: 0 7px 7px 0;
    background: var(--teal);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.search-summary {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}

.result-section {
    margin-top: 24px;
}

.result-section h2 {
    margin: 0 0 10px;
    font-size: 21px;
}

.result-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(23,49,61,.04);
}

.result-row {
    padding: 17px 18px;
    border-top: 1px solid var(--line);
}

.result-row:first-child {
    border-top: 0;
}

.result-row:nth-child(even) {
    background: #f5f9f8;
}

.discussion-result-layout {
    display: flex;
    align-items: flex-start;
    gap: 17px;
}

.discussion-result-content {
    min-width: 0;
    flex: 1;
}

.discussion-author-avatar {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--teal);
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy), var(--teal));
    color: #fff;
    text-decoration: none;
    font-size: 21px;
    font-weight: 900;
}

.discussion-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discussion-author-avatar:hover,
.discussion-author-avatar:focus-visible {
    box-shadow: 0 0 0 3px rgba(22,125,112,.15);
}

.discussion-author-name {
    color: var(--teal);
    text-decoration: none;
    font-weight: 800;
}

.discussion-author-name:hover {
    text-decoration: underline;
}

.result-type {
    margin-bottom: 5px;
    color: var(--teal);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.result-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

.result-title a {
    text-decoration: none;
}

.result-title a:hover {
    color: var(--teal);
}

.result-snippet {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.reply-search-match {
    margin-top: 11px;
    padding: 11px 13px;
    border-left: 3px solid var(--teal);
    border-radius: 5px;
    background: #edf7f4;
    color: var(--navy);
    font-size: 12px;
    line-height: 1.55;
}
.reply-search-match strong { display: block; margin-bottom: 4px; }
.reply-search-match a { display: inline-block; margin-top: 5px; color: var(--teal); font-weight: 800; }

.result-meta {
    margin-top: 8px;
    color: #859398;
    font-size: 11px;
}

.empty,
.error {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.error {
    border-left: 4px solid #bd4b42;
    background: #fdebea;
}

.hint {
    color: var(--muted);
}


/* FOOTER */

.site-footer {
    margin-top: 50px;
    background: var(--navy);
    color: #fff;
}

.footer-inner {
    width:
        min(
            1180px,
            calc(100% - 40px)
        );
    margin: 0 auto;
    padding: 30px 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 12px;
}

.footer-inner a {
    color: #fff;
    text-decoration: none;
}


@media (max-width: 920px) {

    .community-header-inner {
        grid-template-columns:
            minmax(275px,.95fr)
            minmax(280px,1fr)
            auto;
        gap: 16px;
    }

    .member-name {
        display: none;
    }
}


@media (max-width: 760px) {

    .community-header-inner,
    .community-nav,
    .page,
    .footer-inner {
        width:
            min(
                100% - 24px,
                1220px
            );
    }

    .community-header-inner {
        min-height: 82px;
        grid-template-columns:
            auto
            minmax(0,1fr)
            auto;
        gap: 11px;
    }

    .mobile-menu-button {
        display: flex;
        width: 38px;
        height: 38px;
        padding: 8px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        border: 1px solid rgba(255,255,255,.42);
        border-radius: 6px;
        background: transparent;
        cursor: pointer;
    }

    .mobile-menu-button span {
        display: block;
        width: 19px;
        height: 2px;
        background: #fff;
    }

    .brand {
        font-size: 31px;
    }

    .community-name {
        margin-top: 5px;
        font-size: 10px;
    }

    .community-search,
    .community-nav-wrap {
        display: none;
    }

    .member-menu-button {
        min-height: 42px;
        border: 0;
        padding: 0;
        background: transparent;
    }

    .member-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .member-name {
        display: none;
    }

    .search-panel form {
        grid-template-columns: 1fr;
    }

    .search-panel input,
    .search-panel select,
    .search-panel button {
        border-radius: 7px;
        border: 1px solid #cbd6d2;
    }

    .search-panel select,
    .search-panel button {
        margin-top: 8px;
    }

    .search-panel button {
        border-color: var(--teal);
    }
}
