/* article.css */
main {
    position: relative;
    padding: 6rem var(--padding-horizontal) 3rem;
}


/* Заголовок статьи */
.article-header {
    margin-bottom: 2rem;
}

main .header_text {
    font-size: 3rem;
    color: #333;
}

/* Мета-информация */
.article-meta {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.95rem;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 15px;
}

.article-date {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: end;
        -ms-flex-align: end;
            align-items: flex-end;
}

/* Главное изображение статьи */
.article-main-image {
    border-radius: 12px;
    overflow: hidden;
    -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-main-image img {
    aspect-ratio: 21 / 9;
    width: 100%;
    height: auto;
    display: block;
    -webkit-transition: -webkit-transform 0.5s ease;
    transition: -webkit-transform 0.5s ease;
    -o-transition: transform 0.5s ease;
    transition: transform 0.5s ease;
    transition: transform 0.5s ease, -webkit-transform 0.5s ease;
}

.article-main-image:hover img {
    -webkit-transform: scale(1.02);
        -ms-transform: scale(1.02);
            transform: scale(1.02);
}

/* Контент статьи */
.article-content {
    margin-bottom: 4rem;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.8;
}

/* Навигация между статьями */
.article-navigation {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    padding: 25px 0;
    border-top: 1px solid #eee;
    margin-top: 3rem;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    gap: 20px;
}

.nav-link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gray-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--blue);
    font-weight: 500;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    max-width: 45%;
}

.nav-link:hover {
    background: #E0E8F9;
    border-color: var(--blue);
    -webkit-transform: translateY(-2px);
        -ms-transform: translateY(-2px);
            transform: translateY(-2px);
}

.nav-link.prev:hover svg {
    -webkit-transform: translateX(-3px);
        -ms-transform: translateX(-3px);
            transform: translateX(-3px);
}

.nav-link.next:hover svg {
    -webkit-transform: translateX(3px);
        -ms-transform: translateX(3px);
            transform: translateX(3px);
}

.nav-link svg {
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: -webkit-transform 0.3s ease;
    -o-transition: transform 0.3s ease;
    transition: transform 0.3s ease;
    transition: transform 0.3s ease, -webkit-transform 0.3s ease;
}

.nav-text {
    overflow: hidden;
    -o-text-overflow: ellipsis;
       text-overflow: ellipsis;
    white-space: nowrap;
}

.all-articles-link {
    padding: 12px 24px;
    background: var(--blue);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.all-articles-link:hover {
    background: #1a6fd8;
    -webkit-transform: translateY(-2px);
        -ms-transform: translateY(-2px);
            transform: translateY(-2px);
    -webkit-box-shadow: 0 4px 12px rgba(40, 131, 238, 0.2);
            box-shadow: 0 4px 12px rgba(40, 131, 238, 0.2);
}

/* Пирамида */
main .pyramid {
    position: absolute;
    height: 320px;
    width: 290px;
    -webkit-transform: rotate(-126deg);
        -ms-transform: rotate(-126deg);
            transform: rotate(-126deg);
    right: -100px;
    opacity: 0.7;
    z-index: -1;
    bottom: 50px;
}

/* Адаптивность */
@media (max-width: 768px) {
    main {
        padding: 4rem var(--padding-horizontal) 2rem;
    }
    
    main .header_text {
        font-size: 2rem;
        text-align: center;
    }
    
    .back-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .article-meta {
        -webkit-box-pack: center;
            -ms-flex-pack: center;
                justify-content: center;
        text-align: center;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        gap: 10px;
    }
    
    .article-main-image {
        border-radius: 8px;
    }
    
    .article-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .article-navigation {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        -webkit-box-align: stretch;
            -ms-flex-align: stretch;
                align-items: stretch;
        text-align: center;
        gap: 15px;
    }
    
    .nav-link {
        max-width: 100%;
        -webkit-box-pack: center;
            -ms-flex-pack: center;
                justify-content: center;
        -webkit-box-ordinal-group: 3;
            -ms-flex-order: 2;
                order: 2;
    }
    
    .nav-link.prev {
        -webkit-box-ordinal-group: 2;
            -ms-flex-order: 1;
                order: 1;
    }
    
    .all-articles-link {
        -webkit-box-ordinal-group: 4;
            -ms-flex-order: 3;
                order: 3;
    }
    
    main .pyramid {
        display: none;
    }
}

/* Для очень больших экранов */
@media (min-width: 1400px) {
    .article-content,
    .article-main-image {
        max-width: 1200px;
    }
}

/* Анимация появления статьи */
@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
                transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
                transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
}

.article-header,
.article-content,
.article-navigation {
    -webkit-animation: fadeInUp 0.6s ease-out;
            animation: fadeInUp 0.6s ease-out;
}

.article-content {
    -webkit-animation-delay: 0.2s;
            animation-delay: 0.2s;
}

.article-navigation {
    -webkit-animation-delay: 0.4s;
            animation-delay: 0.4s;
}

/* Стили для кода в статьях (если Summernote добавляет код) */
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #334155;
}


.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-content p {
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.article-content h2, 
.article-content h3 {
    margin: 1.5em 0 1em;
    color: #333;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.article-content blockquote {
    border-left: 4px solid var(--blue);
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    color: #555;
}

.article-content a {
    color: var(--blue);
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}