/* Communities page */
.community-hero {
    align-items: center;
    background:
        radial-gradient(circle at 88% 20%, rgba(45, 212, 191, .24), transparent 15rem),
        linear-gradient(135deg, #18344b 0%, #235a67 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(28, 54, 72, .16);
    color: #fff;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    min-height: 230px;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
}

.community-hero-copy {
    max-width: 650px;
    position: relative;
    z-index: 1;
}

.community-eyebrow,
.community-section-kicker {
    color: #3abaae;
    display: block;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.community-eyebrow i {
    margin-right: .4rem;
}

.community-hero h2 {
    color: #fff;
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    font-weight: 750;
    letter-spacing: -.025em;
    line-height: 1.15;
    margin: .45rem 0 .65rem;
}

.community-hero p {
    color: rgba(255, 255, 255, .76);
    font-size: .94rem;
    line-height: 1.6;
    margin: 0;
    max-width: 590px;
}

.community-hero-action {
    background: #fff;
    border: 0;
    border-radius: 9px;
    color: #1d4854;
    font-size: .82rem;
    font-weight: 700;
    margin-top: 1.15rem;
    padding: .65rem .9rem;
}

.community-hero-action:hover,
.community-hero-action:focus {
    color: #0f766e;
    transform: translateY(-1px);
}

.community-hero-visual {
    flex: 0 0 210px;
    height: 170px;
    position: relative;
}

.community-hero-core,
.community-orbit {
    align-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    box-shadow: 0 12px 28px rgba(5, 24, 35, .16);
    display: flex;
    justify-content: center;
    position: absolute;
}

.community-hero-core {
    font-size: 2rem;
    height: 86px;
    left: 62px;
    top: 42px;
    width: 86px;
}

.community-orbit {
    backdrop-filter: blur(5px);
    font-size: 1.1rem;
    height: 44px;
    width: 44px;
}

.community-orbit-one { left: 5px; top: 15px; }
.community-orbit-two { bottom: 5px; left: 18px; }
.community-orbit-three { right: 5px; top: 25px; }

.community-filters {
    background: #fff;
    border: 1px solid #dfe6ed;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(31, 45, 61, .07);
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.community-filter-fields {
    display: grid;
    gap: .85rem;
    grid-template-columns: minmax(260px, 1.5fr) minmax(210px, .7fr);
}

.community-filter-field label,
.community-type-label {
    color: #526174;
    display: block;
    font-size: .72rem;
    font-weight: 700;
    margin-bottom: .4rem;
}

.community-input-wrap {
    position: relative;
}

.community-input-wrap > i {
    color: #8290a2;
    left: .85rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.community-input-wrap .form-control,
.community-input-wrap .custom-select {
    border-color: #d9e2ea;
    border-radius: 9px;
    height: 43px;
    padding-left: 2.4rem;
}

.community-type-label {
    border-top: 1px solid #edf1f5;
    margin-top: .9rem;
    padding-top: .8rem;
}

.type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.type-chip {
    align-items: center;
    background: #f7f9fb;
    border: 1px solid #dfe5eb;
    border-radius: 999px;
    color: #586779;
    cursor: pointer;
    display: inline-flex;
    font-size: .77rem;
    font-weight: 650;
    gap: .4rem;
    min-height: 34px;
    padding: .4rem .75rem;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.type-chip:hover,
.type-chip:focus {
    border-color: #82aaa8;
    color: #17665f;
    outline: none;
    transform: translateY(-1px);
}

.type-chip.active {
    background: #176f68;
    border-color: #176f68;
    box-shadow: 0 5px 12px rgba(23, 111, 104, .18);
    color: #fff;
}

.community-directory-heading {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 0 .85rem;
    scroll-margin-top: 1rem;
}

.community-directory-heading h2,
.community-contribute h2 {
    color: #24384d;
    font-size: 1.2rem;
    font-weight: 750;
    margin: .15rem 0 0;
}

.community-result-count {
    color: #6a7889;
    font-size: .74rem;
}

.community-result-count i {
    color: #1a8a79;
    margin-right: .3rem;
}

.community-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.community-scroll-wrap {
    position: relative;
}

.community-scroll {
    border-radius: 12px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-color: rgba(39, 74, 91, .28) transparent;
    scrollbar-width: thin;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.community-draggable {
    align-content: start;
    cursor: grab;
    display: grid;
    gap: 1rem;
    grid-auto-columns: 290px;
    grid-auto-flow: column;
    grid-auto-rows: max-content;
    grid-template-rows: repeat(2, max-content);
    min-width: 100%;
    padding: .3rem .3rem 1.15rem;
    user-select: none;
    width: max-content;
}

.community-draggable.dragging {
    cursor: grabbing;
}

.community-scroll .community-card {
    scroll-snap-align: start;
}

.community-scroll::-webkit-scrollbar {
    height: 7px;
}

.community-scroll::-webkit-scrollbar-thumb {
    background: rgba(39, 74, 91, .28);
    border-radius: 999px;
}

.community-scroll::-webkit-scrollbar-track {
    background: rgba(39, 74, 91, .07);
    border-radius: 999px;
}

.community-nav {
    align-items: center;
    background: #fff;
    border: 1px solid #d8e1e8;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(31, 45, 61, .13);
    color: #345367;
    display: flex;
    height: 38px;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: transform .15s ease, color .15s ease;
    width: 38px;
    z-index: 2;
}

.community-nav:hover,
.community-nav:focus {
    color: #118376;
    outline: none;
    transform: translateY(-50%) scale(1.05);
}

.community-prev { left: -.35rem; }
.community-next { right: -.35rem; }

.community-card {
    background: linear-gradient(160deg, #fff 0%, #fbfcfd 100%);
    border: 1px solid #dfe5eb;
    border-top: 3px solid var(--community-accent, #16877c);
    border-radius: 13px;
    box-shadow: 0 7px 20px rgba(31, 45, 61, .07);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 1rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    width: 100%;
}

.community-card:hover {
    box-shadow: 0 12px 28px rgba(31, 45, 61, .12);
    transform: translateY(-2px);
}

.community-meta {
    align-items: center;
    display: flex;
    gap: .7rem;
    min-width: 0;
}

.community-icon {
    align-items: center;
    background: color-mix(in srgb, var(--community-accent, #16877c) 13%, white);
    border: 1px solid color-mix(in srgb, var(--community-accent, #16877c) 22%, white);
    border-radius: 10px;
    color: var(--community-accent, #16877c);
    display: flex;
    flex: 0 0 40px;
    font-size: 1rem;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.community-meta-copy {
    min-width: 0;
}

.community-country {
    color: #34485d;
    font-size: .73rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-country i {
    color: #8a98a8;
    font-size: .65rem;
    margin-right: .3rem;
}

.community-platform {
    color: #8490a0;
    font-size: .69rem;
    margin-top: .1rem;
}

.community-card h5 {
    color: #21354a;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.3;
    margin: 0;
    overflow-wrap: anywhere;
}

.community-card > p {
    color: #6c7989;
    display: -webkit-box;
    font-size: .78rem;
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.community-actions {
    align-items: stretch;
    border-top: 1px solid #edf1f4;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    justify-content: flex-start;
    margin-top: auto;
    padding-top: .75rem;
}

.community-link-status {
    color: #728091;
    font-size: .67rem;
}

.community-link-status i {
    color: #27a174;
    margin-right: .25rem;
}

.community-join-links {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.community-join {
    align-items: center;
    background: var(--link-color, var(--community-accent, #176f68));
    border: 0;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: .73rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    min-height: 32px;
    padding: .35rem .7rem;
    text-align: center;
}

.community-join i {
    margin-right: .35rem;
}

.community-join:hover,
.community-join:focus {
    box-shadow: 0 5px 12px rgba(31, 45, 61, .16);
    color: #fff;
    filter: brightness(.92);
}

.empty-state {
    align-items: center;
    background: #f9fbfc;
    border: 1px dashed #cbd5df;
    border-radius: 13px;
    color: #6c7989;
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 210px;
    padding: 2rem;
    text-align: center;
}

.empty-state > span {
    align-items: center;
    background: #eaf2f5;
    border-radius: 50%;
    color: #427586;
    display: flex;
    height: 48px;
    justify-content: center;
    margin-bottom: .7rem;
    width: 48px;
}

.empty-state h3 {
    color: #30465a;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 .25rem;
}

.empty-state p {
    font-size: .8rem;
    margin: 0;
}

.community-loading {
    color: #657587;
    display: none;
    font-size: .78rem;
    padding: .65rem;
    text-align: center;
}

.community-loading.show {
    display: block;
}

.community-loading i {
    color: #16877c;
    margin-right: .35rem;
}

.community-contribute {
    align-items: center;
    background: linear-gradient(135deg, #edf8f6 0%, #f7fafc 100%);
    border: 1px solid #d5e9e5;
    border-radius: 16px;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 1.35rem;
}

.community-contribute-icon {
    align-items: center;
    background: #16877c;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(22, 135, 124, .18);
    color: #fff;
    display: flex;
    font-size: 1.1rem;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.community-contribute-copy p {
    color: #68798a;
    font-size: .8rem;
    margin: .35rem 0 .45rem;
}

.community-contribute-copy ul {
    color: #68798a;
    display: flex;
    flex-wrap: wrap;
    font-size: .7rem;
    gap: .25rem 1.2rem;
    margin: 0;
    padding-left: 1rem;
}

.community-contribute-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.btn-main {
    align-items: center;
    border-radius: 9px;
    display: inline-flex;
    font-size: .76rem;
    font-weight: 700;
    gap: .45rem;
    justify-content: center;
    min-height: 40px;
    padding: .55rem .8rem;
    text-decoration: none;
}

.btn-submit {
    background: #176f68;
    border: 1px solid #176f68;
    box-shadow: 0 6px 14px rgba(23, 111, 104, .16);
    color: #fff;
}

.btn-submit:hover,
.btn-submit:focus {
    background: #115e59;
    color: #fff;
}

.btn-secondary-soft {
    background: #fff;
    border: 1px solid #d4dee5;
    color: #506174;
}

.btn-secondary-soft:hover,
.btn-secondary-soft:focus {
    background: #f7f9fb;
    color: #253b4f;
}

@media (max-width: 767.98px) {
    .community-hero {
        min-height: 0;
        padding: 1.25rem;
    }

    .community-hero h2 {
        font-size: 1.45rem;
    }

    .community-hero-visual {
        display: none;
    }

    .community-hero-action {
        min-height: 42px;
        width: 100%;
    }

    .community-filter-fields {
        grid-template-columns: 1fr;
    }

    .community-filters {
        padding: .85rem;
    }

    .type-chips {
        flex-wrap: nowrap;
        margin: 0 -.85rem;
        overflow-x: auto;
        padding: 0 .85rem .25rem;
        scrollbar-width: none;
    }

    .type-chips::-webkit-scrollbar {
        display: none;
    }

    .type-chip {
        flex: 0 0 auto;
        min-height: 38px;
    }

    .community-directory-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: .35rem;
    }

    .community-grid {
        grid-template-columns: 1fr;
    }

    .community-draggable {
        gap: .75rem;
        grid-auto-columns: min(82vw, 280px);
        grid-template-rows: repeat(2, max-content);
        padding-bottom: 1rem;
    }

    .community-nav {
        display: none;
    }

    .community-card {
        min-height: 0;
    }

    .community-join {
        min-height: 34px;
        padding-left: .9rem;
        padding-right: .9rem;
    }

    .community-contribute {
        align-items: flex-start;
        grid-template-columns: auto 1fr;
        padding: 1rem;
    }

    .community-contribute-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
        width: 100%;
    }

    .community-contribute-actions .btn {
        flex: 1 1 100%;
        min-height: 44px;
    }
}

@media (max-width: 420px) {
    .community-contribute-icon {
        display: none;
    }

    .community-contribute {
        display: block;
    }

    .community-contribute-actions {
        margin-top: .9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .community-card,
    .community-hero-action,
    .type-chip {
        transition: none;
    }
}
