/* ── ZSM Digital Blog ── */
/* Matches site design system: dark minimal, Inter + Playfair Display */

:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-bg-top: #0a0a0b;
    --card-bg-bottom: #111113;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-muted: #888888;
    --text-soft: #bdbdbd;
    --accent-glow: rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* ── Navbar (matches home page exactly) ── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.85);
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}
.logo {
    display: flex; align-items: center; gap: 12px;
    color: white; text-decoration: none; font-weight: 600; font-size: 16px;
}
.logo-icon {
    width: 32px; height: 32px;
    background: url('https://zsm.digital/static/cleaned_transparent_image.png') center/contain no-repeat;
    filter: brightness(1.2);
}
.nav-links {
    display: flex; align-items: center; gap: 40px; list-style: none;
}
.nav-links a {
    color: #999; text-decoration: none; font-weight: 400; font-size: 14px;
    transition: all 0.3s ease; letter-spacing: 0.01em;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-buttons { display: flex; align-items: center; gap: 16px; }
.login-btn {
    color: #999; text-decoration: none; font-weight: 400; font-size: 14px;
    transition: color 0.3s ease;
}
.login-btn:hover { color: white; }
.signup-btn {
    background: white; color: #000; padding: 10px 22px; border-radius: 6px;
    text-decoration: none; font-weight: 500; font-size: 14px;
    transition: all 0.3s ease;
}
.signup-btn:hover { background: #e5e5e5; transform: translateY(-1px); }

/* ── Mobile menu ── */
.hamburger {
    display: none; flex-direction: column; cursor: pointer;
    padding: 8px; border-radius: 8px; transition: all 0.3s ease;
}
.hamburger:hover { background: rgba(255, 255, 255, 0.05); }
.hamburger span {
    width: 20px; height: 2px; background: white; margin: 3px 0;
    transition: all 0.3s ease; border-radius: 2px; transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scale(0); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.mobile-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 999; opacity: 0; transition: opacity 0.3s ease;
}
.mobile-overlay.active { display: block; opacity: 1; }
.mobile-menu {
    display: none; position: absolute; top: calc(100% + 10px);
    left: 20px; right: 20px;
    background: rgba(10, 10, 12, 0.98); border-radius: 16px;
    padding: 24px 20px; backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0; transform: translateY(-10px); transition: all 0.3s ease;
}
.mobile-menu.active { display: block; opacity: 1; transform: translateY(0); }
.mobile-nav-links { list-style: none; margin-bottom: 20px; }
.mobile-nav-links li { margin: 0; }
.mobile-nav-links a {
    color: #999; text-decoration: none; font-weight: 400; font-size: 15px;
    display: block; padding: 12px 16px; border-radius: 10px;
    transition: all 0.3s ease;
}
.mobile-nav-links a:hover, .mobile-nav-links a.active {
    color: white; background: rgba(255, 255, 255, 0.05);
}
.mobile-buttons {
    display: flex; flex-direction: column; gap: 10px;
    padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-buttons .login-btn {
    text-align: center; padding: 12px 20px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.05); color: #999;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease; font-weight: 400;
}
.mobile-buttons .login-btn:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.mobile-buttons .signup-btn {
    text-align: center; padding: 12px 20px; border-radius: 8px;
    background: white; color: #000; border: none;
    transition: all 0.3s ease; font-weight: 500;
}
.mobile-buttons .signup-btn:hover { background: #e5e5e5; }

@media (max-width: 900px) {
    .navbar { padding: 14px 20px; }
    .nav-links, .nav-buttons { display: none; }
    .hamburger { display: flex; }
}

/* ── Blog Hero ── */
.blog-hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 160px 40px 80px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 70%),
        var(--bg-color);
}
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 1;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 72%);
}
.blog-hero::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.015) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}
.blog-hero-inner {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 1s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
}
@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
    display: inline-block;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.15em; color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 6px 16px; border-radius: 100px;
    margin-bottom: 24px;
}
.blog-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    color: white;
}
.blog-hero h1 em {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
}
.blog-hero h1 .hero-brand-z {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-style: normal;
}
.blog-hero h1 strong {
    font-weight: 400;
}
.hero-subtitle {
    font-size: 1.1rem; color: #666; line-height: 1.6;
    max-width: 500px; margin: 0 auto;
    font-weight: 400;
}

/* ── Category Filter Bar ── */
.category-bar { padding: 0 40px 40px; }
.category-bar-inner {
    max-width: 900px; margin: 0 auto;
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center;
}
.cat-pill {
    display: inline-block; padding: 7px 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px; font-size: 12px; font-weight: 500;
    color: #666; text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
}
.cat-pill:hover { border-color: rgba(255, 255, 255, 0.15); color: var(--text-main); }
.cat-pill.active {
    background: #fff; color: #000; border-color: #fff;
}

/* ── Blog Grid ── */
.blog-grid-section { padding: 0 40px 60px; }
.blog-grid {
    max-width: 1100px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.blog-card {
    position: relative;
    background: var(--card-bg-top);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    overflow: hidden;
    text-decoration: none; color: inherit;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    display: flex; flex-direction: column;
}
.blog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.015) 100%);
    pointer-events: none;
    z-index: 1;
}
.blog-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Card entrance animation */
@keyframes cardReveal {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.blog-card {
    opacity: 0;
    animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.blog-card:nth-child(1) { animation-delay: 0.05s; }
.blog-card:nth-child(2) { animation-delay: 0.12s; }
.blog-card:nth-child(3) { animation-delay: 0.19s; }
.blog-card:nth-child(4) { animation-delay: 0.26s; }
.blog-card:nth-child(5) { animation-delay: 0.33s; }
.blog-card:nth-child(6) { animation-delay: 0.40s; }
.blog-card:nth-child(7) { animation-delay: 0.47s; }
.blog-card:nth-child(8) { animation-delay: 0.54s; }
.blog-card:nth-child(9) { animation-delay: 0.61s; }
.blog-card-image {
    position: relative; width: 100%;
    aspect-ratio: 16 / 9; overflow: hidden;
    background: #0a0a0b;
}
.blog-card-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-image img { transform: scale(1.04); }
.blog-card-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.1);
}
.blog-card-placeholder svg { width: 48px; height: 48px; }
.blog-card-body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.blog-card-category {
    display: inline-block;
    font-family: 'Inter', monospace;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-muted); margin-bottom: 10px;
}
.blog-card-title {
    font-size: 1.1rem; font-weight: 500; line-height: 1.4;
    margin-bottom: 10px; color: #fff;
}
.blog-card-excerpt {
    font-size: 0.85rem; color: #666; line-height: 1.6;
    margin-bottom: 16px; flex: 1;
    font-weight: 400;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-meta {
    font-size: 0.8rem; color: #666;
    display: flex; align-items: center; gap: 6px;
    font-weight: 400;
}
.meta-dot { opacity: 0.4; }

/* ── Empty State ── */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center; padding: 80px 20px;
    color: #666;
}
.blog-empty svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.2; }
.blog-empty h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text-main); font-weight: 400; }
.blog-empty p { font-weight: 400; }

/* ── Pagination ── */
.blog-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; padding: 0 40px 60px;
}
.page-btn {
    display: inline-block; padding: 10px 22px;
    border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 2px;
    font-size: 14px; font-weight: 500;
    color: var(--text-main); text-decoration: none;
    transition: all 0.3s ease;
}
.page-btn:hover { border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.02); }
.page-info { font-size: 13px; color: #666; font-weight: 400; }

/* ═══════════════════════════════════════
   Article Detail Page
   ═══════════════════════════════════════ */

.article-hero {
    position: relative; width: 100%;
    max-height: 480px; overflow: hidden;
    margin-top: 64px;
}
.article-hero img {
    width: 100%; height: 480px; object-fit: cover;
    display: block;
    filter: grayscale(100%);
    pointer-events: none;
}
.article-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--bg-color) 100%);
    filter: grayscale(100%);
    pointer-events: none;
}
.article-container {
    max-width: 760px; margin: 0 auto;
    padding: 0 24px 80px;
    position: relative;
}
.blog-article .article-container {
    margin-top: -60px;
}
.blog-article:not(:has(.article-hero)) .article-container {
    margin-top: 120px;
}

/* Breadcrumb */
.article-breadcrumb {
    font-size: 13px; color: #666;
    margin-bottom: 32px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-weight: 400;
}
.article-breadcrumb a {
    color: #666; text-decoration: none;
    transition: color 0.3s ease;
}
.article-breadcrumb a:hover { color: var(--text-main); }
.bc-sep { opacity: 0.3; }
.bc-current { color: #999; }

/* Header */
.article-header { margin-bottom: 48px; }
.article-category {
    display: inline-block;
    font-family: 'Inter', monospace;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-muted); margin-bottom: 16px;
}
.article-header h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    color: #fff;
}
.article-excerpt {
    font-size: 1.1rem; color: #666; line-height: 1.6;
    margin-bottom: 20px; font-weight: 400;
}
.article-meta {
    font-size: 0.85rem; color: #666;
    display: flex; align-items: center; gap: 6px;
    font-weight: 400;
}

/* ── Article Content (rich HTML) ── */
.article-content {
    font-size: 1.05rem; line-height: 1.85; color: #666;
    font-weight: 400;
}
.article-content h2 {
    font-size: 1.6rem; font-weight: 500;
    color: var(--text-main);
    margin: 48px 0 16px;
    letter-spacing: -0.02em;
}
.article-content h3 {
    font-size: 1.2rem; font-weight: 500;
    color: var(--text-main);
    margin: 36px 0 12px;
}
.article-content p { margin-bottom: 20px; }
.article-content a {
    color: #fff; text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}
.article-content a:hover { opacity: 0.7; }
.article-content ul, .article-content ol {
    margin: 0 0 20px 24px; color: #666;
}
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
    border-left: 3px solid rgba(255,255,255,0.15);
    padding: 16px 0 16px 24px;
    margin: 28px 0;
    color: #888;
    font-style: italic;
    font-size: 1.1rem;
}
.article-content img {
    max-width: 100%; height: auto;
    border-radius: 2px;
    margin: 28px 0;
    display: block;
}
.article-content pre {
    background: #0e0e10;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    padding: 20px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 24px 0;
}
.article-content code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.article-content pre code {
    background: transparent; padding: 0;
}

/* Tags */
.article-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 48px; padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.tag-chip {
    display: inline-block; padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 2px; font-size: 11px;
    color: #666; font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}
.tag-chip:hover { border-color: rgba(255, 255, 255, 0.15); color: #999; }

/* Share */
.article-share {
    margin-top: 32px; padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; align-items: center; gap: 16px;
}
.share-label { font-size: 13px; color: #666; font-weight: 400; }
.share-links { display: flex; gap: 8px; }
.share-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 2px;
    color: #666; background: transparent;
    text-decoration: none; cursor: pointer;
    transition: all 0.3s ease; font-size: 12px;
}
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { border-color: rgba(255, 255, 255, 0.15); color: var(--text-main); }
.share-copy {
    width: auto; padding: 0 14px; font-family: inherit;
}

/* ── Related Posts ── */
.related-section { padding: 60px 40px 80px; }
.related-inner { max-width: 1100px; margin: 0 auto; }
.related-inner h2 {
    font-size: 1.6rem; font-weight: 400;
    margin-bottom: 32px; text-align: center;
    letter-spacing: -0.02em;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* ── CTA Section (matches home page final-cta) ── */
.final-cta {
    background: rgba(255, 255, 255, 0.02);
    margin: 80px 20px;
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    transition: border-color 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.final-cta:hover {
    border-color: rgba(255, 255, 255, 0.15);
}
.final-cta h2 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.final-cta p {
    color: #888;
    margin-bottom: 36px;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
}
.cta-btn {
    display: inline-block; padding: 14px 36px;
    background: #fff; color: #000;
    border-radius: 8px; font-weight: 500; font-size: 14px;
    text-decoration: none; transition: all 0.3s ease;
}
.cta-btn:hover { background: #e5e5e5; transform: translateY(-1px); }

/* ── Footer (matches home page) ── */
.footer {
    background: rgba(0, 0, 0, 0.4);
    padding: 60px 20px 30px;
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-content {
    max-width: 1200px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-section h4 {
    font-weight: 500;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: #fff;
}
.footer-section a,
.footer-section p {
    color: #666;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}
.footer-section a:hover { color: #999; }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #555;
    font-size: 0.85rem;
}
.footer-bottom p { font-size: 0.8rem; color: #444; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .blog-hero { min-height: 60vh; padding: 130px 20px 50px; }
    .blog-grid-section, .category-bar, .blog-pagination { padding-left: 20px; padding-right: 20px; }
    .blog-grid { grid-template-columns: 1fr; gap: 20px; }
    .article-hero img { height: 280px; }
    .article-container { padding: 0 16px 60px; }
    .article-content { font-size: 1rem; }
    .related-section { padding: 40px 20px 60px; }
    .related-grid { grid-template-columns: 1fr; }
    .final-cta { margin: 40px 20px; padding: 40px 20px; }
    .footer { padding: 40px 20px 30px; margin-top: 40px; }
    .article-share { flex-direction: column; align-items: flex-start; }
}
