/* === CSS VARIABLES === */
:root {
    --color-primary: #000000;
    --color-secondary: #ffffff;
    --color-accent: #00ffff;
    --color-text: #000000;
    --color-text-light: #666666;
    --color-border: #e5e5e5;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --max-width: 1200px;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
.site-header {
    background: var(--color-primary);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    display: block;
    height: 40px;
}

.site-logo img {
    height: 100%;
    width: auto;
    display: block;
}

.site-title {
    color: var(--color-secondary);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

.site-nav a {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    white-space: nowrap;
}

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

/* === MAIN CONTENT === */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* === MAGAZINE LAYOUT === */
.magazine-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.main-content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 100px;
}

/* === FEATURED POST === */
.featured-post {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 2px solid #e0e0e0;
}

.featured-post .post-card {
    border-bottom: none;
    padding-bottom: 0;
}

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

.featured-post .post-card-image {
    height: 400px !important;
}

/* === POST CARDS === */
.posts-list {
    display: grid;
    gap: 2.5rem;
}

.post-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
    align-items: start;
}

.post-card:last-child {
    border-bottom: none;
}

.post-card-image {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 200px !important;
    background: #f5f5f5;
}

.post-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
    transition: opacity 0.2s ease;
    max-height: 200px !important;
}

.post-card:hover .post-card-image img {
    opacity: 0.9;
}

.post-card-content {
    min-width: 0;
}

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

.post-card-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

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

.post-card-excerpt {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.post-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-wrap: wrap;
}

.post-card-tag {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.post-card-tag:hover {
    opacity: 0.8;
}

.reading-time::before {
    content: "•";
    margin-right: 1rem;
}

/* === SIDEBAR === */
.sidebar-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-post {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sidebar-post:last-child {
    margin-bottom: 0;
}

.sidebar-pages-list {
    display: grid;
    gap: 1.5rem;
}

.sidebar-post-image {
    display: block;
    overflow: hidden;
    height: 80px !important;
    width: 80px !important;
    background: #f5f5f5;
}

.sidebar-post-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.sidebar-post-image-placeholder {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.sidebar-post-image-placeholder span {
    font-size: 2rem;
}

.sidebar-post-content {
    min-width: 0;
}

.sidebar-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.sidebar-post-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

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

.sidebar-post-date {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-categories {
    list-style: none;
}

.sidebar-category {
    margin-bottom: 0.75rem;
}

.sidebar-category:last-child {
    margin-bottom: 0;
}

.sidebar-category a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: flex;
    justify-content: space-between;
}

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

.category-count {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

.sidebar-empty {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
}

.sidebar-members-notice {
    margin-top: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border-left: 3px solid var(--color-accent);
    border-radius: 3px;
}

.sidebar-members-notice p {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0;
}

.sidebar-members-notice a {
    color: var(--color-accent);
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s;
}

.sidebar-members-notice a:hover {
    opacity: 0.8;
}

/* === TAG PAGE HEADER === */
.tag-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tag-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tag-description {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* === SINGLE POST === */
.post-single {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-tag {
    display: inline-block;
    color: var(--color-accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 1rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.post-tag:hover {
    opacity: 0.8;
}

.post-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.post-meta {
    display: flex;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-feature-image {
    margin-bottom: 2.5rem;
}

.post-feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* === POST CONTENT === */
.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.875rem 0 0.9375rem;
    line-height: 1.3;
}

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

.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.post-content a:hover {
    opacity: 0.8;
}

.post-content ul,
.post-content ol {
    margin: 1.5625rem 0;
    padding-left: 1.875rem;
}

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

.post-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.25rem;
    margin: 1.875rem 0;
    font-style: italic;
    color: var(--color-text-light);
}

.post-content code {
    font-family: var(--font-mono);
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-content pre {
    background: #f5f5f5;
    padding: 1.25rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5625rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.875rem auto;
}

/* === KOENIG EDITOR CLASSES === */
.kg-width-wide {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* === POST FOOTER === */
.post-footer {
    margin-top: 3.75rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

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

.post-tags .tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--color-primary);
    color: var(--color-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-radius: 3px;
    transition: background 0.2s;
}

.post-tags .tag:hover {
    background: var(--color-accent);
    color: var(--color-primary);
}

/* === RELATED POSTS === */
.related-posts {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 2px solid #e0e0e0;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-card {
    display: grid;
    gap: 1rem;
}

.related-image {
    display: block;
    overflow: hidden;
    height: 150px;
    background: #f5f5f5;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.related-card:hover .related-image img {
    opacity: 0.9;
}

.related-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.related-card-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* === PAGE STYLES === */
.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
}

.page-feature-image {
    margin-bottom: 2.5rem;
}

.page-feature-image img {
    width: 100%;
    height: auto;
    display: block;
}

.page-text {
    font-size: 1.125rem;
    line-height: 1.8;
}

.page-text h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem;
    line-height: 1.3;
}

.page-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.875rem 0 0.9375rem;
    line-height: 1.3;
}

.page-text p {
    margin-bottom: 1.5625rem;
}

.page-text a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.page-text a:hover {
    opacity: 0.8;
}

.page-text ul,
.page-text ol {
    margin: 1.5625rem 0;
    padding-left: 1.875rem;
}

.page-text li {
    margin-bottom: 0.625rem;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.9375rem;
    margin-top: 3.75rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

.pagination a {
    padding: 0.625rem 1.25rem;
    background: var(--color-primary);
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    transition: background 0.2s;
}

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

/* === FOOTER === */
.site-footer {
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 2.5rem 0;
    margin-top: 5rem;
}

.footer-content {
    text-align: center;
    font-size: 0.875rem;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .magazine-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }
    
    .site-branding {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .site-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.9375rem;
    }
    
    .post-card {
        grid-template-columns: 1fr;
    }
    
    .post-card-image {
        height: 250px !important;
    }
    
    .featured-post .post-card-image {
        height: 300px !important;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.75rem;
    }
    
    .post-content h3 {
        font-size: 1.375rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .kg-width-wide,
    .kg-width-full {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}
