/* styles/pages/community-topic.css */


/* ========== HEADING ========== */

.community-heading {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.community-heading h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.35;
}

.community-back {
    width: fit-content;
    color: var(--accent-violet);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.community-back:hover {
    color: var(--accent-pink);
}


/* ========== TOPIC DETAIL ========== */

.topic-detail {
    margin-bottom: 42px;
    border: 1px solid #333;
    border-radius: 4px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.topic-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid #333;
}

.topic-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.topic-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topic-author-name {
    color: var(--accent-violet);
    font-size: 12px;
    font-weight: 600;
}

.topic-date {
    color: var(--text-muted);
    font-size: 10px;
}


/* ========== TOPIC BODY ========== */

.topic-body {
    padding: 22px 18px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.7;
}

.topic-body p {
    margin: 0 0 16px;
}

.topic-body p:last-child {
    margin-bottom: 0;
}


/* ========== TOPIC ACTIONS ========== */

.topic-actions {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 18px;
    border-top: 1px solid #333;
}

.vote-button {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.vote-button.active,
.vote-button.active .vote-icon {
    color: var(--accent-pink);
}

.vote-button:hover {
    color: var(--accent-violet);
    border-color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.08);
}

.vote-icon {
    color: var(--accent-violet);
    font-size: 10px;
}

.vote-count {
    color: inherit;
    font-weight: 600;
}

.topic-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 10px;
}

.topic-stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ================================
   TOPIC IMAGES
================================ */

.topic-images {
    width: 30%;
    display: grid;
    gap: 0.75rem;
    margin: 1rem auto;
}

.topic-images-1 {
    grid-template-columns: minmax(0, 1fr);
}

.topic-images-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-images-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topic-image {
    display: block;
    width: 100%;
    object-fit: contain;
    background: var(--bg-primary);
    border-radius: 8px;
}

.topic-image {
    border: 1px solid transparent;
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: cover;
}

.topic-image:hover {
    cursor: pointer;
    opacity: 0.5;
    border: 1px solid var(--accent-violet);
}

/* ================================
   IMAGE MODAL
================================ */

.community-image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.community-image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.community-image-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 92vh;
}

.community-image-modal-image {
    display: block;
    max-width: 95vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.community-image-modal-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.community-image-modal-close:hover {
    color: var(--accent-pink);
}

.topic-image,
.comment-image {
    cursor: pointer;
}

.topic-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s ease, background 0.15s ease;
    margin-left: auto;
}

.topic-delete-btn:hover {
    background: var(--bg-card);
    opacity: 1;
    filter: saturate(1.5);
}

.topic-delete-btn img {
    display: block;
    width: 17px;
    height: 17px;
}

.topic-follow {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    margin-left: auto;
    cursor: pointer;
    opacity: 0.5;
}

.topic-follow:hover {
    opacity: 1;
}

.topic-follow.active {
    opacity: 1;
}

.topic-follow img {
    width: 100%;
    height: 100%;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 800px) {
    .community-heading h1 {
        font-size: 20px;
    }

    .topic-body {
        padding: 18px 14px;
    }

    .topic-actions {
        gap: 14px;
        padding: 0 14px;
    }

    .comment {
        padding: 14px;
    }

    .topic-images-2,
    .topic-images-3 {
        grid-template-columns: 1fr;
    }

    .topic-image {
        max-height: 400px;
    }

    .comment-images-2,
    .comment-images-3 {
        grid-template-columns: 1fr;
    }

    .comment-image {
        max-height: 350px;
    }
}