/* ==========================================================================
   Lexunit Blog Theme - Ghost CMS
   ========================================================================== */

/* Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --accent: #0cc066;
    --accent-hover: #0aa058;
    --border: #262626;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;
}

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

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

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

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

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

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

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo img {
    height: 32px;
    width: auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav li {
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--text-primary);
}

.nav-subscribe {
    background: var(--accent);
    color: var(--bg-primary) !important;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 600;
}

.nav-subscribe:hover {
    background: var(--accent-hover);
    color: var(--bg-primary) !important;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.2s ease;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.site-main {
    flex: 1;
    padding-top: 80px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.hero-container {
    max-width: 700px;
    margin: 0 auto;
}

.hero-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ==========================================================================
   Tags Filter
   ========================================================================== */

.tags-filter {
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 64px;
    z-index: 50;
}

.tags-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.tag-pill {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tag-pill:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.tag-pill.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.tag-pill.active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ==========================================================================
   Newsletter Section
   ========================================================================== */

.newsletter-section {
    padding: 4rem 2rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.newsletter-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.newsletter-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.newsletter-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.newsletter-form .form-group {
    display: flex;
    gap: 0.75rem;
    max-width: 450px;
    margin: 0 auto;
}

.newsletter-form input[type="email"] {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
}

.newsletter-form input[type="email"]::placeholder {
    color: var(--text-muted);
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent);
}

.newsletter-form button {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 100px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.newsletter-form button:hover {
    background: var(--accent-hover);
}

.newsletter-form .button-loading {
    display: none;
}

.newsletter-form.loading .button-text {
    display: none;
}

.newsletter-form.loading .button-loading {
    display: inline;
}

.form-message {
    margin-top: 1rem;
}

.form-message p {
    display: none;
    font-size: 0.875rem;
}

.newsletter-form.success .success-message {
    display: block;
    color: var(--accent);
}

.newsletter-form.error .error-message {
    display: block;
    color: #ef4444;
}

/* ==========================================================================
   Posts Section
   ========================================================================== */

.posts-section {
    padding: 4rem 2rem;
}

.posts-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* ==========================================================================
   Post Card
   ========================================================================== */

.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.post-card-image-link {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.post-card-tag {
    color: var(--accent);
    font-weight: 600;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--text-primary);
}

.post-card-title a:hover {
    color: var(--accent);
}

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.reading-time {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Single Post
   ========================================================================== */

.post-full {
    padding-bottom: 4rem;
}

.post-header {
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.post-header-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.post-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-excerpt {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

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

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

.post-author a {
    color: var(--text-secondary);
}

.post-author a:hover {
    color: var(--accent);
}

.post-feature-image {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
}

.post-feature-image img {
    border-radius: 16px;
}

.post-feature-image figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ==========================================================================
   Post Content (gh-content)
   ========================================================================== */

.post-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.gh-content > * + * {
    margin-top: 1.5rem;
}

.gh-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 3rem;
}

.gh-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 2.5rem;
}

.gh-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 2rem;
}

.gh-content p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.gh-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gh-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.gh-content ul,
.gh-content ol {
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.gh-content li + li {
    margin-top: 0.5rem;
}

.gh-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-secondary);
}

.gh-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.gh-content :not(pre) > code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.gh-content figure {
    margin: 2rem 0;
}

.gh-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.gh-content img {
    border-radius: 12px;
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

/* Ghost Cards */
.gh-content .kg-card {
    margin: 2rem 0;
}

.gh-content .kg-image-card img {
    margin: 0 auto;
}

.gh-content .kg-width-wide {
    max-width: 1000px;
    margin-left: calc(50% - 500px);
    margin-right: calc(50% - 500px);
}

.gh-content .kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.gh-content .kg-bookmark-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.gh-content .kg-bookmark-container {
    display: flex;
    text-decoration: none;
}

.gh-content .kg-bookmark-content {
    flex: 1;
    padding: 1.5rem;
}

.gh-content .kg-bookmark-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gh-content .kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.gh-content .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.gh-content .kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.gh-content .kg-bookmark-thumbnail {
    width: 200px;
    flex-shrink: 0;
}

.gh-content .kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Post Footer
   ========================================================================== */

.post-footer {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
}

.tag-link:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ==========================================================================
   Related Posts
   ========================================================================== */

.related-posts {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 4rem 2rem;
}

.related-posts-container {
    max-width: 1200px;
    margin: 0 auto;
}

.related-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* ==========================================================================
   Archive Pages (Tag, Author)
   ========================================================================== */

.archive-header {
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.archive-header-container {
    max-width: 700px;
    margin: 0 auto;
}

.archive-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.archive-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    margin-bottom: 1rem;
}

.archive-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.author-header .author-profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    object-fit: cover;
}

.author-location,
.author-website {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 3rem 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.pagination a {
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination a:hover {
    color: var(--accent);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Error Page
   ========================================================================== */

.error-section {
    padding: 8rem 2rem;
    text-align: center;
}

.error-container {
    max-width: 500px;
    margin: 0 auto;
}

.error-code {
    font-family: var(--font-mono);
    font-size: 6rem;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.3;
}

.error-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.error-button {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 600;
}

.error-button:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
}

/* ==========================================================================
   Page
   ========================================================================== */

.page-header {
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.page-header-container {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
}

.page-feature-image {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
}

.page-feature-image img {
    border-radius: 16px;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 4rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 4rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9375rem;
    max-width: 300px;
    margin-top: 1rem;
    line-height: 1.6;
}

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

.footer-column h4 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li + li {
    margin-top: 0.5rem;
}

.footer-column a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 4rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

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

.powered-by a:hover {
    color: var(--accent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .footer-container {
        flex-direction: column;
        gap: 3rem;
    }

    .posts-container,
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .gh-content .kg-width-wide,
    .gh-content .kg-width-full {
        margin-left: -2rem;
        margin-right: -2rem;
        max-width: calc(100% + 4rem);
    }
}

@media (max-width: 700px) {
    .tags-filter {
        padding: 1rem 1.5rem;
        top: 56px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tags-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        padding-bottom: 0.25rem;
    }

    .tag-pill {
        flex-shrink: 0;
        padding: 0.4rem 1rem;
        font-size: 0.8125rem;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 2rem 2rem;
        gap: 1rem;
    }

    .site-nav.active {
        display: flex;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-section,
    .post-header,
    .archive-header,
    .page-header {
        padding: 4rem 1.5rem 3rem;
    }

    .posts-section,
    .related-posts {
        padding: 3rem 1.5rem;
    }

    .newsletter-section {
        padding: 3rem 1.5rem;
    }

    .newsletter-form .form-group {
        flex-direction: column;
    }

    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .gh-content .kg-bookmark-container {
        flex-direction: column;
    }

    .gh-content .kg-bookmark-thumbnail {
        width: 100%;
        height: 200px;
    }
}
