/* Landing hero — main-domain UI/UX redesign (Batch 5).

   Loaded by landing.php after public.css and before plan_card.css. Owns
   only the new .landing-hero* component; the legacy .hero* selectors in
   modules/offers/css/public.css remain untouched and will be removed by
   Batch 8 once the rollout is confirmed.

   Acceptance contract from plan §5/Batch 5:
     - LCP image ≤ 80 KB AVIF.
     - Hero reserves height before the image arrives → no CLS.
     - prefers-reduced-motion disables the scroll-cue bounce + button micro
       transforms.

   All sizing comes from logical properties so RTL inherits without an
   `[dir="rtl"]` override block. Token references stay aligned with
   theme_a/tokens.css (--space-*, --primary, --surface, --text*, --muted,
   --radius, --shadow, --primary-rgb).
*/

.landing-hero {
    position: relative;
    isolation: isolate;
    margin-block: var(--space-7) var(--space-8);
    padding-block: clamp(var(--space-7), 6vw, var(--space-10));
    padding-inline: clamp(var(--space-5), 5vw, var(--space-8));
    border-radius: var(--radius-large, 22px);
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.10), transparent 55%),
        linear-gradient(180deg, rgba(var(--surface-rgb), 1) 0%, rgba(var(--surface-2-rgb), 0.6) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.landing-hero::before {
    content: "";
    position: absolute;
    inset-block-start: -40%;
    inset-inline-end: -20%;
    inline-size: 60%;
    block-size: 120%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.16) 0%, transparent 70%);
    filter: blur(32px);
    z-index: 0;
    pointer-events: none;
}

.landing-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(var(--space-5), 4vw, var(--space-8));
    align-items: center;
}

/* Solo variant — copy-only hero (image disabled). Single full-width column,
 * lead paragraph keeps its 56ch readability cap so the line length doesn't
 * stretch awkwardly on wide viewports. */
.landing-hero--solo .landing-hero__inner {
    grid-template-columns: minmax(0, 1fr);
}

.landing-hero__copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-inline-size: 0;
}

.landing-hero__eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--primary);
}

.landing-hero__title {
    margin: 0;
    font-size: clamp(2rem, 4.6vw + 0.4rem, 3.5rem);
    line-height: 1.05;
    font-weight: 800;
    color: var(--text-strong);
    letter-spacing: -0.01em;
}

.landing-hero__lead {
    margin: 0;
    font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.25rem);
    line-height: 1.55;
    color: var(--text);
    max-inline-size: 56ch;
}

.landing-hero__trust {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
}

.landing-hero__trust-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding-block: 6px;
    padding-inline: 12px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-strong);
    background: rgba(var(--text-rgb), 0.04);
    border: 1px solid var(--border);
    line-height: 1.2;
}

.landing-hero__trust-icon {
    inline-size: 16px;
    block-size: 16px;
    flex: 0 0 auto;
    color: var(--primary);
}

.landing-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-block-start: var(--space-2);
}

.landing-hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding-block: 14px;
    padding-inline: clamp(var(--space-5), 2vw, var(--space-7));
    min-block-size: 52px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    border: 1px solid transparent;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.landing-hero__cta:focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), 0.5);
    outline-offset: 3px;
}

.landing-hero__cta--primary {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.3);
}

.landing-hero__cta--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(var(--primary-rgb), 0.36);
}

.landing-hero__cta--ghost {
    background: transparent;
    color: var(--text-strong);
    border-color: var(--border);
}

.landing-hero__cta--ghost:hover {
    background: rgba(var(--text-rgb), 0.04);
    border-color: rgba(var(--text-rgb), 0.18);
}

.landing-hero__cta-arrow,
.landing-hero__cta-play {
    inline-size: 18px;
    block-size: 18px;
    flex: 0 0 auto;
}

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

/* Arabic line-height: the Latin-tuned 1.05 collapses descenders/marks into
 * the line above. Bump to a value that gives the title (and lead) breathing
 * room without making the block feel airy. */
[dir="rtl"] .landing-hero__title {
    line-height: 1.35;
    letter-spacing: 0;
}

[dir="rtl"] .landing-hero__lead {
    line-height: 1.7;
}

.landing-hero__scroll-cue {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-block-start: var(--space-4);
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0.85;
}

.landing-hero__scroll-cue-icon {
    display: inline-flex;
    inline-size: 18px;
    block-size: 18px;
    animation: landing-hero-bounce 1.8s ease-in-out infinite;
}

.landing-hero__scroll-cue-icon svg {
    inline-size: 100%;
    block-size: 100%;
}

@keyframes landing-hero-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

/* Media slot: aspect-ratio reserves the height before the AVIF arrives so
   CLS stays at 0. The min-block-size guard keeps a sensible reservation on
   browsers that miss aspect-ratio (very old WebViews); modern engines pick
   the aspect-ratio path. */
.landing-hero__media {
    position: relative;
    inline-size: 100%;
    align-self: stretch;
    min-block-size: 280px;
}

.landing-hero__picture,
.landing-hero__image {
    display: block;
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 4 / 3;
}

.landing-hero__image {
    border-radius: var(--radius-large, 22px);
    object-fit: cover;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
    background: var(--surface-2);
}

/* ---------------------------------------------------------------------------
   Tablet — keep two columns but tighten gaps. */
@media (max-width: 1023px) {
    .landing-hero {
        padding-inline: var(--space-5);
    }
    .landing-hero__inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: var(--space-5);
    }
    .landing-hero__title {
        font-size: clamp(1.75rem, 3.6vw + 0.6rem, 2.6rem);
    }
}

/* ---------------------------------------------------------------------------
   Mobile — single column, image rendered first so it remains the LCP
   candidate and is closer to the fold. */
@media (max-width: 767px) {
    .landing-hero {
        margin-block: var(--space-5) var(--space-6);
        padding-block: var(--space-6);
        padding-inline: var(--space-4);
        border-radius: var(--radius-medium, 18px);
    }
    .landing-hero__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-5);
    }
    .landing-hero__media {
        order: -1;
        min-block-size: 220px;
    }
    .landing-hero__image {
        border-radius: var(--radius-medium, 18px);
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    }
    .landing-hero__title {
        font-size: clamp(1.6rem, 7vw + 0.2rem, 2.1rem);
    }
    .landing-hero__lead {
        font-size: 1rem;
    }
    .landing-hero__cta {
        inline-size: 100%;
    }
    .landing-hero__scroll-cue {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
   Reduced motion — kill bounce + transform-on-hover. The hero itself never
   relies on motion to convey meaning, so disabling it is safe. */
@media (prefers-reduced-motion: reduce) {
    .landing-hero__scroll-cue-icon {
        animation: none;
    }
    .landing-hero__cta {
        transition: none;
    }
    .landing-hero__cta--primary:hover {
        transform: none;
    }
}

/* ---------------------------------------------------------------------------
   Print — drop the decorative gradient + image so the hero reads as a
   clean text block when the page is printed. */
@media print {
    .landing-hero {
        box-shadow: none;
        background: none;
        border: none;
        padding: 0;
    }
    .landing-hero::before,
    .landing-hero__media,
    .landing-hero__scroll-cue {
        display: none;
    }
}
