.community-hero,
.community-detail-hero {
    background:
        radial-gradient(circle at top right, rgba(232, 200, 149, 0.16), transparent 32%),
        linear-gradient(180deg, #fffdf9 0%, #f7fbf7 58%, #fffdfa 100%);
    padding: 40px 0 24px;
}

.community-hero-inner {
    display: block;
}

.community-hero-copy {
    max-width: 760px;
}

.community-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.community-hero h1,
.community-detail-cover h1,
.community-section h2,
.community-empty h1 {
    margin: 0;
    color: var(--primary);
    line-height: 1.06;
}

.community-hero h1,
.community-detail-cover h1 {
    font-size: clamp(2.2rem, 6vw, 4.1rem);
}

.community-hero p,
.community-detail-cover p {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.community-hero-actions,
.community-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.community-hero-actions {
    margin-top: 18px;
}

.community-hero-meta {
    display: inline-flex;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.community-btn,
.community-mini-btn,
.community-full-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary);
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.community-btn:hover,
.community-mini-btn:hover,
.community-full-link:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 111, 92, 0.3);
}

.community-btn-primary,
.community-mini-btn.is-active,
.community-btn.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.community-section {
    padding: 34px 0;
}

.community-band {
    background: linear-gradient(180deg, rgba(248, 242, 230, 0.45), rgba(255, 255, 255, 0));
}

.community-section-head {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.community-section-head-discovery {
    align-items: end;
}

.community-section-head-simple {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.community-search {
    display: grid;
    gap: 8px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 900;
}

.community-search-label {
    display: inline-flex;
}

.community-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    border: 1px solid rgba(15, 111, 92, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0 16px;
    box-shadow: 0 10px 24px rgba(15, 111, 92, 0.05);
}

.community-search-field svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    stroke: var(--muted);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.community-search-field input {
    min-height: 48px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
}

.community-search-field input:focus {
    outline: none;
}

/* GRID DE COMUNIDADES — ESTILO CAPAS/CATEGORIAS */

.community-grid {
    display: grid;
    gap: 14px;
}

.community-card {
    display: block;
}

.community-card.is-hidden {
    display: none;
}

.community-category-card {
    position: relative;
    min-height: 104px;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(18, 42, 35, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.community-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(18, 42, 35, 0.12);
}

.community-category-main {
    position: relative;
    min-height: 104px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46%;
    align-items: stretch;
    color: var(--text);
    text-decoration: none;
}

.community-category-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px 18px 16px;
}

.community-category-copy h3 {
    margin: 0;
    max-width: 12ch;
    color: #121a17;
    font-size: 1.04rem;
    font-weight: 1000;
    line-height: 1.18;
}

.community-category-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.community-category-card:hover .community-category-stats,
.community-category-card:focus-within .community-category-stats {
    opacity: 1;
    transform: translateY(0);
}

.community-category-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.community-category-stats svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.community-category-cover {
    position: absolute;
    top: 0;
    right: 0;
    width: 47%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 30%),
        linear-gradient(145deg, var(--community-color, #0f6f5c), #f26b2b);
    clip-path: polygon(28% 0, 100% 0, 100% 100%, 5% 100%, 23% 72%, 0 52%, 24% 27%);
}

.community-card.has-cover .community-category-cover {
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.08)),
        var(--community-cover);
    background-size: cover;
    background-position: center;
}

.community-category-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.12));
}

.community-category-cover span {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 1000;
    backdrop-filter: blur(8px);
}

.community-card.has-cover .community-category-cover span {
    opacity: 0;
}

.community-category-actions {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.community-category-card:hover .community-category-actions,
.community-category-card:focus-within .community-category-actions {
    opacity: 1;
    transform: translateY(0);
}

.community-category-actions form {
    margin: 0;
}

.community-category-action {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 0 9px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 1000;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.community-category-action span {
    display: none;
}

.community-category-action.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* SECÇÕES SECUNDÁRIAS */

.community-two-col {
    display: grid;
    gap: 20px;
}

.community-secondary-grid {
    display: grid;
    gap: 16px;
}

.community-secondary-card {
    padding: 16px;
    border: 1px solid rgba(15, 111, 92, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 28px rgba(18, 42, 35, 0.04);
}

.community-feed,
.community-writer-list,
.community-tab-panels,
.community-book-list {
    display: grid;
    gap: 10px;
}

.community-feed-card,
.community-side,
.community-book-card,
.community-person-card,
.community-empty,
.community-detail-cover {
    border: 1px solid rgba(15, 111, 92, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 32px rgba(18, 42, 35, 0.05);
}

.community-feed-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
}

.community-feed-card > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f0f7f1;
    color: var(--primary);
    font-size: 0.96rem;
    font-weight: 1000;
}

.community-feed-card p {
    margin: 0;
    color: var(--text);
    font-weight: 760;
    line-height: 1.42;
}

.community-feed-card a {
    color: var(--primary);
    font-weight: 900;
}

.community-feed-card time,
.community-book-card small {
    display: inline-flex;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.78rem;
}

.community-side {
    padding: 16px;
}

.community-side-head {
    margin-bottom: 10px;
}

.community-person {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15, 111, 92, 0.08);
}

.community-person:last-child {
    border-bottom: 0;
}

.community-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #eef7ef;
    color: var(--primary);
    font-weight: 1000;
}

.community-avatar-large {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
}

.community-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-person strong,
.community-person span,
.community-person small {
    display: block;
}

.community-person span,
.community-person small,
.community-book-card p,
.community-person-card span,
.community-person-card p,
.community-empty,
.community-detail-cover p {
    color: var(--muted);
}

.community-person a,
.community-book-card a,
.community-person-card a {
    color: var(--accent-strong);
    font-weight: 900;
    text-decoration: none;
}

.community-full-link {
    width: 100%;
    margin-top: 10px;
}

.community-full-link.is-inline {
    width: auto;
    margin-top: 0;
}

.community-book-grid,
.community-people-grid {
    display: grid;
    gap: 14px;
}

.community-book-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.community-book-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
}

.community-book-cover {
    aspect-ratio: 3 / 4;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(180deg, #145646 0%, #0d3f35 100%);
    color: #fff;
    font-weight: 1000;
    text-decoration: none;
}

.community-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-book-card strong {
    display: block;
    color: var(--primary);
}

.community-book-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.community-book-row-cover {
    aspect-ratio: 3 / 4;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, #145646 0%, #0d3f35 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 1000;
}

.community-book-row-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-book-row strong {
    display: block;
    color: var(--primary);
}

.community-book-row p {
    margin: 2px 0;
}

/* PÁGINA INTERNA DA COMUNIDADE */

.community-detail-cover {
    position: relative;
    padding: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--community-color, #0f6f5c) 30%, #fff 70%), transparent 34%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 252, 247, 0.96) 100%);
}

.community-detail-cover::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -50px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--community-color, #0f6f5c) 15%, transparent);
}

.community-detail-head,
.community-detail-bar {
    position: relative;
    z-index: 1;
}

.community-detail-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.community-symbol {
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: color-mix(in srgb, var(--community-color, var(--accent)) 14%, #fff);
    color: var(--community-color, var(--accent));
    font-weight: 1000;
}

.community-symbol-large {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
}

.community-detail-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.community-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0;
}

.community-detail-stats dt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 900;
}

.community-detail-stats svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.community-detail-actions form {
    margin: 0;
}

.community-share-status {
    min-height: 20px;
    margin: 10px 0 0;
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 900;
}

.community-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.community-tabs button {
    min-height: 48px;
    border: 1px solid rgba(15, 111, 92, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.community-tabs button.is-active {
    border-color: rgba(15, 111, 92, 0.16);
    background: #eef7ef;
    color: var(--primary);
}

.community-tab-panels {
    padding-top: 18px;
}

.community-tab-panel {
    display: none;
}

.community-tab-panel.is-active {
    display: block;
}

.community-person-card {
    padding: 18px 14px;
    text-align: center;
}

.community-person-card h3 {
    margin: 0 0 4px;
    color: var(--primary);
}

.community-person-card p {
    margin: 0 0 6px;
}

.community-empty {
    padding: 18px;
    font-weight: 800;
}

.community-empty a {
    color: var(--accent-strong);
    font-weight: 900;
}

/* RESPONSIVO */

@media (min-width: 620px) {
    .community-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 760px) {
    .community-section-head {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
        align-items: end;
    }

    .community-two-col {
        grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.8fr);
        align-items: start;
    }

    .community-secondary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .community-book-grid,
    .community-people-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 920px) {
    .community-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .community-book-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .community-people-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1180px) {
    .community-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 759px) {
    .community-section-head-simple {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .community-hero,
    .community-detail-hero {
        padding-top: 28px;
    }

    .community-category-main {
        min-height: 96px;
        grid-template-columns: minmax(0, 1fr) 44%;
    }

    .community-category-copy {
        padding: 15px;
    }

    .community-category-copy h3 {
        font-size: 0.98rem;
    }

    .community-category-actions {
        opacity: 1;
        transform: none;
    }

    .community-detail-head {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .community-symbol-large {
        margin: 0 auto;
    }

    .community-detail-bar {
        justify-content: center;
    }

    .community-tabs {
        display: flex;
        overflow-x: auto;
    }

    .community-tabs button {
        flex: 1 0 104px;
    }

    .community-book-grid-compact {
        grid-template-columns: 1fr;
    }
}