/* ═══════════════════════════════════════════════
   شريط «أثرٌ على الأرض» — صفَّان متعاكسان من صور المشاريع المنجزة
   حركة CSS خالصة، بلا أي مكتبة جافاسكربت.
   ═══════════════════════════════════════════════ */

.gallery-strip {
    position: relative;
    background: #fff;
    padding: 64px 0 56px;
    overflow: hidden;
}

/* ── الترويسة ── */
.gs-head {
    text-align: center;
    margin-bottom: 34px;
}
.gs-subtitle {
    color: var(--bs-secondary);
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 12px;
}
.gs-subtitle i {
    margin-inline-end: 8px;
}
.gs-title {
    color: var(--bs-primary);
    font-weight: 800;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    margin: 0 0 12px;
}
.gs-desc {
    color: #6b6b6b;
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.02rem;
    line-height: 1.9;
}

/* ── الصفوف ── */
.gs-rows {
    display: flex;
    flex-direction: column;
    gap: 18px;
    /* اتجاه ثابت للصفوف — في RTL يُدفع المسار الأعرض من الشاشة خارجها يساراً */
    direction: ltr;
    /* تلاشي الحواف حتى تدخل الصور وتخرج بنعومة */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}

.gs-row {
    overflow: hidden;
}

.gs-track {
    display: flex;
    width: max-content;
    gap: 18px;
    will-change: transform;
    animation: gsScroll var(--gs-duration, 60s) linear infinite;
}
.gs-row-reverse .gs-track {
    animation-direction: reverse;
}

@keyframes gsScroll {
    from { transform: translate3d(0, 0, 0); }
    /* نصف المسافة = نسخة واحدة كاملة، والنصف الآخر يواصل بلا قفزة.
       نصف الفجوة يعوّض الفراغ الزائد بين النسختين. */
    to   { transform: translate3d(calc(-50% - 9px), 0, 0); }
}

.gs-row:hover .gs-track,
.gs-track:focus-within,
/* لا تتحرك قبل أن تكتمل الصور */
.gallery-strip:not(.gs-ready) .gs-track {
    animation-play-state: paused;
}

/* ── البطاقة ── */
.gs-item {
    position: relative;
    flex: 0 0 auto;
    width: 268px;
    height: 190px;
    border-radius: 16px;
    overflow: hidden;
    display: block;
    background: #f2ece3;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(92, 23, 49, .07);
    transition: transform .35s ease, box-shadow .35s ease;
}
.gs-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}
.gs-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(90, 25, 50, .82) 0%, rgba(90, 25, 50, .28) 42%, transparent 72%);
    opacity: 0;
    transition: opacity .35s ease;
}
.gs-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(92, 23, 49, .18);
}
.gs-item:hover img {
    transform: scale(1.07);
}
.gs-item:hover::after,
.gs-item:focus-visible::after {
    opacity: 1;
}
.gs-item:focus-visible {
    outline: 3px solid var(--bs-secondary);
    outline-offset: 3px;
}

.gs-caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 2;
    direction: rtl;
    padding: 12px 14px;
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
    /* سطران كحد أقصى */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gs-item:hover .gs-caption,
.gs-item:focus-visible .gs-caption {
    opacity: 1;
    transform: none;
}

/* ── نمط ظهور الاسم (يُضبط من اللوحة) ── */

/* دائماً — تدرّج خفيف يحمل النص من الأسفل دون أن يطمس الصورة،
   وظل النص هو ما يضمن القراءة فوق الصور الفاتحة */
.gs-cap-always .gs-item::after {
    opacity: 1;
    background: linear-gradient(to top,
        rgba(90, 25, 50, .68) 0%,
        rgba(90, 25, 50, .34) 22%,
        rgba(90, 25, 50, .06) 46%,
        transparent 64%);
}
.gs-cap-always .gs-item:hover::after {
    background: linear-gradient(to top,
        rgba(90, 25, 50, .86) 0%,
        rgba(90, 25, 50, .5) 28%,
        rgba(90, 25, 50, .14) 56%,
        transparent 76%);
}
.gs-cap-always .gs-caption {
    opacity: 1;
    transform: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .65), 0 0 14px rgba(0, 0, 0, .4);
}

/* بدون — لا تسمية، والتعتيم عند المرور فقط */
.gs-cap-none .gs-item::after {
    background: linear-gradient(to top, rgba(90, 25, 50, .45), rgba(90, 25, 50, .12));
}

/* ── الزر ── */
.gs-foot {
    text-align: center;
    margin-top: 38px;
}
.gs-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    border-radius: 50px;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}
.gs-btn:hover {
    background: var(--bs-secondary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(214, 152, 50, .32);
}
.gs-btn i {
    transition: transform .3s ease;
}
.gs-btn:hover i {
    transform: translateX(-4px);
}

/* ── الشاشات الصغيرة ── */
@media (max-width: 991px) {
    .gallery-strip { padding: 48px 0 42px; }
    .gs-item { width: 214px; height: 152px; }
    .gs-rows { gap: 14px; }
    .gs-track { gap: 14px; }
    @keyframes gsScroll {
        from { transform: translate3d(0, 0, 0); }
        to   { transform: translate3d(calc(-50% - 7px), 0, 0); }
    }
}
@media (max-width: 575px) {
    .gs-item { width: 168px; height: 120px; border-radius: 13px; }
    .gs-caption { font-size: .82rem; padding: 9px 10px; }
    .gs-head { margin-bottom: 26px; }
}

/* ── احترام تفضيل تقليل الحركة ── */
@media (prefers-reduced-motion: reduce) {
    .gs-track {
        animation: none;
        transform: none;
    }
    .gs-row {
        overflow-x: auto;
        scrollbar-width: thin;
    }
    .gs-item img { transition: none; }
}
