/*==================================================
 AL FAJR FOUNDATION
 PROJECTS SECTION — FINAL PREMIUM VERSION
==================================================*/


/*=========================================
 SECTION BASE
=========================================*/

.projects-section {
    position: relative;
    overflow: hidden;
    padding: 48px 0 52px;
    background: linear-gradient(
        160deg,
        #fffefb 0%,
        #fdf9f0 45%,
        #f5f0e2 100%
    );
    scroll-margin-top: 100px;
}


/*=========================================
 AMBIENT LIGHT ORBS
=========================================*/

.projects-light {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(70px);
}

.projects-light.one {
    width: 600px;
    height: 600px;
    left: -220px;
    top: -160px;
    background: rgba(212, 175, 55, .10);
}

.projects-light.two {
    width: 480px;
    height: 480px;
    right: -160px;
    bottom: -120px;
    background: rgba(6, 20, 45, .06);
}


/*=========================================
 SECTION HEADING OVERRIDE (scoped — projects only)
=========================================*/

/* Reduce h2 size so the section fits in one screen */
.projects-section .section-heading {
    margin-bottom: 0;
}

.projects-section .section-subtitle {
    margin-bottom: 10px;
}

.projects-section .section-heading h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    line-height: 1.2;
}

.projects-section .heading-divider {
    margin: 14px auto;
}

.projects-section .section-heading p {
    font-size: .93rem;
    line-height: 1.55;
    max-width: 560px;
}


/*=========================================
 FUTURE-READY TOOLBAR
 (hidden until categories/filters exist)
=========================================*/

.projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 36px;
    padding: 0 4px;
}

.projects-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.projects-pagination-slot {
    margin-left: auto;
}


/*=========================================
 PROJECT GRID
=========================================*/

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 20px;
    align-items: stretch;
}

/* When grid contains only the empty state, center it */
.projects-grid:has(.projects-empty-state) {
    display: flex;
    justify-content: center;
    align-items: center;
}


/*=========================================
 PROJECT CARD — Equal-height Flexbox
=========================================*/

.project-card {
    position: relative;
    display: flex;
    flex-direction: column; /* stack image → content vertically */
    overflow: hidden;
    border-radius: 28px;
    background: #FFFEF7;
    border: 1px solid rgba(212, 175, 55, .18);
    box-shadow: 0 8px 32px rgba(7, 26, 54, .07);
    transition:
        transform .35s cubic-bezier(.165, .84, .44, 1),
        box-shadow .35s cubic-bezier(.165, .84, .44, 1),
        border-color .35s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, .42);
    box-shadow: 0 24px 60px rgba(7, 26, 54, .12),
                0  4px 16px rgba(212, 175, 55, .12);
}


/*=========================================
 SHINE SWEEP (hover)
=========================================*/

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, .45),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0s;
}

.project-card:hover::after {
    animation: projectShine 1s ease forwards;
}


/*=========================================
 IMAGE AREA
=========================================*/

.project-image {
    position: relative;
    overflow: hidden;
    height: 260px;
    flex-shrink: 0; /* never compress image */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #FAF5EB;
    display: block;
    transition:
        transform .4s cubic-bezier(.165, .84, .44, 1),
        filter .4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
    filter: brightness(1.04) saturate(108%);
}

/* Dark overlay — deepens on hover */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(6, 20, 45, .60) 0%,
        rgba(6, 20, 45, .02) 60%
    );
    transition: opacity .35s ease;
    opacity: 1;
}

.project-card:hover .project-overlay {
    opacity: .85;
}


/*=========================================
 CARD CONTENT — flex grow so cards are equal height
=========================================*/

.project-content {
    display: flex;
    flex-direction: column;
    flex: 1; /* grow to fill remaining card height */
    padding: 28px 30px 24px;
    gap: 0;
}


/*=========================================
 STATUS BADGE
=========================================*/

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    width: fit-content;
    margin-bottom: 16px;
}

/* Colour variants */
.project-status-badge.status--completed {
    background: rgba(34, 197, 94, .12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, .25);
}

.project-status-badge.status--ongoing {
    background: rgba(212, 175, 55, .12);
    color: #b8911f;
    border: 1px solid rgba(212, 175, 55, .30);
}

.project-status-badge.status--planned {
    background: rgba(99, 102, 241, .10);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, .22);
}

.project-status-badge.status--default {
    background: rgba(107, 114, 128, .10);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, .20);
}


/*=========================================
 TITLE
=========================================*/

.project-title {
    margin: 0 0 12px;
    font-family: "Playfair Display", serif;
    font-size: 1.45rem;
    line-height: 1.3;
    color: var(--navy);
    font-weight: 700;
    transition: color .3s ease;
}

.project-card:hover .project-title {
    color: #8B6A14;
}


/*=========================================
 DESCRIPTION
=========================================*/

.project-description {
    margin: 0;
    color: #6B6254;
    line-height: 1.75;
    font-size: .96rem;
}


/*=========================================
 SPACER — pushes footer to card bottom
=========================================*/

.project-content-spacer {
    flex: 1;
    min-height: 20px;
}


/*=========================================
 CARD FOOTER
=========================================*/

.project-footer {
    display: flex;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, .14);
}


/*=========================================
 LEARN MORE LINK
=========================================*/

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .03em;
    color: var(--navy);
    transition: color .3s ease, gap .3s ease;
}

.project-link i {
    font-size: .85rem;
    transition: transform .3s cubic-bezier(.165, .84, .44, 1);
}

.project-card:hover .project-link {
    color: #B8911F;
    gap: 14px;
}

.project-card:hover .project-link i {
    transform: translateX(5px);
}


/*=========================================
 PREMIUM EMPTY STATE
=========================================*/

.projects-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 40px;
    background: #FFFEF7;
    border: 1px solid rgba(212, 175, 55, .22);
    border-left: 3px solid rgba(201, 162, 39, .45);
    border-radius: 24px;
    box-shadow: 0 6px 28px rgba(7, 26, 54, .06);
    width: 100%;
    max-width: 580px;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 39, .10);
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 12px;
    border: 1px solid rgba(201, 162, 39, .18);
}

.empty-state-title {
    margin: 0 0 8px;
    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
    color: var(--navy);
    font-weight: 700;
}

.empty-state-body {
    margin: 0 0 16px;
    font-size: .88rem;
    line-height: 1.65;
    color: #6B6254;
    max-width: 400px;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), #E5C768);
    color: var(--navy);
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(212, 175, 55, .30);
    transition: transform .3s ease, box-shadow .3s ease;
}

.empty-state-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(212, 175, 55, .40);
}


/*=========================================
 PREMIUM CTA BLOCK
=========================================*/

.projects-cta {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 36px;
    margin-top: 24px;
    padding: 32px 44px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--navy) 0%, #0b2247 100%);
    box-shadow: 0 28px 70px rgba(6, 20, 45, .22);
    overflow: hidden;
}

/* Gold glow orb */
.projects-cta-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    right: -160px;
    top: -140px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(212, 175, 55, .22),
        transparent 70%
    );
    filter: blur(28px);
    pointer-events: none;
}

.projects-cta-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.projects-cta-subtitle {
    display: inline-block;
    margin-bottom: 14px;
    color: #f4d777;
    font-size: .80rem;
    font-weight: 700;
    letter-spacing: .28em;
}

.projects-cta h3 {
    margin: 0 0 12px;
    color: #ffffff;
    font-family: "Playfair Display", serif;
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    line-height: 1.3;
    font-weight: 700;
}

.projects-cta p {
    margin: 0;
    color: rgba(255, 255, 255, .80);
    line-height: 1.65;
    font-size: .92rem;
}

/* CTA Actions */
.projects-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.projects-cta-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    padding: 15px 32px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .92rem;
    transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
    text-align: center;
    white-space: nowrap;
    min-width: 200px;
}

/* Gold primary */
.projects-cta-actions .btn-primary {
    background: linear-gradient(135deg, var(--gold), #E5C768);
    color: var(--navy);
    box-shadow: 0 8px 24px rgba(212, 175, 55, .35);
}

.projects-cta-actions .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(212, 175, 55, .48);
}

/* Outlined secondary */
.projects-cta-actions .btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, .48);
}

.projects-cta-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .85);
    transform: translateY(-3px);
}


/*=========================================
 KEYFRAMES
=========================================*/

@keyframes projectShine {
    from { left: -120%; }
    to   { left: 170%;  }
}

@keyframes projectFade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/*=========================================
 CARD ENTRANCE ANIMATION
=========================================*/

.project-card {
    opacity: 0;
    animation: projectFade .7s ease forwards;
}

.project-card:nth-child(1) { animation-delay: .10s; }
.project-card:nth-child(2) { animation-delay: .22s; }
.project-card:nth-child(3) { animation-delay: .34s; }
.project-card:nth-child(4) { animation-delay: .46s; }
.project-card:nth-child(5) { animation-delay: .58s; }
.project-card:nth-child(6) { animation-delay: .70s; }


/*=========================================
 RESPONSIVE — Tablet (≤900px)
=========================================*/

@media (max-width: 900px) {

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 40px;
    }

    .projects-cta {
        flex-direction: column;
        text-align: center;
        padding: 48px 36px;
    }

    .projects-cta-actions {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    .projects-cta-glow {
        right: -100px;
        top: -100px;
    }

}


/*=========================================
 RESPONSIVE — Mobile (≤600px)
=========================================*/

@media (max-width: 600px) {

    .projects-section {
        padding: 52px 0 60px;
    }

    .project-image {
        height: 220px;
    }

    .project-content {
        padding: 22px 22px 18px;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .projects-cta {
        padding: 38px 24px;
        border-radius: 24px;
    }

    .projects-cta h3 {
        font-size: 1.6rem;
    }

    .projects-cta-actions a {
        padding: 14px 24px;
        min-width: unset;
        width: 100%;
    }

}


/*=========================================
 RESPONSIVE — Small Mobile (≤380px)
=========================================*/

@media (max-width: 380px) {

    .project-title {
        font-size: 1.15rem;
    }

    .project-description {
        font-size: .90rem;
    }

}