/* widgets/communities/context_header/context_header.css
 * Спільний hero. Токени --n-*. Без картки — відкритий блок над контентом. */

.community-context { margin: 0 0 var(--n-s-4); }

.community-context__cover {
    height: 190px;
    border-radius: var(--n-r-md);
    background: linear-gradient(135deg, var(--n-accent-soft), var(--n-bg-sunk));
    background-size: cover;
    background-position: center;
    border: 1px solid var(--n-line);
}
.community-context[data-has-cover="1"] .community-context__cover {
    background-image: var(--cc-cover);
}

.community-context__bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: flex-end;
    gap: var(--n-s-4);
    margin-top: -44px;
    padding: 0 var(--n-s-4);
}

.community-context__avatar {
    width: 96px;
    height: 96px;
    border-radius: var(--n-r-md);
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--n-accent-soft);
    border: 3px solid var(--n-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    flex: none;
}
.community-context__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.community-context__init {
    font-family: var(--n-font-display, var(--n-font));
    font-weight: var(--n-w-black, 800);
    font-size: 40px;
    color: var(--n-accent);
    line-height: 1;
}

.community-context__id { min-width: 0; padding-bottom: 4px; }
.community-context__title {
    display: flex;
    align-items: center;
    gap: var(--n-s-2);
    margin: 0;
    font-family: var(--n-font-display, var(--n-font));
    font-weight: var(--n-w-bold);
    font-size: 26px;
    line-height: var(--n-lh-tight);
    color: var(--n-text-strong, var(--n-text));
}
.community-context__title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-context__verified { display: inline-flex; color: var(--n-accent); flex: none; }
.community-context__verified svg { display: block; }

.community-context__meta {
    margin: 4px 0 0;
    font-size: var(--n-fs-sm);
    color: var(--n-text-mute);
}
.community-context__metrics {
    margin: 4px 0 0;
    font-size: var(--n-fs-sm);
    color: var(--n-text-mute);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.community-context__metrics strong { color: var(--n-text-soft); font-weight: var(--n-w-sem); font-variant-numeric: tabular-nums; }
.community-context__dot { opacity: .5; }

.community-context__actions {
    display: flex;
    align-items: center;
    gap: var(--n-s-2);
    padding-bottom: 4px;
}
.community-context__primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 var(--n-s-5);
    border-radius: var(--n-r-sm);
    font-weight: var(--n-w-sem);
    font-size: var(--n-fs);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--n-dur-fast) var(--n-ease);
}
.community-context__primary.is-join,
.community-context__primary.is-open { background: var(--n-accent); color: var(--n-text-on-accent); }
.community-context__primary.is-join:hover,
.community-context__primary.is-open:hover { background: var(--n-accent-hover); }
.community-context__primary.is-requested { background: transparent; border-color: var(--n-line-strong); color: var(--n-text-mute); }
.community-context__primary.is-joined { background: var(--n-accent-soft); color: var(--n-accent); }
.community-context__primary[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* Overflow ⋯ (native <details>, без JS) */
.community-context__overflow { position: relative; }
.community-context__overflow > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--n-r-sm);
    border: 1px solid var(--n-line-strong);
    color: var(--n-text-mute);
    cursor: pointer;
}
.community-context__overflow > summary::-webkit-details-marker { display: none; }
.community-context__overflow > summary:hover { background: var(--n-bg-hover); color: var(--n-text); }
.community-context__overflow[open] > summary { border-color: var(--n-accent-border); color: var(--n-text); }
.community-context__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 190px;
    background: var(--n-surface, var(--n-bg-soft));
    border: 1px solid var(--n-line-strong);
    border-radius: var(--n-r-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
    padding: var(--n-s-1);
    z-index: var(--n-z-popover, 1500);
    display: flex;
    flex-direction: column;
}
.community-context__menu a {
    padding: 9px var(--n-s-3);
    border-radius: var(--n-r-xs);
    color: var(--n-text-soft);
    text-decoration: none;
    font-size: var(--n-fs-sm);
    white-space: nowrap;
}
.community-context__menu a:hover { background: var(--n-bg-hover); color: var(--n-text); }

@media (max-width: 640px) {
    .community-context__cover { height: 140px; }
    .community-context__bar {
        grid-template-columns: auto 1fr;
        margin-top: -36px;
    }
    .community-context__avatar { width: 76px; height: 76px; }
    .community-context__init { font-size: 32px; }
    .community-context__title { font-size: 22px; }
    .community-context__actions {
        grid-column: 1 / -1;
        padding-top: var(--n-s-2);
    }
    .community-context__primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .community-context__primary { transition: none; }
}
