/* Homepage Chess Basics promo — a compact bridge between the hero and the
   opening catalog. Framing/interactive elements reuse styles.css's global
   --accent cyan; --basics-promo-amber (kept for the rule below that already
   names it) resolves to the same violet used across the rest of Chess Basics
   (courses.html's --fusion-purple value) for the one decorative label, not a
   standalone gold. No new palette, and nothing here touches the courses page. */

:root {
    --basics-promo-amber: #ad7dff;
    --basics-promo-panel: rgba(13, 17, 27, 0.86);
    --basics-promo-line: rgba(0, 200, 255, 0.22);
}

/* styles.css pins direction:rtl even under html[dir="ltr"] — the site-wide
   convention is that each component opts into LTR for itself (the landing hero
   does the same). Without this the promo would lay itself out right-to-left on
   an English page. */
[dir="ltr"] .basics-promo {
    direction: ltr;
}

/* The arrow points along the reading direction: it means "onward", so in RTL
   it must mirror rather than keep pointing at the page edge. */
.basics-dir-arrow {
    font-size: 0.85em;
    transition: transform 0.2s ease;
}

[dir="rtl"] .basics-dir-arrow {
    transform: scaleX(-1);
}

/* ── Homepage promo ─────────────────────────────────────────────────── */
.basics-promo-wrap {
    max-width: 1200px;
    margin: 0 auto 2.25rem;
    padding: 0 4px;
}

.basics-promo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.05rem 1.35rem;
    border: 1px solid var(--basics-promo-line);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(0, 200, 255, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(100deg, rgba(0, 200, 255, 0.08), rgba(173, 125, 255, 0.05) 55%, transparent),
        var(--basics-promo-panel);
    color: var(--text-primary, #fff);
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.basics-promo:hover,
.basics-promo:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(0, 200, 255, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.36);
}

.basics-promo:focus-visible {
    outline: 2px solid var(--accent, #00c8ff);
    outline-offset: 3px;
}

.basics-promo-art {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(0, 200, 255, 0.28);
    border-radius: 14px;
    background:
        repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px,
        rgba(0, 200, 255, 0.08);
}

.basics-promo-art img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.basics-promo-body {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
}

.basics-promo-title {
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
}

.basics-promo-sub {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.92rem;
    line-height: 1.5;
}

.basics-promo-meta {
    color: var(--basics-promo-amber);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.basics-promo-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.basics-promo-bar {
    position: relative;
    display: block;
    flex: 1 1 auto;
    max-width: 260px;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.basics-promo-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent, #00c8ff);
}

.basics-promo-percent {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.basics-promo-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.62rem 1.15rem;
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 999px;
    background: rgba(0, 200, 255, 0.12);
    color: var(--accent, #00c8ff);
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.basics-promo:hover .basics-promo-cta {
    background: rgba(0, 200, 255, 0.2);
}

.basics-promo:hover .basics-dir-arrow {
    transform: translateX(3px);
}

[dir="rtl"] .basics-promo:hover .basics-dir-arrow {
    transform: scaleX(-1) translateX(3px);
}

@media (max-width: 720px) {
    .basics-promo {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.75rem 0.9rem;
        padding: 0.95rem 1rem;
    }

    .basics-promo-art {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .basics-promo-art img {
        width: 27px;
        height: 27px;
    }

    /* The CTA drops to its own full-width row instead of squeezing the copy. */
    .basics-promo-cta {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .basics-promo-title {
        font-size: 1.02rem;
    }

    .basics-promo-sub {
        font-size: 0.86rem;
    }

    .basics-promo-bar {
        max-width: none;
    }
}

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

    .basics-promo,
    .basics-dir-arrow {
        transition: none;
    }

    .basics-promo:hover {
        transform: none;
    }
}
