/* Estilos do módulo de conteúdo: feed, posts, cursos, reações, comentários, modal */

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.feed-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.feed-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(10, 175, 168, .18);
}

.feed-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-card-body { padding: 16px; }
.feed-card-body h3 { margin: 6px 0; font-size: 17px; }
.feed-card-body p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }

.feed-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
}

/* Visualização em lista (alternativa à grade) */
.feed-grid.is-list {
    display: flex;
    flex-direction: column;
}

.feed-grid.is-list .feed-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.feed-grid.is-list .feed-card-img-wrap {
    width: 240px;
    min-height: 140px;
    flex-shrink: 0;
}

.feed-grid.is-list .feed-card-body {
    flex: 1;
}

.view-toggle {
    display: inline-flex;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.view-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--white);
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.view-toggle button:hover { background: var(--brand-pale); }

.view-toggle button.active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: var(--white);
}

@media (max-width: 640px) {
    .feed-grid.is-list .feed-card { flex-direction: column; }
    .feed-grid.is-list .feed-card-img-wrap { width: 100%; height: 160px; }
}

.tag-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--brand-pale);
    color: var(--brand-darker);
    font-size: 11px;
    font-weight: 700;
}

.badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}
.badge-publicado { background: #e2f7ee; color: #1e8a5f; }
.badge-rascunho { background: #f3f0e2; color: #8a7a1e; }
.badge-arquivado { background: #f0f0f0; color: #666; }

.post-content { line-height: 1.7; font-size: 16px; }
.post-content img, .post-content video { max-width: 100%; border-radius: 10px; }

/* Reações estilo Instagram */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 15px;
    transition: transform .12s ease, background .12s ease;
}
.reaction-btn:hover { transform: scale(1.06); background: var(--brand-pale); }
.reaction-btn.active { background: var(--brand-pale); border-color: var(--brand); }
.reaction-count { font-size: 13px; color: var(--muted); }

/* Modal de confirmação customizado */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay[hidden] {
    display: none !important;
}
.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 48px rgba(0, 0, 0, .25);
}
.modal-box p { margin: 0 0 18px; font-size: 15px; }

/* Sino de notificações */
.notif-bell { position: relative; cursor: pointer; }
.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e0483e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
}
.notif-dropdown {
    position: absolute;
    right: 0;
    top: 36px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, .2);
    z-index: 50;
}
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }

/* Carrossel de banners (topo do feed da comunidade) */
.banner-carousel {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(5, 86, 83, .16);
    margin-bottom: 22px;
    background: var(--brand-pale);
}
.banner-carousel-track {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    min-height: 140px;
}
.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}
.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.banner-slide a { display: block; width: 100%; height: 100%; }
.banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(4, 48, 46, .45);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
    z-index: 5;
}
.banner-nav:hover { background: rgba(4, 48, 46, .7); transform: translateY(-50%) scale(1.08); }
.banner-nav.prev { left: 12px; }
.banner-nav.next { right: 12px; }
.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}
.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s ease, transform .2s ease;
}
.banner-dot.active { background: #fff; transform: scale(1.25); }

/* Modal de Regras da comunidade */
.rules-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    max-width: 560px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.rules-modal-box h2 {
    margin: 0 0 4px;
    color: var(--brand-darker);
    display: flex;
    align-items: center;
    gap: 10px;
}
.rules-modal-box .rules-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 20px;
}
.rule-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.rule-item:last-child { border-bottom: none; }
.rule-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-pale);
    color: var(--brand-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.rule-item h4 { margin: 2px 0 4px; font-size: 15px; color: var(--brand-darker); }
.rule-item p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.rules-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    border-radius: 50%;
    transition: background .15s ease;
}
.rules-modal-close:hover { background: var(--brand-pale); }
.rules-modal-box { position: relative; }

.header-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
    padding: 0;
}
.header-icon-link:hover { color: var(--brand-pale); text-decoration: none; }
.notif-item.unread { background: var(--brand-pale); }
