/* ------------------------------------------------------------------ */
/* Our Contracts                                                        */
/*                                                                      */
/* Only the parts this page adds on top of style.css: the figure cards, */
/* the search + filter bar, the category tabs and the directory grid.   */
/* Everything is written with logical properties so the Arabic build    */
/* mirrors without a single override in rtl.css.                        */
/* ------------------------------------------------------------------ */

.contracts-intro {
    padding: clamp(40px, 4vw, 72px) 0 clamp(24px, 2.4vw, 40px);
}

.contracts-intro__text {
    max-width: 980px;
    margin-top: clamp(14px, 1.4vw, 24px);
    font-size: var(--fs-sub);
    line-height: 1.8;
    color: var(--text);
}

    .contracts-intro__text > p:last-child {
        margin-bottom: 0;
    }

/* ---- figure cards ------------------------------------------------- */

.figure-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(12px, 1.2vw, 22px);
    margin: clamp(28px, 2.8vw, 48px) 0 0;
    padding: 0;
    list-style: none;
}

.figure-card {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.1vw, 20px);
    padding: clamp(18px, 1.7vw, 30px) clamp(16px, 1.6vw, 28px);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 8px 26px rgba(31, 49, 99, .07);
}

.figure-card__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: clamp(44px, 3.1vw, 56px);
    height: clamp(44px, 3.1vw, 56px);
    border-radius: 50%;
    background: #E7F3EE;
    color: #1a906e;
    font-size: clamp(17px, 1.25vw, 23px);
}

    .figure-card__icon img {
        width: 55%;
        height: auto;
        margin: auto;
    }

.figure-card strong {
    display: block;
    font-size: clamp(26px, 2.2vw, 40px);
    font-weight: 700;
    line-height: 1.1;
    color: var(--heading);
}

.figure-card span {
    font-size: clamp(13px, 1vw, 17px);
    color: var(--text-soft);
}

/* ---- search + filters --------------------------------------------- */

.contracts-directory {
    padding: 0 0 var(--section-gap);
}

.contracts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(10px, 1vw, 18px);
    padding: clamp(14px, 1.3vw, 24px);
    border-radius: 18px;
    background: #F5F6FA;
}

.contracts-search {
    position: relative;
    flex: 1 1 320px;
    display: flex;
    align-items: center;
}

    .contracts-search i {
        position: absolute;
        inset-inline-start: clamp(16px, 1.3vw, 22px);
        color: var(--text-soft);
        font-size: .95em;
        pointer-events: none;
    }

.contracts-search__input {
    width: 100%;
    padding: clamp(11px, 1vw, 16px) clamp(16px, 1.3vw, 22px);
    padding-inline-start: clamp(42px, 3.2vw, 54px);
    border: 0;
    border-radius: 999px;
    background: var(--white);
    font: inherit;
    font-size: clamp(14px, 1.05vw, 17px);
    color: var(--text);
}

    .contracts-search__input::placeholder {
        color: var(--text-soft);
    }

    .contracts-search__input:focus-visible {
        outline: 2px solid var(--navy);
        outline-offset: 2px;
    }

.contracts-select {
    position: relative;
    flex: 0 1 260px;
    display: flex;
}

    /* The chevron is drawn as a background so the control keeps one box;
   `inset-inline` cannot be used on a background, so the position flips
   with the `dir` rule at the end of this file instead. */
    .contracts-select select {
        width: 100%;
        padding: clamp(11px, 1vw, 16px) clamp(16px, 1.3vw, 22px);
        padding-inline-end: clamp(40px, 3vw, 50px);
        border: 0;
        border-radius: 999px;
        background-color: var(--white);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23141C38' stroke-width='1.6' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: 12px 8px;
        background-position: right clamp(16px, 1.3vw, 22px) center;
        font: inherit;
        font-size: clamp(14px, 1.05vw, 17px);
        color: var(--text);
        appearance: none;
        cursor: pointer;
    }

        .contracts-select select:focus-visible {
            outline: 2px solid var(--navy);
            outline-offset: 2px;
        }

/* ---- category tabs ------------------------------------------------ */

.contracts-tabs {
    display: flex;
    gap: clamp(20px, 2.2vw, 44px);
    margin-top: clamp(26px, 2.6vw, 46px);
    border-bottom: 1px solid #D9DCE6;
    overflow-x: auto;
    scrollbar-width: none;
}

    .contracts-tabs::-webkit-scrollbar {
        display: none;
    }

.contracts-tab {
    flex-shrink: 0;
    padding: 0 0 clamp(10px, 1vw, 16px);
    border: 0;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    background: none;
    font: inherit;
    font-size: clamp(14px, 1.1vw, 19px);
    color: var(--text-soft);
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

    .contracts-tab:hover {
        color: var(--heading);
    }

    .contracts-tab.is-active {
        border-bottom-color: #1a906e;
        font-weight: 700;
        color: var(--heading);
    }

/* ---- directory grid ----------------------------------------------- */

.contracts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(14px, 1.4vw, 26px);
    margin-top: clamp(24px, 2.4vw, 42px);
}

.contract-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, .8vw, 14px);
    padding: clamp(20px, 2vw, 36px) clamp(14px, 1.4vw, 24px);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 8px 26px rgba(31, 49, 99, .07);
    text-align: center;
}

.contract-card__logo {
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(86px, 7vw, 124px);
}

    .contract-card__logo img {
        max-width: 76%;
        max-height: 100%;
        object-fit: contain;
    }

.contract-card__name {
    font-size: clamp(15px, 1.2vw, 21px);
    font-weight: 700;
    color: var(--heading);
}

    .contract-card__name a {
        color: inherit;
        text-decoration: none;
    }

        .contract-card__name a:hover {
            text-decoration: underline;
        }

.contract-card__type {
    font-size: clamp(12px, .95vw, 16px);
    color: var(--text-soft);
}

.contract-card__status {
    padding: clamp(6px, .55vw, 10px) clamp(16px, 1.4vw, 26px);
    border-radius: 999px;
    font-size: clamp(12px, .95vw, 16px);
}

.active_status {
    background: #E7F3EE;
    color: #1a906e;
}

.inactive_status {
    background: #E7F3EE;
    color: #C67676;
}

.contracts-empty {
    margin-top: clamp(24px, 2.4vw, 42px);
    font-size: var(--fs-sub);
    color: var(--text-soft);
    text-align: center;
}

/* ---- RTL ----------------------------------------------------------- */

/* `background-position` has no logical form, so the select's chevron is
   the one thing on this page that has to be mirrored by hand. */
[dir="rtl"] .contracts-select select {
    background-position: left clamp(16px, 1.3vw, 22px) center;
}

/* "60+" ends in a neutral character, which an RTL context reorders to
   the front as "+60". The figure keeps its own LTR direction so the
   digits and the plus stay in the written order. */
[dir="rtl"] .figure-card strong {
    unicode-bidi: isolate;
    direction: ltr;
    text-align: right;
}

/* ---- responsive ---------------------------------------------------- */

@media (max-width: 1199.98px) {
    .figure-cards,
    .contracts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767.98px) {
    .figure-cards,
    .contracts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 479.98px) {
    .figure-cards,
    .contracts-grid {
        grid-template-columns: 1fr;
    }

    .contracts-select {
        flex-basis: 100%;
    }
}
