/*
Theme Name: LEWICKI Dark Blog
Theme URI: https://lewickiy.ru
Author: Lewickiy
Description: Минималистичная тёмная тема WordPress в стиле терминала
Version: 2.0
Text Domain: lewicki
*/

/* ===== ПОДКЛЮЧЕНИЕ ШРИФТА ===== */
@font-face {
    font-family: "San Francisco Pro Display";
    src: local("San Francisco Pro Display"), local("SF Pro Display"), local("SF Pro"), local("Helvetica Neue");
    font-weight: 400;
    font-style: normal;
}

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    --bg: #0f1115;           /* основной фон */
    --panel: #151820;         /* панели, карточки */
    --text: #e6e6e6;          /* основной текст */
    --muted: #9aa0a6;         /* приглушенный текст */
    --accent: #2d5a27;        /* терминальный зеленый для акцентов */
    --border: #2a2d36;        /* границы */
    --hover: #222630;         /* ховер для панелей */
    --code-bg: #0a0c0f;       /* фон для кода */
}

* { 
    box-sizing: border-box; 
}

body { 
    margin: 0; 
    font-family: "San Francisco Pro Display", sans-serif; 
    font-weight: 400;
    background: var(--bg); 
    color: var(--text);
    line-height: 1.6;
}

a { 
    color: inherit; 
    text-decoration: none; 
    transition: color 0.2s ease;
}

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

/* ===== ШАПКА И ПОДВАЛ ===== */
header, footer { 
    background: var(--panel); 
    border-bottom: 1px solid var(--border);
}

footer {
    border-bottom: none;
    border-top: 1px solid var(--border);
}

.header-inner, .footer-inner { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 16px 24px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo, .footer-logo { 
    font-weight: 400; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    font-size: 1.2rem;
}

.logo a:hover, .footer-logo a:hover {
    color: var(--accent);
}

/* ===== СОЦИАЛЬНЫЕ ИКОНКИ ===== */
.socials { 
    display: flex; 
    gap: 10px; 
}

.socials a { 
    width: 36px; 
    height: 36px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--bg); 
    border: 1px solid var(--border);
    border-radius: 6px; 
    color: var(--text); 
    transition: all 0.2s ease;
}

.socials a:hover { 
    background: var(--accent); 
    border-color: var(--accent);
    color: #000;
    transform: translateY(-2px);
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
main { 
    max-width: 900px; 
    margin: 0 auto; 
    padding: 48px 24px; 
    min-height: 60vh;
}

/* ===== БЛОК ПОСТА ===== */
article {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 32px;
    transition: all 0.3s ease;
}

article:hover {
    background: var(--hover);
    border-color: #3a4050;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Заголовки */
article h1,
article h2 {
    font-weight: 400;
    font-size: 2rem;
    margin: 0 0 16px;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

article h1 a,
article h2 a {
    color: var(--text);
}

article h1 a:hover,
article h2 a:hover {
    color: var(--accent);
}

/* Мета-информация */
.meta {
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta i {
    font-size: 0.8rem;
    opacity: 0.7;
}

.meta a {
    color: var(--muted);
    border-bottom: 1px dashed transparent;
}

.meta a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== ТЕГИ ===== */
.post-tags {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags a {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.post-tags a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.post-tags i {
    margin-right: 4px;
    font-size: 0.75rem;
}

/* ===== КОНТЕНТ ЗАПИСИ ===== */
.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.entry-content p {
    margin: 0 0 24px;
}

.entry-content h1 {
    font-size: 2.2rem;
    margin: 48px 0 24px;
}

.entry-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.entry-content h3 {
    font-size: 1.5rem;
    margin: 32px 0 16px;
}

.entry-content h4 {
    font-size: 1.3rem;
    margin: 28px 0 14px;
    color: var(--muted);
}

.entry-content h5 {
    font-size: 1.1rem;
    margin: 24px 0 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.entry-content h6 {
    font-size: 1rem;
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 24px 24px;
}

.entry-content li {
    margin-bottom: 8px;
}

.entry-content li:last-child {
    margin-bottom: 0;
}

.entry-content strong {
    color: #fff;
    font-weight: 500;
}

.entry-content em {
    color: #ccc;
    font-style: italic;
}

/* Разделитель */
.entry-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 48px 0;
}

/* ===== БЛОКИ КОДА ===== */
pre {
    background: var(--code-bg);
    color: #f0f0f0;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 24px 0;
    border: 1px solid var(--border);
    position: relative;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
}

code {
    background: var(--code-bg);
    color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* Кнопка копирования */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--border);
    color: var(--text);
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn:hover {
    opacity: 1;
    background: var(--accent);
    color: #000;
}

.copy-btn.copied {
    background: var(--accent);
    color: #000;
    opacity: 1;
}

/* ===== ЦИТАТЫ ===== */
.entry-content blockquote {
    background: var(--code-bg);
    border-left: 4px solid var(--accent);
    padding: 20px 24px;
    margin: 32px 0;
    border-radius: 4px;
    font-style: italic;
    color: #ccc;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.entry-content blockquote p {
    margin: 0;
    font-size: 1.1rem;
}

.entry-content blockquote cite {
    display: block;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--muted);
    font-style: normal;
}

/* ===== ТАБЛИЦЫ ===== */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.entry-content th {
    background: var(--code-bg);
    color: var(--text);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.entry-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.entry-content tr:last-child td {
    border-bottom: none;
}

.entry-content tr:hover td {
    background: var(--hover);
}

/* ===== ПАГИНАЦИЯ ===== */
.pagination {
    margin: 48px 0 24px;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

/* ===== СТРАНИЦА 404 ===== */
.error-404 {
    text-align: center;
    padding: 80px 24px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.error-404 h1 {
    font-size: 6rem;
    margin: 0 0 16px;
    color: var(--muted);
    font-weight: 400;
}

.error-404 p {
    font-size: 1.3rem;
    margin-bottom: 32px;
    color: var(--muted);
}

.error-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
}

.error-404 .search-field {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.error-404 .search-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(45, 90, 39, 0.2);
}

.error-404 .search-submit {
    display: none;
}

/* ===== ВИДЖЕТЫ ===== */
.widget {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 32px;
}

.widget-title {
    font-size: 1.2rem;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.widget li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget a {
    color: var(--muted);
    transition: color 0.2s ease;
    display: inline-block;
}

.widget a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

/* ===== ТЕРМИНАЛЬНЫЕ ЭФФЕКТЫ ===== */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.terminal-cursor::after {
    content: "_";
    animation: blink 1s step-end infinite;
    margin-left: 4px;
    color: var(--accent);
}

.terminal-prompt::before {
    content: "$ ";
    color: var(--accent);
    font-weight: bold;
}

/* ===== СТИЛИ ДЛЯ ПЕЧАТИ ===== */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    header, 
    footer, 
    .socials, 
    .copy-btn,
    .pagination,
    .post-tags {
        display: none !important;
    }
    
    article {
        background: white;
        border: none;
        padding: 0;
        box-shadow: none;
    }
    
    article:hover {
        background: white;
        box-shadow: none;
    }
    
    pre, code {
        background: #f5f5f5;
        color: black;
        border: 1px solid #ddd;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .entry-content blockquote {
        background: #f5f5f5;
        color: #333;
        border-left-color: #333;
    }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .header-inner,
    .footer-inner {
        padding: 16px;
    }

    main {
        padding: 32px 16px;
    }

    article {
        padding: 20px;
    }

    article h1,
    article h2 {
        font-size: 1.6rem;
    }

    .meta {
        flex-direction: column;
        gap: 8px;
    }

    .entry-content {
        font-size: 1rem;
    }

    .entry-content h1 {
        font-size: 1.8rem;
    }

    .entry-content h2 {
        font-size: 1.5rem;
    }

    .entry-content h3 {
        font-size: 1.3rem;
    }

    .entry-content blockquote {
        padding: 16px 20px;
    }

    .error-404 h1 {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .logo, .footer-logo {
        font-size: 1rem;
    }

    .socials a {
        width: 32px;
        height: 32px;
    }

    article {
        padding: 16px;
    }

    .post-tags a {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

article {
    animation: fadeIn 0.5s ease-out;
}

/* ===== ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ ===== */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
