/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: hsl(250, 85%, 60%);
    --color-primary-light: hsl(270, 80%, 65%);
    --color-primary-8: hsl(250, 85%, 60%, 0.08);
    --color-primary-15: hsl(250, 85%, 60%, 0.15);
    --color-bg: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-card-bg: #f9fafb;
    --color-hero-bg: hsl(250, 40%, 97%);
    --gradient: linear-gradient(135deg, hsl(250, 85%, 60%) 0%, hsl(270, 80%, 65%) 100%);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Cascadia Code', monospace;
    --max-width: 1200px;
    --content-width: 720px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --radius: 0.75rem;
    --radius-lg: 1rem;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Utilities ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 640px) {
    .container { padding: 0 2rem; }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 14px -4px hsl(250, 85%, 60%, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -4px hsl(250, 85%, 60%, 0.5);
    color: #fff;
}

.btn-white {
    background: #fff;
    color: var(--color-primary);
    font-weight: 700;
}

.btn-white:hover {
    background: hsl(250, 40%, 97%);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary-15);
}

.btn-outline:hover {
    background: var(--color-primary-8);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-lg {
    font-size: 1rem;
    padding: 0.75rem 2rem;
}

/* ===== Header ===== */
.header {
    border-bottom: 1px solid var(--color-border);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo img {
    width: 28px;
    height: 28px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 0.375rem 0.5rem;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-cta {
    background: var(--gradient);
    color: #fff !important;
    border-radius: 9999px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.nav-cta:hover {
    opacity: 0.9;
    color: #fff !important;
}

@media (min-width: 768px) {
    .nav { gap: 1.25rem; }
    .nav-link { font-size: 0.875rem; padding: 0.375rem 0; }
    .nav-cta { font-size: 0.85rem; padding: 0.5rem 1.25rem; }
}

/* ===== Category Tag ===== */
.category-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    background: var(--color-primary-8);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.category-tag-sm {
    font-size: 0.625rem;
    padding: 0.2rem 0.5rem;
}

/* ===== Read More Link ===== */
.read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: auto;
    padding-top: 0.5rem;
}

.meta-sep {
    color: var(--color-border);
}

/* ===== Author Inline ===== */
.author-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

/* ===== Home ===== */
.home-hero {
    background: var(--color-hero-bg);
    padding: 3rem 0;
    text-align: center;
}

.home-hero-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.home-hero-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.home-hero-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .home-hero { padding: 4rem 0; }
    .home-hero-title { font-size: 2.75rem; }
    .home-hero-subtitle { font-size: 1.15rem; }
}

/* ===== Featured Card ===== */
.featured-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 2.5rem 0;
    transition: border-color 0.2s, box-shadow 0.25s;
    text-decoration: none;
    color: inherit;
}

.featured-card:hover {
    border-color: var(--color-primary-15);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.featured-card-image img,
.featured-card-placeholder {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.featured-card-placeholder,
.post-card-placeholder,
.related-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-hero-bg);
    color: var(--color-primary-15);
    height: 100%;
    min-height: inherit;
}

.featured-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.featured-card-title {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}

.featured-card-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.featured-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .featured-card {
        flex-direction: row;
    }
    .featured-card-image {
        flex: 0 0 45%;
        max-width: 45%;
    }
    .featured-card-image img { height: 100%; min-height: 320px; }
    .featured-card-placeholder { min-height: 320px; }
    .featured-card-body { padding: 2rem; justify-content: center; }
    .featured-card-title { font-size: 1.625rem; }
}

/* ===== Posts Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 3rem;
}

@media (min-width: 640px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s;
    text-decoration: none;
    color: inherit;
}

.post-card:hover {
    border-color: var(--color-primary-15);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

.post-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.post-card-placeholder {
    height: 180px;
}

.post-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-text);
}

.post-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-top: 0.25rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 0.875rem 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

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

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

.breadcrumb-sep {
    margin: 0 0.375rem;
    color: var(--color-border);
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
    display: inline-block;
    vertical-align: bottom;
}

/* ===== Post Hero ===== */
.post-hero {
    background: var(--color-hero-bg);
    padding: 2.5rem 0;
}

.post-hero-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-hero-text {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    justify-content: center;
}

.post-hero-title {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.post-hero-reading {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.post-hero-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.author-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.post-hero-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    object-fit: cover;
    max-height: 320px;
}

.post-hero-placeholder {
    width: 100%;
    height: 220px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, hsl(250, 50%, 94%), hsl(270, 40%, 92%));
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(250, 30%, 80%);
}

@media (min-width: 768px) {
    .post-hero { padding: 3.5rem 0; }
    .post-hero-inner {
        flex-direction: row;
        align-items: center;
    }
    .post-hero-text { flex: 1; }
    .post-hero-image {
        flex: 0 0 42%;
        max-width: 42%;
    }
    .post-hero-title { font-size: 2.25rem; }
    .post-hero-placeholder { height: 280px; }
}

@media (min-width: 1024px) {
    .post-hero { padding: 4.5rem 0; }
    .post-hero-title { font-size: 2.75rem; }
    .post-hero-image { flex: 0 0 44%; max-width: 44%; }
    .post-hero-placeholder { height: 320px; }
}

/* ===== Post Body (Sidebar + Content) ===== */
.post-body {
    padding: 2.5rem 0 3rem;
}

.post-body-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .post-body-inner {
        flex-direction: row;
        gap: 3rem;
    }
}

/* ===== Post Sidebar ===== */
.post-sidebar {
    order: -1;
}

.sidebar-mobile-toggle {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sidebar-mobile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    color: var(--color-text);
}

.sidebar-mobile-btn::-webkit-details-marker { display: none; }

.sidebar-mobile-toggle[open] .sidebar-mobile-btn {
    border-bottom: 1px solid var(--color-border);
}

.toc-mobile {
    padding: 0.75rem 1rem;
}

.sidebar-sticky {
    display: none;
}

@media (min-width: 1024px) {
    .post-sidebar {
        flex: 0 0 220px;
        order: 0;
    }
    .sidebar-mobile-toggle { display: none; }
    .sidebar-sticky {
        display: block;
        position: sticky;
        top: 80px;
    }
}

/* ===== Table of Contents ===== */
.toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li + li {
    margin-top: 0.25rem;
}

.toc-link {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: block;
    padding: 0.3rem 0;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    line-height: 1.35;
}

.toc-link:hover {
    color: var(--color-text);
}

.toc-link.active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

/* ===== Social Share ===== */
.social-share {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.social-share-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.625rem;
}

.social-share-buttons {
    display: flex;
    gap: 0.5rem;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    border-color: var(--color-primary-15);
    color: var(--color-primary);
    background: var(--color-primary-8);
}

.social-whatsapp:hover { color: #25D366; }
.social-linkedin:hover { color: #0077B5; }
.social-twitter:hover { color: #1DA1F2; }
.social-facebook:hover { color: #1877F2; }

.social-copy.copied {
    background: var(--color-primary-8);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ===== Article Content ===== */
.post-content {
    flex: 1;
    min-width: 0;
    max-width: var(--content-width);
}

@media (min-width: 1024px) {
    .post-content {
        max-width: none;
    }
}

/* ===== Prose ===== */
.prose {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--color-text);
}

.prose > *:first-child {
    margin-top: 0;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    scroll-margin-top: 80px;
}

.prose h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose li::marker {
    color: var(--color-primary);
}

.prose blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    background: var(--color-primary-8);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-card-bg);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    border: 1px solid var(--color-border);
}

.prose pre {
    background: var(--color-text);
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.prose pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

.prose img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.prose strong {
    font-weight: 600;
}

/* ===== Article CTA ===== */
.article-cta {
    margin: 2.5rem 0;
    padding: 2rem;
    background: var(--color-hero-bg);
    border: 1px solid var(--color-primary-15);
    border-radius: var(--radius-lg);
    text-align: center;
}

.article-cta-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.article-cta-content p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.article-cta-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

/* ===== About Box ===== */
.about-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.about-box h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.about-box p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ===== Related Articles ===== */
.related-section {
    padding: 3rem 0;
    background: var(--color-card-bg);
    border-top: 1px solid var(--color-border);
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    border-color: var(--color-primary-15);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

.related-card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.related-card-placeholder {
    height: 160px;
}

.related-card-body {
    padding: 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.related-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-text);
}

.related-card-author {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.related-all {
    text-align: center;
    margin-top: 2rem;
}

/* ===== Conversion Banner ===== */
.conversion-banner {
    background: var(--gradient);
    padding: 4rem 0;
    text-align: center;
    color: #fff;
}

.conversion-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.conversion-subtitle {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.conversion-cta {
    margin-bottom: 0.75rem;
}

.conversion-note {
    font-size: 0.8rem;
    opacity: 0.75;
}

@media (min-width: 768px) {
    .conversion-banner { padding: 5rem 0; }
    .conversion-title { font-size: 2.25rem; }
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.footer-logo:hover { color: var(--color-text); }

.footer-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.375rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

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

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

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
    .footer-links { gap: 2rem; }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* ===== 404 ===== */
.not-found {
    text-align: center;
    padding: 4rem 1rem;
}

.not-found h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.not-found p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}
