/* ============================================
   REVVED UP CARS - COMMUNITY HUB
   Version: 6.0.0
   Modern social-media inspired community page
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
.community-hub {
    --ch-accent: #C5D631;
    --ch-accent-hover: #b5c42a;
    --ch-accent-dark: #9eb029;
    --ch-accent-glow: rgba(197, 214, 49, 0.25);
    --ch-dark: #1a1f1a;
    --ch-dark-2: #222722;
    --ch-dark-3: #2a2f2a;
    --ch-text: #1a1f1a;
    --ch-text-2: #444;
    --ch-text-3: #777;
    --ch-text-muted: #999;
    --ch-border: #e5e8e5;
    --ch-border-light: #f0f2f0;
    --ch-bg: #f7f8f7;
    --ch-bg-card: #ffffff;
    --ch-bg-widget: #f8faf8;
    --ch-radius: 12px;
    --ch-radius-lg: 16px;
    --ch-radius-pill: 100px;
    --ch-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --ch-shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --ch-shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --ch-transition: 0.2s ease;
    --ch-container: 1280px;
}

[data-theme="dark"] .community-hub {
    --ch-text: #f0f0f0;
    --ch-text-2: #ccc;
    --ch-text-3: #999;
    --ch-text-muted: #666;
    --ch-border: #333;
    --ch-border-light: #2a2a2a;
    --ch-bg: #141814;
    --ch-bg-card: #1e1e1e;
    --ch-bg-widget: #1e231e;
}

/* ============================================
   BASE / CONTAINER
   ============================================ */
/* Global: remove browser focus outlines/highlights on all interactive elements */
.community-hub button,
.community-hub [type="button"],
.community-hub a {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.community-hub {
    background: var(--ch-bg);
    min-height: 100vh;
}

.comm-container {
    max-width: var(--ch-container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.comm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    border: none;
    border-radius: var(--ch-radius-pill);
    cursor: pointer;
    transition: all var(--ch-transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.comm-btn--primary {
    background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-hover));
    color: var(--ch-dark);
    padding: 12px 24px;
}

.comm-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--ch-accent-glow);
}

.comm-btn--outline {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    padding: 10px 20px;
}

.comm-btn--outline:hover {
    border-color: var(--ch-accent);
    color: var(--ch-accent);
}

[data-theme="dark"] .comm-btn--outline {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

[data-theme="dark"] .comm-btn--outline:hover {
    border-color: var(--ch-accent);
    color: var(--ch-accent);
}

.comm-btn--sm {
    font-size: 12px;
    padding: 8px 16px;
}

.comm-btn--lg {
    font-size: 14px;
    padding: 12px 24px;
}

.comm-btn--accent {
    background: rgba(197, 214, 49, 0.12);
    color: var(--ch-accent-dark);
    padding: 8px 16px;
}

[data-theme="dark"] .comm-btn--accent {
    background: rgba(197, 214, 49, 0.1);
    color: var(--ch-accent);
}

.comm-btn--accent:hover {
    background: rgba(197, 214, 49, 0.2);
}

.comm-btn--block {
    width: 100%;
}

/* ============================================
   HERO SECTION (Compact Bar)
   ============================================ */
.comm-hero {
    background: var(--ch-dark);
    padding: 14px 0;
    border-bottom: 1px solid rgba(197, 214, 49, 0.15);
}

.comm-hero__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.comm-hero__left {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.comm-hero__title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.comm-hero__accent {
    color: var(--ch-accent);
    font-weight: 800;
}

.comm-hero__subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    margin: 0;
    line-height: 1;
}

.comm-hero__stats {
    display: flex;
    align-items: center;
    gap: 0;
}

.comm-stat {
    text-align: center;
    padding: 0 14px;
}

.comm-stat__number {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 2px;
}

.comm-stat__label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.comm-stat__divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.comm-hero__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex: 1;
    justify-content: flex-end;
}

/* ============================================
   STORIES CAROUSEL (Instagram-style)
   ============================================ */
.comm-stories {
    background: var(--ch-bg-card);
    border-bottom: 1px solid var(--ch-border-light);
    padding: 20px 0;
}

[data-theme="dark"] .comm-stories {
    background: var(--ch-bg-card);
    border-color: var(--ch-border);
}

.comm-stories__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.comm-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ch-text);
    margin: 0;
}

.comm-section-title svg {
    color: var(--ch-accent);
}

.comm-stories__live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.comm-stories__carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.comm-stories__carousel::-webkit-scrollbar {
    display: none;
}

.comm-stories__empty {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--ch-text-3);
    font-size: 13px;
}

/* Story Ring (individual story bubble) */
.comm-story-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: none !important;
    border: none;
    padding: 2px;
    font-family: inherit;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}

.comm-story-ring:hover,
.comm-story-ring:focus,
.comm-story-ring:focus-visible,
.comm-story-ring:active {
    outline: none !important;
    background: none !important;
    box-shadow: none;
}

.comm-story-ring__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ch-dark-3);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 0 0 3px var(--ch-bg-card), 0 0 0 5px var(--ch-accent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comm-story-ring:hover .comm-story-ring__avatar {
    transform: scale(1.08);
}

.comm-story-ring--create .comm-story-ring__avatar {
    background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-hover));
    color: var(--ch-dark);
    box-shadow: 0 0 0 3px var(--ch-bg-card), 0 0 0 5px var(--ch-border);
}

.comm-story-ring--featured .comm-story-ring__avatar {
    box-shadow: 0 0 0 3px var(--ch-bg-card), 0 0 0 5px #f59e0b;
}

.comm-story-ring__name {
    font-size: 11px;
    color: var(--ch-text);
    font-weight: 600;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.comm-story-ring__time {
    font-size: 9px;
    color: var(--ch-accent-dark);
    font-weight: 600;
    margin-top: -4px;
}

[data-theme="dark"] .comm-story-ring__time {
    color: var(--ch-accent);
}

/* ============================================
   STORY VIEWER (Instagram-style fullscreen)
   ============================================ */
.comm-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comm-story-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
}

.comm-story-viewer__container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 85vh;
    max-height: 760px;
    background: var(--ch-dark);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.comm-story-viewer__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 3;
}

.comm-story-viewer__progress-bar {
    height: 100%;
    background: var(--ch-accent);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

.comm-story-viewer__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ch-transition);
    backdrop-filter: blur(4px);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.comm-story-viewer__close svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    stroke-width: 2.5;
}

.comm-story-viewer__close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.comm-story-viewer__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.comm-story-viewer__header {
    padding: 14px 56px 10px 16px;
    position: relative;
    z-index: 2;
}

.comm-story-viewer__author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comm-story-viewer__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ch-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ch-dark);
    font-weight: 700;
    font-size: 14px;
}

.comm-story-viewer__name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.comm-story-viewer__time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: block;
}

.comm-story-viewer__image {
    flex: 1;
    background-size: cover;
    background-position: center;
    background-color: var(--ch-dark-3);
    position: relative;
}

.comm-story-viewer__image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.comm-story-viewer__text {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 0 20px;
    z-index: 2;
}

.comm-story-viewer__text h3 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.3;
}

.comm-story-viewer__text p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comm-story-viewer__vehicle {
    font-size: 12px;
    color: var(--ch-accent);
    font-weight: 600;
}

.comm-story-viewer__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 16px;
    position: relative;
    z-index: 2;
    background: var(--ch-dark);
}

.comm-story-viewer__action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all var(--ch-transition);
    text-decoration: none;
    font-family: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.comm-story-viewer__action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.viewer-like-btn.active {
    color: #ef4444;
}

.viewer-like-btn.active svg {
    fill: #ef4444;
}

.comm-story-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ch-transition);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.comm-story-viewer__nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.comm-story-viewer__nav--prev {
    left: 12px;
}

.comm-story-viewer__nav--next {
    right: 12px;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.comm-main {
    padding: 32px 0 48px;
}

.comm-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

/* ============================================
   TOOLBAR (Filter + Search)
   ============================================ */
.comm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--ch-bg-card);
    border-radius: var(--ch-radius);
    border: 1px solid var(--ch-border-light);
}

[data-theme="dark"] .comm-toolbar {
    border-color: var(--ch-border);
}

.comm-toolbar__filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.comm-toolbar__filters::-webkit-scrollbar {
    display: none;
}

.comm-filter-chip {
    padding: 7px 14px;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-pill);
    background: transparent;
    color: var(--ch-text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--ch-transition);
    font-family: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.comm-filter-chip:hover {
    border-color: var(--ch-accent);
    color: var(--ch-accent-dark);
}

.comm-filter-chip.active {
    background: var(--ch-dark);
    border-color: var(--ch-dark);
    color: #fff;
}

[data-theme="dark"] .comm-filter-chip.active {
    background: var(--ch-accent);
    border-color: var(--ch-accent);
    color: var(--ch-dark);
}

.comm-toolbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-left: 1px solid var(--ch-border-light);
    color: var(--ch-text-3);
    flex-shrink: 0;
}

[data-theme="dark"] .comm-toolbar__search {
    border-color: var(--ch-border);
}

.comm-toolbar__search input {
    border: none;
    background: none;
    color: var(--ch-text);
    font-size: 13px;
    width: 140px;
    padding: 6px 0;
    outline: none;
    font-family: inherit;
}

.comm-toolbar__search input::placeholder {
    color: var(--ch-text-muted);
}

/* ============================================
   ARTICLE CARDS
   ============================================ */
.comm-articles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.comm-card {
    background: var(--ch-bg-card);
    border-radius: var(--ch-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ch-border-light);
    transition: all 0.25s ease;
}

.comm-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ch-shadow-lg);
    border-color: var(--ch-accent);
}

[data-theme="dark"] .comm-card {
    border-color: var(--ch-border);
}

[data-theme="dark"] .comm-card:hover {
    border-color: var(--ch-accent);
}

/* Featured card spans full width */
.comm-card--featured {
    grid-column: 1 / -1;
}

.comm-card--featured .comm-card__link {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.comm-card--featured .comm-card__image {
    height: 100%;
    min-height: 280px;
}

.comm-card--featured .comm-card__body {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.comm-card--featured .comm-card__title {
    font-size: 22px;
    -webkit-line-clamp: 3;
}

.comm-card--featured .comm-card__excerpt {
    -webkit-line-clamp: 3;
}

.comm-card__link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.comm-card__image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--ch-bg);
}

.comm-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.comm-card:hover .comm-card__image img {
    transform: scale(1.05);
}

.comm-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ch-text-muted);
}

.comm-card__category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-hover));
    color: var(--ch-dark);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--ch-radius-pill);
    z-index: 1;
}

.comm-card__body {
    padding: 18px;
}

.comm-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-text);
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comm-card__excerpt {
    font-size: 13px;
    color: var(--ch-text-3);
    line-height: 1.5;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comm-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.comm-card__author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comm-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-hover));
    color: var(--ch-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.comm-card__author-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--ch-text-2);
}

.comm-card__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ch-text-muted);
}

.comm-card__dot {
    opacity: 0.4;
}

.comm-card__comments {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ============================================
   PAGINATION
   ============================================ */
.comm-pagination {
    margin-top: 32px;
    text-align: center;
}

.comm-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 6px;
}

.comm-pagination li a,
.comm-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--ch-bg-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    color: var(--ch-text-2);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ch-transition);
}

.comm-pagination li a:hover {
    border-color: var(--ch-accent);
    color: var(--ch-accent-dark);
}

.comm-pagination li span.current {
    background: var(--ch-dark);
    border-color: var(--ch-dark);
    color: #fff;
}

[data-theme="dark"] .comm-pagination li span.current {
    background: var(--ch-accent);
    border-color: var(--ch-accent);
    color: var(--ch-dark);
}

/* ============================================
   SIDEBAR
   ============================================ */
.comm-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comm-widget {
    background: var(--ch-bg-card);
    border-radius: var(--ch-radius-lg);
    padding: 20px;
    border: 1px solid var(--ch-border-light);
}

[data-theme="dark"] .comm-widget {
    border-color: var(--ch-border);
}

.comm-widget__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ch-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ch-border-light);
}

[data-theme="dark"] .comm-widget__title {
    border-color: var(--ch-border);
}

.comm-widget__title svg {
    color: var(--ch-accent);
    flex-shrink: 0;
}

.comm-widget__title--light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* CTA Widget */
.comm-widget--cta {
    background: linear-gradient(135deg, var(--ch-dark) 0%, var(--ch-dark-2) 100%);
    border: none;
}

.comm-widget--cta h3 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
}

.comm-widget--cta p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px;
    line-height: 1.5;
}

/* Trending Widget */
.comm-trending {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comm-trending__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    text-decoration: none;
    transition: background var(--ch-transition);
}

.comm-trending__item:hover {
    background: rgba(197, 214, 49, 0.08);
}

.comm-trending__rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-hover));
    color: var(--ch-dark);
    font-size: 12px;
    font-weight: 900;
    border-radius: 8px;
}

.comm-trending__content {
    flex: 1;
    min-width: 0;
}

.comm-trending__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ch-text);
    margin: 0 0 2px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comm-trending__meta {
    font-size: 11px;
    color: var(--ch-text-muted);
}

/* Story Tags */
.comm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comm-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ch-bg);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-pill);
    font-size: 12px;
    font-weight: 500;
    color: var(--ch-text-2);
    transition: all var(--ch-transition);
    cursor: default;
}

[data-theme="dark"] .comm-tag {
    background: var(--ch-dark-3);
    border-color: var(--ch-border);
}

.comm-tag__count {
    font-size: 10px;
    padding: 1px 5px;
    background: var(--ch-border-light);
    border-radius: var(--ch-radius-pill);
    color: var(--ch-text-3);
}

[data-theme="dark"] .comm-tag__count {
    background: #333;
}

/* Dark Widget */
.comm-widget--dark {
    background: var(--ch-dark);
    border: none;
}

.comm-widget--dark .comm-widget__title {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.comm-guidelines {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comm-guidelines li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.comm-guidelines li::before {
    content: '✓';
    color: var(--ch-accent);
    font-weight: 700;
    flex-shrink: 0;
}

/* Newsletter Widget */
.comm-widget--newsletter {
    background: linear-gradient(135deg, #1a1f1a 0%, #252a25 100%);
    border: none;
}

.comm-newsletter__desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin: 0 0 14px;
}

.comm-widget--newsletter .newsletter-form,
.comm-widget--newsletter .revved-newsletter-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comm-widget--newsletter input[type="email"] {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--ch-radius-pill);
    color: #fff;
    font-size: 13px;
}

.comm-widget--newsletter input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.comm-widget--newsletter input[type="email"]:focus {
    outline: none;
    border-color: var(--ch-accent);
}

.comm-widget--newsletter button[type="submit"] {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--ch-accent), var(--ch-accent-hover));
    border: none;
    border-radius: var(--ch-radius-pill);
    color: var(--ch-dark);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--ch-transition);
}

.comm-widget--newsletter button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--ch-accent-glow);
}

.comm-newsletter__note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

/* Social Links */
.comm-social {
    display: flex;
    gap: 10px;
}

.comm-social__link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: all var(--ch-transition);
}

.comm-social__link--fb {
    background: #1877f2;
}

.comm-social__link--ig {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.comm-social__link--x {
    background: var(--ch-dark);
    border: 1px solid #333;
}

[data-theme="dark"] .comm-social__link--x {
    background: #333;
}

.comm-social__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Empty State */
.comm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--ch-text-3);
}

.comm-empty svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.comm-empty h3 {
    font-size: 18px;
    color: var(--ch-text-2);
    margin: 0 0 8px;
}

.comm-empty p {
    font-size: 14px;
    margin: 0;
}

/* ============================================
   STORY SUBMISSION MODAL
   ============================================ */
.story-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 10, 0.85);
    z-index: 100001;
    overflow-y: auto;
    padding: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    opacity: 1 !important;
    transition: none !important;
}

.story-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 16px;
    margin: 0 auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.06);
    animation: storyModalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

[data-theme="dark"] .story-modal {
    background: #1a1d1a;
}

@keyframes storyModalSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close Button */
.modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 10;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .modal-close {
    background: rgba(255, 255, 255, 0.08);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

[data-theme="dark"] .modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-close svg {
    color: #666;
    width: 16px;
    height: 16px;
}

[data-theme="dark"] .modal-close svg {
    color: #aaa;
}

.modal-close:hover svg {
    color: #1a1f1a;
}

[data-theme="dark"] .modal-close:hover svg {
    color: #fff;
}

/* Progress Steps */
.modal-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 16px;
    background: #f8f9f8;
    border-bottom: 1px solid #eee;
}

[data-theme="dark"] .modal-progress {
    background: #1e211e;
    border-color: #2a2d2a;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}

.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    color: #888;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: linear-gradient(135deg, #C5D631, #a8b82a);
    color: #1a1f1a;
}

.step-label {
    font-size: 10px;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: #1a1f1a;
}

[data-theme="dark"] .progress-step.active .step-label,
[data-theme="dark"] .progress-step.completed .step-label {
    color: #f0f0f0;
}

.progress-line {
    width: 40px;
    height: 2px;
    background: #ddd;
    margin: 0 10px;
    margin-top: -16px;
    transition: all 0.2s ease;
}

.progress-line.completed {
    background: #C5D631;
}

/* Form Steps */
.form-step {
    display: none;
    padding: 20px 24px;
}

.form-step.active {
    display: block;
    animation: formStepIn 0.2s ease;
}

@keyframes formStepIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.step-header {
    text-align: center;
    margin-bottom: 20px;
}

.step-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #1a1f1a;
    margin: 0 0 4px;
}

[data-theme="dark"] .step-header h2 {
    color: #f0f0f0;
}

.step-header p {
    font-size: 13px;
    color: #999;
    margin: 0;
}

[data-theme="dark"] .step-header p {
    color: #999;
}

/* Form Fields */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-field label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

[data-theme="dark"] .form-field label {
    color: #ccc;
}

.form-field .required {
    color: #ef4444;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea {
    padding: 10px 14px;
    background: #f5f7f5;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    color: #1a1f1a;
    transition: all 0.15s ease;
    font-family: inherit;
}

[data-theme="dark"] .form-field input[type="text"],
[data-theme="dark"] .form-field input[type="email"],
[data-theme="dark"] .form-field textarea {
    background: #252a25;
    color: #f0f0f0;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    background: #fff;
    border-color: #C5D631;
    box-shadow: 0 0 0 4px rgba(197, 214, 49, 0.15);
}

[data-theme="dark"] .form-field input:focus,
[data-theme="dark"] .form-field textarea:focus {
    background: #1a1f1a;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #a0a5a0;
}

.form-field small {
    font-size: 12px;
    color: #a0a5a0;
}

.form-field input.error,
.form-field textarea.error {
    border-color: #ef4444 !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* Category Chips */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-chip {
    cursor: pointer;
}

.category-chip input {
    display: none;
}

.chip-label {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f7f5;
    border: 1.5px solid #e8ebe8;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: #6b706b;
    transition: all 0.15s ease;
}

[data-theme="dark"] .chip-label {
    background: #252a25;
    border-color: #333;
    color: #999;
}

.category-chip:hover .chip-label {
    border-color: #a0a5a0;
}

.category-chip input:checked + .chip-label {
    background: #1a1f1a;
    border-color: #1a1f1a;
    color: #fff;
}

[data-theme="dark"] .category-chip input:checked + .chip-label {
    background: #C5D631;
    border-color: #C5D631;
    color: #1a1f1a;
}

/* Upload Area */
.upload-area {
    position: relative;
    border: 1.5px dashed #d0d5d0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

[data-theme="dark"] .upload-area {
    border-color: #444;
}

.upload-area:hover {
    border-color: #C5D631;
    background: rgba(197, 214, 49, 0.05);
}

.upload-area.drag-over {
    border-color: #C5D631;
    background: rgba(197, 214, 49, 0.1);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder svg {
    color: #a0a5a0;
    margin-bottom: 12px;
}

.upload-placeholder span {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #6b706b;
    margin-bottom: 4px;
}

.upload-placeholder small {
    color: #a0a5a0;
}

.upload-preview {
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    object-fit: contain;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-image:hover {
    background: #ef4444;
}

/* Textarea Footer */
.textarea-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.char-count {
    font-size: 12px;
    color: #a0a5a0;
}

.char-count.valid {
    color: #22c55e;
}

/* Terms */
.terms-field {
    padding: 16px;
    background: #f5f7f5;
    border-radius: 12px;
}

[data-theme="dark"] .terms-field {
    background: #252a25;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #C5D631;
    cursor: pointer;
}

.terms-text {
    font-size: 14px;
    color: #6b706b;
    line-height: 1.5;
}

[data-theme="dark"] .terms-text {
    color: #999;
}

.terms-text strong {
    color: #1a1f1a;
}

[data-theme="dark"] .terms-text strong {
    color: #f0f0f0;
}

/* Step Actions */
.step-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8ebe8;
}

[data-theme="dark"] .step-actions {
    border-color: #333;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: 1.5px solid #d0d5d0;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: #6b706b;
    cursor: pointer;
    transition: all 0.15s ease;
}

[data-theme="dark"] .btn-back {
    border-color: #444;
    color: #999;
}

.btn-back:hover {
    border-color: #a0a5a0;
    color: #1a1f1a;
}

.btn-next,
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #C5D631, #a8b82a);
    border: none;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: #1a1f1a;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-next:hover,
.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(197, 214, 49, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success Step */
.success-step {
    padding: 40px 24px;
    text-align: center;
}

.success-content .success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(197, 214, 49, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-content .success-icon svg {
    color: #C5D631;
}

.success-content h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1a1f1a;
    margin: 0 0 8px;
}

[data-theme="dark"] .success-content h2 {
    color: #f0f0f0;
}

.success-content p {
    font-size: 16px;
    color: #6b706b;
    margin: 0 0 32px;
    line-height: 1.6;
}

.success-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-close-success {
    padding: 14px 28px;
    background: #f0f0f0;
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1f1a;
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="dark"] .btn-close-success {
    background: #333;
    color: #f0f0f0;
}

.btn-close-success:hover {
    background: #e0e0e0;
}

.btn-share-another {
    padding: 14px 28px;
    background: linear-gradient(135deg, #C5D631, #a8b82a);
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1f1a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-share-another:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(197, 214, 49, 0.4);
}

/* Form Message */
.form-message {
    padding: 16px 24px;
    margin: 0 32px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.form-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .form-message.error {
    background: #3b1515;
    border-color: #5c2020;
}

.form-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Toast Notification */
.ch-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 24px;
    background: #1a1f1a;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.ch-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .ch-toast {
    background: #fff;
    color: #1a1f1a;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .comm-layout {
        grid-template-columns: 1fr 300px;
        gap: 24px;
    }

    /* Hero: hide subtitle on tablet */
    .comm-hero__subtitle {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Hero stacks vertically on mobile */
    .comm-hero__inner {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .comm-hero__left {
        width: 100%;
        justify-content: center;
        flex: none;
    }

    .comm-hero__subtitle {
        display: none;
    }

    .comm-hero__stats {
        order: 3;
        flex: none;
    }

    .comm-hero__actions {
        flex: none;
        justify-content: center;
    }

    /* Layout stacks */
    .comm-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Toolbar stacks */
    .comm-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .comm-toolbar__search {
        border-left: none;
        border-top: 1px solid var(--ch-border-light);
        padding: 12px 0 0;
        width: 100%;
    }

    .comm-toolbar__search input {
        width: 100%;
    }

    /* Articles single column */
    .comm-articles {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .comm-card--featured .comm-card__link {
        grid-template-columns: 1fr;
    }

    .comm-card--featured .comm-card__image {
        min-height: 200px;
    }

    .comm-card--featured .comm-card__body {
        padding: 18px;
    }

    .comm-card--featured .comm-card__title {
        font-size: 18px;
    }

    /* Story rings smaller */
    .comm-story-ring__avatar {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }

    /* Story viewer full screen on mobile */
    .comm-story-viewer__container {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .comm-story-viewer__nav {
        display: none;
    }

    /* Sidebar horizontal scroll for widgets */
    .comm-sidebar {
        gap: 16px;
    }

    .comm-main {
        padding: 20px 0 32px;
    }

    /* Modal responsive */
    .story-modal {
        margin: 8px auto;
        border-radius: 14px;
    }

    .modal-progress {
        padding: 16px 12px 12px;
    }

    .progress-line {
        width: 30px;
        margin: 0 6px;
    }

    .step-label {
        font-size: 9px;
    }

    .form-step {
        padding: 16px;
    }

    .step-header h2 {
        font-size: 16px;
    }

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

    .step-actions {
        flex-direction: column-reverse;
    }

    .btn-back,
    .btn-next,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }

    .category-chips {
        gap: 8px;
    }

    .chip-label {
        padding: 10px 16px;
        font-size: 13px;
    }

    .success-step {
        padding: 32px 16px;
    }

    .success-actions {
        flex-direction: column;
    }

    .btn-close-success,
    .btn-share-another {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .comm-hero__title {
        font-size: 16px;
    }

    .comm-hero__actions {
        width: 100%;
        justify-content: center;
    }

    .comm-stories__carousel {
        gap: 12px;
    }

    .comm-story-ring__avatar {
        width: 52px;
        height: 52px;
    }

    .comm-card__image {
        height: 160px;
    }

    .comm-card__body {
        padding: 14px;
    }

    .comm-card__title {
        font-size: 15px;
    }

    .comm-card__excerpt {
        display: none;
    }

    .comm-toolbar__filters {
        gap: 4px;
    }

    .comm-filter-chip {
        padding: 6px 10px;
        font-size: 12px;
    }
}
