/* ==========================================================================
   UniFluent — blog article pages
   --------------------------------------------------------------------------
   Shared by every blog post and its locale clones; replaces the per-file
   inline <style> blocks (extracted 2026-08, restyled to the dark brand).
   Load order: brand.css first (tokens, navbar, footer, base), then this.

   Anatomy: breadcrumb strip → article header (dark, indigo glow) →
   hero image → reading column → boxes (toc/tip/stage) → inline CTA →
   related articles band → page CTA. Footer and navbar come from brand.css.

   Notes for the port:
   - Body copy is deliberately brighter than --uf-text-dim: long-form
     reading needs more contrast than UI chrome.
   - Logical properties (margin-inline, border-inline-start) keep the
     Arabic (dir="rtl") clones correct without their own rules.
   - Breakpoint is 900px to agree with the navbar collapse in brand.css;
     768 (the old inline value) left iPads in a hybrid state.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Article reading tokens
   -------------------------------------------------------------------------- */

:root {
    --art-measure: 780px;
    --art-body: rgba(224, 224, 232, 0.88);   /* brighter than --uf-text-dim */
    --art-accent: var(--uf-indigo-soft, #8b8dff);
}

/* --------------------------------------------------------------------------
   Breadcrumb — either its own strip under the navbar (EN pages) or the
   first line inside the article header (locale clones). Works as both.
   -------------------------------------------------------------------------- */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

/* Strip form: the EN pages render it as a standalone div under the navbar
   (locale clones use <nav class="breadcrumb"> inside the article header). */
div.breadcrumb {
    display: block;
    padding: 0.9rem clamp(1.25rem, 4vw, 2rem);
    margin-top: 72px; /* clear of the fixed navbar */
    background: var(--uf-ink-raised, #101016);
    border-bottom: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
}

.breadcrumb-container {
    max-width: var(--art-measure);
    margin: 0 auto;
    font-size: 0.85rem;
}

.breadcrumb a {
    color: var(--art-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--uf-text-faint, rgba(206, 206, 215, 0.42));
    margin: 0 0.5rem;
}

/* --------------------------------------------------------------------------
   Article header — dark with the brand's indigo bloom instead of the old
   flat purple gradient. Fraunces comes from brand.css's heading rule.
   -------------------------------------------------------------------------- */

.article-header {
    position: relative;
    padding: clamp(7rem, 16vh, 9.5rem) clamp(1.25rem, 4vw, 2rem) clamp(2.75rem, 7vh, 4rem);
    background:
        radial-gradient(70% 90% at 50% 0%, rgba(85, 87, 232, 0.28), transparent 70%),
        var(--uf-ink, #0a0a0b);
    color: var(--uf-text, #f4f4f7);
    overflow-x: clip;
}

/* When the breadcrumb strip precedes it, the navbar is already cleared. */
div.breadcrumb + .article-header {
    padding-top: clamp(3.5rem, 9vh, 5.5rem);
}

.article-header-content {
    max-width: var(--art-measure);
    margin: 0 auto;
}

.article-header .breadcrumb {
    margin-bottom: 1.5rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

.article-header .breadcrumb a {
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

.article-category {
    display: inline-block;
    padding: 0.3rem 1rem;
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    border-radius: 999px;
    background: rgba(139, 141, 255, 0.1);
    color: var(--art-accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.article-header h1 {
    font-size: clamp(2.2rem, 5.4vw, 3.6rem);
    line-height: 1.08;
    margin-bottom: 1.25rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    font-size: 0.92rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Hero image
   -------------------------------------------------------------------------- */

.hero-image-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
    position: relative;
    z-index: 10;
}

.hero-image {
    width: 100%;
    height: clamp(240px, 44vw, 420px);
    object-fit: cover;
    border-radius: var(--uf-radius, 20px);
    border: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Reading column
   -------------------------------------------------------------------------- */

.article-content {
    max-width: var(--art-measure);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vh, 3.5rem) clamp(1.25rem, 4vw, 2rem) clamp(3rem, 8vh, 4.5rem);
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.06rem;
    line-height: 1.8;
    color: var(--art-body);
}

.article-content h2 {
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    margin: 2.5rem 0 1rem;
}

.article-content h3 {
    font-size: clamp(1.2rem, 1.9vw, 1.4rem);
    margin: 2rem 0 1rem;
}

.article-content a {
    color: var(--art-accent);
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem;
    padding-inline-start: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--art-body);
}

/* --------------------------------------------------------------------------
   Boxes — panels lifted from the ink, hairline edges, one accent each
   -------------------------------------------------------------------------- */

.table-of-contents,
.stage-box {
    background: var(--uf-ink-panel, #14141c);
    border: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1.5rem 2rem;
    margin: 0 0 2rem;
}

.stage-box {
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.table-of-contents h2 {
    font-size: 1.15rem;
    margin: 0 0 1rem;
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: var(--art-accent);
    text-decoration: none;
    font-size: 0.98rem;
}

.table-of-contents a:hover {
    text-decoration: underline;
}

.tip-box {
    background: rgba(85, 87, 232, 0.09);
    border: 1px solid rgba(139, 141, 255, 0.18);
    border-inline-start: 3px solid var(--uf-indigo, #5557e8);
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1.5rem;
    margin: 2rem 0;
}

.tip-box h4 {
    color: var(--art-accent);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-weight: 600;
    font-size: 1rem;
}

.tip-box p {
    margin: 0;
    font-size: 1rem;
    color: var(--art-body);
}

.stage-box h3 {
    color: var(--art-accent);
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.stage-box p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--art-body);
}

.stage-box p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   CTAs — the one place the article keeps a filled gradient, now in the
   brand's indigo→violet rather than the legacy purple.
   -------------------------------------------------------------------------- */

.inline-cta {
    background: linear-gradient(135deg, var(--uf-indigo, #5557e8) 0%, var(--uf-violet, #7b3fa8) 100%);
    color: #fff;
    padding: 2rem;
    border-radius: var(--uf-radius, 20px);
    margin: 2.5rem 0;
    text-align: center;
}

.inline-cta h3 {
    color: #fff;
    margin: 0 0 0.5rem;
}

.inline-cta p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.cta-section {
    background:
        radial-gradient(70% 100% at 50% 100%, rgba(123, 63, 168, 0.35), transparent 70%),
        var(--uf-ink-raised, #101016);
    border-block: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    padding: clamp(3.5rem, 9vh, 5rem) clamp(1.25rem, 4vw, 2rem);
    text-align: center;
    color: var(--uf-text, #f4f4f7);
}

.cta-section h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.4rem);
    margin-bottom: 1rem;
}

.cta-section p {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Legacy button names, brand button skins (see .uf-btn in brand.css). */
.btn {
    padding: 0.95rem 1.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s var(--uf-ease, ease),
                background-color 0.3s var(--uf-ease, ease),
                box-shadow 0.3s var(--uf-ease, ease);
}

.inline-cta .btn,
.btn-white {
    background: var(--uf-paper, #ceced7);
    color: #101014;
}

.inline-cta .btn:hover,
.btn-white:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.btn-outline {
    background: rgba(206, 206, 215, 0.06);
    color: var(--uf-text, #f4f4f7);
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
}

.btn-outline:hover {
    background: rgba(206, 206, 215, 0.12);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Related articles
   -------------------------------------------------------------------------- */

.related-articles {
    background: var(--uf-ink-raised, #101016);
    border-top: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    padding: clamp(3rem, 8vh, 4rem) clamp(1.25rem, 4vw, 2rem);
}

.related-articles-container {
    max-width: var(--art-measure);
    margin: 0 auto;
}

.related-articles h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

.related-card {
    background: var(--uf-ink-panel, #14141c);
    border: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    padding: 1.5rem;
    border-radius: var(--uf-radius-sm, 12px);
}

.related-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.related-card h3 a {
    color: var(--uf-text, #f4f4f7);
    text-decoration: none;
}

.related-card h3 a:hover {
    color: var(--art-accent);
}

.related-card p {
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    font-size: 0.95rem;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive — 900px agrees with the navbar collapse in brand.css
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .article-header h1 {
        font-size: clamp(1.9rem, 7.2vw, 2.6rem);
    }

    .article-meta {
        gap: 0.5rem 1.5rem;
    }

    .table-of-contents {
        padding: 1.25rem 1.5rem;
    }
}

@media (max-width: 560px) {
    .article-content p,
    .article-content li {
        font-size: 1rem;
    }

    .hero-image {
        height: 220px;
        border-radius: var(--uf-radius-sm, 12px);
    }

    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}
