/* ============================================================
 * docs.css — self-contained styling for the /{lang}/docs/* guides
 * (InstallWidget, LeadCapture, WhatsApp, Telegram, GoogleBusiness,
 *  TrainYourBot) across en / he / ru.
 *
 * WHY THIS FILE EXISTS: the docs pages were authored against a class
 * vocabulary (.feat-card / .step-card / .section-title / .py-section
 * + a Bootstrap grid) that was NEVER present in any www stylesheet —
 * www loads design-tokens + base + layout, none of which define these.
 * Result: every guide rendered as unstyled HTML (flat text, bare
 * emoji, collapsed grid). This module supplies exactly that vocabulary
 * as a premium, brand-consistent design. base.css already provides
 * .page-hero*, .section-eyebrow, .cta-*, .btn-hero-primary — those are
 * intentionally NOT redefined here.
 *
 * Palette/tokens mirror base.css + design-tokens.css so guides read as
 * one system with the rest of www: ink #0f172a, slate #475569, hairline
 * #e5e7eb, brand #1e40af, emphasis gradient #3B82F6→#8B5CF6.
 * ============================================================ */

:root {
    /* Referenced inline by the guides (background:var(--light)); was
       undefined, so those bands rendered transparent. */
    --light: #f8fafc;
    --docs-ink: #0f172a;
    --docs-slate: #475569;
    --docs-muted: #6b7280;
    --docs-hairline: #e5e7eb;
    --docs-brand: #1e40af;
    --docs-brand-2: #8b5cf6;
    --docs-gap: 1.5rem;
}

/* Grid + spacing utilities now live in base.css (single definition,
   loaded site-wide). */

/* ─────────────────────────────────────────────────────────────
   Section titles — Fraunces serif display, quietly premium.
   ───────────────────────────────────────────────────────────── */
.section-title {
    font-family: "Fraunces", Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--docs-ink);
    margin: 0 auto;
    max-width: 760px;
    text-wrap: balance;
}
[dir="rtl"] .section-title { font-family: "Heebo", sans-serif; font-weight: 700; }

/* ─────────────────────────────────────────────────────────────
   Feature cards — elevated surface, gradient icon badge (turns the
   inline emoji into a deliberate, branded mark instead of a naked
   glyph), reward-on-hover lift.
   ───────────────────────────────────────────────────────────── */
.feat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--docs-hairline);
    border-radius: 16px;
    padding: 1.75rem 1.6rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out;
}
.feat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .18);
    border-color: color-mix(in srgb, var(--docs-brand) 45%, var(--docs-hairline));
}
.feat-card h3 {
    margin: 1.15rem 0 .5rem;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--docs-ink);
}
.feat-card p {
    margin: 0;
    font-size: .95rem;
    line-height: 1.62;
    color: var(--docs-slate);
}
.feat-card p:last-child { margin-top: auto; padding-top: .35rem; }

.feat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 1.55rem;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}
/* Colour variants — soft pastel field + tinted ring, matching the
   design-tokens pastel icon palette. */
.feat-icon.fi-blue   { background: #EFF6FF; box-shadow: inset 0 0 0 1px rgba(59,130,246,.18); }
.feat-icon.fi-green  { background: #ECFDF5; box-shadow: inset 0 0 0 1px rgba(16,185,129,.18); }
.feat-icon.fi-orange { background: #FEF3C7; box-shadow: inset 0 0 0 1px rgba(217,119,6,.18); }
.feat-icon.fi-purp   { background: #F3E8FF; box-shadow: inset 0 0 0 1px rgba(139,92,246,.18); }

/* Cards that wrap a link (related-guides) keep ink text + lift. */
a .feat-card { cursor: pointer; }
a:hover .feat-card h3 { color: var(--docs-brand); }

/* ─────────────────────────────────────────────────────────────
   Step cards — a vertical numbered timeline. Gradient number badge
   sits in the start margin; a hairline rail connects consecutive
   steps for a guided, premium read.
   ───────────────────────────────────────────────────────────── */
.step-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--docs-hairline);
    border-radius: 16px;
    padding: 1.6rem 1.75rem 1.6rem 4.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
[dir="rtl"] .step-card { padding: 1.6rem 4.75rem 1.6rem 1.75rem; }

.step-card h3 {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--docs-ink);
}
.step-card p { margin: 0 0 .4rem; font-size: .95rem; line-height: 1.62; color: var(--docs-slate); }
.step-card p:last-child { margin-bottom: 0; }

.step-num {
    position: absolute;
    inset-inline-start: 1.35rem;
    top: 1.6rem;
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 16px -6px rgba(59, 130, 246, .55);
    z-index: 1;
}
/* Connecting rail between a step and the one below it. The steps are
   laid out with mb-4 (1.5rem) gaps, so the rail bridges the badge
   centre through that gap. Hidden on the last card via :last-child. */
.step-card:not(:last-child) .step-num::after {
    content: "";
    position: absolute;
    top: 100%;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(1.5rem + 1.6rem);
    background: linear-gradient(to bottom, color-mix(in srgb, #8B5CF6 55%, transparent), transparent);
}
[dir="rtl"] .step-card:not(:last-child) .step-num::after { transform: translateX(50%); }

/* ─────────────────────────────────────────────────────────────
   Secondary hero button (base.css defines only the primary).
   ───────────────────────────────────────────────────────────── */
.btn-hero-secondary {
    display: inline-block;
    padding: .8rem 1.6rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: .98rem;
    text-decoration: none;
    color: var(--docs-ink);
    background: #fff;
    border: 1px solid var(--docs-hairline);
    transition: border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn-hero-secondary:hover {
    color: var(--docs-brand);
    border-color: color-mix(in srgb, var(--docs-brand) 55%, var(--docs-hairline));
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -10px rgba(30, 64, 175, .4);
}

/* ─────────────────────────────────────────────────────────────
   Entrance animation — gentle rise/fade, staggered. Fully disabled
   under prefers-reduced-motion (content stays visible).
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .animate-in {
        opacity: 0;
        transform: translateY(14px);
        animation: docsFadeUp .55s cubic-bezier(.22, .61, .36, 1) forwards;
    }
    .animate-in.delay-1 { animation-delay: .08s; }
    .animate-in.delay-2 { animation-delay: .16s; }
    .animate-in.delay-3 { animation-delay: .24s; }
    @keyframes docsFadeUp {
        to { opacity: 1; transform: none; }
    }
}
