/**
 * استایل قالب مدرن نمایش تک کمپین
 * تمام کلاس‌ها با پیشوند cmm- نوشته شده‌اند تا با قالب کلاسیک/مینیمال (template-1/3) تداخل نکنند.
 *
 * نکته مهم دربارهٔ RTL + CSS Grid: در جهت راست‌به‌چپ، ستون اول grid-template-columns
 * (و اولین نام در grid-template-areas) از سمت راست صفحه چیده می‌شود، نه چپ. برای اینکه از
 * اشتباه گرفتن این موضوع (که در قالب کلاسیک هم پیش آمد) دوباره جلوگیری شود، در این فایل
 * همیشه از grid-template-areas با نام صریح برای هر بخش استفاده شده تا محل قرارگیری هر
 * عنصر مستقل از ترتیب DOM و بدون ابهام مشخص باشد.
 *
 * @package Campaign_Management
 */

.cm-template-modern {
    background: #f8fafc;
    direction: rtl;
    font-family: inherit;
}

.cm-template-modern * {
    box-sizing: border-box;
}

.cmm-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ===================== ردیف هیرو ===================== */
.cmm-hero-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    grid-template-areas: "info image";
    gap: 32px;
    margin-bottom: 32px;
    align-items: stretch;
}

.cmm-hero-image {
    grid-area: image;
    border-radius: 18px;
    overflow: hidden;
    min-height: 320px;
}

.cmm-hero-image img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    display: block;
}

.cmm-hero-image iframe {
    width: 100%;
    height: 100%;
    min-height: 320px;
    border: 0;
}

.cmm-hero-info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.cmm-category-badge {
    align-self: flex-start;
    background: #dcfce7;
    color: #16a34a;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 999px;
}

.cmm-title {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.cmm-excerpt {
    font-size: 15px;
    color: #64748b;
    line-height: 1.9;
    margin: 0;
}

.cmm-progress-block {
    margin-top: 6px;
}

.cmm-progress-label {
    font-size: 14px;
    color: #334155;
    margin-bottom: 8px;
}

.cmm-progress-label strong {
    color: #16a34a;
    font-weight: 800;
    font-size: 16px;
}

.cmm-progress-bar {
    background: #e5e7eb;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
}

.cmm-progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.cmm-amounts-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}

.cmm-goal-amount {
    color: #64748b;
}

.cmm-raised-amount {
    color: #16a34a;
    font-weight: 800;
    font-size: 16px;
}

.cmm-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 8px;
    transition: background 0.2s ease;
}

.cmm-cta-btn:hover {
    background: #128038;
    color: #fff;
}

/* ===================== ردیف بدنه: کارت اطلاعات + محتوای اصلی ===================== */
.cmm-body-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-areas: "main sidebar";
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .cmm-hero-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "image"
            "info";
    }

    .cmm-body-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "main";
    }
}

.cmm-main {
    grid-area: main;
    min-width: 0;
}

/* کارت اطلاعات کمپین (سایدبار) */
.cmm-info-card {
    grid-area: sidebar;
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.cmm-info-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.cmm-info-card-title i {
    color: #16a34a;
}

.cmm-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.cmm-info-value {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #0f172a;
    font-weight: 700;
}

.cmm-info-value i {
    color: #16a34a;
}

.cmm-info-label {
    color: #94a3b8;
}

.cmm-countdown-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    margin: 14px 0 10px 0;
}

.cmm-countdown-heading i {
    color: #16a34a;
}

.cmm-countdown-cells {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.cmm-countdown-cell {
    background: #f0fdf4;
    border-radius: 10px;
    text-align: center;
    padding: 10px 4px;
}

.cmm-countdown-cell strong {
    display: block;
    font-size: 17px;
    color: #16a34a;
    font-weight: 800;
}

.cmm-countdown-cell span {
    font-size: 11px;
    color: #94a3b8;
}

.cmm-countdown-expired {
    grid-column: 1 / -1;
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
}

.cmm-verified-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 12px;
    line-height: 1.8;
    font-weight: 600;
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 16px;
}

/* بخش‌های محتوایی ستون اصلی */
.cmm-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.cmm-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.cmm-section-title i {
    color: #16a34a;
}

.cmm-description {
    line-height: 2;
    color: #334155;
    font-size: 15px;
}

/* گالری */
.cmm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.cmm-gallery-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* نظرات */
.cmm-comments-list {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.cmm-comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
}

.cmm-comment-item .children {
    list-style: none;
    margin: 10px 0 0 0;
    padding-right: 30px;
}

.cmm-comment-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.cmm-comment-body {
    flex: 1;
}

.cmm-comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.cmm-comment-author {
    color: #0f172a;
    font-size: 14px;
}

.cmm-comment-date {
    color: #94a3b8;
    font-size: 12px;
}

.cmm-comment-text {
    color: #475569;
    font-size: 14px;
    line-height: 1.9;
}

/* فرم ارسال نظر: ورودی گرد + دکمه سبز کنارش */
.cmm-comment-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cmm-comment-field-wrap {
    flex: 1;
    margin: 0;
}

.cmm-comment-field {
    width: 100%;
    resize: none;
    height: 46px;
    padding: 12px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
}

.cmm-comment-field:focus {
    outline: none;
    border-color: #16a34a;
}

.cmm-comment-submit-wrap {
    margin: 0;
}

.cmm-comment-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.cmm-comment-submit:hover {
    background: #128038;
}

/* ===================== ریسپانسیو ===================== */

@media (max-width: 900px) {
    .cmm-hero-image {
        min-height: 220px;
    }

    .cmm-hero-image img,
    .cmm-hero-image iframe {
        min-height: 220px;
    }

    .cmm-hero-info {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .cmm-container {
        padding: 16px 14px 40px;
    }

    .cmm-title {
        font-size: 23px;
    }

    .cmm-excerpt {
        font-size: 14px;
    }

    .cmm-hero-row {
        gap: 18px;
        margin-bottom: 20px;
    }

    .cmm-hero-image {
        min-height: 180px;
        border-radius: 14px;
    }

    .cmm-hero-image img,
    .cmm-hero-image iframe {
        min-height: 180px;
    }

    .cmm-section,
    .cmm-info-card {
        padding: 16px;
        border-radius: 12px;
    }

    .cmm-countdown-cells {
        gap: 6px;
    }

    .cmm-countdown-cell {
        padding: 8px 2px;
    }

    .cmm-countdown-cell strong {
        font-size: 15px;
    }

    .cmm-cta-btn {
        font-size: 14px;
        padding: 13px 16px;
    }

    .cmm-amounts-row {
        font-size: 13px;
    }

    .cmm-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .cmm-comment-form {
        flex-wrap: wrap;
    }

    .cmm-comment-field-wrap {
        flex-basis: 100%;
    }

    .cmm-comment-submit-wrap {
        width: 100%;
    }

    .cmm-comment-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .cmm-countdown-cells {
        grid-template-columns: repeat(2, 1fr);
    }
}
