/* Dioboo Blog — shared stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #9D8CFF;
    --primary-dark: #7B68EE;
    --primary-bg: rgba(157, 140, 255, 0.08);
    --text: #1a1a1a;
    --text-muted: rgba(26, 26, 26, 0.65);
    --text-light: rgba(26, 26, 26, 0.5);
    --border: rgba(26, 26, 26, 0.1);
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --reading-width: 720px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

/* Navigation — same as landing (fixed sticky). Scoped to direct child of body so breadcrumbs don't inherit fixed positioning. */
body > nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-center a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.nav-center a:hover {
    background: rgba(157, 140, 255, 0.08);
    color: var(--primary-dark);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.4rem;
    color: #000000;
}

.logo-icon {
    height: 28px;
    width: auto;
}

.logo-text {
    height: 56px;
    width: auto;
}

/* App Store badge */
.app-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #000000;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.app-store-badge:hover {
    background: #1a1a1a;
    transform: scale(1.02);
    color: white;
}

.app-store-badge svg {
    width: 28px;
    height: 28px;
}

.badge-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.badge-text span {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.9;
}

.badge-text strong {
    font-size: 1.3rem;
    font-weight: 600;
}

.app-store-badge-nav {
    padding: 10px 20px;
}

.app-store-badge-nav svg {
    width: 22px;
    height: 22px;
}

.app-store-badge-nav .badge-text span {
    font-size: 0.6rem;
}

.app-store-badge-nav .badge-text strong {
    font-size: 1rem;
}

/* Language selector */
.lang-selector {
    position: relative;
    margin-left: 12px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lang-btn:hover {
    background: rgba(157, 140, 255, 0.08);
    border-color: rgba(157, 140, 255, 0.3);
}

.lang-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    min-width: 140px;
    z-index: 200;
}

.lang-selector:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.lang-dropdown a:first-child {
    border-radius: 12px 12px 0 0;
}

.lang-dropdown a:last-child {
    border-radius: 0 0 12px 12px;
}

.lang-dropdown a:hover {
    background: rgba(157, 140, 255, 0.08);
}

.lang-dropdown a.active {
    background: rgba(157, 140, 255, 0.12);
    font-weight: 600;
}

/* Layout */
.container {
    max-width: var(--reading-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

main {
    padding: 140px 0 80px;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.article-header .breadcrumbs {
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary-dark);
}

.breadcrumbs span.sep {
    margin: 0 8px;
    color: var(--text-light);
}

/* Article header */
.article-header {
    margin-bottom: 40px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.article-meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-light);
}

h1.article-title {
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text);
}

.article-lede {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Article body */
.article-body {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text);
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 48px 0 16px;
    color: var(--text);
    letter-spacing: -0.01em;
    /* Compensate for the fixed nav so anchor links land just below it */
    scroll-margin-top: 110px;
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 32px 0 12px;
    color: var(--text);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul,
.article-body ol {
    margin: 0 0 20px 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-body strong {
    font-weight: 700;
}

.article-body em {
    font-style: italic;
}

.article-body blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 20px;
    margin: 24px 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

/* Table of contents (auto-generated by blog.js) */
.toc {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 32px;
}

.toc summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.toc summary::-webkit-details-marker {
    display: none;
}

.toc summary::before {
    content: "›";
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.toc[open] summary::before {
    transform: rotate(90deg);
}

.toc ol {
    margin: 16px 0 4px 0;
    padding-left: 28px;
    counter-reset: toc-item;
    list-style: none;
}

.toc li {
    margin: 8px 0;
    font-size: 0.95rem;
    counter-increment: toc-item;
    position: relative;
}

.toc li::before {
    content: counter(toc-item) ".";
    position: absolute;
    left: -24px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}

.toc a {
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.5;
}

.toc a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* App CTA card (subtle, in-article) */
.app-cta {
    margin: 56px 0 0;
    padding: 28px;
    background: var(--primary-bg);
    border-radius: 16px;
    text-align: left;
}

.app-cta h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.app-cta p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.app-cta .app-store-badge {
    padding: 10px 18px;
}

.app-cta .app-store-badge svg {
    width: 22px;
    height: 22px;
}

.app-cta .app-store-badge .badge-text span {
    font-size: 0.65rem;
}

.app-cta .app-store-badge .badge-text strong {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Blog index page */
.blog-header {
    text-align: left;
    margin-bottom: 40px;
    max-width: 720px;
}

.blog-header h1 {
    font-size: clamp(2.2rem, 4.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.blog-header .lede {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.blog-header .lede:last-child {
    margin-bottom: 0;
}

/* Filter pills */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: rgba(157, 140, 255, 0.04);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Articles grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.article-card {
    display: flex;
    flex-direction: column;
    padding: 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    transition: all 0.25s ease;
}

.article-card:hover {
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(157, 140, 255, 0.12);
    transform: translateY(-2px);
}

.article-card .card-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 14px;
}

.article-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text);
    transition: color 0.2s;
}

.article-card:hover h2 {
    color: var(--primary-dark);
}

.article-card .excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 20px;
    flex-grow: 1;
}

.article-card .card-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: auto;
}

/* Empty state — shown when filter returns 0 results */
.empty-state {
    display: none;
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    font-size: 0.95rem;
    border: 1px dashed var(--border);
    border-radius: 16px;
    grid-column: 1 / -1;
}

/* Coming soon note */
.coming-soon {
    margin-top: 56px;
    padding: 32px 28px;
    background: var(--bg-alt);
    border-radius: 16px;
    text-align: center;
}

.coming-soon p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    max-width: 520px;
    margin: 0 auto;
}

/* Mobile — stack articles to 1 column */
@media (max-width: 720px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .blog-header {
        margin-bottom: 32px;
    }

    .filters {
        margin-bottom: 32px;
        padding-bottom: 20px;
    }

    .article-card {
        padding: 24px;
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    padding: 40px 0 32px;
    margin-top: 80px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
}

.footer-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Mobile */
@media (max-width: 900px) {
    .nav-center {
        display: none;
    }
}

@media (max-width: 640px) {
    .nav-inner {
        padding: 14px 20px;
    }

    .logo-text {
        height: 44px;
    }

    .app-store-badge-nav {
        padding: 8px 14px;
    }

    .app-store-badge-nav svg {
        width: 18px;
        height: 18px;
    }

    .app-store-badge-nav .badge-text span {
        font-size: 0.55rem;
    }

    .app-store-badge-nav .badge-text strong {
        font-size: 0.85rem;
    }

    main {
        padding: 100px 0 60px;
    }

    .article-body {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .article-body h2 {
        font-size: 1.3rem;
        margin: 36px 0 12px;
    }

    h1.article-title {
        font-size: 1.7rem;
    }
}
