/* ------- تصميم الصفحة الرئيسية (محصور داخل .homePage حتى لا يؤثر على باقي الصفحات) ------- */

.homePage {
    --brand-teal: #326666;
    --brand-teal-dark: #264f4f;
    --brand-red: #9b1e42;
    --text-main: #1d2327;
    --text-muted: #6b7378;
    --surface: #ffffff;
    --surface-alt: #f4f6f6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 6%), 0 1px 2px rgb(0 0 0 / 4%);
    --shadow-md: 0 10px 24px rgb(0 0 0 / 10%);
    --ease: cubic-bezier(.2, .7, .3, 1);
}

.homePage a {
    overflow-wrap: anywhere;
}

/* مسافة إضافية لأن شريط الاشتراك في الفوتر يرتفع 38px فوق بدايته */
.homePage {
    padding-bottom: 24px;
}

/* ---------- شريط آخر الأخبار ---------- */

/* هامش القائمة السفلي 40px (و24px تحت 992px)، فنرفع الشريط ليبقى على بعد 16px منها */
.homePage .newsTicker {
    display: flex;
    align-items: stretch;
    margin: -24px 0 20px;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e7ebeb;
    overflow: hidden;
}

.homePage .newsTickerLabel {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--brand-red);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
}

.homePage .liveDot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: livePulse 1.6s ease-out infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgb(255 255 255 / 70%); }
    100% { box-shadow: 0 0 0 9px rgb(255 255 255 / 0%); }
}

.homePage .newsTickerViewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}

.homePage .newsTickerTrack {
    display: flex;
    width: max-content;
    animation: tickerMove 60s linear infinite;
}

.homePage .newsTicker:hover .newsTickerTrack,
.homePage .newsTicker:focus-within .newsTickerTrack {
    animation-play-state: paused;
}

/* المسار نسختان متطابقتان؛ تحريكه بعرض نسخة واحدة يعطي حركة متصلة بلا فراغ.
   في العربي يبدأ المسار من اليمين فيتحرك لليمين، وفي الإنجليزي العكس */
@keyframes tickerMove {
    from { transform: translateX(0); }
    to { transform: translateX(50%); }
}

@keyframes tickerMoveLtr {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

html:not([dir="rtl"]) .homePage .newsTickerTrack {
    animation-name: tickerMoveLtr;
}

.homePage .newsTickerList {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.homePage .newsTickerList li {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.homePage .newsTickerList li::after {
    content: '';
    width: 6px;
    height: 6px;
    margin: 0 18px;
    border-radius: 50%;
    background: var(--brand-teal);
    opacity: .5;
}

.homePage .newsTickerList a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    overflow-wrap: normal;
    transition: color .2s;
}

.homePage .newsTickerList a:hover {
    color: var(--brand-red);
}

/* ---------- حركة الدخول والظهور ---------- */

.homePage .heroRow .bigImage a,
.homePage .heroRow .col_12 a,
.homePage .heroRow .col_6 a {
    animation: heroIn .8s var(--ease) both;
}

.homePage .heroRow .col_12 a { animation-delay: .12s; }
.homePage .heroRow .col_6 a { animation-delay: .22s; }
.homePage .heroRow .col_6 + .col_6 a { animation-delay: .32s; }

@keyframes heroIn {
    from { opacity: 0; transform: translateY(16px) scale(.985); }
    to { opacity: 1; transform: none; }
}

/* حركة بطيئة جداً لصورة الخبر الرئيسي حتى لا تبدو ثابتة */
.homePage .bigImage a::before {
    animation: heroDrift 18s ease-in-out infinite alternate;
}

.homePage .bigImage a:hover::before {
    animation-play-state: paused;
}

@keyframes heroDrift {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.homePage .titleLastNews {
    transition: transform .4s var(--ease);
}

.homePage .heroRow a:hover .titleLastNews {
    transform: translateY(-4px);
}

/* تُضاف .reveal بالجافاسكربت فقط، فبدونه يبقى المحتوى ظاهراً */
.homePage .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity .7s var(--ease) var(--reveal-delay, 0ms),
        transform .7s var(--ease) var(--reveal-delay, 0ms),
        box-shadow .3s var(--ease),
        background-color .2s,
        border-color .2s;
}

.homePage .reveal.is-visible {
    opacity: 1;
    transform: none;
}

.homePage a.CardEconomy.reveal.is-visible:hover {
    transform: translateY(-4px);
    transition-delay: 0ms;
}

/* شريط لوني يتمدد تحت عنوان القسم عند ظهوره */
.homePage .titleSection::after {
    transform-origin: right;
    transition: transform 1s var(--ease) .2s;
}

.homePage .titleSection.reveal::after {
    transform: scaleX(0);
}

.homePage .titleSection.reveal.is-visible::after {
    transform: scaleX(1);
}

/* ---------- الأقسام والمسافات ---------- */

.homePage .homeSection {
    margin-bottom: 56px;
}

.homePage .in_depth,
.homePage .technology {
    min-height: 0;
    background: var(--surface-alt);
    padding: 48px 0 24px;
    margin-bottom: 56px;
}

/* ---------- عناوين الأقسام ---------- */

.homePage .titleSection,
.homePage .titleSection.c1,
.homePage .titleSection.c2 {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 0;
    margin-bottom: 22px;
}

.homePage .titleSection::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dde3e3;
}

.homePage .titleSection span,
.homePage .titleSection.c1 span,
.homePage .titleSection.c2 span {
    background: transparent;
    color: var(--text-main);
    padding: 0 14px 0 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    position: relative;
}

.homePage .titleSection span::before {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    bottom: 15%;
    width: 5px;
    border-radius: 3px;
    background: var(--brand-red);
}

.homePage .titleSection.c1 span::before {
    background: var(--brand-teal);
}

/* ---------- الواجهة (أهم الأخبار) ---------- */

.homePage .heroRow {
    --hero-gap: 12px;
    row-gap: var(--hero-gap);
    margin-bottom: 56px;
}

.homePage .heroRow .setPaddingLft { padding-left: calc(var(--hero-gap) / 2); }
.homePage .heroRow .setPaddingRit { padding-right: calc(var(--hero-gap) / 2); }
.homePage .heroRow .setPaddingMd_Lft { padding-left: calc(var(--bs-gutter-x) * .5); }
.homePage .heroRow .row { row-gap: var(--hero-gap); }
.homePage .heroRow .mb-1 { margin-bottom: 0 !important; }

.homePage .bigImage a,
.homePage .col_12 a,
.homePage .col_6 a {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0;
    isolation: isolate;
    transition: box-shadow .35s var(--ease);
}

.homePage .bigImage a {
    height: 512px;
}

/* تكبير الصورة عند المرور: طبقة داخلية ترث الخلفية */
.homePage .bigImage a::before,
.homePage .col_12 a::before,
.homePage .col_6 a::before,
.homePage .religion a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    transition: transform .6s var(--ease);
    z-index: -1;
}

.homePage .bigImage a:hover::before,
.homePage .col_12 a:hover::before,
.homePage .col_6 a:hover::before,
.homePage .religion a:hover::before {
    transform: scale(1.05);
}

.homePage .bigImage a:hover,
.homePage .col_12 a:hover,
.homePage .col_6 a:hover {
    box-shadow: var(--shadow-md);
}

.homePage a .boxTitle {
    height: 100%;
    padding: 20px;
    background: linear-gradient(180deg, rgb(0 0 0 / 0%) 35%, rgb(0 0 0 / 55%) 65%, rgb(0 0 0 / 85%) 100%);
}

.homePage .tagCatge {
    background: var(--brand-red);
    border-radius: 999px;
    padding: 3px 14px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.homePage .titleLastNews {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgb(0 0 0 / 40%);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.homePage .bigImage .titleLastNews {
    font-size: 26px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
}

/* ---------- بطاقات الأخبار ---------- */

.homePage .CardEconomy {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

/* تساوي ارتفاع البطاقات فقط عندما تكون البطاقة وحدها في العمود،
   حتى لا تدفع الصفوف التي تحتها خارج العمود (قسم صحة) */
.homePage .CardEconomy:only-child {
    height: 100%;
}

.homePage a.CardEconomy:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.homePage .CardEconomy .imgCardEconomy {
    height: auto;
    aspect-ratio: 16 / 10;
    margin-bottom: 0;
}

.homePage .CardEconomy .titleCardEconomy {
    padding: 16px 16px 0;
    margin-bottom: 8px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.homePage a.CardEconomy:hover .titleCardEconomy {
    color: var(--brand-red);
}

.homePage .CardEconomy .dataCardEconomy {
    padding: 0 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.homePage .descriptionCardEconomy {
    padding: 0 16px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-muted);
    text-align: start;
}

.homePage .descriptionCardEconomy > span:first-child {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.homePage .descriptionCardEconomy .readMore,
.homePage .descriptionCardEconomy a {
    display: inline-block;
    color: var(--brand-red);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 0;
}

/* بطاقة "مجتمع" الكبيرة: النص بجانب الصورة بدون إطار مزدوج */
.homePage .technology .cardTechnologyImg {
    height: 100%;
    min-height: 260px;
    border-radius: var(--radius);
    transition: box-shadow .3s var(--ease);
}

.homePage .technology .cardTechnologyImg:hover {
    box-shadow: var(--shadow-md);
}

.homePage .technology .imgCardEconomy {
    height: auto;
}

/* ---------- صفوف الأخبار الصغيرة ---------- */

.homePage .CardEconomy + .CardEconomyRow {
    margin-top: 16px;
}

.homePage .CardEconomyRow {
    padding: 8px;
    margin: 0 -8px 10px;
    border-radius: var(--radius-sm);
    transition: background-color .2s;
}

.homePage .CardEconomyRow:hover {
    background: var(--surface-alt);
}

.homePage .technology .CardEconomyRow:hover {
    background: var(--surface);
}

.homePage .CardEconomyRow .imgRowCardEconomy {
    width: 120px !important;
    height: 80px !important;
    border-radius: var(--radius-sm);
}

.homePage .titleRowCardEconomy {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.homePage .CardEconomyRow:hover .titleRowCardEconomy {
    color: var(--brand-red);
}

.homePage .rowDataCardEconomy,
.homePage .rowDataOpinions_ideas {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ---------- "عالمية": بطاقات بصورة كاملة ---------- */

.homePage .religion a {
    height: 230px;
    border-radius: var(--radius);
    overflow: hidden;
    isolation: isolate;
    transition: box-shadow .3s var(--ease);
}

.homePage .religion a:hover {
    box-shadow: var(--shadow-md);
}

.homePage .religion .religion_boxTitle {
    height: 100%;
    padding: 14px;
    background: linear-gradient(180deg, rgb(0 0 0 / 0%) 30%, rgb(0 0 0 / 85%) 100%);
}

.homePage .religion .religion_titleLastNews {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.homePage .religion .religion_dateLastNews {
    display: block;
    margin-bottom: 0;
    font-size: 12.5px;
    color: rgb(255 255 255 / 80%);
}

/* ---------- "دين": قائمة مرقّمة الشكل ---------- */

.homePage .Opinions_ideasRow {
    background: var(--surface);
    border: 1px solid #e7ebeb;
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 12px;
    transition: border-color .2s, box-shadow .2s;
}

.homePage .Opinions_ideasRow:hover {
    border-color: var(--brand-teal);
    box-shadow: var(--shadow-sm);
}

.homePage .Opinions_ideasRow .imgRowOpinions_ideas {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
}

.homePage .titleRowOpinions_ideas {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- "مجتمع": روابط العناوين ---------- */

.homePage .rowTech {
    justify-content: flex-start;
    text-align: start;
    min-height: 84px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border-right: 4px solid var(--brand-teal);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    transition: box-shadow .2s, color .2s;
}

.homePage .rowTech:hover {
    color: var(--brand-red);
    box-shadow: var(--shadow-md);
}

/* ---------- الشاشات الصغيرة ---------- */

@media (max-width: 991px) {
    .homePage .newsTicker {
        margin-top: -8px;
    }

    .homePage .bigImage a {
        height: 420px;
    }

    .homePage .heroRow .setPaddingLft,
    .homePage .heroRow .setPaddingRit {
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
    }

    .homePage .heroRow .setPaddingMd_Lft { padding-left: calc(var(--hero-gap) / 2); }
    .homePage .heroRow .setPaddingMd_Rit { padding-right: calc(var(--hero-gap) / 2); }

    .homePage .technology .cardTechnologyImg {
        min-height: 230px;
    }
}

@media (max-width: 575px) {
    .homePage .homeSection,
    .homePage .heroRow,
    .homePage .in_depth,
    .homePage .technology {
        margin-bottom: 40px;
    }

    .homePage .in_depth,
    .homePage .technology {
        padding: 36px 0 12px;
    }

    .homePage .heroRow .setPaddingMd_Lft,
    .homePage .heroRow .setPaddingMd_Rit {
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
    }

    .homePage .bigImage a {
        height: 340px;
    }

    .homePage .bigImage .titleLastNews {
        font-size: 20px;
    }

    .homePage .col_12 a,
    .homePage .col_6 a {
        height: 220px;
    }

    .homePage .titleSection span {
        font-size: 19px;
    }

    .homePage .religion a {
        height: 210px;
    }
}

@media (max-width: 575px) {
    .homePage .newsTicker {
        border-radius: var(--radius-sm);
    }

    .homePage .newsTickerLabel {
        padding: 8px 12px;
        font-size: 13px;
    }

    .homePage .newsTickerTrack {
        animation-duration: 45s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .homePage *,
    .homePage *::before,
    .homePage *::after {
        transition: none !important;
        animation: none !important;
    }

    /* بدون حركة: الشريط يصبح قابلاً للتمرير يدوياً */
    .homePage .newsTickerViewport {
        overflow-x: auto;
    }

    .homePage .newsTickerList[aria-hidden="true"] {
        display: none;
    }
}
