/* ========= پایه عمومی ========= */

.caf-form,
.caf-post-list,
.caf-profile-layout {
    direction: rtl;
    font-family: inherit;
}

.caf-success,
.caf-error {
    max-width: 1100px;
    margin: 0 auto 16px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
}

.caf-success {
    background: #eef8e3;
    color: #3b6f1a;
}

.caf-error {
    background: #ffe7e7;
    color: #a42828;
}

/* دکمه سبز عمومی */

.caf-button {
    border: none;
    outline: none;
    background: #88B04B !important;
    color: #fff !important;
    border-radius: 14px;
    padding: 10px 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: background .2s, transform .1s, box-shadow .2s;
}

.caf-button:hover {
    background: #6e9339 !important;
    transform: translateY(-1px);
}

/* =========================================================================
 *  فرم ارسال مقاله [caf_submit_post]
 * =========================================================================*/

.caf-submit-wrapper {
    max-width: 1100px;
    margin: 40px auto;
}

.caf-submit-container {
    background: #fbfeff;
    border: 1px solid #d7e7f5;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.caf-submit-header {
    padding: 16px 24px 8px;
}

.caf-submit-title {
    font-size: 20px;
    font-weight: 700;
    color: #174372;
}

.caf-submit-inner {
    padding: 0 24px 24px;
}

.caf-post-form {
    margin: 0;
}

/* ردیف‌ها */

.caf-row {
    width: 100%;
}

.caf-row-top {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 20px;
}

.caf-row-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* بلوک ورودی */

.caf-input-block {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* عنوان بزرگ‌تر از بقیه */

.caf-title-block {
    flex: 2 1 260px;
}

.caf-file-block {
    flex: 1 1 200px;
}

/* لیبل‌ها */

.caf-label {
    background: #f7faf3;
    color: #78A5BF;
    font-size: 13px;
    padding: 0 12px 0 6px;
    align-self: flex-start;
    margin-bottom: -10px;
}

/* ورودی متن و textarea */

.caf-input-block input[type="text"],
.caf-input-block textarea {
    background: #f9fcff;
    border: 1px solid #A2D5F2;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    outline: 0;
}

.caf-input-block textarea {
    min-height: 180px;
    resize: vertical;
}

.caf-input-block input[type="text"]:focus,
.caf-input-block textarea:focus {
    border-color: #88B04B;
    box-shadow: 0 0 0 2px rgba(136, 176, 75, 0.18);
    background: #ffffff;
}

/* فایل‌ها – input مخفی + لیبل قرص‌شکل */

.caf-hidden-file {
    position: absolute !important;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
    margin: 0;
    clip: rect(0,0,0,0);
}

.caf-file-label {
    border: 1px solid #A2D5F2;
    border-radius: 999px;
    padding: 8px 18px;
    background: #f4f8ff;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.caf-file-text {
    color: #78A5BF;
}

.caf-file-ico {
    font-size: 16px;
}

/* دکمه ارسال زیر متن */

.caf-submit-btn-wrap {
    text-align: left;
    margin-top: 4px;
}

/* دسکتاپ: دکمه کنار textarea در پایین */

@media (min-width: 900px) {
    .caf-row-bottom {
        flex-direction: row;
        align-items: flex-end;
        gap: 40px;
    }

    .caf-content-block {
        flex: 1 1 auto;
    }

    .caf-submit-btn-wrap {
        flex: 0 0 auto;
    }
}

/* موبایل: ستون‌ها زیر هم */

@media (max-width: 700px) {
    .caf-row-top {
        flex-direction: column;
    }

    .caf-submit-inner {
        padding: 0 16px 16px;
    }
}

/* =========================================================================
 *  لیست نوشته‌ها [caf_my_posts]
 * =========================================================================*/

.caf-post-list {
    max-width: 1100px;
    margin: 0 auto 60px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.caf-post-item {
    background: #fbfeff;
    border: 1px solid #d8e7f5;
    border-radius: 16px;
    padding: 16px 18px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.caf-post-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #232f3e;
}

.caf-post-meta {
    font-size: 12px;
    color: #9ba9ba;
    margin-top: 6px;
    text-align: left;
}

.caf-post-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.caf-btn-edit,
.caf-btn-delete {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f6fc;
    text-decoration: none;
    border: none;
    outline: none;
    cursor: pointer;
    overflow: hidden;
    text-indent: -9999px;
}

.caf-btn-edit::before,
.caf-btn-delete::before {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.caf-btn-edit::before {
    content: "✏";
    color: #6276a3;
}

.caf-btn-delete::before {
    content: "🗑";
    color: #c75454;
}

/* =========================================================================
 *  پروفایل [caf_profile]
 * =========================================================================*/

.caf-profile-layout {
    max-width: 1100px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 70px;
    flex-wrap: wrap;
    flex-direction: row-reverse;
}

/* کارت بیو */

.caf-profile-bio-card {
    position: relative;
    flex: 1 1 60%;
    border: 1px solid #88B04B;
    border-radius: 24px;
    padding: 34px 60px 46px;
}

.caf-profile-bio-title {
    position: absolute;
    top: 16px;
    left: 50px;
    font-size: 13px;
    color: #4E4637;
}

.caf-profile-bio-pencil {
    position: absolute;
    top: 18px;
    right: 26px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #cfe49c;
    background-color: #f3fbe7;
}

.caf-profile-bio-pencil::before {
    content: "✏";
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #7ea33a;
}

.caf-profile-bio-body {
    margin-top: 10px;
}

.caf-profile-bio-input {
    width: 100%;
    min-height: 150px;
    border: none;
    outline: none;
    resize: vertical;
    font-size: 14px;
    line-height: 2.4;
    color: #333;
    background: transparent;
}

.caf-profile-social {
    margin-top: 18px;
    text-align: center;
}

.caf-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

/* ستون راست پروفایل */

.caf-profile-side {
    flex: 0 0 260px;
    text-align: center;
}

.caf-profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 18px;
}

.caf-profile-avatar-circle {
    width: 208px;
    height: 208px;
    border-radius: 50%;
    border: 2px solid #88B04B;
    background-position: center;
    background-size: cover;
    background-color: #f3f5eb;
}

.caf-profile-avatar-edit {
    position: absolute;
    right: 8px;
    bottom: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #cfe49c;
    background: #f7fcea;
    cursor: pointer;
}

.caf-profile-avatar-edit::before {
    content: "✏";
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #7ea33a;
}

.caf-profile-avatar-edit input {
    display: none;
}

.caf-profile-name-row,
.caf-profile-phone-row {
    position: relative;
    margin-bottom: 10px;
    padding-right: 34px;
}

.caf-profile-name-pencil,
.caf-profile-phone-pencil {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #cfe49c;
    background: #f7fcea;
}

.caf-profile-name-pencil::before,
.caf-profile-phone-pencil::before {
    content: "✏";
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #7ea33a;
}

.caf-profile-name-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 28px;
    font-weight: 900;
    color: #40591B;
    text-align: right;
}

.caf-profile-phone-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-weight: 300;
    line-height: 32px;
    font-size: 14px;
    color: #4E4637;
    text-align: right;
}

.caf-profile-save-btn {
    margin-top: 12px;
    padding: 8px 32px;
    font-size: 14px;
}

/* ریسپانسیو پروفایل */

@media (max-width: 900px) {
    .caf-profile-layout {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .caf-profile-bio-card {
        padding: 26px 26px 38px;
    }

    .caf-profile-bio-title {
        left: 26px;
    }
}
