/* =============================================================================
   COMMUNITY PROFILE PAGE
   =============================================================================
   Styles for views/community/view.php - moved out of an inline registerCss()
   heredoc (it had grown past 300 lines) into its own asset, registered via
   assets/CommunityProfileAsset.php so load order after site.css/theme.css
   stays deterministic (see that file's docblock, mirroring
   assets/MarketingGroveAsset.php's same rationale).
   ============================================================================= */

.community-view-hero {
    position: relative;
    overflow: hidden;
}

.community-moderator-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    background: rgba(0, 0, 0, 0.7);
    color: #ffc107;
}

/* Full-bleed hero: cover image with a bottom scrim so the breadcrumb / pills /
   title / lead / actions layer reads over any photo. */
.community-view-cover {
    height: 420px;
    object-fit: cover;
    width: 100%;
    display: block;
}

.community-view-cover-placeholder {
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.community-view-hero video.community-hero-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}
.community-view-hero .community-hero-bg-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.community-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Bottom-weighted gradient behind the text layer - independent of the optional
   dark community-hero-overlay above, so text stays legible over bright photos
   even when no landing-page background overlay is active. */
.community-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 75%);
    pointer-events: none;
}

.community-hero-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.5rem 0 1.75rem;
    color: #fff;
}

.community-hero-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.75rem;
}
.community-hero-breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}
.community-hero-breadcrumb a:hover {
    text-decoration: underline;
}
.community-hero-breadcrumb .community-hero-breadcrumb-sep {
    opacity: 0.6;
}

.community-hero-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.community-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    border-radius: var(--radius-full, 999px);
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.community-hero-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md, 0.5rem);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}
.community-hero-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md, 0.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

.community-hero-title {
    font-family: var(--font-family-heading, inherit);
    font-weight: 700;
    font-size: clamp(1.85rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: #fff;
}

.community-hero-lead {
    font-size: 1rem;
    max-width: 46rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.1rem;
}

.community-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Logo edit overlay for community owners, now hosted inside the hero pill row. */
.community-logo-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.community-logo-edit-btn {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    padding: 0;
    border-radius: var(--radius-md, 0.5rem);
    color: #fff;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.community-logo-wrapper:hover .community-logo-edit-btn {
    opacity: 1;
}
.community-logo-edit-btn:hover {
    color: #fff;
}

/* ===== Sticky tab bar ===== */
.community-view-tabs-wrap {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
}

.community-view-tabs .nav-link {
    color: var(--text-secondary, #6c757d);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s;
}

.community-view-tabs .nav-link:hover {
    color: var(--text-primary, #212529);
    border-bottom-color: var(--color-primary-300, #93c5fd);
}

.community-view-tabs .nav-link.active {
    color: var(--color-primary-600, #2563eb);
    border-bottom-color: var(--color-primary-600, #2563eb);
    background: transparent;
}

.community-view-tabs .nav-link i {
    margin-right: 0.375rem;
}

/* ===== About tab: facts + moderators sidebar panels ===== */
.community-facts-panel .community-fact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    font-size: 0.875rem;
}
.community-facts-panel .community-fact-row:last-child {
    border-bottom: none;
}
.community-facts-panel .community-fact-label {
    color: var(--text-muted, #6c757d);
}
.community-facts-panel .community-fact-value {
    font-weight: 600;
    text-align: right;
}

.community-moderator-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.community-moderator-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.community-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.community-member-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.community-post-item {
    border-bottom: 1px solid var(--border-color, #dee2e6);
    padding: 1rem 0;
}

.community-post-item:last-child {
    border-bottom: none;
}

.community-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.post-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2em 0.55em;
    border-radius: 0.25rem;
    white-space: nowrap;
}
.post-type-badge-discussion {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}
.post-type-badge-question {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}
.post-type-tabs .nav-link {
    border: 1px solid var(--border-color, #dee2e6);
    color: var(--text-secondary, #6c757d);
    padding: 0.4rem 1.25rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
}
.post-type-tabs .nav-link.active {
    border-color: var(--color-primary-600, #2563eb);
    color: var(--color-primary-600, #2563eb);
    background: rgba(37, 99, 235, 0.05);
}
.post-type-badge-announcement {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}
.answered-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2em 0.55em;
    border-radius: 0.25rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    white-space: nowrap;
}

.community-stat-card {
    background: var(--bg-primary, #fff);
    border-radius: var(--radius-md, 0.375rem);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    text-align: center;
}

[data-theme="dark"] .community-stat-card {
    background: var(--bg-secondary, #1e293b);
}

.community-fullpage-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
}
.community-fullpage-bg video {
    width: 100%; height: 100%;
    object-fit: cover;
}
.community-fullpage-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.3);
}

/* ===== Cover image reposition controls (admin-only, drag-on-hero) =====
   Pinned to the TOP-right of the hero (not the bottom) - the hero's bottom
   is now the text content layer (breadcrumb/pills/title/lead/actions), so
   an owner's Edit Cover / Reposition cluster living there would overlap it. */
.community-cover-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.community-view-hero:hover .community-cover-actions {
    opacity: 1;
}
.community-view-hero.is-repositioning .community-cover-actions {
    display: none;
}

.community-cover-toolbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    display: none;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    padding: 0.5rem;
    border-radius: var(--radius-md, 0.375rem);
}
.community-view-hero.is-repositioning .community-cover-toolbar {
    display: flex;
}

.community-view-hero.is-repositioning {
    cursor: grab;
    outline: 3px dashed rgba(255, 255, 255, 0.7);
    outline-offset: -6px;
    user-select: none;
}
.community-view-hero.is-repositioning.is-dragging {
    cursor: grabbing;
}

.community-cover-reposition-hint {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md, 0.375rem);
    font-size: var(--font-size-sm, 0.875rem);
    display: none;
    pointer-events: none;
}
.community-view-hero.is-repositioning .community-cover-reposition-hint {
    display: block;
}

/* Empty cover: button cluster stays visible since there's no image to hover. */
.community-cover-actions--empty {
    opacity: 1;
}

@media (max-width: 767.98px) {
    .community-view-cover,
    .community-view-cover-placeholder {
        height: 320px;
    }
    .community-hero-title {
        font-size: 1.85rem;
    }
}
