/* ============================================
   COOPERATIVA MODELO — Comunidade
   Feed social estilo Instagram/blog
   ============================================ */

.community {
    max-width: 880px;
    margin: 0 auto;
    padding: 50px 24px 80px;
}

/* ============ HEADER ============ */
.community__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.community__intro h1 {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 12px 0 8px;
}
.community__intro h1 em { font-style: italic; color: var(--green-700); font-weight: 400; }

.community__intro p {
    font-size: 16px;
    color: var(--ink-soft);
    max-width: 560px;
    line-height: 1.5;
}

/* ============ FILTROS ============ */
.community__filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 32px;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
}

.community__filters::-webkit-scrollbar { height: 6px; }
.community__filters::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.community__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--white);
    border: 1.5px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
    transition: all .25s ease;
    scroll-snap-align: start;
    flex-shrink: 0;
}
.community__chip:hover {
    border-color: var(--green-500);
    color: var(--green-700);
}
.community__chip.active {
    background: var(--green-700);
    border-color: var(--green-700);
    color: var(--white);
}
.community__chip span { font-size: 18px; line-height: 1; }

/* ============ FEED ============ */
.community__feed {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.community__feed--compact { gap: 16px; }

/* ============ CARD DE POST ============ */
.cm-post {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    transition: all .3s ease;
    box-shadow: var(--shadow-sm);
}
.cm-post:hover {
    border-color: var(--green-500);
    box-shadow: var(--shadow-md);
}

.cm-post__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    gap: 12px;
}

.cm-post__author {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    transition: color .2s ease;
}
.cm-post__author:hover { color: var(--green-700); }
.cm-post__author img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cream);
}
.cm-post__author strong {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    display: block;
}
.cm-post__author span {
    font-size: 12px;
    color: var(--muted);
}

.cm-post__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--cream);
    color: var(--green-700);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.cm-post__cat:hover { background: var(--green-50); }
.cm-post__cat span { font-size: 14px; line-height: 1; }

.cm-post__title-link { color: var(--ink); display: block; padding: 0 22px; }
.cm-post__title-link:hover { color: var(--green-700); }
.cm-post__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

/* ============ GALERIA DE IMAGENS ============ */
.cm-post__gallery {
    display: grid;
    gap: 2px;
    background: var(--line);
    margin-bottom: 16px;
}

.cm-post__gallery--1 { grid-template-columns: 1fr; }
.cm-post__gallery--2 { grid-template-columns: 1fr 1fr; }
.cm-post__gallery--3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.cm-post__gallery--3 a:first-child { grid-row: span 2; }
.cm-post__gallery--4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.cm-post__img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--cream);
    display: block;
}
.cm-post__gallery--1 .cm-post__img { aspect-ratio: 16/10; max-height: 600px; }

.cm-post__img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.cm-post__img:hover img { transform: scale(1.05); }

.cm-post__more {
    position: absolute;
    inset: 0;
    background: rgba(20,40,30,.6);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
}

/* ============ VÍDEO YOUTUBE ============ */
.cm-post__video {
    background: #000;
    margin-bottom: 16px;
}
.cm-post__video-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
}
.cm-post__video-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity .3s ease;
}
.cm-post__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,0,0,.9);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all .25s ease;
    border: 4px solid rgba(255,255,255,.3);
}
.cm-post__play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #ff0000;
}

/* ============ BODY ============ */
.cm-post__body {
    padding: 0 22px 16px;
}
.cm-post__body p {
    font-size: 15px;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 12px;
}
.cm-post__readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--green-700);
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: gap .25s ease;
}
.cm-post__readmore:hover { gap: 12px; color: var(--green-800); }

/* ============ FOOTER (ações) ============ */
.cm-post__footer {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    background: var(--paper);
}

.cm-post__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    flex: 1;
    justify-content: center;
}
.cm-post__action:hover {
    background: var(--cream);
    color: var(--green-700);
}
.cm-post__action i { font-size: 18px; }

.cm-like-btn.active {
    color: #e63946;
}
.cm-like-btn.active i { color: #e63946; }

.cm-like-btn--lg {
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    font-family: var(--font-display);
    font-size: 22px;
    flex: 0 1 auto;
    min-width: 100px;
}
.cm-like-btn--lg i { font-size: 28px; }
.cm-like-btn--lg small {
    font-size: 11px;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
}

@keyframes likePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.cm-like-btn.pop i { animation: likePop .4s ease; }

/* ============ EMPTY STATE ============ */
.community__empty {
    text-align: center;
    padding: 80px 24px;
    background: var(--white);
    border: 1px dashed var(--line);
    border-radius: 18px;
}
.community__empty i {
    font-size: 64px;
    color: var(--green-500);
    margin-bottom: 20px;
    display: block;
    opacity: .5;
}
.community__empty h3 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--ink);
    margin-bottom: 10px;
    font-weight: 500;
}
.community__empty p {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ============ NEW POST FORM ============ */
.cm-newpost {
    padding: 50px 24px 80px;
}

.cm-newpost__inner {
    max-width: 720px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
}
@media (max-width: 560px) {
    .cm-newpost__inner { padding: 28px 20px; }
}

.cm-newpost__header {
    text-align: center;
    margin-bottom: 32px;
}
.cm-newpost__header h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 38px);
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 10px;
}
.cm-newpost__header h1 em { font-style: italic; color: var(--green-700); font-weight: 400; }
.cm-newpost__header p {
    color: var(--ink-soft);
    font-size: 15px;
}

.cm-newpost__notice {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: rgba(212,164,75,.1);
    border-left: 3px solid var(--gold);
    border-radius: 12px;
    margin-bottom: 28px;
}
.cm-newpost__notice i {
    font-size: 22px;
    color: var(--gold);
    margin-top: 2px;
    flex-shrink: 0;
}
.cm-newpost__notice strong {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--ink);
}
.cm-newpost__notice p {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0;
}

/* Textarea sem ícone */
.cm-newpost__form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 15px;
    background: var(--paper);
    color: var(--ink);
    transition: all .25s ease;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 160px;
}
.cm-newpost__form textarea:focus {
    outline: none;
    border-color: var(--green-500);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(86,184,118,.1);
}

/* ============ UPLOAD ============ */
.cm-upload {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cm-upload__drop {
    border: 2px dashed var(--line);
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all .25s ease;
    background: var(--paper);
}
.cm-upload__drop:hover,
.cm-upload__drop.dragover {
    border-color: var(--green-500);
    background: var(--green-50);
}
.cm-upload__drop i {
    font-size: 36px;
    color: var(--green-700);
    display: block;
    margin-bottom: 12px;
}
.cm-upload__drop strong {
    display: block;
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--ink);
    margin-bottom: 4px;
}
.cm-upload__drop span {
    font-size: 13px;
    color: var(--muted);
}

.cm-upload__previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.cm-upload__preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.cm-upload__preview img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.cm-upload__remove {
    position: absolute;
    top: 6px; right: 6px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(20,40,30,.85);
    color: var(--white);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all .2s ease;
}
.cm-upload__remove:hover { background: #b03a3a; }

/* ============ SINGLE POST ============ */
.cm-single {
    background: var(--white);
    border-radius: 24px;
    padding: 36px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
@media (max-width: 560px) { .cm-single { padding: 24px 20px; } }

.cm-single__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.cm-single__author {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
}
.cm-single__author img {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cream);
}
.cm-single__author strong {
    display: block;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
}
.cm-single__author span { font-size: 13px; color: var(--muted); }

.cm-single__video {
    margin-bottom: 28px;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.cm-single__video iframe {
    width: 100%; height: 100%;
    border: none;
    display: block;
}

.cm-single__gallery {
    display: grid;
    gap: 8px;
    margin-bottom: 28px;
}
.cm-single__gallery--1 { grid-template-columns: 1fr; }
.cm-single__gallery--2,
.cm-single__gallery--3,
.cm-single__gallery--4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.cm-single__img {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 14px;
    display: block;
}
.cm-single__gallery--1 .cm-single__img { aspect-ratio: 16/10; max-height: 600px; }
.cm-single__img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.cm-single__img:hover img { transform: scale(1.04); }

.cm-single__content {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
    margin-bottom: 32px;
}
.cm-single__content p { margin-bottom: 16px; }

.cm-single__actions {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.cm-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 999px;
    background: var(--green-700);
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all .2s ease;
}
.cm-follow-btn:hover { background: var(--green-800); transform: translateY(-1px); }
.cm-follow-btn.active {
    background: var(--green-50);
    color: var(--green-700);
    border: 1px solid var(--green-700);
}
.cm-follow-btn.active:hover {
    background: rgba(176,58,58,.1);
    color: #b03a3a;
    border-color: #b03a3a;
}
.cm-follow-btn.active:hover span::before { content: 'Deixar de seguir'; }
.cm-follow-btn.active:hover span { font-size: 0; }
.cm-follow-btn.active:hover span::before { font-size: 14px; }

.cm-related {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}
.cm-related h3 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 500;
}
.cm-related h3 em { font-style: italic; color: var(--green-700); }

/* ============ MEMBER PROFILE ============ */
.member-profile-hero {
    position: relative;
    padding: 60px 0 40px;
    overflow: hidden;
    color: var(--white);
}
.member-profile-hero__bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(20,55,30,.92), rgba(28,85,48,.88)),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=1920&q=80') center/cover;
    z-index: 0;
}
.member-profile-hero::after {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(212,164,75,.3), transparent 70%);
    z-index: 0;
}
.member-profile-hero .container { position: relative; z-index: 1; }

.member-profile-hero__main {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.member-profile-hero__avatar img {
    width: 160px; height: 160px;
    border-radius: 50%;
    border: 5px solid var(--gold);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.member-profile-hero__info {
    flex: 1;
    min-width: 280px;
}

.member-profile-hero__info h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.5vw, 48px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.member-profile-hero__location {
    font-size: 14px;
    color: var(--gold-light);
    margin-bottom: 12px;
}
.member-profile-hero__location i { margin-right: 6px; }

.member-profile-hero__bio {
    font-size: 16px;
    color: rgba(255,255,255,.85);
    line-height: 1.6;
    max-width: 560px;
    margin-bottom: 22px;
}

.member-profile-hero__stats {
    display: flex;
    gap: 32px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.member-profile-hero__stats div {
    display: flex;
    flex-direction: column;
}
.member-profile-hero__stats strong {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
}
.member-profile-hero__stats span {
    font-size: 12px;
    color: rgba(255,255,255,.65);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-top: 4px;
}

.member-profile-hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============ DARK MODE ============ */
[data-theme="dark"] .cm-post,
[data-theme="dark"] .cm-single,
[data-theme="dark"] .cm-newpost__inner,
[data-theme="dark"] .community__empty,
[data-theme="dark"] .community__chip { background: var(--white); }
[data-theme="dark"] .cm-post__footer,
[data-theme="dark"] .cm-upload__drop { background: var(--cream); }
[data-theme="dark"] .cm-newpost__form textarea { background: var(--cream); color: var(--ink); }
