/* /domains/gromadan.com/public_html/css/post/new
   Стили попапа "Додати пост" (post/new_post_popup/index.php) */

.post-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}
.post-overlay.open { display: flex; }
body.post-modal-lock { overflow: hidden; }

.post-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

.post-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.post-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}
.post-modal-header h3 { flex: 1; font-size: 1.2rem; }

.post-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.post-type-tab {
    padding: 7px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}
.post-type-tab.active {
    background: var(--gradient);
    color: #fff;
}

.post-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.post-modal-close:hover { background: var(--border); }

.post-textarea {
    width: 100%;
    min-height: 160px;
    border: none;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 14px;
}
.post-textarea:focus { outline: 2px solid var(--primary-light); }

.post-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.post-field-limit {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.post-input {
    width: 100%;
    border: none;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 14px;
}
.post-input:focus { outline: 2px solid var(--primary-light); }

.post-question-title-hidden {
    visibility: hidden;
    pointer-events: none;
}

.post-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    border: 2px dashed var(--primary-light);
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 14px;
}
.post-upload.dragover,
.post-upload:hover { border-color: var(--primary); }

.post-upload-icon {
    width: 40px;
    height: 40px;
    color: var(--primary);
    background: var(--surface);
    border-radius: 50%;
    padding: 10px;
    box-sizing: content-box;
}
.post-upload-text { font-weight: 600; font-size: 1rem; }
.post-upload-sub,
.post-upload-hint { font-size: 0.85rem; color: var(--text-secondary); }

.post-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.post-preview:empty { display: none; margin: 0; }

.post-thumb {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.post-error {
    color: var(--nope-bg);
    font-size: 0.85rem;
    min-height: 1em;
    margin-bottom: 8px;
}

.post-modal-footer { display: flex; justify-content: flex-end; }

.post-submit {
    padding: 13px 34px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--gradient);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.post-submit:disabled {
    background: var(--primary-light);
    color: var(--text-secondary);
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .post-modal { padding: 20px; max-height: 92vh; }
}