/* ============================================
   LinuxLaunchpad Ghost Theme
   Dark theme with emerald green accent
   ============================================ */

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

:root {
    --bg: #09090b;
    --bg-card: #111113;
    --bg-card-hover: #18181b;
    --border: #27272a;
    --border-light: #3f3f46;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --green: #22c55e;
    --green-dark: #16a34a;
    --green-glow: rgba(34, 197, 94, 0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --max-width: 1200px;
    --content-width: 720px;
    --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

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

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
}

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

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

.site-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
}

.site-nav a:hover {
    color: var(--text);
    background: var(--bg-card-hover);
}

.nav-search {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-pill);
    transition: color var(--transition);
    display: flex;
    align-items: center;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--green);
    color: #000;
    border-color: var(--green);
}

.btn-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-outline:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--bg-card);
}

/* --- Hero --- */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.hero-badge svg { color: var(--green); }

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.text-green { color: var(--green); }

.hero-description {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.hero-badges {
    display: flex;
    gap: 16px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
}

.badge svg { color: var(--green); }

/* --- Terminal --- */
.terminal {
    background: #0c0c0e;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 60px var(--green-glow), 0 20px 60px rgba(0,0,0,0.5);
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #111113;
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.terminal-title {
    font-size: 12px;
    color: var(--text-dim);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.terminal-body {
    padding: 20px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 2;
}

.terminal-line { white-space: nowrap; }

.prompt { color: var(--green); font-weight: bold; }
.dir { color: #38bdf8; }
.cmd { color: var(--text); }

.cursor {
    color: var(--green);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* --- Features --- */
.features {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: border-color var(--transition), background var(--transition);
}

.feature-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--green);
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* --- Section Titles --- */
.section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 6px;
}

/* --- Featured Guide --- */
.featured-guide {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.featured-guide .section-title { margin-bottom: 24px; }

.featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition);
}

.featured-card:hover { border-color: var(--border-light); }

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-dim);
}

.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--green-glow);
    color: var(--green);
    font-size: 12px;
    font-weight: 500;
}

.featured-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.featured-content p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.read-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-weight: 500;
    font-size: 14px;
    transition: gap var(--transition);
}

.read-link:hover { gap: 12px; }

/* --- Posts Grid --- */
.posts-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.posts-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.post-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-image-wrap {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-card-hover);
}

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

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

.post-card-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.post-card-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(8px);
    color: var(--green);
    font-size: 12px;
    font-weight: 500;
}

.post-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-date {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.post-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green);
    font-size: 14px;
    font-weight: 500;
    transition: gap var(--transition);
}

.post-card:hover .post-card-readmore { gap: 10px; }

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

/* --- Post Full --- */
.post-full {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.post-header {
    margin-bottom: 40px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.reading-time { color: var(--text-dim); }

.post-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.post-excerpt {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.author-info a {
    font-weight: 500;
    font-size: 14px;
}

.post-feature-image {
    margin-bottom: 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-feature-image img {
    width: 100%;
}

/* --- Post Content --- */
.post-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
}

.post-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.post-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
}

.post-content p { margin-bottom: 24px; }

.post-content a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content a:hover { color: var(--green-dark); }

.post-content ul, .post-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 8px; }

.post-content blockquote {
    border-left: 3px solid var(--green);
    padding: 16px 24px;
    margin: 32px 0;
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-style: italic;
}

.post-content pre {
    background: #0c0c0e;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 24px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.post-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--green);
}

.post-content pre code {
    background: none;
    padding: 0;
    color: var(--text);
}

.post-content img {
    border-radius: var(--radius);
    margin: 32px 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.post-content th, .post-content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    background: var(--bg-card);
    font-weight: 600;
}

/* --- Post Footer --- */
.post-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag-pill {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.tag-pill:hover {
    border-color: var(--green);
    color: var(--green);
}

/* --- Related Posts --- */
.related-posts {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.related-posts .section-title { margin-bottom: 24px; }

/* --- Tag Page --- */
.tag-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 40px;
    text-align: center;
}

.tag-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.tag-description {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 12px;
}

.tag-count {
    font-size: 14px;
    color: var(--text-dim);
}

/* --- Author Page --- */
.author-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 40px;
    text-align: center;
}

.author-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    object-fit: cover;
    border: 2px solid var(--border);
}

.author-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.author-bio {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 12px;
}

.author-location {
    color: var(--text-dim);
    font-size: 14px;
}

/* --- Error Page --- */
.error-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px 24px;
    text-align: center;
}

.error-code {
    font-size: 120px;
    font-weight: 800;
    color: var(--green);
    line-height: 1;
    margin-bottom: 16px;
}

.error-message {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 32px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 48px;
}

.footer-brand { max-width: 300px; }

.footer-brand .site-logo { margin-bottom: 12px; }

.footer-description {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-col h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-col li { margin-bottom: 10px; }

.footer-col a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color var(--transition);
}

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

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

.footer-bottom p {
    color: var(--text-dim);
    font-size: 13px;
}

.footer-meta {
    display: flex;
    gap: 24px;
}

.footer-meta a {
    color: var(--text-dim);
    font-size: 13px;
    transition: color var(--transition);
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 48px 24px;
        gap: 40px;
    }

    .features { grid-template-columns: 1fr; }

    .post-grid { grid-template-columns: repeat(2, 1fr); }

    .featured-card { grid-template-columns: 1fr; }

    .featured-image { aspect-ratio: 16/9; }

    .footer-top { flex-direction: column; gap: 40px; }
}

@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }

    .site-nav { display: none; }
    .site-nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
    }

    .nav-toggle { display: block; }

    .hero-title { font-size: 32px; }

    .footer-links { flex-direction: column; gap: 32px; }

    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* --- Koenig Width Classes --- */
.kg-width-wide {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
}

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

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

/* --- Ghost-specific overrides --- */
.kg-card { margin-bottom: 24px; }

.kg-image-card img { border-radius: var(--radius); }

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

.kg-bookmark-container { display: flex; }

.kg-bookmark-content { padding: 20px; flex: 1; }

.kg-bookmark-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.kg-bookmark-description {
    color: var(--text-muted);
    font-size: 14px;
}

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

.kg-gallery-card { margin-bottom: 24px; }

.kg-callout-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.kg-toggle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
