/* AMAJED HOME | Our Partners V1
   Isolated to the public Home page. Other pages and existing slider behavior stay unchanged.
   Uses existing five-column spacing; links are styled on hover/focus.
   Supplied KRUPPS and NEVO logos retain their exact letter shapes; only transparent
   canvas around the user-uploaded marks was cropped for clear rendering.
*/

/* The slim band starts exactly where the hero ends (desktop / medium laptops). */
@media (min-width: 1000px) and (min-height: 620px) {
    body[data-page="home"] #homeHero.hero--partners {
        --amajed-partners-height: clamp(96px, 12.6dvh, 124px);
        height: calc(100svh - var(--amajed-partners-height)) !important;
        height: calc(100dvh - var(--amajed-partners-height)) !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    /* Override the existing later wide-screen safety layer only for this Home hero. */
    body[data-page="home"] #homeHero.hero--partners .hero-grid {
        padding-top: clamp(85px, 10vh, 125px) !important;
        padding-bottom: clamp(42px, 5.8vh, 68px) !important;
    }

    body[data-page="home"] .amajed-partners {
        height: clamp(96px, 12.6dvh, 124px);
        min-height: 0;
        box-sizing: border-box;
    }
}

body[data-page="home"] .amajed-partners {
    position: relative;
    z-index: 1;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    padding: 8px clamp(16px, 3vw, 48px) 7px;
    border-top: 1px solid rgba(0, 191, 235, 0.58);
    background: linear-gradient(90deg, #eefaff 0%, #fff 14%, #fff 86%, #ecf9ff 100%);
    color: #0a213c;
}

body[data-page="home"] .amajed-partners::before,
body[data-page="home"] .amajed-partners::after {
    content: "";
    position: absolute;
    top: 36%;
    width: 48px;
    height: 48px;
    transform: rotate(45deg);
    border-top: 7px solid rgba(7, 171, 223, .055);
    border-right: 7px solid rgba(7, 171, 223, .055);
    pointer-events: none;
}
body[data-page="home"] .amajed-partners::before { left: -26px; }
body[data-page="home"] .amajed-partners::after { right: -26px; transform: rotate(225deg); }

body[data-page="home"] .amajed-partners__inner {
    position: relative;
    z-index: 1;
    height: 100%;
    max-width: 1430px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

body[data-page="home"] .amajed-partners__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .27em;
    margin: 0;
    color: #061c3a;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    direction: ltr;
    font-size: clamp(19px, 1.5vw, 25px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.08;
    text-align: center;
    white-space: nowrap;
}
body[data-page="home"] .amajed-partners__title::before,
body[data-page="home"] .amajed-partners__title::after {
    content: "";
    width: clamp(30px, 6vw, 96px);
    height: 1px;
    margin-inline: clamp(7px, 1.6vw, 20px);
    background: linear-gradient(90deg, rgba(6, 181, 226, .12), #167bac);
}
body[data-page="home"] .amajed-partners__title::after {
    transform: rotate(180deg);
}
body[data-page="home"] .amajed-partners__title strong {
    color: #03afd8;
    font: inherit;
}

/* Arabic label only; preserve all original logo cell dimensions and order. */
body[data-page="home"] .amajed-partners__title[lang="ar"] {
    direction: rtl;
    gap: 0;
    letter-spacing: 0;
}
body[data-page="home"] .amajed-partners__title[lang="ar"] span {
    color: #061c3a;
}

body[data-page="home"] .amajed-partners__rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    justify-items: stretch;
    gap: 0;
    min-height: 58px;
    outline-offset: -2px;
}
body[data-page="home"] .amajed-partners__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 58px;
    padding: 0 clamp(9px, 1.5vw, 26px);
}
body[data-page="home"] .amajed-partners__item + .amajed-partners__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24%;
    height: 52%;
    width: 1px;
    background: rgba(30, 53, 68, .24);
}
body[data-page="home"] .amajed-partners__item img {
    display: block;
    flex: none;
    width: min(100%, 205px);
    max-width: 100%;
    height: 58px;
    object-fit: cover;
    object-position: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* These are static logo marks, so no hover animation or grayscale. */
}
body[data-page="home"] .amajed-partners__item--tnk img {
    width: min(100%, 118px);
    object-fit: contain;
}
body[data-page="home"] .amajed-partners__item--modular img {
    width: min(100%, 200px);
    filter: invert(1);
}
body[data-page="home"] .amajed-partners__item--krupps img {
    width: min(100%, 180px);
    object-fit: contain;
    filter: none;
}
body[data-page="home"] .amajed-partners__item--nevo img {
    width: min(100%, 176px);
    object-fit: contain;
    filter: none;
}
body[data-page="home"] .amajed-partners__item--kastel img {
    width: min(100%, 139px);
    object-fit: contain;
    height: 58px;
}

/* Preserve the existing full-screen Home hero on constrained viewports.
   Partner marks remain one horizontal row, scrollable with touch/keyboard. */
@media (max-width: 999px), (max-height: 619px) {
    body[data-page="home"] .amajed-partners {
        height: auto;
        padding: 12px 0 8px;
    }
    body[data-page="home"] .amajed-partners__title {
        font-size: 21px;
        margin-bottom: 5px;
    }
    body[data-page="home"] .amajed-partners__rail {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0;
        overflow-x: auto;
        max-width: 100%;
        padding: 0 12px 3px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-inline: contain;
    }
    body[data-page="home"] .amajed-partners__item {
        flex: 0 0 157px;
        scroll-snap-align: center;
        height: 61px;
        padding-inline: 12px;
    }
    body[data-page="home"] .amajed-partners__item--kastel img { height: 60px; }
}


/* V2: keep the exact original five cells and their dividers; only their contents
   become interactive. Hover/focus never move the grid track or divider. */
body[data-page="home"] a.amajed-partners__item {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
body[data-page="home"] a.amajed-partners__item:focus-visible {
    outline: none;
}
body[data-page="home"] .amajed-partners__card {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    background-color: transparent;
    transition: background-color .2s ease, border-color .2s ease,
                box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) and (pointer: fine) {
    body[data-page="home"] a.amajed-partners__item:hover .amajed-partners__card {
        background-color: rgba(0, 181, 232, .075);
        border-color: rgba(0, 164, 221, .32);
        box-shadow: 0 4px 13px rgba(9, 42, 60, .10);
        transform: translateY(-1px);
    }
}
body[data-page="home"] a.amajed-partners__item:focus-visible .amajed-partners__card {
    border-color: #007ca7;
    background-color: rgba(0, 181, 232, .09);
    box-shadow: 0 0 0 2px #007ca7;
}
body[data-page="home"] a.amajed-partners__item:active .amajed-partners__card {
    background-color: rgba(0, 181, 232, .14);
}
@media (prefers-reduced-motion: reduce) {
    body[data-page="home"] .amajed-partners__card { transition: none; transform: none !important; }
}
