/* linux.io - Dark Minimal Theme
   Inspired by OpenAI News / Anthropic Blog */

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

:root {
    --bg: #000000;
    --bg-elevated: #111111;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --accent: #ffffff;
    --border: #222222;
    --max-width: 1200px;
    --content-width: 720px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

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

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.site-nav a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

/* ========== Hero ========== */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 2rem 3rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* ========== Post Feed (Index) ========== */
.post-feed-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.post-card {
    border-top: 1px solid var(--border);
}

.post-card-link {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    padding: 2rem 0;
    transition: background 0.2s;
    align-items: center;
}

.post-card-link:hover {
    background: var(--bg-card-hover);
    margin: 0 -1rem;
    padding: 2rem 1rem;
    border-radius: 12px;
}

.post-card-content {
    order: 1;
}

.post-card-image {
    order: 2;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/10;
}

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

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

.post-card-tag {
    color: var(--text-primary);
    font-weight: 500;
}

.post-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.post-card-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== Post Full (Single) ========== */
.post-full {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.post-header {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 4rem 0 2rem;
}

.post-meta-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-tag {
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

.post-tag:hover {
    text-decoration: underline;
}

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

.post-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

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

.post-share {
    padding-top: 0.5rem;
}

.share-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.share-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Feature image */
.post-feature-image {
    max-width: 960px;
    margin: 0 auto 3rem;
    border-radius: 12px;
    overflow: hidden;
}

/* Post content */
.post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 3rem 0 1rem;
}

.post-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 2.5rem 0 0.75rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content a {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--text-tertiary);
    transition: text-decoration-color 0.2s;
}

.post-content a:hover {
    text-decoration-color: var(--text-primary);
}

.post-content ul, .post-content ol {
    margin: 0 0 1.5rem 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 3px solid var(--text-tertiary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-content code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
}

.post-content p code,
.post-content li code {
    background: var(--bg-elevated);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.post-content img {
    border-radius: 8px;
    margin: 2rem auto;
}

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

/* Post footer */
.post-footer {
    max-width: var(--content-width);
    margin: 3rem auto 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

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

.tag-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all 0.2s;
}

.tag-link:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.post-nav {
    margin-top: 1rem;
}

.nav-next {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background 0.2s;
}

.nav-next:hover {
    background: var(--bg-elevated);
}

.nav-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* ========== 404 ========== */
.error-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 10rem 2rem;
    text-align: center;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 700;
    color: var(--text-tertiary);
}

.error-page p {
    margin: 1rem 0 2rem;
    color: var(--text-secondary);
}

.back-link {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ========== Footer ========== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.footer-line {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.footer-sep {
    margin: 0 0.5rem;
    color: var(--text-tertiary);
}

.trademark-notice-wrap {
    position: relative;
    display: inline-block;
}

.trademark-trigger {
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 1px dotted var(--text-tertiary);
    transition: color 0.2s;
}

.trademark-trigger:hover {
    color: var(--text-secondary);
}

.trademark-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: 90vw;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: left;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.trademark-tooltip strong {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.trademark-notice-wrap:hover .trademark-tooltip {
    display: block;
}

/* ========== About Page ========== */
.about-site-box {
    max-width: var(--content-width);
    margin: 0 auto 3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    background: var(--bg-elevated);
}

.about-site-box h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.about-site-box p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-site-box p:last-child {
    margin-bottom: 0;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0;
}

.pagination a {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.pagination a:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.25rem;
    }

    .post-card-link {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .post-card-image {
        order: 1;
    }

    .post-card-content {
        order: 2;
    }

    .post-card-title {
        font-size: 1.25rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .header-inner {
        padding: 0 1rem;
    }

    .hero, .post-feed-container, .post-full {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========== Ghost Specific ========== */
.kg-width-wide {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

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

.kg-bookmark-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 2rem 0;
}

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

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

.kg-bookmark-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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