/* قواعد خاصة بالرئيسية منصة المجتمع الجيومكاني فقط.
   المشترك (الهيدر/الناف/الفوتر وصندوق الاقتراحات) في css/site.css ويُحمَّل قبل هذا الملف.

   المحتوى منقول عن رئيسية المنصة في موقع الهيئة
   (geosa.gov.sa/ar/Knowledgecenter/geospatial-community/Pages/default.aspx)،
   وأسماء الجهات الأعضاء مصحّحة على شعاراتها. */

.cm-section {
    padding: 56px 0;
}

.cm-section--tint {
    background: #f9fafb;
}

/* مسافة أوسع بين آخر قسم في الصفحة وسطر «تاريخ آخر تعديل» */
main > .cm-section:last-child {
    padding-bottom: 96px;
}

.cm-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.cm-section__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    color: #161616;
}

.cm-section__lead {
    margin: 4px 0 0;
    font-size: 1rem;
    line-height: 1.8;
    color: #384250;
}

/* أيقونة دائرية — نفس شكل أيقونات بطاقات الموقع (.details-icon) */
.cm-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f3fcf6;
    color: #1b8354;
}

.cm-icon svg {
    width: 24px;
    height: 24px;
}

/* ===== التعريف ===== */
.cm-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px 48px;
    padding: 32px;
    border: 1px solid #d7f0e2;
    border-radius: 16px;
    background: #f3fcf6;
}

.cm-intro p {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.9;
    color: #1f2a37;
}

.cm-intro p + p {
    margin-top: 12px;
}

/* ===== الأعضاء =====
   الدوّار وأسهمه وشارة العدد من GEOSA_Committee.css (قسم «عضوياتها»)
   وسكربته js/GEOSA_Logo_Slider.js (يحسب الخطوة من عرض العنصر الفعلي).
   والعناصر بطاقات جهات على شكل بطاقة الخبر في الرئيسية العامة
   (.nds-news-section .about-card): إطار #d2d6db بزوايا 16 وحشو 16،
   وصورة بزوايا 8 ثم سطر صغير ثم عنوان 18px ثم زر بإطار. */
.cm-members-count {
    margin-top: 12px;
}

/* البطاقات نفسها بإطار، فلا إطار حول الدوّار كما في صفّ الأخبار */
#cm-members-track {
    align-items: stretch;
}

.cmte-slider__box:has(#cm-members-track) {
    padding: 0;
    border: 0;
    background: none;
}

#cm-members-track .cmte-slider__item {
    flex-basis: 25%;
    align-items: stretch;
}

.cm-org {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 16px;
    border: 1px solid #d2d6db;
    border-radius: 16px;
    background: #fff;
}

.cm-org__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 8px;
    background: #f9fafb;
}

/* الأبعاد صريحة: cwv-fix.js يضيف للصور أبعاداً وقت التشغيل */
.cm-org__logo img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cm-org__count {
    margin: 0;
    font-size: .9375rem;
    color: #384250;
}

.cm-org__name {
    margin: 4px 0 0;
    padding-bottom: 16px;
    font-size: 1.125rem !important;   /* UDesign تفرض حجم h3 على الجوال */
    font-weight: 700;
    line-height: 1.6;
    color: #1f2a37;
}

/* الزر أسفل البطاقة فتتحاذى أزرار الصف مهما طال اسم الجهة */
.cm-org__actions {
    display: flex;
    margin-top: auto;
}

/* رأس قسم الأعضاء: العنوان والعدد، و«عرض الكل» في الطرف المقابل */
.cm-members-head {
    align-items: flex-start;
}

/* صفحة «أعضاء المجتمع الجيومكاني»: البطاقات نفسها في شبكة */
.cm-members-count--page {
    margin: 0 0 24px;
}

.cm-orgs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-orgs-grid > li {
    display: flex;
}

@media (max-width: 1199.98px) {
    #cm-members-track .cmte-slider__item {
        flex-basis: 33.3333%;
    }

    .cm-orgs-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    #cm-members-track .cmte-slider__item {
        flex-basis: 50%;
    }

    .cm-orgs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 599.98px) {
    #cm-members-track .cmte-slider__item {
        flex-basis: 100%;
    }

    .cm-orgs-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== الإحصائيات ===== */
.cm-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

.cm-stat__value {
    margin: 4px 0 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1b8354;
}

.cm-stat__label {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.6;
    color: #384250;
}

/* ===== العضوية ===== */
.cm-join {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px 32px;
    padding: 32px;
    border-radius: 16px;
    background: #104631;
    color: #fff;
}

.cm-join .cm-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.cm-join .cm-icon svg {
    width: 32px;
    height: 32px;
}

.cm-join__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.cm-join__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: #e5f5ec;
}

.cm-join__text + .cm-join__text {
    margin-top: 4px;
}

.cm-join__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

/* زر أبيض على الخلفية الداكنة */
.cm-join .dga-btn,
.cm-join .dga-btn:link,
.cm-join .dga-btn:visited {
    justify-content: center;
    border-color: #fff;
    background: #fff;
    color: #104631;
}

.cm-join .dga-btn:hover,
.cm-join .dga-btn:focus {
    background: #f3fcf6;
    color: #104631;
}

.cm-join__note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: .875rem;
    line-height: 1.6;
    color: #e5f5ec;
}

.cm-join__note svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

/* ===== أقسام المنصة ===== */
.cm-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: 24px;
    border: 1px solid #d2d6db;
    border-radius: 16px;
    background: #fff;
}

.cm-card__title {
    margin: 4px 0 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.6;
    color: #161616;
}

.cm-card__text {
    margin: 0;
    text-align: start;   /* UDesign تضبط الفقرات (justify) فتتباعد الكلمات في الأعمدة الضيقة */
    font-size: .9375rem;
    line-height: 1.8;
    color: #384250;
}

/* زر الإجراء في أسفل البطاقة — أخضر أساسي لأنه الإجراء الوحيد في البطاقة، كزر
   «تفاصيل» في بطاقات اللجان الوطنية، ويُدفع للأسفل لتتحاذى أزرار البطاقات في الصف */
.cm-card__actions {
    display: flex;
    margin-top: auto;
    padding-top: 8px;
}

/* ===== بريد المجتمع =====
   بنفس شكل سطر البريد في صفحة الشراكات (.partners-contact) */
.cm-mail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 48px 0 0;
    padding: 16px;
    border: 1px solid #d7f0e2;
    border-radius: 12px;
    background: #f7fdf9;
    font-size: 1rem;
    color: #1f2a37;
}

.cm-mail svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: #1b8354;
}

.cm-mail a,
.cm-mail a:link,
.cm-mail a:visited {
    color: #1b8354;
    font-weight: 700;
    text-decoration: none;
}

.cm-mail a:hover,
.cm-mail a:focus {
    text-decoration: underline;
}

/* ===== الشاشات المتوسطة والجوال ===== */
@media (max-width: 1199.98px) {
    .cm-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cm-join {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cm-join__actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

@media (max-width: 767.98px) {
    .cm-section {
        padding: 40px 0;
    }

    main > .cm-section:last-child {
        padding-bottom: 64px;
    }

    .cm-mail {
        margin-top: 32px;
    }

    .cm-section__title,
    .cm-join__title {
        font-size: 1.25rem;
    }

    .cm-intro {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .cm-intro .dga-btn {
        justify-self: start;
    }

    .cm-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* الإجمالي العام على عرض الصف كاملاً */
    .cm-stat--total {
        grid-column: 1 / -1;
    }

    .cm-stat {
        padding: 16px 12px;
    }

    .cm-stat__value {
        font-size: 1.5rem;
    }

    .cm-join {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .cm-join .cm-icon {
        width: 56px;
        height: 56px;
    }

    .cm-join__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cm-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* UDesign تضبط الفقرات (text-align:justify) فتتباعد الكلمات في الأسطر
   القصيرة، خاصة على الجوال */
.cm-intro p,
.cm-join__text {
    text-align: start;
}

.cm-stat__label {
    text-align: center;
}

/* شعارات الجهات: صيغة JPG لا تدعم الشفافية، فخلفيتها البيضاء تظهر مستطيلًا على
   الصناديق الرمادية. multiply يجعل الأبيض يأخذ لون الصندوق ولا يغيّر ألوان الشعار.
   (يعمل كذلك مع صيغ تدعم الشفافية دون أثر) */
.cm-org__logo img,
.co-org__logo img,
.co-card__logo img,
.cmte-slider__item img {
    mix-blend-mode: multiply;
}
