body {
    margin: 0;
    background: #fff;
    color: var(--ag-ink, #15242b);
    font-family: "Segoe UI", sans-serif;
}

/* LANGUAGE SWITCH, HEADER, HERO, FOOTER, NAV TOGGLE and RESPONSIVE HEADER
   behaviour all come from css/sabic-inspired.css so this page matches the
   rest of the site exactly. Only the projects-specific grid/card/modal
   styling lives here. */

/* PROJECTS GRID — 4 per row on desktop, with 3D card treatment */
.projects-grid {
    max-width: 1380px;
    margin: 0 auto;
    padding: 72px clamp(22px, 5vw, 68px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    background: #fff;
}

.project-card {
    position: relative;
    background: #fff;
    color: var(--ag-ink, #15242b);
    border: 1px solid var(--ag-line, #dbe4e8);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(20, 52, 62, .06), 0 14px 30px rgba(20, 52, 62, .10);
    overflow: hidden;
    cursor: pointer;
    transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .45s cubic-bezier(.22, .61, .36, 1), border-color .45s ease;
}

.project-card:before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--ag-green, #007a4d), var(--ag-teal, #00a6a6), var(--ag-blue, #1675b9));
    z-index: 1;
}

.project-card:hover {
    transform: perspective(900px) rotateX(4deg) translateY(-12px) scale(1.02);
    box-shadow: 0 10px 20px rgba(20, 52, 62, .14), 0 34px 60px rgba(20, 52, 62, .24);
    border-color: #b9d1d8;
}

.project-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: var(--ag-soft, #f2f6f7);
}

.project-info {
    padding: 20px 20px 24px;
}

.project-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ag-ink, #15242b);
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-category {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ag-green, #007a4d);
    background: var(--ag-soft, #f2f6f7);
    border: 1px solid var(--ag-line, #dbe4e8);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.project-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--ag-muted, #65757d);
    margin-bottom: 10px;
}

.project-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ag-muted, #65757d);
}

/* POPUP MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 28, 35, .78);
    backdrop-filter: blur(7px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.hidden {
    display: none;
}

.modal-content {
    position: relative;
    width: 650px;
    background: #fff;
    color: var(--ag-ink, #15242b);
    border: 0;
    border-top: 7px solid var(--ag-green, #007a4d);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 25, 35, .28);
    padding-bottom: 30px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--ag-soft, #f2f6f7);
}

.modal-content h2 {
    padding: 20px 25px 5px;
    color: var(--ag-ink, #15242b);
    text-align: center;
}

.modal-category,
.modal-year {
    padding: 0 25px;
    color: var(--ag-muted, #65757d);
    font-size: 14px;
    text-align: center;
    margin: 4px 0;
}

.modal-content p {
    padding: 20px 25px;
    line-height: 1.7;
    font-size: 17px;
    text-align: center;
    color: var(--ag-muted, #65757d);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--ag-green, #007a4d);
    font-size: 32px;
    cursor: pointer;
    z-index: 2;
}

/* RTL SUPPORT */
body.rtl .project-card,
body.rtl .modal-content {
    text-align: center;
}

/* RESPONSIVE */
@media (max-width: 1180px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 860px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 50px 20px;
    }
}

@media (max-width: 560px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 90%;
    }
}
