/* =====================================================================
   صفحه‌های محتوایی: درباره ما و مقالات

   بلوک‌ها را همین فایل می‌چیند. هر بلوک عرض کامل می‌گیرد و خودش داخلش
   را مرتب می‌کند، تا ادمین بتواند هر ترتیبی بچیند و صفحه نشکند.
   ===================================================================== */

.content-page {
    --cp-radius: 22px;
    --cp-ink: #111827;
    --cp-muted: #6b7280;
    --cp-line: #e9ecf1;
    --cp-soft: #f6f7fb;
    padding-bottom: 40px;
}

.content-page .cp-block + .cp-block {
    margin-top: 46px;
}

.cp-block-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--cp-ink);
    line-height: 1.7;
    margin: 0 0 6px;
}

.cp-block-subtitle {
    font-size: 15px;
    color: var(--cp-muted);
    line-height: 1.9;
    margin: 0 0 18px;
}

.cp-body {
    font-size: 15px;
    line-height: 2.1;
    color: #374151;
    white-space: pre-line;   /* ادمین با Enter پاراگراف می‌سازد، نه با HTML */
}

/* --- hero: بنر بالای صفحه --- */
.cp-hero {
    position: relative;
    border-radius: var(--cp-radius);
    overflow: hidden;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, var(--main-color-one, #cd0543), #1f2937);
}

.cp-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-hero-veil {
    position: relative;
    width: 100%;
    padding: 36px 28px 28px;
    background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, .12) 65%, transparent);
    color: #fff;
}

.cp-hero-veil .cp-block-title {
    color: #fff;
    font-size: 30px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}

.cp-hero-veil .cp-block-subtitle {
    color: rgba(255, 255, 255, .92);
    margin-bottom: 0;
}

/* --- متن ساده --- */
.cp-text {
    background: #fff;
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-radius);
    padding: 26px 24px;
}

/* --- تصویر تکی --- */
.cp-image figure {
    margin: 0;
}

.cp-image img {
    width: 100%;
    border-radius: var(--cp-radius);
    display: block;
    cursor: zoom-in;
}

.cp-image figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--cp-muted);
    text-align: center;
}

/* --- تصویر + متن کنار هم --- */
.cp-image-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-radius);
    padding: 22px;
}

.cp-image-text.is-image-left {
    direction: ltr;      /* فقط ترتیب ستون‌ها؛ متن داخلش دوباره rtl می‌شود */
}

.cp-image-text.is-image-left > * {
    direction: rtl;
}

.cp-image-text img {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    max-height: 340px;
    cursor: zoom-in;
}

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

.cp-gallery-grid figure {
    margin: 0;
}

.cp-gallery-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    display: block;
    cursor: zoom-in;
    transition: transform .25s ease, box-shadow .25s ease;
}

.cp-gallery-grid img:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
}

.cp-gallery-grid figcaption {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--cp-muted);
    text-align: center;
}

/* --- چارت سازمانی --- */
.cp-org {
    background: var(--cp-soft);
    border-radius: var(--cp-radius);
    padding: 26px 20px;
}

.cp-org-level + .cp-org-level {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px dashed #d6dae2;
}

.cp-org-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.cp-org-card {
    width: 190px;
    background: #fff;
    border: 1px solid var(--cp-line);
    border-radius: 18px;
    padding: 18px 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

.cp-org-card img {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    background: #eef1f6;
}

.cp-org-name {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--cp-ink);
    line-height: 1.7;
}

.cp-org-role {
    font-size: 12.5px;
    color: var(--cp-muted);
    margin-top: 2px;
}

/* --- آمار --- */
.cp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.cp-stat {
    background: #fff;
    border: 1px solid var(--cp-line);
    border-radius: 18px;
    padding: 22px 14px;
    text-align: center;
}

.cp-stat-value {
    font-size: 27px;
    font-weight: 700;
    color: var(--main-color-one, #cd0543);
    line-height: 1.4;
}

.cp-stat-label {
    font-size: 13px;
    color: var(--cp-muted);
    margin-top: 4px;
}

/* --- نقل‌قول --- */
.cp-quote {
    background: var(--cp-soft);
    border-right: 4px solid var(--main-color-one, #cd0543);
    border-radius: 16px;
    padding: 24px 22px;
}

.cp-quote-body {
    font-size: 16px;
    line-height: 2.1;
    color: #374151;
}

.cp-quote-author {
    margin-top: 12px;
    font-size: 13px;
    color: var(--cp-muted);
    font-weight: 700;
}

/* --- دعوت به اقدام --- */
.cp-cta {
    background: linear-gradient(135deg, var(--main-color-one, #cd0543), #7f1d3a);
    color: #fff;
    border-radius: var(--cp-radius);
    padding: 30px 26px;
    text-align: center;
}

.cp-cta .cp-block-title,
.cp-cta .cp-block-subtitle {
    color: #fff;
}

.cp-cta-button {
    display: inline-block;
    margin-top: 12px;
    background: #fff;
    color: var(--main-color-one, #cd0543);
    font-weight: 700;
    padding: 11px 26px;
    border-radius: 30px;
    transition: transform .2s ease;
}

.cp-cta-button:hover {
    transform: translateY(-2px);
    color: var(--main-color-one, #cd0543);
}

/* =====================================================================
   فهرست مقالات
   ===================================================================== */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--cp-line, #e9ecf1);
    border-radius: 20px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .1);
}

.article-card-cover {
    aspect-ratio: 16 / 9;
    background: #f1f3f7;
    overflow: hidden;
}

.article-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-card-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.8;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-summary {
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-card-meta {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: #9ca3af;
}

.article-card-more {
    color: var(--main-color-one, #cd0543);
    font-weight: 700;
}

/* --- سربرگ صفحه --- */
.content-hero {
    background: linear-gradient(135deg, rgba(205, 5, 67, .06), rgba(31, 41, 55, .05));
    border: 1px solid var(--cp-line, #e9ecf1);
    border-radius: 22px;
    padding: 28px 24px;
    margin-bottom: 26px;
}

.content-hero h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.content-hero p {
    margin: 0;
    color: #6b7280;
    font-size: 14.5px;
    line-height: 1.9;
}

/* --- حالت خالی --- */
.cp-empty {
    text-align: center;
    padding: 50px 20px;
    color: #9ca3af;
}

.cp-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: .6;
}

/* =====================================================================
   موبایل
   ===================================================================== */

@media (max-width: 768px) {
    .content-page .cp-block + .cp-block { margin-top: 30px; }

    .cp-block-title { font-size: 20px; }
    .cp-hero-veil .cp-block-title { font-size: 22px; }
    .cp-hero { min-height: 200px; }
    .cp-hero-veil { padding: 24px 18px 20px; }

    .cp-image-text {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    /* روی موبایل ترتیب ستون‌ها بی‌معنی است؛ همیشه عکس بالا */
    .cp-image-text.is-image-left { direction: rtl; }

    .cp-text { padding: 20px 16px; }
    .cp-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .cp-org-card { width: 150px; padding: 14px 10px; }
    .cp-org-card img { width: 60px; height: 60px; }
    .content-hero { padding: 20px 16px; border-radius: 18px; }
    .content-hero h1 { font-size: 21px; }
}
