.community-v5 {
    --community-v5-bg: #f5efe5;
    --community-v5-surface: rgba(255, 255, 255, 0.44);
    --community-v5-text: #14283d;
    --community-v5-muted: #4d5d6d;
    --community-v5-accent: #b57a2d;
    --community-v5-accent-soft: rgba(181, 122, 45, 0.14);
    --community-v5-border: rgba(20, 40, 61, 0.12);
    --community-v5-shadow: 0 34px 80px rgba(15, 23, 42, 0.12);
    position: relative;
    margin: 0;
    padding: clamp(4.5rem, 8vw, 7rem) clamp(1.25rem, 3vw, 2.5rem);
    background: linear-gradient(180deg, #f8f2e9 0%, #f1ebdf 100%);
    color: var(--community-v5-text);
    overflow: hidden;
}

.community-v5__inner {
    width: min(100%, 80rem);
    margin: 0 auto;
}

.community-v5__intro {
    position: relative;
    max-width: 40rem;
    margin: 0 auto 2.35rem;
    padding: 0.9rem 1.5rem 1rem;
    border: 1px solid rgba(20, 40, 61, 0.08);
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    text-align: center;
}

.community-v5__eyebrow {
    margin: 0 0 1.15rem;
    color: #9a651e;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-family: "Space Grotesk", Arial, sans-serif;
}

.community-v5__intro h2 {
    margin: 0;
    color: var(--community-v5-text);
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(3.1rem, 5.4vw, 4.6rem);
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 0.98;
    text-wrap: balance;
}

.community-v5__lead {
    margin: 1.35rem auto 0;
    max-width: 38rem;
    color: #3e5063;
    font-size: clamp(1.08rem, 1.7vw, 1.35rem);
    font-weight: 500;
    line-height: 1.6;
    font-family: "Space Grotesk", Arial, sans-serif;
}

.community-v5__stage {
    position: relative;
    width: min(100%, 76rem);
    height: clamp(31rem, 46vw, 44rem);
    margin: 0 auto;
    perspective: 2200px;
    perspective-origin: center center;
    user-select: none;
}

.community-v5__track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.community-v5__slide {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(68vw, 45rem);
    max-width: 45rem;
    border-radius: 1.55rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid var(--community-v5-border);
    box-shadow: var(--community-v5-shadow);
    opacity: 0;
    transform-style: preserve-3d;
    transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease, box-shadow 420ms ease;
    cursor: pointer;
    will-change: transform, opacity;
}

.community-v5__slide:focus-visible,
.community-v5__prev:focus-visible,
.community-v5__next:focus-visible,
.community-v5__dot:focus-visible {
    outline: 3px solid rgba(21, 78, 155, 0.9);
    outline-offset: 3px;
}

.community-v5__slide.is-active {
    box-shadow: 0 44px 110px rgba(15, 23, 42, 0.16);
}

.community-v5__media {
    position: relative;
    margin: 0;
    height: clamp(22rem, 33vw, 31rem);
    overflow: hidden;
    background: #dfe7ee;
}

.community-v5__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 700ms ease;
}

.community-v5__slide:hover .community-v5__media img,
.community-v5__slide.is-active .community-v5__media img {
    transform: scale(1.03);
}

.community-v5__caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 1.35rem;
    background: rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.community-v5__label {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--community-v5-accent);
    font-family: "Space Grotesk", Arial, sans-serif;
}

.community-v5__caption h3 {
    margin: 0;
    color: var(--community-v5-text);
    font-size: clamp(1.05rem, 1.8vw, 1.5rem);
    line-height: 1.2;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-weight: 700;
}

.community-v5__controls {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.community-v5__prev,
.community-v5__next {
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(20, 40, 61, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.68);
    color: var(--community-v5-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.community-v5__prev:hover,
.community-v5__next:hover,
.community-v5__dot:hover {
    transform: translateY(-1px);
}

.community-v5__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.community-v5__dot {
    width: 0.8rem !important;
    height: 0.8rem !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none;
    border-radius: 999px;
    background: rgba(20, 40, 61, 0.18);
    cursor: pointer;
    transition: width 180ms ease, background 180ms ease, transform 180ms ease;
}

.community-v5__dot.is-active {
    width: 2.25rem !important;
    background: var(--community-v5-accent);
}

body[data-theme="dark"] .community-v5,
body.dark .community-v5 {
    --community-v5-bg: #071525;
    --community-v5-surface: rgba(15, 28, 48, 0.9);
    --community-v5-text: var(--theme-text-primary, #f4efe4);
    --community-v5-muted: var(--theme-text-secondary, #d9e2ee);
    --community-v5-accent: var(--theme-accent-gold-bright, #fbbf24);
    --community-v5-border: rgba(148, 163, 184, 0.2);
    --community-v5-shadow: 0 34px 80px rgba(0, 0, 0, 0.36);
    background: linear-gradient(180deg, #07111f 0%, var(--community-v5-bg) 100%);
}

body[data-theme="dark"] .community-v5__intro,
body.dark .community-v5__intro {
    background: rgba(15, 28, 48, 0.48);
    border-color: rgba(148, 163, 184, 0.16);
}

body[data-theme="dark"] .community-v5__lead,
body.dark .community-v5__lead {
    color: var(--community-v5-muted);
}

body[data-theme="dark"] .community-v5__caption,
body.dark .community-v5__caption {
    background: rgba(7, 21, 37, 0.78);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

body[data-theme="dark"] .community-v5__prev,
body[data-theme="dark"] .community-v5__next,
body.dark .community-v5__prev,
body.dark .community-v5__next {
    background: rgba(15, 28, 48, 0.76);
    border-color: rgba(148, 163, 184, 0.24);
    color: var(--community-v5-text);
}

body[data-theme="dark"] .community-v5__dot,
body.dark .community-v5__dot {
    background: rgba(217, 226, 238, 0.3);
}

body[data-theme="dark"] .community-v5__dot.is-active,
body.dark .community-v5__dot.is-active {
    background: var(--community-v5-accent);
}

@media (max-width: 1024px) {
    .community-v5__stage {
        height: 33rem;
    }

    .community-v5__slide {
        width: min(72vw, 36rem);
    }

    .community-v5__media {
        height: clamp(19rem, 31vw, 24rem);
    }
}

@media (max-width: 768px) {
    .community-v5 {
        padding-top: 3.35rem;
        padding-bottom: 4rem;
    }

    .community-v5__intro {
        margin-bottom: 0.95rem;
        padding: 0.75rem 1rem 0.85rem;
    }

    .community-v5__stage {
        height: 27.25rem;
    }

    .community-v5__slide {
        width: min(84vw, 26rem);
    }

    .community-v5__media {
        height: 18.2rem;
    }

    .community-v5__caption {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.28rem;
        min-height: 5.5rem;
        padding: 0.75rem 1rem 0.85rem;
        background: rgba(255, 252, 245, 0.9);
    }

    .community-v5__controls {
        margin-top: 0.85rem;
        gap: 0.7rem;
    }

    .community-v5__label {
        color: #9a651e;
        font-size: 0.62rem;
        letter-spacing: 0.16em;
        line-height: 1.25;
    }

    .community-v5__caption h3 {
        color: #102033;
        font-size: clamp(1.12rem, 5vw, 1.28rem);
        line-height: 1.14;
    }

    .community-v5__slide {
        opacity: 0;
    }

    .community-v5__slide.is-active {
        opacity: 1;
    }

    .community-v5__slide.is-prev,
    .community-v5__slide.is-next {
        opacity: 0.58;
    }

    .community-v5__prev,
    .community-v5__next {
        width: 2.9rem;
        height: 2.9rem;
        font-size: 1.22rem;
        background: rgba(255, 252, 245, 0.86);
    }

    .community-v5__dots {
        gap: 0.48rem;
    }

    .community-v5__dot {
        width: 0.58rem !important;
        height: 0.58rem !important;
    }

    .community-v5__dot.is-active {
        width: 0.7rem !important;
        height: 0.7rem !important;
    }

    body[data-theme="dark"] .community-v5__caption,
    body.dark .community-v5__caption {
        background: rgba(7, 21, 37, 0.84);
    }

    body[data-theme="dark"] .community-v5__label,
    body.dark .community-v5__label {
        color: var(--theme-accent-gold-bright, #fbbf24);
    }

    body[data-theme="dark"] .community-v5__caption h3,
    body.dark .community-v5__caption h3 {
        color: var(--theme-text-primary, #f4efe4);
    }
 }

@media (max-width: 430px) {
    .community-v5 {
        scroll-margin-top: 2.75rem;
    }

    .community-v5__stage {
        height: 25.65rem;
    }

    .community-v5__slide {
        width: min(86vw, 21rem);
    }

    .community-v5__media {
        height: 17.25rem;
    }

    .community-v5__prev,
    .community-v5__next {
        width: 2.75rem;
        height: 2.75rem;
    }

    .community-v5__dot {
        width: 0.56rem !important;
        height: 0.56rem !important;
    }

    .community-v5__dot.is-active {
        width: 0.68rem !important;
        height: 0.68rem !important;
    }
}

@media (max-width: 420px) {
    .community-v5__controls {
        gap: 0.55rem;
    }

    .community-v5__dots {
        gap: 0.45rem;
        flex-wrap: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .community-v5__slide,
    .community-v5__media img,
    .community-v5__prev,
    .community-v5__next,
    .community-v5__dot {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
