/*
Theme Name: IT Blog
Theme URI: https://blog.puzco.ru
Author: PuzCo
Author URI: https://blog.puzco.ru
Description: Современная тема для IT блога с минималистичным дизайном. Оптимизирована для публикации статей по IT тематике.
Version: 1.0.0
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: it-blog
Tags: blog, it, tech, modern, minimal, responsive
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f5f5f5;
    --bg-light: #e8e8e8;
    --border-color: #d1d5db;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --link-color: #2563eb;
    --link-hover: #1e40af;
    --header-bg: rgba(245, 245, 245, 0.95);
    --footer-bg: #e8e8e8;
    --max-width: 1200px;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Dark theme */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --text-color: #e5e7eb;
    --text-light: #9ca3af;
    --bg-color: #111827;
    --bg-light: #1f2937;
    --border-color: #374151;
    --code-bg: #0f172a;
    --code-text: #cbd5e1;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --header-bg: rgba(17, 24, 39, 0.95);
    --footer-bg: #1f2937;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global transitions for theme switching */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Exclude elements that shouldn't transition */
img, svg, video, iframe, canvas {
    transition: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1.5rem;
}

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

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

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

.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-logo-row {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-menu-row {
    padding: 1rem 0;
}

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

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

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--text-color);
}

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

.site-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation ul li {
    margin: 0;
}

.main-navigation a {
    color: var(--text-color);
    font-weight: 500;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

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

/* Home Layout - Two Columns */
.home-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.main-column {
    flex: 0 0 60%;
    width: 60%;
}

.sidebar-column {
    flex: 0 0 40%;
    width: 40%;
}

/* Full Post in Main Column */
.post-full {
    margin-bottom: 0;
}

.post-full .post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-full .post-content h2,
.post-full .post-content h3,
.post-full .post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

.post-full .post-content ul,
.post-full .post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

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

.post-full .post-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--primary-color);
}

.post-full .post-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.post-full .post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

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

.post-full .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-full .post-content a {
    text-decoration: underline;
}

/* Sidebar Posts List */
.posts-list-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item-sidebar {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

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

.post-thumbnail-sidebar {
    margin-bottom: 1rem;
}

.post-image-sidebar {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.post-title-sidebar {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

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

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

.post-meta-sidebar {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Posts List */
.posts-list {
    display: grid;
    gap: 3rem;
}

.post-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

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

.post-title {
    margin-bottom: 0.5rem;
}

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

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

.post-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-excerpt {
    color: var(--text-light);
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

.read-more:hover {
    color: var(--link-hover);
}

/* Single Post */
.single-post {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

.post-content ul,
.post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

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

.post-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--primary-color);
}

.post-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-content a {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-navigation {
    margin-bottom: 1.5rem;
}

.footer-navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.footer-navigation ul li {
    margin: 0;
}

.footer-navigation a {
    color: var(--text-light);
    font-weight: 500;
}

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

.site-info {
    text-align: center;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.theme-toggle:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.theme-toggle .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-sun {
    display: inline-block;
}

[data-theme="dark"] .theme-toggle .theme-icon-moon {
    display: none;
}

.theme-toggle .theme-icon-moon {
    display: inline-block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}

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

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Archive */
.archive-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.archive-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.archive-description {
    color: var(--text-light);
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    gap: 2rem;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.post-navigation .nav-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
}

.post-navigation a:hover .nav-title {
    color: var(--primary-color);
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.post-tags a {
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.post-tags a:hover {
    background: var(--primary-color);
    color: white;
}

/* Post Categories */
.post-categories a {
    color: var(--text-light);
}

.post-categories a:hover {
    color: var(--primary-color);
}

/* Post Image */
.post-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.post-thumbnail {
    margin-bottom: 1.5rem;
}

/* Page Links */
.page-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.page-links a {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.page-links a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 404 Page */
.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.error-404 p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .header-logo-row {
        padding: 1rem 0;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .header-menu-row {
        padding: 0.75rem 0;
    }
    
    .theme-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .theme-toggle .theme-toggle-text {
        display: none;
    }
    
    .main-navigation ul {
        flex-direction: row;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .main-navigation ul li {
        margin: 0;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .site-main {
        padding: 2rem 0;
    }
    
    .post-navigation {
        flex-direction: column;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Mobile: Only one column - show full post OR sidebar list */
    .home-layout {
        flex-direction: column;
        gap: 2rem;
    }
    
    .main-column {
        flex: 1;
        width: 100%;
    }
    
    .sidebar-column {
        flex: 1;
        width: 100%;
    }
    
    .footer-navigation ul {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}

