/* Waplix premium blog system */

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

:root {
    --blog-bg: #ffffff;
    --blog-surface: #f8fafc;
    --blog-card: rgba(255, 255, 255, .86);
    --blog-text: #0f172a;
    --blog-muted: #64748b;
    --blog-border: rgba(15, 23, 42, .10);
    --blog-primary: #10b981;
    --blog-primary-2: #14b8a6;
    --blog-dark: #020617;
    --blog-shadow: 0 24px 80px rgba(2, 6, 23, .12);
    --blog-radius: 24px;
}

html[data-theme="dark"] {
    --blog-bg: #020617;
    --blog-surface: #07111f;
    --blog-card: rgba(15, 23, 42, .82);
    --blog-text: #e5f7ef;
    --blog-muted: #94a3b8;
    --blog-border: rgba(148, 163, 184, .18);
    --blog-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

body.blog-premium-page,
.blog-premium-page {
    background:
        radial-gradient(circle at 12% 0%, rgba(16, 185, 129, .16), transparent 30rem),
        radial-gradient(circle at 88% 10%, rgba(20, 184, 166, .14), transparent 28rem),
        linear-gradient(180deg, rgba(2, 6, 23, .02), transparent 22rem),
        var(--blog-bg);
    color: var(--blog-text);
    overflow-x: clip;
}

.blog-premium-page *,
.blog-premium-page *::before,
.blog-premium-page *::after {
    box-sizing: border-box;
}

.blog-premium-hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 48px;
    margin-bottom: 8px;
}

.blog-premium-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, .12), transparent 34%, rgba(20, 184, 166, .10)),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .08), transparent 25%);
    pointer-events: none;
}

.blog-hero-grid,
.blog-layout {
    position: relative;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.blog-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
    gap: 42px;
    align-items: center;
}

.blog-hero-copy {
    min-width: 0;
}

.blog-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .08);
    color: var(--blog-primary);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.blog-hero-title {
    margin: 18px 0 16px;
    max-width: 980px;
    color: var(--blog-text);
    font-size: clamp(2.25rem, 4.8vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: 0;
    text-wrap: balance;
}

.blog-hero-subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--blog-muted);
    font-size: clamp(1.08rem, 1.35vw, 1.18rem);
    line-height: 1.78;
}

.blog-hero-meta,
.blog-share-placeholder {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.blog-hero-meta span,
.blog-share-placeholder span,
.blog-share-placeholder button,
.reading-progress-card span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--blog-border);
    background: var(--blog-card);
    color: var(--blog-muted);
    font: inherit;
}

.blog-share-placeholder button {
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.blog-share-placeholder button:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, .32);
    background: rgba(16, 185, 129, .08);
}

.blog-hero-visual,
.blog-featured-image {
    margin: 0;
}

.blog-hero-visual img,
.blog-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--blog-radius) + 4px);
    border: 1px solid var(--blog-border);
    box-shadow: var(--blog-shadow);
}

.blog-hero-visual figcaption,
.blog-featured-image figcaption {
    margin-top: 12px;
    color: var(--blog-muted);
    font-size: .92rem;
    line-height: 1.6;
}

.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
    padding: 26px 0 90px;
}

.blog-main {
    min-width: 0;
}

.blog-sidebar {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 16px;
}

.blog-sidebar-card,
.blog-card,
.blog-callout,
.blog-cta,
.blog-screenshot-placeholder,
.blog-toc {
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    background: var(--blog-card);
    box-shadow: var(--blog-shadow);
}

.blog-sidebar-card,
.blog-card,
.blog-callout,
.blog-cta {
    padding: 22px;
}

.blog-premium-page .blog-section {
    scroll-margin-top: 110px;
    padding: 28px 0;
}

.blog-premium-page .blog-section > * {
    max-width: 100%;
}

.blog-premium-page .blog-section h2 {
    margin: 0 0 14px;
    color: var(--blog-text);
    font-size: clamp(1.85rem, 2.8vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: 0;
}

.blog-premium-page .blog-section h3 {
    margin: 24px 0 10px;
    color: var(--blog-text);
    font-size: clamp(1.35rem, 1.8vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: 0;
}

.blog-premium-page .blog-section p,
.blog-premium-page .blog-section li {
    max-width: 75ch;
    color: var(--blog-muted);
    font-size: clamp(1.05rem, 1.15vw, 1.12rem);
    line-height: 1.78;
}

.blog-premium-page .blog-section a {
    color: var(--blog-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.blog-callout {
    margin: 24px 0;
}

.blog-callout.info { border-color: rgba(20, 184, 166, .30); }
.blog-callout.tip { border-color: rgba(16, 185, 129, .34); }
.blog-callout.warning { border-color: rgba(245, 158, 11, .38); }
.blog-callout.success { border-color: rgba(34, 197, 94, .38); }

.blog-cta {
    margin: 28px 0;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, .14), rgba(20, 184, 166, .08)),
        var(--blog-card);
}

.blog-cta h2 {
    margin-bottom: 8px;
    font-size: clamp(1.5rem, 2.2vw, 2.15rem);
}

.blog-cta .neon-button,
.blog-cta .outline-neon-button {
    margin: 8px 8px 0 0;
}

.blog-toc {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.blog-toc h2 {
    margin: 0 0 2px;
    color: var(--blog-text);
    font-size: 1rem;
}

.blog-toc a {
    display: block;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--blog-muted);
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.blog-toc a:hover,
.blog-toc a:focus-visible {
    transform: translateX(2px);
    background: rgba(16, 185, 129, .08);
    color: var(--blog-primary);
}

.reading-progress-card {
    display: grid;
    gap: 10px;
}

.reading-progress-track {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(100, 116, 139, .18);
}

.reading-progress-track i {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blog-primary), var(--blog-primary-2));
}

.blog-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--blog-border);
    border-radius: 18px;
    background: var(--blog-card);
    box-shadow: var(--blog-shadow);
}

.blog-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    color: var(--blog-muted);
}

.blog-table th,
.blog-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--blog-border);
    vertical-align: top;
    text-align: left;
}

.blog-table th {
    color: var(--blog-text);
    background: rgba(16, 185, 129, .08);
    font-weight: 700;
}

.blog-code-wrap {
    position: relative;
    margin: 18px 0 24px;
}

.blog-code {
    overflow-x: auto;
    margin: 0;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: #020617;
    color: #d1fae5;
    font-size: .92rem;
    line-height: 1.7;
}

.code-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #d1fae5;
    font: inherit;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
}

.code-copy-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .12);
}

.blog-step-grid,
.blog-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.blog-card {
    min-width: 0;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.blog-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, .26);
    box-shadow: 0 28px 80px rgba(2, 6, 23, .14);
}

.blog-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    border-radius: 14px;
    color: var(--blog-primary);
    background: rgba(16, 185, 129, .08);
    font-weight: 800;
}

.blog-checklist {
    display: grid;
    gap: 12px;
    padding-left: 1.1rem;
}

.blog-screenshot-placeholder {
    margin: 28px 0;
    overflow: hidden;
}

.screenshot-placeholder-card {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 28px;
    text-align: center;
    border: 1px dashed rgba(100, 116, 139, .42);
    background:
        linear-gradient(135deg, rgba(16, 185, 129, .10), rgba(20, 184, 166, .06)),
        repeating-linear-gradient(45deg, transparent 0 12px, rgba(100, 116, 139, .08) 12px 24px);
}

.screenshot-placeholder-card span {
    color: var(--blog-text);
    font-size: 1.06rem;
    font-weight: 800;
}

.screenshot-placeholder-card p {
    max-width: 32rem;
    margin: 10px 0 0;
    color: var(--blog-muted);
}

.blog-screenshot-placeholder figcaption {
    padding: 14px 18px;
    color: var(--blog-muted);
}

.blog-faq h3 {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--blog-border);
}

.related-articles .blog-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.implementation-summary th {
    width: 220px;
}

@media (max-width: 1120px) {
    .blog-hero-grid,
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 760px) {
    .blog-premium-hero {
        padding: 72px 0 34px;
    }

    .blog-hero-title {
        font-size: clamp(2rem, 11vw, 3.1rem);
    }

    .blog-premium-page .blog-section {
        padding: 22px 0;
    }

    .blog-step-grid,
    .blog-feature-grid {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        gap: 12px;
    }

    .blog-sidebar-card,
    .blog-card,
    .blog-callout,
    .blog-cta {
        padding: 18px;
    }

    .blog-table {
        min-width: 640px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .blog-card,
    .blog-toc a,
    .blog-share-placeholder button,
    .code-copy-btn {
        transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
    }
}
