/* Posts Modal Styles */
:root { --border-radius: 0.6vw; }
.posts-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vh 3vw;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
}

.posts-modal.active { display: flex; }

.posts-modal-content {
    background: #dee5db;
    border-radius: var(--border-radius, 0.6vw);
    width: 100%;
    max-width: 1100px;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(120, 150, 102, 0.18), 0 2px 8px rgba(0,0,0,0.08);
    border: 1.5px solid #b7cdb0;
    overflow: hidden;
    position: relative;
}

.posts-modal-header-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #8caa76;
    border-bottom: 1px solid #0000001a;
}

.posts-modal-main-row {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    padding: 1.25rem;
    align-items: stretch;
    min-height: 0;
    box-sizing: border-box;
}

.posts-modal-title {
    font-size: 1.5rem;
    font-weight: 850;
    color: #4a5568;
    margin: 0;
    text-align: center;
    display: block;
    padding: 1rem 1.5rem;
    min-height: auto;
    overflow: visible;
}

.posts-modal-left {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    min-height: 0;
}

@media (min-width: 768px) {
    .posts-modal-left {
        flex: 0 0 55%;
    }
}

.posts-modal-thumbnails {
    width: 130px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    height: 100%;
    padding: 0.25rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
    align-self: stretch;
}
.posts-modal-thumbnails::-webkit-scrollbar { display: none; }

.posts-modal-dots,
.posts-modal .img-wrapper .posts-modal-dots {
    display: none;
    justify-content: center;
    gap: 8px;
    padding: 0.5rem 0 0;
}
.posts-modal-dot,
.posts-modal .img-wrapper .posts-modal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}
.posts-modal-dot.active,
.posts-modal .img-wrapper .posts-modal-dot.active {
    background: #91AE7E;
    transform: scale(1.15);
}

.posts-modal-thumbnail {
    width: 110px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: filter 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.posts-modal-thumbnail:not(.selected) { filter: brightness(0.55) saturate(0.95); opacity: 0.85; }
.posts-modal-thumbnail.selected { filter: none; opacity: 1; }

.posts-modal-image,
.posts-modal .img-wrapper {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: visible;
    border-radius: 0.6vw;
    position: relative;
}
.posts-modal-img {
    max-width: 100%;
    max-height: 70vh;
    width: 100%;
    height: auto;
    object-fit: contain;
    align-self: center;
}

.posts-modal-text {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    overflow-y: auto;
    padding: 1.2rem 1.25rem 1.5rem;
    align-items: stretch;
    justify-content: flex-start;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.8);
    border-left: 1px solid #00000012;
    border-radius: var(--border-radius, 0.6vw);
    gap: 1vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.35) transparent;
}
@media (max-width: 768px) {
    .posts-modal-text {
        max-height: 40vh;
    }
}
.posts-modal-text::-webkit-scrollbar { width: 10px; }
.posts-modal-text::-webkit-scrollbar-track { background: transparent; }
.posts-modal-text::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.35); border-radius: 999px; }
.posts-modal-text::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.5); }

.posts-modal-footer {
    padding: 1.5rem 1.25rem;
    color: #4a5568;
    border-top: 1px solid rgba(0,0,0,0.1);
    background: rgba(140, 170, 118, 0.15);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    gap: 1rem;
    flex-shrink: 0;
    margin-top: auto;
}

.posts-modal-date {
    padding: 0.6rem 1rem;
    background: #f3f5f1;
    border-radius: var(--border-radius, 0.6vw);
    color: #4a5568;
    font-size: 0.95rem;
    margin-right: auto;
}

.posts-modal-close {
    background: #aebbaa;
    border: none;
    border-radius: var(--border-radius, 0.6vw);
    color: #4a5568;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
    flex: 0 0 auto;
    min-width: max-content;
}
.posts-modal-close:hover {
    background: #8caa76;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    :root { --border-radius: 1vw; }
    .posts-modal-main-row {
        flex-direction: column;
        padding: 0.5rem;
    }
    .posts-modal-left {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    .posts-modal-thumbnails {
        display: none;
    }
    .posts-modal-dots,
    .posts-modal .img-wrapper .posts-modal-dots {
        display: inline-flex;
        position: absolute;
        left: 50%;
        bottom: 6px;
        transform: translateX(-50%);
        z-index: 3;
    }
    .posts-modal-image,
    .posts-modal .img-wrapper {
        flex: none;
        width: 100%;
        padding-bottom: 32px;
    }
    .posts-modal-img { max-height: 400px; }
}

@media (min-width: 769px) {
    .posts-modal-dots,
    .posts-modal .img-wrapper .posts-modal-dots {
        display: none !important;
    }
}
