/* =============================================================================
   Aamal Aljoud — Auctions (AUC-P2)
   -----------------------------------------------------------------------------
   The page is the homepage's auction block given a room of its own: the same
   light, photographic language — a real picture behind a white wash, the
   platform mark sitting straight on it — at the scale a whole page allows.

   The gateway card itself is the shared component, untouched. Everything here
   is a wrapper or a modifier around it.

   Scope: loaded by /mazadat only.
   ========================================================================== */

/* ============================================================== 0. MOTION = */

/*
 * Reveals are opt in — the marker class is set by a one line script in the
 * head, so with JavaScript disabled nothing is ever hidden. Reduced motion
 * opts out again, and both paths end at the same painted result.
 */
.aj-motion [data-aj-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 620ms var(--aj-ease), transform 620ms var(--aj-ease);
}

.aj-motion [data-aj-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .aj-motion [data-aj-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================================ 1. SHARED === */

.aj-auc-eyebrow {
    display: block;
    margin-block-end: var(--aj-space-2);
    color: var(--aj-accent);
    font-size: var(--aj-fs-caption);
    font-weight: var(--aj-fw-bold);
    letter-spacing: 0.08em;
}

.aj-auc-title {
    margin: 0;
    color: var(--aj-text);
    font-size: var(--aj-fs-h2);
    font-weight: var(--aj-fw-bold);
    line-height: var(--aj-lh-tight);
    letter-spacing: var(--aj-ls-tight);
}

.aj-auc-head {
    margin-block-end: var(--aj-space-8);
}

/* ================================================================ 2. HERO = */

/*
 * Image led and light: the company's own photograph carries the block, held
 * far back under a near white wash so the type stays charcoal on light rather
 * than white on a dark overlay.
 */
.aj-auc-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(3rem, 2rem + 5vw, 6rem);
    background-color: var(--aj-surface-muted);
    border-block-end: 1px solid var(--aj-border);
}

.aj-auc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: var(--aj-auc-hero-bg, none);
    background-size: cover;
    /* a different crop from the gateway below, so the same file does not read
       as the same picture twice */
    background-position: center 28%;
}

/* the wash: heavier on the reading edge, thinner where the picture shows */
.aj-auc-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(
            to left,
            rgba(255, 255, 255, 0.985) 0%,
            rgba(255, 255, 255, 0.95) 44%,
            rgba(255, 255, 255, 0.8) 100%
        );
}

.aj-auc-hero__copy {
    max-inline-size: 46rem;
}

.aj-auc-hero__copy .aj-breadcrumb {
    margin-block-end: var(--aj-space-4);
}

.aj-auc-hero__title {
    margin: 0;
    color: var(--aj-text);
    font-size: var(--aj-fs-h1);
    font-weight: var(--aj-fw-bold);
    line-height: var(--aj-lh-tight);
    letter-spacing: var(--aj-ls-tight);
}

.aj-auc-hero__lead {
    margin-block: var(--aj-space-4) var(--aj-space-6);
    max-inline-size: 52ch;
    color: var(--aj-text-secondary);
    font-size: var(--aj-fs-body-lg);
    line-height: var(--aj-lh-normal);
}

/* ============================================================ 3. GATEWAYS = */

.aj-auc-gateways {
    padding-block: var(--aj-section-y);
}

.aj-auc-gateways__list {
    display: grid;
    gap: clamp(var(--aj-space-6), 2.5vw, var(--aj-space-10));
}

/*
 * Each gateway takes the full width of the page rather than half of it, and
 * the two alternate which side carries the photograph — the shared component's
 * own grid, addressed from here so the component itself stays untouched.
 */
.aj-auc-gateway .aj-auction-card__visual {
    min-block-size: clamp(260px, 26vw, 380px);
}

.aj-auc-gateway .aj-auction-card__logo {
    block-size: clamp(120px, 12vw, 168px);
    inline-size: min(300px, 74%);
    transition: transform var(--aj-duration-slow) var(--aj-ease);
}

.aj-auc-gateway .aj-auction-card__body {
    gap: var(--aj-space-4);
    padding: clamp(var(--aj-space-8), 4vw, var(--aj-space-16));
}

.aj-auc-gateway .aj-auction-card__text {
    max-inline-size: 44ch;
    font-size: var(--aj-fs-body-lg);
    line-height: var(--aj-lh-normal);
}

/* the second gateway mirrors the first, so the two read as a pair — the track
   sizes swap with the columns, or the mirrored picture would come out wider */
.aj-auc-gateway--flip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.aj-auc-gateway--flip .aj-auction-card__visual {
    grid-column: 1;
}

.aj-auc-gateway--flip .aj-auction-card__body {
    grid-column: 2;
}

/* ---- restrained life: the picture breathes, the mark lifts a little ---- */

.aj-auc-gateway .aj-auction-card__visual {
    background-size: cover;
    transition: background-size var(--aj-duration-slow) var(--aj-ease);
}

.aj-auc-gateway:hover .aj-auction-card__visual {
    background-size: 106%;
}

.aj-auc-gateway:hover .aj-auction-card__logo {
    transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {

    .aj-auc-gateway .aj-auction-card__visual,
    .aj-auc-gateway .aj-auction-card__logo {
        transition: none;
    }

    .aj-auc-gateway:hover .aj-auction-card__visual {
        background-size: cover;
    }

    .aj-auc-gateway:hover .aj-auction-card__logo {
        transform: none;
    }
}

/* ============================================================= 4. NOTES === */

/*
 * Three short lines about the channels themselves — no count, no timing, no
 * operational claim the site cannot stand behind.
 */
.aj-auc-notes {
    padding-block: calc(var(--aj-section-y) * 0.7);
    border-block-start: 1px solid var(--aj-divider);
}

.aj-auc-notes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: clamp(var(--aj-space-5), 2vw, var(--aj-space-8));
}

.aj-auc-note__icon {
    display: grid;
    place-items: center;
    inline-size: 46px;
    block-size: 46px;
    margin-block-end: var(--aj-space-4);
    border-radius: var(--aj-radius-md);
    background: var(--aj-accent-soft);
    color: var(--aj-accent);
}

.aj-auc-note__title {
    margin: 0 0 var(--aj-space-2);
    color: var(--aj-text);
    font-size: var(--aj-fs-h4);
    font-weight: var(--aj-fw-bold);
}

.aj-auc-note__text {
    margin: 0;
    max-inline-size: 38ch;
    color: var(--aj-text-secondary);
    font-size: var(--aj-fs-sm);
    line-height: var(--aj-lh-normal);
}

/* =============================================================== 6. CTA === */

/*
 * Light rather than a heavy dark band: a tinted surface with the motif behind
 * it, so the page closes without stacking a second dark block on the footer.
 */
.aj-auc-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
    background: var(--aj-accent-soft);
    border-block-start: 1px solid var(--aj-accent-border);
}

.aj-auc-cta__motif {
    position: absolute;
    inset-block-start: -30%;
    inset-inline-start: -3%;
    z-index: -1;
    inline-size: clamp(240px, 28vw, 420px);
    block-size: clamp(240px, 28vw, 420px);
    background: var(--aj-motif) center / contain no-repeat;
    opacity: 0.08;
    pointer-events: none;
}

.aj-auc-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--aj-space-6);
}

.aj-auc-cta__title {
    margin: 0;
    color: var(--aj-text);
    font-size: var(--aj-fs-h2);
    font-weight: var(--aj-fw-bold);
    line-height: var(--aj-lh-tight);
}

.aj-auc-cta__lead {
    margin: var(--aj-space-2) 0 0;
    color: var(--aj-text-secondary);
    font-size: var(--aj-fs-body-lg);
}

/* ======================================================== 7. RESPONSIVE === */

@media (max-width: 860px) {

    /*
     * The shared component stacks below this width and puts the picture first.
     * The flipped gateway must follow it back, or its two halves would swap
     * into the wrong rows.
     */
    .aj-auc-gateway--flip {
        grid-template-columns: minmax(0, 1fr);
    }

    .aj-auc-gateway--flip .aj-auction-card__visual {
        grid-column: 1;
        grid-row: 1;
    }

    .aj-auc-gateway--flip .aj-auction-card__body {
        grid-column: 1;
        grid-row: 2;
    }

    .aj-auc-gateway .aj-auction-card__visual {
        min-block-size: clamp(200px, 34vw, 260px);
    }

    .aj-auc-gateway .aj-auction-card__logo {
        block-size: clamp(96px, 22vw, 124px);
    }

    .aj-auc-gateway .aj-auction-card__body {
        padding: var(--aj-space-6) var(--aj-space-6) var(--aj-space-8);
    }
}

@media (max-width: 480px) {

    .aj-auc-cta__inner .aj-btn {
        inline-size: 100%;
        justify-content: center;
    }
}

/* ============================================ PHONES AND FOLDABLES ===== */

/*
 * Up to 720px — a phone, and a foldable folded or open; the iPad mini and
 * wider are untouched. The gateways as on the home page: a compact picture,
 * each centred on its mark with its button centred, side by side where a
 * foldable opens; the page's own buttons centred too.
 */
@media (max-width: 720px) {
    .aj-auc-hero__copy > .aj-btn {
        display: flex;
        inline-size: fit-content;
        margin-inline: auto;
    }

    .aj-auc-gateways__list {
        gap: var(--aj-space-4);
    }
    .aj-auc-gateways__list .aj-auction-card {
        grid-template-columns: 1fr;
    }
    .aj-auc-gateways__list .aj-auction-card__visual {
        grid-column: 1;
        grid-row: 1;
        min-block-size: 96px;
        padding: var(--aj-space-3);
    }
    .aj-auc-gateways__list .aj-auction-card__logo {
        block-size: 56px;
    }
    .aj-auc-gateways__list .aj-auction-card__body {
        align-items: center;
        gap: var(--aj-space-2);
        grid-column: 1;
        grid-row: 2;
        padding: var(--aj-space-3) var(--aj-space-4) var(--aj-space-4);
        text-align: center;
    }
    .aj-auc-gateways__list .aj-auction-card__title {
        font-size: var(--aj-fs-h3);
    }
    .aj-auc-gateways__list .aj-auction-card__text {
        font-size: var(--aj-fs-sm);
    }
    .aj-auc-gateways__list .aj-auction-card__meta {
        justify-content: center;
        padding-block-start: 0;
    }
    .aj-auc-gateways__list .aj-auction-card__footer {
        margin-block-start: var(--aj-space-2);
    }
    .aj-auc-gateways__list .aj-auction-card__footer .aj-btn {
        inline-size: auto;
        min-block-size: 44px;
        padding-inline: var(--aj-space-6);
    }

    .aj-auc-cta__inner {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
}

@media (min-width: 560px) and (max-width: 720px) {
    .aj-auc-gateways__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
