/* ==============================================================
   home_carousels.css  —  كاروسيل المقالات والأخبار (الصفحة الرئيسية)
   ألوان الموقع فقط: #1a365d (أساسي) / #c59d5f (ذهبي).
   تصميم متجاوب بلا أي تمرير أفقي.
   ============================================================== */

.hc {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.hc-viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;            /* مهم: يمنع تمدّد الفليكس وتجاوز العرض */
    overflow: hidden;
}

.hc-track {
    display: flex;
    transition: transform .45s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .hc-track { transition: none; }
}

.hc-page {
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(var(--pv, 3), minmax(0, 1fr));
    gap: 1.25rem;
    padding: 6px 4px;       /* مساحة لظلال البطاقات */
}

/* ---------- البطاقة ---------- */
.hc-card {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(26, 54, 93, .06);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
    min-width: 0;
    outline: none;
}
.hc-card:hover,
.hc-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(26, 54, 93, .14);
}
.hc-card:focus-visible { box-shadow: 0 0 0 3px rgba(197, 157, 95, .55); }

.hc-spacer {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

.hc-card-media {
    position: relative;
    height: 172px;
    background: linear-gradient(135deg, #1a365d 0%, #24487a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .85);
    font-size: 2.6rem;
}
.hc-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hc-card-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.hc-card-date {
    color: #8a94a6;
    font-size: .78rem;
    margin-bottom: 6px;
}
.hc-card-title {
    color: #1a365d;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hc-card-excerpt {
    color: #54606f;
    font-size: .9rem;
    line-height: 1.8;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hc-card-more {
    margin-top: auto;
    color: #c59d5f;
    font-weight: 700;
    font-size: .85rem;
}
.hc-card-more i { font-size: .75rem; }

/* ---------- أزرار التنقل ---------- */
.hc-nav {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid #e2e7ee;
    background: #fff;
    color: #1a365d;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 54, 93, .08);
    transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.hc-nav:hover:not(:disabled) { background: #c59d5f; color: #fff; border-color: #c59d5f; }
.hc-nav:disabled { opacity: .35; cursor: default; }
.hc-nav.hc-hidden { visibility: hidden; }

/* ---------- حالات فارغة/خطأ ---------- */
.hc-empty {
    flex: 0 0 100%;
    text-align: center;
    color: #8a94a6;
    padding: 30px 10px;
    font-size: .95rem;
}
.hc-empty--err { color: #c0392b; }

/* ---------- الجوال ---------- */
@media (max-width: 640px) {
    .hc { gap: 6px; }
    .hc-nav { width: 38px; height: 38px; font-size: .9rem; }
    .hc-card-media { height: 156px; }
    .hc-page { gap: 1rem; }
}
