/* ================================================================
   community.css — GoPlaces Community design system

   Ported from the Communities design spec. All rules are scoped under
   .gp-community-root so this file can't bleed into the rest of the
   Tailwind-based app. Light/dark gated on the existing html.dark toggle.

   Page wrappers:
     <div class="gp-community-root">…</div>             (any community page)
     Add class "is-mobile" via media query below — handled automatically.

   Sections:
     1. Design tokens (dark default, light override)
     2. Typography & base
     3. Layout: content + rail
     4. Cards / buttons / chips / tabs / pills
     5. Community-specific: banner, header bar, community-card
     6. Posts: post, vote rail, post-actions, place-chips
     7. Comments
     8. Empty states / banners
     9. Mobile responsive
   ================================================================ */

/* ── 1. Design tokens (DARK is the default body) ──────────────── */
.gp-community-root {
    --gpc-bg:            #0F1620;
    --gpc-surface:       #161E2B;
    --gpc-raised:        #1C2533;
    --gpc-raised-2:      #232C3D;
    --gpc-border:        #232C3D;
    --gpc-border-strong: #2E384B;
    --gpc-text:          #F1F1EC;
    --gpc-text-2:        #B7BFCC;
    --gpc-text-3:        #7A8294;
    --gpc-text-4:        #545B6B;
    --gpc-accent:        #FF6B3D;
    --gpc-accent-soft:   rgba(255, 107, 61, 0.12);
    --gpc-accent-hover:  #FF7E55;
    --gpc-nav-active:        #1F3A2A;
    --gpc-nav-active-text:   #4ADE80;
    --gpc-up:            #FF6B3D;
    --gpc-down:          #6B8FFF;
    --gpc-warn:          #F2B544;
    --gpc-warn-soft:     rgba(242, 181, 68, 0.10);
    --gpc-pill:          #232C3D;
    --gpc-pill-text:     #B7BFCC;

    background: var(--gpc-bg);
    color: var(--gpc-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100%;
}

/* Light-mode overrides — when site is NOT in dark mode */
html:not(.dark) .gp-community-root {
    --gpc-bg:            #FAFAF7;
    --gpc-surface:       #FFFFFF;
    --gpc-raised:        #FFFFFF;
    --gpc-raised-2:      #F4F4EE;
    --gpc-border:        #E8E8DF;
    --gpc-border-strong: #D8D8CD;
    --gpc-text:          #161E2B;
    --gpc-text-2:        #4A5160;
    --gpc-text-3:        #767D8C;
    --gpc-text-4:        #A0A6B2;
    --gpc-accent:        #FF6B3D;
    --gpc-accent-soft:   rgba(255, 107, 61, 0.10);
    --gpc-nav-active:        #E6F4EC;
    --gpc-nav-active-text:   #1F8A4C;
    --gpc-pill:          #F0F0E8;
    --gpc-pill-text:     #4A5160;
}

/* ── 2. Typography helpers ─────────────────────────────────────── */
.gp-community-root .serif {
    font-family: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
}
.gp-community-root .muted   { color: var(--gpc-text-3); }
.gp-community-root .muted-2 { color: var(--gpc-text-4); }
.gp-community-root .dot-sep::before {
    content: "·"; margin: 0 6px; color: var(--gpc-text-4);
}
.gp-community-root .row { display: flex; align-items: center; gap: 8px; }
.gp-community-root .col { display: flex; flex-direction: column; }
.gp-community-root .gap-2 { gap: 8px; }
.gp-community-root .gap-3 { gap: 12px; }
.gp-community-root .gap-4 { gap: 16px; }

/* ── 3. Layout: content + rail ─────────────────────────────────── */
.gp-community-root .gpc-content {
    padding: 24px 28px 80px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    max-width: 1340px;
    width: 100%;
    margin: 0 auto;
}
.gp-community-root .gpc-content.no-rail { grid-template-columns: 1fr; }

.gp-community-root .rail { display: flex; flex-direction: column; gap: 16px; }
.gp-community-root .rail h3 {
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--gpc-text-3); font-weight: 600;
    margin: 0 0 10px;
}

/* ── 4. Primitives ─────────────────────────────────────────────── */
.gp-community-root .card {
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 14px;
}
.gp-community-root .card-pad { padding: 16px 18px; }

.gp-community-root .btn {
    border: 1px solid var(--gpc-border-strong);
    background: transparent; color: var(--gpc-text);
    padding: 8px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.gp-community-root .btn:hover { background: var(--gpc-raised-2); }
.gp-community-root .btn-primary {
    background: var(--gpc-accent); color: white; border-color: transparent;
}
.gp-community-root .btn-primary:hover { background: var(--gpc-accent-hover); }
.gp-community-root .btn-primary:disabled,
.gp-community-root .btn-primary[disabled] {
    opacity: 0.55; cursor: not-allowed;
}
.gp-community-root .btn-ghost { border-color: transparent; color: var(--gpc-text-2); }
.gp-community-root .btn-ghost:hover { background: var(--gpc-raised-2); color: var(--gpc-text); }
.gp-community-root .btn-sm { padding: 5px 10px; font-size: 12px; }

.gp-community-root .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--gpc-pill); color: var(--gpc-pill-text);
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    border: 0;
}
.gp-community-root .chip.active { background: var(--gpc-text); color: var(--gpc-bg); }
.gp-community-root .chip-soft {
    background: transparent;
    border: 1px solid var(--gpc-border);
}

.gp-community-root .tabs {
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--gpc-border);
    margin-bottom: 4px;
}
.gp-community-root .tab {
    padding: 10px 14px; font-size: 13px; font-weight: 500;
    color: var(--gpc-text-3); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent; border-top: 0; border-left: 0; border-right: 0;
}
.gp-community-root .tab.active { color: var(--gpc-text); border-bottom-color: var(--gpc-accent); }
.gp-community-root .tab:hover { color: var(--gpc-text); }

.gp-community-root .sort-pills { display: flex; gap: 4px; }
.gp-community-root .sort-pill {
    padding: 6px 12px; border-radius: 999px;
    font-size: 12.5px; color: var(--gpc-text-2);
    cursor: pointer; font-weight: 500;
    background: transparent; border: 0;
}
.gp-community-root .sort-pill.active { background: var(--gpc-raised-2); color: var(--gpc-text); }
.gp-community-root .sort-pill:hover  { color: var(--gpc-text); }

.gp-community-root .section-title {
    display: flex; align-items: center; justify-content: space-between;
    margin: 18px 0 12px;
}
.gp-community-root .section-title h2 {
    font-size: 16px; font-weight: 600; margin: 0;
    letter-spacing: -0.01em;
}
.gp-community-root .section-title .more {
    font-size: 12px; color: var(--gpc-text-3); cursor: pointer; text-decoration: none;
}

.gp-community-root .personalized-strip {
    background: var(--gpc-warn-soft);
    border: 1px solid rgba(242, 181, 68, 0.25);
    color: #E0A436;
    padding: 10px 14px; border-radius: 10px;
    font-size: 12.5px;
    display: flex; align-items: center; gap: 8px;
}
.gp-community-root .personalized-strip strong { color: var(--gpc-text); }
.gp-community-root .personalized-strip .show {
    margin-left: auto; cursor: pointer; text-decoration: underline; opacity: 0.85;
}

.gp-community-root .filter-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.gp-community-root .filter-bar .divider {
    height: 16px; width: 1px; background: var(--gpc-border);
}

/* ── Sidebar (right rail for Browse page) ────────────────────── */
.gp-community-root .gpc-rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
}

.gp-community-root .sidebar-section {
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 12px;
    padding: 16px;
}

.gp-community-root .sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gpc-text-3);
    margin: 0 0 12px;
}

.gp-community-root .circles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gp-community-root .circle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.gp-community-root .circle-item:hover {
    background: var(--gpc-raised);
}

.gp-community-root .circle-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.gp-community-root .circle-info {
    flex: 1;
    min-width: 0;
}

.gp-community-root .circle-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gpc-text);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gp-community-root .circle-unread {
    background: var(--gpc-accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.gp-community-root .tags-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gp-community-root .tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    cursor: pointer;
    text-decoration: none;
    color: var(--gpc-text-2);
    transition: color 0.15s;
    font-size: 13px;
}

.gp-community-root .tag-item:hover {
    color: var(--gpc-text);
}

.gp-community-root .tag-count {
    font-size: 12px;
    color: var(--gpc-text-3);
}

/* Image placeholder (used when destination has no hero image) */
.gp-community-root .img-ph {
    background:
        repeating-linear-gradient(135deg,
            rgba(255,255,255,0.025) 0 8px,
            rgba(255,255,255,0.05) 8px 16px),
        var(--gpc-raised-2);
    display: grid; place-items: center;
    color: var(--gpc-text-4);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
html:not(.dark) .gp-community-root .img-ph {
    background:
        repeating-linear-gradient(135deg,
            rgba(0,0,0,0.025) 0 8px,
            rgba(0,0,0,0.05) 8px 16px),
        var(--gpc-raised-2);
}

/* ── 5. Community-specific elements ────────────────────────────── */
.gp-community-root .community-banner {
    position: relative;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--gpc-raised-2);
}
.gp-community-root .community-banner img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.gp-community-root .banner-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15,22,32,0) 30%, rgba(15,22,32,0.85) 100%);
    pointer-events: none;
}
html:not(.dark) .gp-community-root .banner-overlay {
    background: linear-gradient(180deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.85) 100%);
}

.gp-community-root .community-header-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 0 4px 16px;
    flex-wrap: wrap;
}
.gp-community-root .community-avatar {
    width: 76px; height: 76px; border-radius: 18px;
    border: 4px solid var(--gpc-bg);
    margin-top: -38px;
    background: var(--gpc-raised);
    display: grid; place-items: center;
    font-size: 28px;
    flex-shrink: 0;
    overflow: hidden;
}
.gp-community-root .community-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.gp-community-root .community-header-bar h1 {
    margin: 6px 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
    color: var(--gpc-text);
}
.gp-community-root .community-header-bar .sub {
    font-size: 12.5px; color: var(--gpc-text-3);
}

/* Discover community card */
.gp-community-root .community-card {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--gpc-border);
    border-radius: 14px;
    background: var(--gpc-surface);
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}
.gp-community-root .community-card:hover { border-color: var(--gpc-border-strong); }
.gp-community-root .community-card .cc-img {
    width: 88px; height: 88px; border-radius: 12px;
    overflow: hidden; flex-shrink: 0;
    display: grid; place-items: center;
    font-size: 32px;
    background: var(--gpc-raised-2);
}
.gp-community-root .community-card .cc-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.gp-community-root .community-card h4 {
    margin: 0 0 4px; font-size: 15px; font-weight: 600;
    letter-spacing: -0.01em; color: var(--gpc-text);
}
.gp-community-root .community-card .cc-meta {
    font-size: 12px; color: var(--gpc-text-3); margin-bottom: 6px;
}
.gp-community-root .community-card .cc-desc {
    font-size: 13px; color: var(--gpc-text-2); margin: 0; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── 6. Posts ──────────────────────────────────────────────────── */
.gp-community-root .post-list { display: flex; flex-direction: column; gap: 12px; }
.gp-community-root .post {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border: 1px solid var(--gpc-border);
    border-radius: 14px;
    background: var(--gpc-surface);
    transition: border-color 0.15s;
    cursor: pointer;
}
.gp-community-root .post:hover { border-color: var(--gpc-border-strong); }
.gp-community-root .post-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--gpc-text-3);
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.gp-community-root .post-meta .uname {
    color: var(--gpc-text); font-weight: 600;
    text-decoration: none;
}
.gp-community-root .post-meta .uname:hover { color: var(--gpc-accent); }
.gp-community-root .post-title {
    font-size: 16px; font-weight: 600; line-height: 1.35;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
    color: var(--gpc-text);
}
.gp-community-root .post-body {
    font-size: 13.5px; color: var(--gpc-text-2);
    margin: 0 0 10px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gp-community-root .post-body.italic { font-style: italic; color: var(--gpc-text-3); }
/* Legacy post-actions (kept for backward compat) */
.gp-community-root .post-actions {
    display: flex; align-items: center; gap: 4px;
    margin-top: 4px;
    color: var(--gpc-text-3); font-size: 12.5px; font-weight: 500;
}
.gp-community-root .post-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 8px; cursor: pointer;
    background: transparent; border: 0; color: inherit; font: inherit;
}
.gp-community-root .post-action:hover { background: var(--gpc-raised-2); color: var(--gpc-text); }

/* ── Reddit-style action bar (pill groups) ─────────────────────── */
.gp-community-root .post-actions-bar {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px;
    color: var(--gpc-text-3); font-size: 13px; font-weight: 500;
}
.gp-community-root .action-pill {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--gpc-raised-2);
    border: 0; border-radius: 999px;
    padding: 4px 12px;
    color: var(--gpc-text-3);
    font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.gp-community-root .action-pill:hover {
    background: var(--gpc-border-strong, #2E3A4E);
    color: var(--gpc-text);
}

/* Vote pill */
.gp-community-root .vote-pill {
    gap: 0; padding: 0;
}
.gp-community-root .vote-pill .pill-btn {
    display: grid; place-items: center;
    background: transparent; border: 0;
    color: inherit; cursor: pointer;
    padding: 6px 6px;
    border-radius: 999px;
    transition: color 0.15s, background 0.15s;
    line-height: 0;
}
.gp-community-root .vote-pill .pill-btn:first-child { border-radius: 999px 0 0 999px; padding-left: 8px; }
.gp-community-root .vote-pill .pill-btn:last-child  { border-radius: 0 999px 999px 0; padding-right: 8px; }
.gp-community-root .vote-pill .vote-up:hover  { color: var(--gpc-up, #FF6B3D); background: rgba(255,107,61,0.12); }
.gp-community-root .vote-pill .vote-down:hover { color: var(--gpc-down, #6B8FFF); background: rgba(107,143,255,0.12); }
.gp-community-root .vote-pill .vote-up.on  { color: var(--gpc-up, #FF6B3D); }
.gp-community-root .vote-pill .vote-down.on { color: var(--gpc-down, #6B8FFF); }
.gp-community-root .vote-pill .pill-score {
    font-size: 12px; font-weight: 700;
    min-width: 20px; text-align: center;
    padding: 0 2px;
    user-select: none;
}

/* Comment pill */
.gp-community-root .comment-pill {
    gap: 6px;
}

/* Star pill */
.gp-community-root .star-pill {
    font-size: 16px; padding: 4px 10px;
}
.gp-community-root .star-pill .star-icon { line-height: 1; }
.gp-community-root .star-pill.post-action--star-on { color: #F2B544; }
.gp-community-root .star-pill.post-action--star-on:hover { background: rgba(242,181,68,0.12); }

/* Share pill */
.gp-community-root .share-pill {
    gap: 6px;
}

/* Legacy vote rail (for detail modal) */
.gp-community-root .vote {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 0;
    color: var(--gpc-text-3);
    font-size: 12px; font-weight: 600;
}
.gp-community-root .vote button {
    background: transparent; border: 0; padding: 4px;
    color: inherit; cursor: pointer; border-radius: 6px;
    display: grid; place-items: center;
}
.gp-community-root .vote button:hover { background: var(--gpc-raised-2); }
.gp-community-root .vote .up.on   { color: var(--gpc-up); }
.gp-community-root .vote .down.on { color: var(--gpc-down); }
.gp-community-root .vote.horizontal {
    flex-direction: row;
    background: var(--gpc-raised-2);
    border-radius: 999px;
    padding: 2px 4px;
}

/* Post-title tags */
.gp-community-root .post-title-tag {
    display: inline-flex; align-items: center;
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 4px;
    margin-right: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 2px;
}
.gp-community-root .tag-question  { background: rgba(107, 143, 255, 0.16); color: #97AEFF; }
.gp-community-root .tag-trip      { background: rgba(74, 222, 128, 0.14); color: #6FE19E; }
.gp-community-root .tag-itinerary { background: rgba(242, 181, 68, 0.16); color: #F2B544; }
.gp-community-root .tag-photo     { background: rgba(245, 158, 11, 0.16); color: #F59E0B; }
.gp-community-root .tag-poll      { background: rgba(168, 85, 247, 0.16); color: #C084FC; }

html:not(.dark) .gp-community-root .tag-question  { background: #E2E9FF; color: #3D5BC4; }
html:not(.dark) .gp-community-root .tag-trip      { background: #DCF5E6; color: #1F8A4C; }
html:not(.dark) .gp-community-root .tag-itinerary { background: #FEF3C7; color: #B45309; }
html:not(.dark) .gp-community-root .tag-photo     { background: #FEF3C7; color: #D97706; }
html:not(.dark) .gp-community-root .tag-poll      { background: #F3E8FF; color: #7E22CE; }

/* Redacted / status */
.gp-community-root .status-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 6px;
    margin-left: 8px;
}
.gp-community-root .status-tag.redacted { background: rgba(255,107,61,0.14); color: #FFA786; }
.gp-community-root .redacted-body {
    padding: 14px 16px;
    border: 1px dashed var(--gpc-border-strong);
    border-radius: 10px;
    color: var(--gpc-text-3);
    font-style: italic;
    font-size: 13px;
}

/* Icon buttons (heart / star membership toggle) */
.gp-community-root .icon-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 999px;
    border: 1px solid var(--gpc-border);
    background: var(--gpc-surface);
    cursor: pointer;
    color: var(--gpc-text-2);
}
.gp-community-root .icon-btn:hover { background: var(--gpc-raised-2); color: var(--gpc-text); }
.gp-community-root .icon-btn.on.heart {
    color: #FF5275; border-color: rgba(255,82,117,0.4); background: rgba(255,82,117,0.08);
}

/* New posts badge on community cards */
.gp-community-root .new-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
    background: var(--gpc-accent); color: white;
    margin-left: 8px; vertical-align: 2px;
    text-transform: none; letter-spacing: 0;
}

/* ── 7. Comments ──────────────────────────────────────────────── */
.gp-community-root .comment {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr); /* minmax(0,1fr) so long content can shrink */
    gap: 12px;
    padding: 12px 0;
}
.gp-community-root .comment > div { min-width: 0; }
.gp-community-root .comment-thread {
    border-left: 1px solid var(--gpc-border);
    padding-left: 14px;
    margin-left: 16px;
    min-width: 0;
}
.gp-community-root .comment-meta {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap; /* let Edit/Delete drop under the timestamp on narrow screens */
    font-size: 12px; color: var(--gpc-text-3);
    margin-bottom: 4px;
}
.gp-community-root .comment-meta .uname { color: var(--gpc-text); font-weight: 600; }
.gp-community-root .comment-meta .op-tag {
    font-size: 10px; padding: 1px 5px; border-radius: 3px;
    background: var(--gpc-accent-soft); color: var(--gpc-accent); font-weight: 600;
}
/* Author-only Edit / Delete sit right after the timestamp on desktop,
   wrap to the next line on mobile via the parent's flex-wrap. */
.gp-community-root .comment-meta .comment-meta-actions {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 8px;
}
.gp-community-root .comment-meta-actions .action-pill {
    padding: 2px 8px; font-size: 11.5px;
    white-space: nowrap;
}
.gp-community-root .comment-body {
    font-size: 13.5px; color: var(--gpc-text); line-height: 1.55;
    overflow-wrap: anywhere; /* long URLs break instead of forcing layout wider */
}
.gp-community-root .comment-actions {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; /* vote pill, Reply, Share, Save, Award wrap on narrow screens */
    margin-top: 6px;
    font-size: 12px; color: var(--gpc-text-3); font-weight: 500;
}
.gp-community-root .comment-actions .action-pill {
    padding: 3px 10px; font-size: 12px;
}

/* Avatar */
.gp-community-root .avatar {
    border-radius: 50%;
    background: var(--gpc-raised-2);
    display: grid; place-items: center;
    font-weight: 600; color: var(--gpc-text-2);
    overflow: hidden; flex-shrink: 0;
}
.gp-community-root .avatar img { width: 100%; height: 100%; object-fit: cover; }
.gp-community-root .avatar.sm  { width: 24px; height: 24px; font-size: 10px; }
.gp-community-root .avatar.md  { width: 32px; height: 32px; font-size: 12px; }
.gp-community-root .avatar.lg  { width: 40px; height: 40px; font-size: 14px; }

/* ── Suggestion banner ────────────────────────────────────────── */
.gp-community-root .suggestion-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 159, 64, 0.3);
    background: rgba(255, 159, 64, 0.08);
}
.gp-community-root .suggestion-banner.hidden { display: none; }
.gp-community-root .suggestion-icon { font-size: 18px; flex-shrink: 0; }
.gp-community-root .suggestion-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--gpc-text);
}
.gp-community-root .suggestion-text strong {
    color: var(--gpc-text);
    font-weight: 600;
}
.gp-community-root .suggestion-why {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--gpc-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    /* Reset native <button> defaults so it reads as an inline text link */
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
}
.gp-community-root .suggestion-why:hover { opacity: 0.8; }

/* Light-mode override */
html:not(.dark) .gp-community-root .suggestion-banner {
    border-color: rgba(255, 140, 40, 0.35);
    background: rgba(255, 159, 64, 0.1);
}

/* ── 8. Empty states / banners / modal ────────────────────────── */
.gp-community-root .empty-state {
    text-align: center;
    padding: 48px 24px;
    border: 1px dashed var(--gpc-border-strong);
    border-radius: 14px;
    background: var(--gpc-surface);
}
.gp-community-root .empty-state .empty-icon {
    margin: 0 auto 16px; width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--gpc-accent-soft); color: var(--gpc-accent);
    display: grid; place-items: center;
}
.gp-community-root .empty-state h3 {
    margin: 0 0 6px; font-size: 18px; font-weight: 600;
    color: var(--gpc-text); letter-spacing: -0.01em;
}
.gp-community-root .empty-state p {
    margin: 0 0 16px; color: var(--gpc-text-3); font-size: 13.5px;
    max-width: 380px; margin-inline: auto; line-height: 1.55;
}

/* Heading for the embedded preview block on the destination page.
   Replaces the hardcoded `text-white` Tailwind utility so the heading
   stays readable in light mode. The selector is unscoped so it still
   resolves before community-preview.js adds .gp-community-root. */
.community-preview-heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--gpc-text, var(--text-primary, currentColor));
}

/* "Coming soon" preview placeholder for destination page embed */
.gp-community-root .preview-placeholder {
    padding: 28px 24px;
    border: 1px dashed var(--gpc-border-strong);
    border-radius: 14px;
    background: var(--gpc-surface);
    text-align: center;
}
.gp-community-root .preview-placeholder h3 {
    margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--gpc-text);
}
.gp-community-root .preview-placeholder p {
    margin: 0; color: var(--gpc-text-3); font-size: 13px;
}

/* Modal */
.gp-community-root .gpc-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(8,12,18,0.7);
    backdrop-filter: blur(8px);
    display: grid; place-items: center;
    z-index: 9990;
}
html:not(.dark) .gp-community-root .gpc-modal-backdrop {
    background: rgba(200,205,215,0.55);
}
.gp-community-root .gpc-modal {
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 16px;
    width: 720px; max-width: 92%;
    max-height: 86vh; overflow-y: auto;
    padding: 22px 24px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.gp-community-root .gpc-modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 999px;
    border: 0; background: transparent;
    color: var(--gpc-text-3); cursor: pointer;
}
.gp-community-root .gpc-modal-close:hover {
    background: var(--gpc-raised-2); color: var(--gpc-text);
}

/* Hidden override (Tailwind .hidden coexistence — enforced by linter) */
.gp-community-root .gpc-modal-backdrop.hidden { display: none; }

/* ── 9. Mobile responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .gp-community-root .gpc-content {
        grid-template-columns: 1fr;
        padding: 20px 18px 64px;
    }
    .gp-community-root .gpc-rail,
    .gp-community-root .rail { display: none; }
}

@media (max-width: 640px) {
    .gp-community-root .gpc-content { padding: 14px 14px 24px; gap: 14px; }
    .gp-community-root .community-banner { height: 130px; border-radius: 12px; margin-bottom: 10px; }
    .gp-community-root .community-avatar {
        width: 56px; height: 56px; font-size: 22px;
        border-radius: 14px; border-width: 3px;
        margin-top: -28px;
    }
    .gp-community-root .community-header-bar h1 { font-size: 18px; margin: 4px 0 2px; }
    .gp-community-root .community-header-bar .sub { font-size: 11.5px; }
    .gp-community-root .community-header-bar .actions {
        width: 100%; flex-wrap: nowrap; display: flex; gap: 8px;
    }
    .gp-community-root .community-header-bar .actions .btn {
        flex: 1; justify-content: center;
    }
    .gp-community-root .filter-bar {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px 8px;
        padding: 12px 10px;
    }
    .gp-community-root .filter-bar .divider {
        display: none;
    }
    .gp-community-root .sort-pills {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 100%;
    }
    .gp-community-root .sort-pills::-webkit-scrollbar {
        display: none;
    }
    .gp-community-root .filter-bar #communityFiltersBtn {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0 !important;
    }
    .gp-community-root .cat-pills {
        grid-column: 1 / span 2;
        grid-row: 2;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
        width: 100%;
    }
    .gp-community-root .cat-pills::-webkit-scrollbar {
        display: none;
    }
    .gp-community-root .post {
        padding: 12px; gap: 10px;
    }
    .gp-community-root .post-title { font-size: 14.5px; line-height: 1.3; }
    .gp-community-root .post-body { font-size: 13px; -webkit-line-clamp: 2; }
    .gp-community-root .post-meta { font-size: 11.5px; }
    .gp-community-root .post-actions { font-size: 11.5px; gap: 2px; }
    .gp-community-root .post-action { padding: 4px 8px; }
    .gp-community-root .vote span { font-size: 11px; }

    .gp-community-root .community-card {
        grid-template-columns: 64px 1fr;
        gap: 12px; padding: 12px;
    }
    .gp-community-root .community-card .cc-img {
        width: 64px; height: 64px; font-size: 24px;
    }
    .gp-community-root .community-card h4 { font-size: 14px; }
    .gp-community-root .community-card .cc-desc { font-size: 12px; }
    .gp-community-root .community-card > .btn {
        grid-column: 1 / -1; width: 100%; justify-content: center;
    }
    .gp-community-root .discover-grid {
        grid-template-columns: 1fr !important;
    }
    .gp-community-root .gpc-page-title { font-size: 22px !important; }
    .gp-community-root .gpc-modal { padding: 18px; }
    .gp-community-root .comment {
        grid-template-columns: 28px 1fr; gap: 10px;
    }
    .gp-community-root .comment-thread { padding-left: 10px; margin-left: 10px; }
}

/* Pagination — declared as a real class so `.hidden` (Tailwind) can suppress it
   without colliding with inline display:flex on the markup. */
.gp-community-root .gpc-pager {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* Hidden visibility override — preserve specificity contract with Tailwind */
.gp-community-root .filter-bar.hidden,
.gp-community-root .post-list.hidden,
.gp-community-root .empty-state.hidden,
.gp-community-root .community-header-bar.hidden,
.gp-community-root .community-banner.hidden,
.gp-community-root .preview-placeholder.hidden,
.gp-community-root .gpc-pager.hidden,
.gp-community-root .gpc-content.hidden,
.gp-community-root .gpc-modal-backdrop.hidden {
    display: none;
}

/* ── Post card — breadcrumb + vote-score (Phase 3 redesign) ── */
.gp-community-root .post-breadcrumb {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 12px; color: var(--gpc-text-3);
    margin-bottom: 6px;
}
.gp-community-root .post-community {
    font-weight: 700; color: var(--gpc-text);
}
.gp-community-root .post-byline .uname {
    color: var(--gpc-accent); font-weight: 600;
    text-decoration: none;
}
.gp-community-root .post-byline .uname:hover { text-decoration: underline; }
.gp-community-root .post-time { color: var(--gpc-text-3); }
.gp-community-root .vote .vote-score {
    font-size: 13px; font-weight: 700;
    color: var(--gpc-text); min-width: 28px; text-align: center;
    padding: 2px 0;
}
.gp-community-root .post-action--muted { color: var(--gpc-text-3); }
.gp-community-root .post-action--muted:hover { color: #FF5275; background: rgba(255,82,117,0.08); }

/* Pinned post indicator */
.gp-community-root .post-pinned-tag {
    display: inline-flex; align-items: center; gap: 3px;
    color: var(--gpc-accent); font-weight: 600; font-size: 11.5px;
}
.gp-community-root .post--pinned {
    border-left: 3px solid var(--gpc-accent);
    padding-left: calc(16px - 3px); /* maintain visual alignment */
}

/* ··· overflow button — pushed to far right */
.gp-community-root .post-action--overflow {
    margin-left: auto;
    font-size: 16px; letter-spacing: 2px; line-height: 1;
    padding: 4px 8px;
}

/* Vote score — slightly larger for prominence */
.gp-community-root .vote .vote-score {
    font-size: 14px;
}

/* Star button (Inbox) — gold tint when toggled on */
.gp-community-root .post-action--star { gap: 4px; }
.gp-community-root .post-action--star .star-icon { font-size: 14px; line-height: 1; }
.gp-community-root .post-action--star-on { color: #F2B544; }
.gp-community-root .post-action--star-on .star-icon { color: #F2B544; }

/* ================================================================
   Community Preview — Destination Page Embed
   Scoped under .gp-community-root so tokens cascade correctly.
   ================================================================ */

/* Post list container */
.gp-community-root .cp-post-list {
    display: flex; flex-direction: column;
    gap: 20px;
}

/* Individual post card */
.gp-community-root .cp-card {
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 14px;
    padding: 18px 20px;
    transition: border-color 0.15s ease;
}
.gp-community-root .cp-card:hover {
    border-color: var(--gpc-border-strong);
}

/* Card header: avatar + meta */
.gp-community-root .cp-card-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}

#community-preview .cp-card {
    background: var(--dp-bg-card);
    border: 1px solid var(--dp-border);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
#community-preview .cp-card:hover {
    border-color: var(--dp-text-3);
}

/* Flex inner layout for horizontal vote split */
#community-preview .cp-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* Left Column: Vote Widget */
#community-preview .cp-vote-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 40px;
    flex-shrink: 0;
    color: var(--dp-text-2);
}
#community-preview .cp-vote-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--dp-text-2);
    cursor: default;
}
#community-preview .cp-vote-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--dp-text-1);
    margin-top: 2px;
}

/* Right Column: Content Area */
#community-preview .cp-content-area {
    flex: 1;
    min-width: 0;
}

/* Post header: avatar + meta */
#community-preview .cp-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* Avatars */
#community-preview .cp-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
#community-preview .cp-reply-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

#community-preview .cp-avatar-link,
#community-preview .cp-reply-avatar-link {
    text-decoration: none;
    line-height: 0;
    flex-shrink: 0;
}

/* Meta info line */
#community-preview .cp-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#community-preview .cp-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13.5px;
}
#community-preview .cp-author {
    font-weight: 700;
    color: var(--dp-text-1);
    text-decoration: none;
}
#community-preview .cp-author:hover {
    color: #E05A2B;
    text-decoration: underline;
}
#community-preview .cp-meta-sep {
    color: var(--dp-text-3);
}
#community-preview .cp-time {
    color: var(--dp-text-2);
}

/* Post type pill */
#community-preview .cp-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 1.5px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 4px;
}
#community-preview .cp-type-pill--question { background: rgba(99,179,237,0.15); color: #4FA3E0; }
#community-preview .cp-type-pill--trip     { background: rgba(72,187,120,0.15); color: #48BB78; }
#community-preview .cp-type-pill--itinerary{ background: rgba(159,122,234,0.15); color: #9F7AEA; }
#community-preview .cp-type-pill--photo    { background: rgba(237,137,54,0.15);  color: #ED8936; }
#community-preview .cp-type-pill--poll     { background: rgba(246,173,85,0.15);  color: #F6AD55; }

/* Light mode overrides for post type pills */
html:not(.dark) #community-preview .cp-type-pill--question { background: rgba(44,82,130,0.08); color: #2B6CB0; }
html:not(.dark) #community-preview .cp-type-pill--trip     { background: rgba(39,103,73,0.08);  color: #2F855A; }
html:not(.dark) #community-preview .cp-type-pill--itinerary{ background: rgba(85,60,154,0.08);  color: #6B46C1; }
html:not(.dark) #community-preview .cp-type-pill--photo    { background: rgba(156,66,33,0.08);  color: #C05621; }
html:not(.dark) #community-preview .cp-type-pill--poll     { background: rgba(183,121,31,0.08); color: #B7791F; }

/* Post Body */
#community-preview .cp-body {
    margin-bottom: 12px;
}
#community-preview .cp-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dp-text-1);
    margin: 0 0 6px;
    line-height: 1.4;
}
#community-preview .cp-text {
    font-size: 14.5px;
    color: var(--dp-text-2);
    margin: 0;
    line-height: 1.55;
    word-break: break-word;
}
#community-preview .cp-text--redacted {
    color: var(--dp-text-3);
    font-style: italic;
}

/* Post Cover Photo */
#community-preview .cp-cover-photo {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 10px;
}

/* Post stats footer */
#community-preview .cp-stats {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--dp-text-3);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--dp-border);
    margin-bottom: 6px;
}

/* Reply Thread Area */
#community-preview .cp-replies {
    padding: 8px 0 4px;
    display: flex;
    flex-direction: column;
}
#community-preview .cp-reply {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--dp-border);
}
#community-preview .cp-reply:last-child {
    border-bottom: none;
}
#community-preview .cp-reply-content {
    flex: 1;
    min-width: 0;
}
#community-preview .cp-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
#community-preview .cp-reply-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--dp-text-1);
    text-decoration: none;
}
#community-preview .cp-reply-author:hover {
    color: #E05A2B;
    text-decoration: underline;
}
#community-preview .cp-reply-time {
    font-size: 11.5px;
    color: var(--dp-text-3);
}
#community-preview .cp-reply-body {
    font-size: 13.5px;
    color: var(--dp-text-2);
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}
#community-preview .cp-reply-stats {
    margin-top: 4px;
}

/* Reply Prompt & Sign-In Nudges */
#community-preview .cp-reply-prompt {
    padding-top: 12px;
}
#community-preview .cp-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #E05A2B;
    text-decoration: none;
    padding: 8px 16px;
    border: 1.5px solid #E05A2B;
    border-radius: 100px;
    transition: background 0.15s ease, color 0.15s ease;
}
#community-preview .cp-reply-link:hover {
    background: #E05A2B;
    color: #fff;
}
#community-preview .cp-reply-link svg {
    stroke: currentColor;
}

#community-preview .cp-signin-nudge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--dp-text-2);
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border: 1px dashed var(--dp-border);
}
html.dark #community-preview .cp-signin-nudge {
    background: rgba(255, 255, 255, 0.02);
}
#community-preview .cp-signin-link {
    color: #E05A2B;
    font-weight: 700;
    text-decoration: none;
}
#community-preview .cp-signin-link:hover {
    text-decoration: underline;
}

/* Bottom Actions Row */
#community-preview .cp-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

/* Ask a Question Button */
#community-preview .cp-btn-ask {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #E05A2B;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.12s;
    cursor: pointer;
}
#community-preview .cp-btn-ask:hover {
    background: #c94f24;
}
#community-preview .cp-btn-ask:active {
    transform: scale(0.97);
}

/* View All Posts Button */
#community-preview .cp-btn-view-all {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--dp-bg-card);
    color: var(--dp-text-1);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--dp-border);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}
#community-preview .cp-btn-view-all:hover {
    background: var(--dp-bg-chip);
    border-color: var(--dp-text-3);
}

/* Mobile responsive overrides */
@media (max-width: 640px) {
    #community-preview {
        padding: 24px 12px 36px;
    }
    #community-preview .cp-card {
        padding: 16px;
        border-radius: 12px;
    }
    #community-preview .cp-card-inner {
        gap: 12px;
    }
    #community-preview .cp-vote-widget {
        width: 30px;
    }
    #community-preview .cp-vote-arrow {
        width: 24px;
        height: 24px;
    }
    #community-preview .cp-vote-count {
        font-size: 12px;
    }
    #community-preview .cp-title {
        font-size: 15.5px;
    }
    #community-preview .cp-text {
        font-size: 13.5px;
    }
    #community-preview .cp-cover-photo {
        max-height: 160px;
    }
    #community-preview .cp-reply {
        gap: 8px;
        padding: 8px 0;
    }
    #community-preview .cp-reply-avatar {
        width: 20px;
        height: 20px;
    }
    #community-preview .cp-reply-body {
        font-size: 12.5px;
    }
    #community-preview .cp-action-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    #community-preview .cp-btn-ask,
    #community-preview .cp-btn-view-all {
        justify-content: center;
        padding: 10px 16px;
    }
}

/* ── /communities discover page — restructure for mobile responsiveness ──
   Goals:
     1. Search input on top, filter pills below in one scrollable row.
     2. Less intrusive Join button — small, pill-shaped, never full width.
     3. Numbered pager that slides as the user navigates.
     4. Right sidebar still shows on mobile (stacked below the main content).
   ───────────────────────────────────────────────────────────────────────── */

/* Filter bar restructure — search row up top, filter pills below */
.gp-community-root .communities-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gp-community-root .communities-search-row { display: flex; }
.gp-community-root .communities-search-input {
    width: 100%;
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--gpc-text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
.gp-community-root .communities-search-input:focus {
    border-color: var(--gpc-border-strong);
}
.gp-community-root .communities-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    /* Hide scrollbar but keep horizontal scroll for overflow pills */
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.gp-community-root .communities-filter-pills::-webkit-scrollbar { display: none; }
.gp-community-root .communities-filter-pills .sort-pill { flex-shrink: 0; }

/* Compact Join button — never dominates the card */
.gp-community-root .cc-join-btn {
    align-self: center;
    background: transparent;
    border: 1px solid var(--gpc-border-strong);
    border-radius: 999px;
    padding: 6px 14px;
    color: var(--gpc-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
.gp-community-root .cc-join-btn:hover {
    background: var(--gpc-raised-2);
    border-color: var(--gpc-text-3);
}
.gp-community-root .cc-join-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.gp-community-root .cc-join-btn--joined {
    background: var(--gpc-raised-2);
    color: var(--gpc-text-2);
    border-color: transparent;
}
.gp-community-root .cc-join-btn--joined:hover {
    background: var(--gpc-raised);
    color: var(--gpc-text);
}

/* Numbered pager */
.gp-community-root .communities-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 24px 0 8px;
    flex-wrap: wrap;
}
.gp-community-root .communities-pager.hidden { display: none; }
.gp-community-root .pager-numbers {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}
.gp-community-root .pager-num,
.gp-community-root .pager-edge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gpc-surface);
    border: 1px solid var(--gpc-border);
    border-radius: 999px;
    padding: 7px 12px;
    min-width: 36px;
    justify-content: center;
    color: var(--gpc-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.gp-community-root .pager-num:hover:not(:disabled),
.gp-community-root .pager-edge:hover:not(:disabled) {
    background: var(--gpc-raised-2);
    border-color: var(--gpc-border-strong);
}
.gp-community-root .pager-num:disabled,
.gp-community-root .pager-edge:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.gp-community-root .pager-num--active {
    background: var(--gpc-accent);
    border-color: var(--gpc-accent);
    color: white;
}
.gp-community-root .pager-num--active:disabled {
    opacity: 1; /* override the disabled fade for the current-page indicator */
}

/* Show the sidebar on mobile as a stacked block below the content.
   Override the .gpc-rail { display: none } from the global mobile media query. */
@media (max-width: 1024px) {
    .gp-community-root .gpc-rail.communities-rail {
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: 100% !important;
        margin-top: 24px;
    }
}

/* Tighter pager spacing on mobile, hide edge labels to save room */
@media (max-width: 640px) {
    .gp-community-root .communities-pager { gap: 4px; }
    .gp-community-root .pager-num,
    .gp-community-root .pager-edge {
        padding: 6px 10px;
        min-width: 32px;
        font-size: 12.5px;
    }
    .gp-community-root .pager-edge-label { display: none; }
    /* The Join button stays compact on mobile too — never goes full-width.
       This neutralizes the earlier .community-card > .btn { width:100% } rule
       that applied when the button used the generic .btn class. */
    .gp-community-root .community-card {
        grid-template-columns: 64px 1fr auto;
        align-items: center;
    }
    .gp-community-root .community-card .cc-join-btn {
        padding: 5px 12px;
        font-size: 12.5px;
    }
}
