/* ==========================================================================
   "Our previous works" showcase
   resources/views/website/includes/sections/works-showcase.blade.php
   Used on home, service details, blog details and offers pages.
   Every class is prefixed with "ws" so nothing leaks into the rest of the page.
   Logical properties keep Arabic (RTL) and English (LTR) mirrored.
   ========================================================================== */

.ws {
    --ws-primary: #421f61;
    --ws-violet: #6b3a93;
    --ws-deeper: #24103a;
    --ws-accent: #dea8e4;
    --ws-soft: #f7f2fa;
    --ws-muted: rgba(66, 31, 97, 0.75);

    position: relative;
    padding-block: clamp(64px, 8vw, 112px);
    background:
        radial-gradient(circle at 85% 0%, rgba(222, 168, 228, 0.16), transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(107, 58, 147, 0.35), transparent 45%),
        var(--ws-deeper);
    overflow: hidden;
    scroll-margin-top: 150px;
}

/* ---------- head ---------- */

.ws__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: clamp(28px, 4vw, 44px);
}

.ws__intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 100%;
    align-items: center;
    text-align: center;
}

.ws-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--ws-accent);
    font-size: 13px;
    font-weight: 700;
}

.ws-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ws-title {
    color: #fff;
    font-weight: 800;
    font-size: clamp(26px, 3.4vw, 42px);
    line-height: 1.35;
    margin: 0;
}

.ws-lead {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(15px, 1.3vw, 17px);
    line-height: 1.9;
    margin: 0;
    max-width: 720px;
}

/* ---------- buttons & small parts ---------- */

.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 26px;
    border-radius: 14px;
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.ws-btn:hover {
    transform: translateY(-2px);
}

.ws-btn--ghost {
    background: transparent;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.45);
}

.ws-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.ws-btn--light {
    background: #fff;
    color: var(--ws-primary) !important;
    border-color: #fff;
}

.ws-btn--light:hover {
    background: var(--ws-accent);
    border-color: var(--ws-accent);
}

.ws__all {
    display: none;
}

.ws__all--bottom {
    display: flex;
    width: fit-content;
    margin: 28px auto 0;
}

html[dir="ltr"] .ws-flip {
    transform: scaleX(-1);
}

.ws-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(222, 168, 228, 0.18);
    color: var(--ws-accent);
    font-size: 12px;
    font-weight: 700;
}

.ws-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.ws-link i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.ws-link--dark {
    color: var(--ws-primary);
}

.ws-featured:hover .ws-link i,
.ws-project:hover .ws-link i {
    transform: translateX(-4px);
}

html[dir="ltr"] .ws-featured:hover .ws-link i,
html[dir="ltr"] .ws-project:hover .ws-link i {
    transform: scaleX(-1) translateX(-4px);
}

.ws a:focus-visible {
    outline: 3px solid var(--ws-accent);
    outline-offset: 3px;
}

/* ---------- featured project ---------- */

.ws-featured {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 24px;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-decoration: none;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.ws-featured:hover {
    border-color: rgba(222, 168, 228, 0.55);
    transform: translateY(-4px);
}

.ws-featured__media {
    position: relative;
    overflow: hidden;
    min-height: 240px;
    background: rgba(255, 255, 255, 0.05);
}

.ws-featured__media img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ws-featured:hover .ws-featured__media img {
    transform: scale(1.05);
}

.ws-featured__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(24px, 3.5vw, 44px);
    text-align: start;
}

.ws-featured__title {
    color: #fff;
    font-weight: 800;
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.4;
    margin: 0;
}

.ws-featured__text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15.5px;
    line-height: 1.9;
    margin: 0;
}

.ws-featured__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 8px;
}

.ws-featured__meta div {
    min-width: 110px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ws-featured__meta dt {
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 600;
}

.ws-featured__meta dd {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- project cards ---------- */

.ws__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -16px;
    padding: 0 16px 12px;
    scrollbar-width: none;
}

.ws__grid::-webkit-scrollbar {
    display: none;
}

.ws-project {
    display: flex;
    flex-direction: column;
    scroll-snap-align: center;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 16px 36px rgba(10, 3, 20, 0.35);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.ws-project:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(10, 3, 20, 0.5);
}

.ws-project__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ws-soft);
}

.ws-project__media > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ws-project:hover .ws-project__media > img {
    transform: scale(1.07);
}

.ws-project__year {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(36, 16, 58, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ws-project__body {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 24px 20px 22px;
    text-align: start;
}

.ws-project__logo {
    position: absolute;
    top: -26px;
    inset-inline-end: 18px;
    z-index: 1;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 18px rgba(66, 31, 97, 0.2);
}

.ws-project__logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.ws-project__industry {
    color: var(--ws-violet);
    font-size: 12px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ws-project__title {
    color: var(--ws-primary);
    font-weight: 800;
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
}

.ws-project__text {
    color: var(--ws-muted);
    font-size: 14px;
    line-height: 1.8;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* closing call-to-action card */
.ws-project--cta {
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px 24px;
    text-align: center;
    background:
        radial-gradient(circle at 100% 0%, rgba(222, 168, 228, 0.35), transparent 55%),
        linear-gradient(135deg, var(--ws-violet), var(--ws-primary));
    border: 1px dashed rgba(255, 255, 255, 0.35);
}

.ws-project--cta .ws-project__title {
    color: #fff;
    font-size: 21px;
}

.ws-project--cta .ws-project__text {
    color: rgba(255, 255, 255, 0.85);
    -webkit-line-clamp: 3;
}

.ws-project__cta-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 30px;
    animation: ws-pulse 2.4s ease-in-out infinite;
}

@keyframes ws-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
    50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

/* ---------- breakpoints ---------- */

@media (min-width: 768px) {
    .ws__grid {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
        overflow: visible;
        margin-inline: 0;
        padding: 0;
    }

    .ws-featured {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .ws-featured__media img {
        aspect-ratio: auto;
        min-height: 100%;
    }
}

@media (min-width: 1024px) {
    .ws__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 26px;
    }

    .ws__intro {
        flex: 1 1 auto;
        align-items: flex-start;
        text-align: start;
    }

    .ws__all {
        display: inline-flex;
    }

    .ws__all--bottom {
        display: none;
    }
}

@media (max-width: 480px) {
    .ws__all--bottom {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ws-featured, .ws-featured img, .ws-project, .ws-project img, .ws-btn, .ws-link i {
        transition: none !important;
    }

    .ws-project__cta-icon {
        animation: none;
    }
}
