/* Основные переменные стилей */
:root {
    --primary: #cc7832;
    --primary-light: rgba(204, 120, 50, 0.1);
    --secondary: #ffc66d;
    --text: #d4d4d4;
    --text-light: #a0a0a0;
    --bg: #1e1e1e;
    --bg-light: #252526;
    --bg-lighter: #2d2d2d;
    --border: #3c3c3c;
    --python: #3776ab;
    --success: #4CAF50;
}

/* Базовые стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Шапка статьи */
.article-header {
    background: var(--bg-light);
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

a {
    color: #a5ccff;
}

.back-button:hover {
    color: var(--secondary);
    transform: translateX(-5px);
}

.article-header h1 {
    color: var(--secondary);
    font-size: 2.5rem;
    margin: 0 0 1.5rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.meta-item i {
    color: var(--primary);
}

.category {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

.category.python {
    background: rgba(55, 118, 171, 0.2);
    color: #3776ab;
}

/* Контейнер статьи */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Содержимое статьи */
.article-content {
    background: var(--bg-lighter);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.article-image {
    margin: -2rem -2rem 2rem;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

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

.article-image-small {
    margin: -2rem -2rem;
    padding: 1.5rem;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    max-width: 900px;
}

.article-image-small img {
    width: 50%;
    height: auto;
    display: block;
}

.intro {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: var(--secondary);
    font-style: italic;
}

h2 {
    color: var(--primary);
    margin: 2rem 0 1rem;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--primary);
}

p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Блоки с кодом */
.code-block {
    position: relative;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

pre {
    margin: 0;
    overflow-x: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.code-block:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: var(--primary);
    color: white;
}

.copy-button.copied {
    background: var(--success);
    color: white;
}

.copy-button.copied::after {
    content: 'Скопировано!';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 10px;
    background: var(--bg-light);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Навигация по статьям */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.nav-button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Футер */
.article-footer {
    background: var(--bg-light);
    color: var(--text-light);
    padding: 3rem 0 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.subscribe-form {
    display: flex;
    margin-top: 1rem;
}

.subscribe-form input {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 5px 0 0 5px;
    color: var(--text);
}

.subscribe-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-form button:hover {
    background: var(--secondary);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* Адаптивность */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .article-image {
        margin: -1.5rem -1.5rem 1.5rem;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}