/* ===== SONOCREA GHOST THEME ===== */
/* Colors: Violet #8b5cf6 | Indigo #6366f1 | Amber #f59e0b */
/* Background: dark gray-800 -> gray-900 -> slate-900 */

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

:root {
    --color-primary: #8b5cf6;
    --color-secondary: #6366f1;
    --color-accent: #f59e0b;
    --color-bg: #111827;
    --color-bg-2: #0f172a;
    --color-bg-card: rgba(255,255,255,0.05);
    --color-bg-card-hover: rgba(255,255,255,0.08);
    --color-border: rgba(255,255,255,0.08);
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-glow: 0 0 40px rgba(139,92,246,0.15);
    --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ===== BACKGROUND ORBS ===== */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: float 8s ease-in-out infinite;
}
.bg-orb-1 {
    width: 500px; height: 500px;
    background: rgba(139,92,246,0.08);
    top: 5%; left: -5%;
    animation-delay: 0s;
}
.bg-orb-2 {
    width: 400px; height: 400px;
    background: rgba(59,130,246,0.08);
    bottom: 10%; right: -5%;
    animation-delay: -4s;
}
@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* ===== HEADER / NAV ===== */
.site-header {
    position: sticky; top: 0;
    z-index: 100;
    background: rgba(17,24,39,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}
.site-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.nav-brand { display: flex; align-items: center; }
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--color-text);
}
.logo-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 20px rgba(139,92,246,0.4);
}
.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all var(--transition);
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.07); }
.btn-nav-cta {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    transition: all var(--transition) !important;
    box-shadow: 0 4px 15px rgba(139,92,246,0.3);
}
.btn-nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(139,92,246,0.45) !important; }

/* ===== HERO ===== */
.home-hero {
    position: relative; z-index: 1;
    text-align: center;
    padding: 80px 24px 60px;
}
.home-hero-small { padding: 50px 24px 40px; }
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    color: #c4b5fd;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px; font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}
.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    color: #fff;
}
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 18px;
    color: var(--color-text-muted);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== POSTS CONTAINER ===== */
.posts-container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; }
.section-title {
    font-size: 22px; font-weight: 700;
    color: #fff;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}
.featured-section { margin-bottom: 60px; }
.posts-grid-section { margin-bottom: 40px; }

/* ===== POST CARDS ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.post-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.post-card:hover {
    background: var(--color-bg-card-hover);
    border-color: rgba(139,92,246,0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.post-card-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
}
.post-card-image {
    width: 100%; aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(99,102,241,0.2));
}
.post-card-featured .post-card-image { aspect-ratio: auto; height: 100%; min-height: 280px; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-no-image { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.1)); }
.post-card-placeholder { font-size: 48px; opacity: 0.4; }
.post-card-content { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.post-tag {
    display: inline-block;
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.25);
    color: #c4b5fd;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px; font-weight: 600;
    text-decoration: none;
    width: fit-content;
    transition: all var(--transition);
}
.post-tag:hover { background: rgba(139,92,246,0.25); color: #fff; }
.post-card-title { font-size: 18px; font-weight: 700; line-height: 1.35; }
.post-card-title a { color: #fff; text-decoration: none; transition: color var(--transition); }
.post-card-title a:hover { color: #c4b5fd; }
.post-card-featured .post-card-title { font-size: 24px; }
.post-card-excerpt { color: var(--color-text-muted); font-size: 14px; line-height: 1.6; }
.post-card-meta { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.post-date, .read-time { color: var(--color-text-muted); font-size: 12px; }
.read-time::before { content: "· "; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 48px; }
.pagination a, .pagination .page-number {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}
.pagination a { background: var(--color-bg-card); border: 1px solid var(--color-border); color: var(--color-text); }
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .page-number { color: var(--color-text-muted); }

/* ===== SINGLE POST ===== */
.post-full { max-width: 760px; margin: 0 auto; padding: 60px 24px 80px; position: relative; z-index: 1; }
.post-full-header { margin-bottom: 40px; text-align: center; }
.post-full-title { font-size: clamp(28px, 5vw, 48px); font-weight: 800; line-height: 1.2; margin: 16px 0 20px; }
.post-full-excerpt { font-size: 20px; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 24px; }
.post-full-meta { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.author-info { display: flex; align-items: center; gap: 8px; }
.author-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.author-avatar-placeholder { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.author-name { font-size: 14px; font-weight: 600; color: #fff; }
.post-full-image { margin: 0 -24px 48px; border-radius: var(--radius-lg); overflow: hidden; }
.post-full-image img { width: 100%; max-height: 520px; object-fit: cover; }
.image-caption { text-align: center; font-size: 13px; color: var(--color-text-muted); padding: 8px 0; }

/* ===== POST CONTENT ===== */
.gh-content { font-size: 17px; line-height: 1.8; color: #e2e8f0; }
.gh-content h1, .gh-content h2, .gh-content h3, .gh-content h4 { color: #fff; font-weight: 700; margin: 2em 0 0.75em; line-height: 1.3; }
.gh-content h2 { font-size: 28px; }
.gh-content h3 { font-size: 22px; }
.gh-content p { margin-bottom: 1.5em; }
.gh-content a { color: #a78bfa; text-decoration: underline; text-decoration-color: rgba(167,139,250,0.4); transition: all var(--transition); }
.gh-content a:hover { color: #c4b5fd; text-decoration-color: rgba(196,181,253,0.6); }
.gh-content img { max-width: 100%; border-radius: var(--radius); margin: 2em 0; }
.gh-content blockquote { border-left: 3px solid var(--color-primary); padding: 16px 24px; margin: 2em 0; background: rgba(139,92,246,0.08); border-radius: 0 var(--radius) var(--radius) 0; }
.gh-content blockquote p { color: #c4b5fd; font-style: italic; margin-bottom: 0; }
.gh-content code { background: rgba(139,92,246,0.15); color: #c4b5fd; padding: 2px 8px; border-radius: 4px; font-size: 0.9em; font-family: 'JetBrains Mono', monospace; }
.gh-content pre { background: rgba(0,0,0,0.4); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; overflow-x: auto; margin: 2em 0; }
.gh-content pre code { background: none; padding: 0; color: #e2e8f0; }
.gh-content ul, .gh-content ol { padding-left: 24px; margin-bottom: 1.5em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content hr { border: none; border-top: 1px solid var(--color-border); margin: 3em 0; }
.gh-content table { width: 100%; border-collapse: collapse; margin: 2em 0; }
.gh-content th, .gh-content td { padding: 12px 16px; border: 1px solid var(--color-border); text-align: left; }
.gh-content th { background: rgba(139,92,246,0.1); color: #c4b5fd; font-weight: 600; }
.gh-content figure { margin: 2em 0; }
.gh-content figcaption { text-align: center; color: var(--color-text-muted); font-size: 14px; margin-top: 8px; }

/* ===== POST FOOTER / TAGS ===== */
.post-full-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--color-border); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== CTA BOX ===== */
.post-cta-box {
    margin-top: 48px;
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(99,102,241,0.1));
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(10px);
}
.cta-icon { font-size: 40px; margin-bottom: 16px; }
.post-cta-box h3 { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.post-cta-box p { color: var(--color-text-muted); font-size: 16px; margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }
.btn-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff !important;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600; font-size: 15px;
    text-decoration: none !important;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(139,92,246,0.35);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(139,92,246,0.5); }

/* ===== FOOTER ===== */
.site-footer {
    position: relative; z-index: 1;
    border-top: 1px solid var(--color-border);
    background: rgba(17,24,39,0.6);
    backdrop-filter: blur(10px);
    padding: 48px 24px;
    text-align: center;
}
.footer-inner { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-desc { color: var(--color-text-muted); font-size: 14px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--color-text-muted); text-decoration: none; font-size: 14px; transition: color var(--transition); }
.footer-links a:hover { color: #c4b5fd; }
.footer-copy { color: rgba(148,163,184,0.5); font-size: 13px; }

/* ===== SITE MAIN ===== */
.site-main { position: relative; z-index: 1; min-height: calc(100vh - 68px - 200px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .post-card-featured { grid-template-columns: 1fr; }
    .post-card-featured .post-card-image { min-height: 200px; aspect-ratio: 16/9; }
    .posts-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .home-hero { padding: 50px 20px 40px; }
    .post-full { padding: 40px 20px 60px; }
    .post-cta-box { padding: 28px 20px; }
    .bg-orb-1 { width: 300px; height: 300px; }
    .bg-orb-2 { width: 250px; height: 250px; }
}
@media (max-width: 480px) {
    .posts-grid { gap: 16px; }
    .hero-title { font-size: 30px; }
}

/* ===== GHOST BUILT-IN CLASSES ===== */
.kg-image-card img { border-radius: var(--radius); }
.kg-gallery-card { margin: 2em 0; }
.kg-gallery-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.kg-bookmark-card { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; margin: 2em 0; }
.kg-bookmark-content { padding: 16px; background: var(--color-bg-card); }
.kg-bookmark-title { color: #fff; font-weight: 600; margin-bottom: 6px; }
.kg-bookmark-description { color: var(--color-text-muted); font-size: 13px; }
.kg-video-card { margin: 2em 0; }
.kg-video-card video { width: 100%; border-radius: var(--radius); }

/* ===== CARD FULL CLICKABLE ===== */
.post-card {
    position: relative;
}
.post-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--radius-lg);
}
.post-card-content .post-tag,
.post-card-content .post-card-title,
.post-card-content a {
    position: relative;
    z-index: 2;
}

/* ===== GHOST KG CARD WIDTHS (required) ===== */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: 2em calc(50% - 42.5vw);
}
.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.kg-width-full img,
.kg-width-wide img {
    width: 100%;
    border-radius: 0;
}
