/* ============================================================================
   AbuJudom - Home "Why Choose Our Properties" section
   Concept: Stats hero strip + Pillar cards.
   Uses existing brand tokens: --aj-primary, --aj-text, --aj-text-muted,
   --aj-border, --aj-bg-card, --aj-shadow, --aj-shadow-hover, --aj-radius,
   --aj-transition (declared globally in abujudom-enhancements.css).
   Bidirectional via CSS logical properties + dir-aware utilities.
   ============================================================================ */

.aj-why {
    --aj-why-gap: 28px;
    --aj-why-stat-bg: #ffffff;
    --aj-why-pillar-bg: #ffffff;
    --aj-why-accent: var(--aj-primary, #b7cd27);
    --aj-why-accent-soft: var(--aj-primary-soft, rgba(183, 205, 39, 0.12));
    --aj-why-ink: var(--aj-text, #1f2937);
    --aj-why-ink-muted: var(--aj-text-muted, #6b7280);
    --aj-why-ink-strong: #144273;
    --aj-why-border: var(--aj-border, #e5e7eb);
    --aj-why-radius: 16px;
    --aj-why-fade-h: 80px;

    position: relative;
    padding: clamp(56px, 7vw, 96px) 0 84px;
    border-top: 1px solid var(--aj-why-border);
    background:
        linear-gradient(to bottom, rgba(15, 23, 42, 0.025), transparent var(--aj-why-fade-h)),
        radial-gradient(circle at 12% 0%, rgba(183, 205, 39, 0.07), transparent 55%),
        radial-gradient(circle at 92% 100%, rgba(20, 66, 115, 0.06), transparent 55%),
        #f7f9fb;
    overflow: hidden;
}

.aj-why::before {
    content: "";
    position: absolute;
    inset-inline-start: -120px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(183, 205, 39, 0.18), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.aj-why::after {
    content: "";
    position: absolute;
    top: 14px;
    inset-inline: 0;
    width: 64px;
    height: 4px;
    margin-inline: auto;
    border-radius: 999px;
    background: var(--aj-why-accent);
    pointer-events: none;
    z-index: 2;
}

.aj-why .container {
    position: relative;
    z-index: 1;
}

/* ---- Header ---- */
.aj-why__head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 44px;
}

.aj-why__head::before {
    content: "";
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 18px;
    background-image: url("/Content/img/logo.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.15));
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .aj-why__head::before {
        animation: aj-why-logo-in 700ms cubic-bezier(.2, .8, .2, 1) both;
    }
}

@keyframes aj-why-logo-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.aj-why__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--aj-why-accent-soft);
    color: var(--aj-why-ink-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.aj-why__eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aj-why-accent);
    box-shadow: 0 0 0 4px rgba(183, 205, 39, 0.18);
}

.aj-why__title {
    margin: 0 0 12px;
    color: var(--aj-why-ink-strong);
    font-size: clamp(26px, 3.2vw, 36px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.2px;
}

.aj-why__title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--aj-why-accent), #cee552);
}

.aj-why__lede {
    margin: 0;
    color: var(--aj-why-ink-muted);
    font-size: 15.5px;
    line-height: 1.7;
}

/* ---- Stats strip ---- */
.aj-why__stats {
    list-style: none;
    margin: 0 0 56px;
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    background: var(--aj-why-stat-bg);
    border: 1px solid var(--aj-why-border);
    border-radius: 22px;
    box-shadow:
        0 2px 6px rgba(15, 23, 42, 0.04),
        0 18px 40px rgba(15, 23, 42, 0.06);
}

.aj-why-stat {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    transition: background var(--aj-transition, 280ms ease), transform var(--aj-transition, 280ms ease);
}

.aj-why-stat + .aj-why-stat::before {
    content: "";
    position: absolute;
    inset-inline-start: -9px;
    top: 18%;
    bottom: 18%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--aj-why-border), transparent);
}

.aj-why-stat:hover {
    background: var(--aj-why-accent-soft);
    transform: translateY(-2px);
}

.aj-why-stat__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--aj-why-accent) 0%, #cee552 100%);
    color: #1f2937;
    font-size: 20px;
    box-shadow: 0 6px 14px rgba(183, 205, 39, 0.28);
}

.aj-why-stat__icon i {
    line-height: 1;
}

.aj-why-stat__body {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.aj-why-stat__num {
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 800;
    color: var(--aj-why-ink-strong);
    letter-spacing: -0.5px;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.aj-why-stat__lbl {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--aj-why-ink-muted);
}

/* ---- Pillar cards ---- */
.aj-why__pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--aj-why-gap);
}

.aj-why-pillar {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 28px 24px 26px;
    background: var(--aj-why-pillar-bg);
    border: 1px solid var(--aj-why-border);
    border-radius: var(--aj-why-radius);
    box-shadow: var(--aj-shadow, 0 4px 12px rgba(15, 23, 42, 0.06));
    transition: transform var(--aj-transition, 280ms ease),
                box-shadow var(--aj-transition, 280ms ease),
                border-color var(--aj-transition, 280ms ease);
    overflow: hidden;
    isolation: isolate;
}

.aj-why-pillar::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--aj-why-accent), #cee552);
    transform: scaleX(0);
    transform-origin: var(--aj-why-origin, left);
    transition: transform 320ms cubic-bezier(.2, .8, .2, 1);
}

html[dir="rtl"] .aj-why-pillar { --aj-why-origin: right; }

.aj-why-pillar:hover,
.aj-why-pillar:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--aj-shadow-hover, 0 12px 28px rgba(15, 23, 42, 0.14));
    border-color: rgba(183, 205, 39, 0.45);
}

.aj-why-pillar:hover::before,
.aj-why-pillar:focus-within::before {
    transform: scaleX(1);
}

.aj-why-pillar__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--aj-why-accent-soft);
    color: var(--aj-why-ink-strong);
    font-size: 22px;
    transition: background var(--aj-transition, 280ms ease), color var(--aj-transition, 280ms ease), transform var(--aj-transition, 280ms ease);
}

.aj-why-pillar:hover .aj-why-pillar__ico {
    background: linear-gradient(135deg, var(--aj-why-accent) 0%, #cee552 100%);
    color: #1f2937;
    transform: rotate(-6deg) scale(1.05);
}

.aj-why-pillar__ico i { line-height: 1; }

.aj-why-pillar__title {
    margin: 0;
    color: var(--aj-why-ink-strong);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.aj-why-pillar__desc {
    margin: 0;
    color: var(--aj-why-ink-muted);
    font-size: 14px;
    line-height: 1.65;
}

/* ---- Dark mode (optional - matches site .aj-dark theme) ---- */
body.aj-dark .aj-why {
    border-top-color: #334155;
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent var(--aj-why-fade-h)),
        radial-gradient(circle at 12% 0%, rgba(183, 205, 39, 0.10), transparent 55%),
        radial-gradient(circle at 92% 100%, rgba(20, 66, 115, 0.18), transparent 55%),
        #0f172a;
}
body.aj-dark .aj-why__title,
body.aj-dark .aj-why-stat__num,
body.aj-dark .aj-why-pillar__title { color: #e5e7eb; }
body.aj-dark .aj-why__lede,
body.aj-dark .aj-why-stat__lbl,
body.aj-dark .aj-why-pillar__desc { color: #94a3b8; }
body.aj-dark .aj-why__stats,
body.aj-dark .aj-why-pillar {
    background: rgba(30, 41, 59, 0.85);
    border-color: #334155;
}
body.aj-dark .aj-why-pillar__ico {
    background: rgba(183, 205, 39, 0.18);
    color: #e5e7eb;
}

/* ---- RTL polish (logical properties already cover most cases) ---- */
html[dir="rtl"] .aj-why-stat + .aj-why-stat::before {
    inset-inline-start: -9px;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .aj-why__stats,
    .aj-why__pillars {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .aj-why-stat + .aj-why-stat::before { display: none; }
}

@media (max-width: 600px) {
    .aj-why {
        padding: clamp(40px, 8vw, 56px) 0 64px;
        --aj-why-fade-h: 60px;
    }
    .aj-why::after {
        top: 10px;
        width: 48px;
        height: 3px;
    }
    .aj-why__stats,
    .aj-why__pillars {
        grid-template-columns: 1fr;
    }
    .aj-why__stats {
        padding: 16px;
        gap: 4px;
    }
    .aj-why-stat {
        padding: 12px 10px;
    }
    .aj-why-pillar {
        padding: 22px 20px;
    }
    .aj-why__head::before {
        width: 90px;
        height: 90px;
        margin-bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aj-why-stat,
    .aj-why-pillar,
    .aj-why-pillar::before,
    .aj-why-pillar__ico {
        transition: none !important;
    }
    .aj-why-stat:hover,
    .aj-why-pillar:hover {
        transform: none !important;
    }
}
