/* 
   COMMUNITY BOARD 
*/

.community-container {
    width: 100%;
    margin: 0;
    padding: 25px 20px 50px;
    background: #E6E6E6;
    font-family: 'PP Mori', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.community-container * { box-sizing: border-box; }

/* Header */
.community-header {
    text-align: center;
    padding: 0;
    max-width: 918px;
    margin: 0 auto;
}

.community-header p {
    margin: 0;
    font-size: 35px;
    font-weight: 600;
    color: #000;
    line-height: 0.98;
}

/* Filters */
.community-filters {
    max-width: 1400px;
    margin: 15px auto 0;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: #000;
    line-height: 19px;
    margin-bottom: 4px;
}

.filter-group select {
    width: 100%;
    height: 37px;
    padding: 10px 10px 9px;
    border: 1px solid #D3D3D3;
    border-radius: 5px;
    background: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #000;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 19px;
}

.urgency-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
}

.urgency-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #fff;
}

.filter-actions .primary {
    background: #0FDE00;
    color: #000;
    border: none;
    border-radius: 35px;
    padding: 10px 26px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.filter-actions .primary:hover {
    background: #11c900;
    box-shadow: 0 8px 18px rgba(15, 222, 0, 0.28);
    transform: translateY(-1px);
}

.filter-actions .primary:focus-visible {
    outline: 2px solid #000;
    outline-offset: 3px;
}

.filter-actions .ghost {
    background: #D3D3D3;
    color: #000;
    border: none;
    border-radius: 35px;
    padding: 10px 26px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}

/* Result count */
.community-count {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    line-height: 22px;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto 20px;
}

/* Posts Grid – 3 columns */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    column-gap: 40px;
    row-gap: 40px;
    max-width: 1400px;
    margin: 0 auto 40px;
    align-items: start;
}

/* Post Card */
.post-card {
    background: #D8D8D8;
    border: 1px solid #fff;
    border-radius: 5px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    min-width: 0;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.post-card:focus-visible {
    outline: 2px solid #000;
    outline-offset: 3px;
}

/* Card number */
.post-card .card-number {
    width: 60px;
    height: 60px;
    background: #000;
    border: 3.5px solid #0FDE00;
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card .card-number span {
    font-size: 35px;
    line-height: 0.98;
    font-weight: 600;
    color: #0FDE00;
}

.post-card .card-title {
    font-size: 35px;
    font-weight: 600;
    color: #000;
    line-height: 1.04;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    padding-bottom: 3px;
}

.post-card .card-org {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    line-height: 22px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.post-card .card-separator {
    width: 100%;
    border-top: 1px solid #fff;
}

.post-card .card-tag {
    display: inline-block;
    background: #000;
    padding: 5px 6px;
    font-size: 14px;
    font-weight: 600;
    color: #0FDE00;
    line-height: 18px;
    border: none;
    width: fit-content;
}

.post-card .card-when {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 17px;
    font-weight: 600;
    color: #000;
    line-height: 19px;
    min-height: 38px;
}

.post-card .card-when .when-label {
    width: 85px;
    flex: 0 0 85px;
}

.post-card .card-when .when-value {
    flex: 1 1 auto;
    min-width: 0;
}

.post-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.post-card .card-posted {
    font-size: 12px;
    font-weight: 600;
    color: #000;
    line-height: 14px;
}

.post-card .card-toggle {
    background: #fff;
    border: none;
    min-height: 21px;
    padding: 3px 9px 4px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
}

.post-card .card-toggle:hover {
    background: #f3f3f3;
}

/* Card image */
.post-card .card-image {
    width: 100%;
    background: #0FDE00;
    min-height: 145px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.post-card .card-image img {
    width: auto;
    max-width: 97px;
    height: 125px;
    object-fit: cover;
}

.post-card .card-image.card-image-empty {
    background: #0FDE00;
}

.post-card .card-image-empty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    font-size: 16px;
    line-height: 18px;
    font-weight: 600;
    color: #000;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 17px;
    font-weight: 600;
    color: #000;
}

/* No posts */
.no-posts {
    text-align: center;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.no-posts h3 {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin-bottom: 10px;
}

/* 
   POST DETAIL MODAL
*/
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

.post-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.post-modal-content {
    position: relative;
    background: #D8D8D8;
    border: 1px solid #fff;
    border-radius: 5px;
    width: 100%;
    max-width: 1158px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    font-family: 'PP Mori', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.post-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 20px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    border-bottom: 1px solid #fff;
}

.post-modal-close {
    background: #fff;
    border: none;
    min-height: 21px;
    padding: 3px 9px 4px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    margin-left: auto;
}

.post-modal-close:hover {
    background: #f3f3f3;
}

.post-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
    gap: 40px;
    align-items: stretch;
    padding: 16px 20px 20px;
}

.post-modal-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.post-modal-number {
    width: 60px;
    height: 60px;
    background: #000;
    border: 3.5px solid #0FDE00;
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    line-height: 0.98;
    font-weight: 600;
    color: #0FDE00;
}

.post-modal-left h2 {
    margin: 0;
    font-size: 35px;
    font-weight: 600;
    color: #000;
    line-height: 0.98;
    overflow-wrap: anywhere;
}

.post-modal-org {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
    line-height: 22px;
}

.post-modal-tag {
    display: inline-block;
    background: #000;
    padding: 5px 6px;
    font-size: 14px;
    font-weight: 600;
    color: #0FDE00;
    line-height: 18px;
    width: fit-content;
}

.post-modal-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-modal-detail-row {
    display: flex;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: #000;
    line-height: 19px;
}

.post-modal-detail-row .detail-label {
    width: 85px;
    flex: 0 0 85px;
    font-weight: 600;
}

.post-modal-detail-row .detail-value {
    flex: 1 1 auto;
    min-width: 0;
}

.post-modal-separator {
    width: 100%;
    border-top: 1px solid #fff;
}

.post-modal-contact-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-modal-contact-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-left: 85px;
}

.post-modal-contact-btn {
    display: inline-block;
    padding: 10px 26px 9px;
    border-radius: 35px;
    font-size: 17px;
    line-height: 19px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    border: none;
    background: #fff;
    text-align: center;
}

.post-modal-contact-btn:hover {
    background: #f5f5f5;
}

.post-modal-contact-btn.green {
    background: #0FDE00;
    border-color: #0FDE00;
}

.post-modal-right {
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #0FDE00;
    padding: 10px;
    min-height: 598px;
    position: relative;
}

.post-modal-image-button {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0;
    position: relative;
    cursor: zoom-in;
}

.post-modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.post-modal-image-fallback {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: transparent;
    padding: 0;
    display: block;
}

.post-modal-image-fallback p {
    margin: 0;
    display: none;
}

.post-modal-right.is-empty {
    background: transparent;
    padding: 0;
}

.post-modal-image-hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    line-height: 14px;
}

.image-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-zoom-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.image-zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1;
    background: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
}

.image-zoom-img {
    position: relative;
    z-index: 1;
    max-width: min(100%, 920px);
    max-height: calc(100vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
}

/* 
   MOBILE
 */
@media (max-width: 960px) {
    .community-container {
        padding: 25px 0 50px;
    }

    .community-header {
        max-width: 370px;
        text-align: left;
    }

    .community-header p {
        font-size: 17px;
        line-height: 19px;
    }

    .community-filters,
    .community-count,
    .posts-grid,
    .loading,
    .no-posts {
        max-width: 370px;
    }

    .community-filters {
        margin-top: 25px;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .filter-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 19px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        row-gap: 10px;
        column-gap: 0;
    }

    .post-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .post-modal-right {
        min-height: 320px;
    }

    .post-modal-content {
        margin: 0 10px;
    }

    .post-modal-contact-buttons {
        padding-left: 0;
    }

    .post-card .card-title {
        font-size: 20px;
        line-height: 22px;
    }

    .post-card .card-org {
        font-size: 17px;
        line-height: 19px;
    }

    .post-card .card-image {
        min-height: 145px;
    }

    .community-count {
        margin-bottom: 0;
    }

    .post-modal-left h2 {
        font-size: 20px;
        line-height: 22px;
    }

    .post-modal-org {
        font-size: 17px;
        line-height: 19px;
    }

    .post-modal-detail-row {
        flex-direction: column;
        gap: 6px;
    }

    .post-modal-detail-row .detail-label {
        width: auto;
        flex: 0 0 auto;
    }

    .post-modal-image-hint {
        right: 10px;
        bottom: 10px;
    }
}
