/* =========================================================
   역곡지구 하우스토리 커뮤니티 전용 스타일
   기존 style.css의 파스텔 토큰/레이아웃을 그대로 사용합니다.
========================================================= */

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.community-sub-header {
    padding-bottom: 30px;
}

.community-sub-header-compact {
    padding-top: 42px;
    padding-bottom: 28px;
}

.community-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    padding: 5px 10px;
    border: 1px solid rgba(126, 169, 231, 0.28);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.68);
    color: #7896c7;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.2px;
    box-shadow: var(--shadow-sm);
}

.community-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #82b2ee, #b4a5e9);
}

.community-shell {
    width: min(1000px, calc(100% - 48px));
    margin: 10px auto 70px;
}

.community-form-shell,
.community-detail-shell {
    width: min(900px, calc(100% - 48px));
}

.community-toolbar-card,
.community-form-card,
.community-detail-card,
.community-comments-card {
    background: rgba(255,255,255,0.94);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.community-toolbar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    margin-bottom: 24px;
}

.community-category-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.community-tab {
    padding: 9px 14px;
    border-radius: 12px;
    color: #748198;
    font-size: 13px;
    font-weight: 800;
    transition: all .2s ease;
}

.community-tab:hover {
    background: var(--primary-tint);
    color: #5d81c0;
}

.community-tab.active {
    background: linear-gradient(135deg, #e6f0ff, #f0ecff);
    color: #5d81c0;
    box-shadow: inset 0 0 0 1px rgba(126,169,231,.22);
}

.community-search {
    display: flex;
    width: min(370px, 100%);
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(93,115,155,.05);
}

.community-search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-body);
    font: inherit;
    font-size: 13px;
}

.community-search-btn {
    flex: 0 0 auto;
    min-width: 62px;
    padding: 0 12px;
    border-radius: 10px;
    background: #edf4ff;
    color: #6286c2;
    font-size: 12px;
    font-weight: 900;
}

.community-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0 4px 14px;
}

.community-list-head > div {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.community-list-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.community-list-head strong {
    color: #5d81c0;
    font-size: 18px;
    font-weight: 900;
}

.community-primary-btn,
.community-secondary-btn,
.community-danger-btn,
.community-ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 17px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.community-primary-btn {
    background: var(--primary-gradient-btn);
    color: #fff;
    box-shadow: 0 6px 14px rgba(111,159,232,.22);
}

.community-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 18px rgba(111,159,232,.28);
}

.community-secondary-btn {
    background: #f1f5f9;
    color: #66748b;
    border: 1px solid #e2e8f0;
}

.community-secondary-btn:hover { background: #e9eef5; }

.community-danger-btn {
    background: #fff2f2;
    color: #dc5555;
    border: 1px solid #ffd9d9;
}

.community-ghost-btn {
    background: #fff;
    color: #7d889b;
    border: 1px solid var(--border-light);
}

.community-board-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.community-post-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    background: rgba(255,255,255,.94);
    border: 1px solid var(--border-card);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.community-post-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(147,197,253,.65);
}

.community-post-main { min-width: 0; }

.community-post-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.community-category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.community-category-badge.free { background: #eef4ff; color: #6c91cc; }
.community-category-badge.question { background: #f2edff; color: #8b79c7; }
.community-category-badge.info { background: #e9f8f2; color: #5eaa91; }

.community-pin-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 8px;
    background: #fff6da;
    color: #bd8122;
    font-size: 10px;
    font-weight: 900;
}

.community-post-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #465268;
    font-size: 15px;
    font-weight: 850;
}

.community-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 12px;
    color: #8a96aa;
    font-size: 11.5px;
    font-weight: 600;
}

.community-post-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.community-stat-pill {
    padding: 5px 8px;
    border-radius: 9px;
    background: #f7f9fc;
    border: 1px solid #edf1f7;
}

.community-loading-card,
.community-empty-card,
.community-error-card {
    width: 100%;
    padding: 55px 20px;
    text-align: center;
    border: 1px dashed #dce4ef;
    border-radius: 20px;
    background: rgba(255,255,255,.75);
    color: #8491a5;
    font-size: 13px;
    font-weight: 700;
}

.community-error-card { color: #dc5555; }

.community-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    min-height: 42px;
}

.community-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 11px;
    color: #7d899c;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--border-light);
    font-size: 12px;
    font-weight: 800;
}

.community-page-btn.active {
    background: linear-gradient(135deg, #e7f1ff, #f0ecff);
    color: #5f83bf;
    border-color: #cddcf2;
}

.community-page-btn:disabled { opacity: .45; cursor: default; }

.community-guide-box {
    margin-top: 30px;
    padding: 18px 20px;
    border-radius: 17px;
    background: linear-gradient(135deg, #f7f9ff, #fbfaff);
    border: 1px solid #e4e8f5;
    color: #758197;
}

.community-guide-box strong {
    display: block;
    margin-bottom: 5px;
    color: #59667c;
    font-size: 13px;
}

.community-guide-box p { font-size: 12px; line-height: 1.7; }

/* ---------- 글쓰기 ---------- */
.community-form-card { padding: 28px; }

.community-form-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
}

.community-field {
    position: relative;
    margin-bottom: 22px;
}

.community-field > label,
.community-label-row > label {
    display: block;
    margin-bottom: 8px;
    color: #536077;
    font-size: 13px;
    font-weight: 850;
}

.required { color: #e06b73; }

.community-field input,
.community-field select,
.community-field textarea,
.community-comment-form input,
.community-comment-form textarea {
    width: 100%;
    border: 1px solid #dfe6f0;
    border-radius: 13px;
    background: #fff;
    color: var(--text-body);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.community-field input,
.community-field select,
.community-comment-form input {
    height: 46px;
    padding: 0 14px;
}

.community-field textarea,
.community-comment-form textarea {
    padding: 13px 14px;
    line-height: 1.7;
    resize: vertical;
}

.community-field input:focus,
.community-field select:focus,
.community-field textarea:focus,
.community-comment-form input:focus,
.community-comment-form textarea:focus {
    border-color: #9dbbea;
    box-shadow: 0 0 0 4px rgba(126,169,231,.12);
}

.community-counter {
    position: absolute;
    right: 7px;
    bottom: -18px;
    color: #a0a9b8;
    font-size: 10.5px;
    font-weight: 700;
}

.community-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.community-label-row > label { margin: 0; }

.community-field-note {
    color: #929daf;
    font-size: 11px;
    font-weight: 650;
}

.community-upload-box {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 135px;
    margin: 0 !important;
    padding: 20px;
    border: 1.5px dashed #cbd8eb;
    border-radius: 18px;
    background: linear-gradient(145deg, #fbfdff, #f7f5ff);
    color: #7c8ba4;
    cursor: pointer;
    text-align: center;
    transition: border-color .2s ease, background .2s ease;
}

.community-upload-box:hover {
    border-color: #9fbce8;
    background: #f5f9ff;
}

.community-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 7px;
    border-radius: 13px;
    background: linear-gradient(135deg, #e5f0ff, #eee9ff);
    color: #7598d0;
    font-size: 22px;
    font-weight: 500;
}

.community-upload-box strong { color: #5f6f88; font-size: 13px; }
.community-upload-box span:last-child { margin-top: 4px; font-size: 11px; }

.community-image-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.community-preview-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: #f4f6fa;
}

.community-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.community-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(25,35,50,.72);
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

.community-preview-item.marked-delete img { opacity: .3; filter: grayscale(.6); }
.community-preview-item.marked-delete::after {
    content: "삭제 예정";
    position: absolute;
    inset: auto 5px 5px;
    padding: 4px 5px;
    border-radius: 7px;
    background: rgba(224,49,49,.86);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    text-align: center;
}

.community-password-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: center;
    margin: 8px 0 25px;
    padding: 18px 20px;
    border-radius: 17px;
    background: linear-gradient(135deg, #f3f7ff, #faf7ff);
    border: 1px solid #e1e7f4;
}

.community-password-copy strong {
    display: block;
    margin-bottom: 4px;
    color: #56647a;
    font-size: 13px;
}

.community-password-copy p {
    color: #8793a7;
    font-size: 11.5px;
    line-height: 1.6;
}

.community-password-field { margin: 0; }

.community-form-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
}

.community-submit-btn { border: 0; }

.community-form-message {
    min-height: 20px;
    margin-top: 14px;
    color: #dc5555;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

/* ---------- 상세 ---------- */
.community-detail-card {
    overflow: hidden;
    min-height: 220px;
}

.community-detail-inner { padding: 28px; }

.community-detail-title-row {
    padding-bottom: 20px;
    border-bottom: 1px solid #edf1f7;
}

.community-detail-title-row h1 {
    margin: 10px 0 10px;
    color: #3f4d63;
    font-size: 25px;
    line-height: 1.45;
    letter-spacing: -.6px;
    word-break: break-word;
}

.community-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #8c97a9;
    font-size: 11.5px;
    font-weight: 650;
}

.community-detail-content {
    min-height: 150px;
    padding: 28px 2px;
    color: #3f4a5d;
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}

.community-detail-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-bottom: 28px;
}

.community-detail-image {
    overflow: hidden;
    border-radius: 17px;
    border: 1px solid #e4e9f1;
    background: #f4f6f8;
    cursor: zoom-in;
}

.community-detail-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: cover;
}

.community-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 13px 0 30px;
}

.community-comments-card { padding: 24px; }

.community-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.community-comments-head h2 {
    color: #526078;
    font-size: 17px;
    font-weight: 900;
}

.community-comments-head h2 span { color: #6f9fe8; }

.community-comment-list {
    display: flex;
    flex-direction: column;
}

.community-comment-item {
    padding: 16px 3px;
    border-bottom: 1px solid #edf1f7;
}

.community-comment-item:first-child { border-top: 1px solid #edf1f7; }

.community-comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.community-comment-author {
    color: #59667c;
    font-size: 12px;
    font-weight: 900;
}

.community-comment-date {
    margin-left: 7px;
    color: #a0a9b8;
    font-size: 10.5px;
    font-weight: 600;
}

.community-comment-actions {
    display: flex;
    gap: 7px;
}

.community-comment-actions button {
    color: #97a0af;
    font-size: 10.5px;
    font-weight: 700;
}

.community-comment-actions button:hover { color: #6387c3; }

.community-comment-content {
    color: #465164;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}

.community-comment-form {
    margin-top: 20px;
    padding: 17px;
    border-radius: 17px;
    background: #f8fafd;
    border: 1px solid #e7ebf2;
}

.community-comment-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.community-comment-content-row {
    display: grid;
    grid-template-columns: 1fr 82px;
    gap: 8px;
    align-items: stretch;
}

.community-comment-content-row textarea { min-height: 80px; resize: vertical; }
.community-comment-submit { min-height: 80px; border: 0; }

.community-comment-help {
    margin-top: 7px;
    color: #9aa5b5;
    font-size: 10.5px;
}

.community-back-row {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* ---------- 신고 다이얼로그 ---------- */
.community-dialog {
    width: min(500px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
}

.community-dialog::backdrop {
    background: rgba(15,23,42,.42);
    backdrop-filter: blur(4px);
}

.community-dialog-card {
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15,23,42,.24);
}

.community-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.community-dialog-head h2 {
    color: #4d5a70;
    font-size: 18px;
    font-weight: 900;
}

.community-dialog-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #8a96a8;
    background: #f4f6f9;
    font-size: 22px;
}

.community-dialog-desc {
    margin-bottom: 18px;
    color: #8792a5;
    font-size: 12px;
    line-height: 1.6;
}

.community-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 760px) {
    .community-shell,
    .community-form-shell,
    .community-detail-shell {
        width: calc(100% - 32px);
        margin-top: 4px;
        margin-bottom: 50px;
    }

    .community-toolbar-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .community-category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 1px;
    }

    .community-category-tabs::-webkit-scrollbar { display: none; }
    .community-tab { flex: 0 0 auto; }
    .community-search { width: 100%; }

    .community-post-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
    }

    .community-post-stats { justify-content: flex-start; }
    .community-form-card { padding: 20px 16px; }
    .community-form-grid { grid-template-columns: 1fr; gap: 0; }

    .community-image-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .community-password-box {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .community-form-actions { grid-template-columns: 1fr 1.6fr; }
    .community-detail-inner { padding: 20px 17px; }
    .community-detail-title-row h1 { font-size: 21px; }
    .community-detail-content { padding: 22px 1px; font-size: 14px; }
    .community-detail-images { grid-template-columns: 1fr; }
    .community-detail-actions { flex-wrap: wrap; }
    .community-comments-card { padding: 18px 15px; }
    .community-comment-input-row { grid-template-columns: 1fr; }
    .community-comment-content-row { grid-template-columns: 1fr; }
    .community-comment-submit { min-height: 44px; }
}

@media (max-width: 420px) {
    .community-list-head { margin-left: 0; margin-right: 0; }
    .community-primary-btn,
    .community-secondary-btn,
    .community-danger-btn,
    .community-ghost-btn { padding-left: 14px; padding-right: 14px; }
    .community-image-preview-grid { grid-template-columns: repeat(2, 1fr); }
    .community-form-actions { grid-template-columns: 1fr; }
}
