/*==========Боковая панель в article_list=========*/

/* Боковая панель */
.sidebar {
    flex: 0 0 25%;
    max-width: 350px;
    position: sticky;
    top: 100px;
    background-color: #1f1f1f;
    padding: 1rem;
    border-radius: 8px;
    max-height: fit-content;
    transition: all 0.3s ease;
}

/* Скрыть боковую панель на мобильных устройствах */
@media (max-width: 1160px) {
    .sidebar {
        display: none;
    }
}

/* Стилизация элементов списка */
.sidebar-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    margin-left: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}

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

.sidebar-list li {
    margin-bottom: 10px;
}

.sidebar-list a {
    font-size: 1.2rem;
    color: #ccc;
    text-decoration: none;
    margin-left: 10px;
    padding: 6px 12px;
    display: block;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.sidebar-list li.active a,
.sidebar-list a:hover {
    background-color: #ff6600;
    color: black;
    font-weight: 600;
}


/*============ Карточки для статей================= */
.articles-content {
    flex-grow: 1;
    min-width: 0;
}
.article-header {
    text-align: center;
    padding-left: 10px;
    margin-bottom: 2rem;
    position: relative;
}

.article-header::after {
    content: "";
    display: block;
    width: 90%;
    height: 2px;
    background-color: #051b63;
    margin: 1.2rem auto 0;
    border-radius: 2px;
}

/* Контейнер, объединяющий сайдбар и контент */
.articles-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-direction: row;
    margin-top: 15px;
}

.article-grid {
    display: grid;
    justify-content: center; /* Центрирует карточки внутри сетки */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px; /* Ограничиваем ширину сетки */
    margin: 0 auto; /* Центрируем */
}

.article-card {
    display: flex;
    flex-direction: column;
    background-color: #2b2b2b;
    color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    height: 100%;
    max-width: 100%;
}

.article-card-outer {
    max-width: 320px; /* Максимальная ширина карточки */
    width: 100%;
    margin: 0 auto;
    background-color: #0c6273;
    padding: 3px;
    border-radius: 12px;
    transition: box-shadow 0.3s;
}

.article-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-body h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.article-excerpt {
    flex-grow: 1;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.85rem;
    margin-top: auto;
}

.article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.article-card-link:hover {
    transform: translateY(-4px);
}

.article-card:hover {
    transform: none;
}

.article-card-outer:hover {
    transform: translateY(-7px);
    box-shadow: 0 0 12px 4px rgba(13, 202, 240, 0.5);
    animation: glow 1.2s infinite;
}

@keyframes glow {
    0% { box-shadow: 0 0 10px rgba(13, 202, 240, 0.3); }
    50% { box-shadow: 0 0 20px rgba(13, 202, 240, 0.7); }
    100% { box-shadow: 0 0 10px rgba(13, 202, 240, 0.3); }
}

.article-image-wrapper {
    margin: 15px;
    padding: 2px;
    background-color: #a678031d;
    border-radius: 10px 10px 5px 5px;
    overflow: hidden;
    position: relative;
}

.article-image-bg {
    height: 250px;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #444;
    border-radius: 10px 10px 5px 5px;
    transition: background-size 3.2s ease;
}


/* Эффект свечения при наведении на карточку */
.article-card-link:hover .article-image-wrapper {
    box-shadow: 0 0 12px 4px rgba(198, 119, 1, 0.18);
}
.article-card-link:hover .article-image-bg {
    background-size: 125%;
}

/* ============Mobile styles============ */
@media (max-width: 600px) {
    .article-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .article-card-outer {
        max-width: 100%;
        padding: 1px;
        background-color: #0c6273;
        border-radius: 10px;
        box-shadow: none;
    }

    .article-card {
        flex-direction: row;
        border-radius: 10px;
        overflow: hidden;
        background-color: #2b2b2b;
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    }

    .article-image-wrapper {
        margin: 0;
        padding: 0;
        width: 120px;
        height: auto;
        flex-shrink: 0;
        border-radius: 0;
    }

    .article-image-bg {
        height: 100%;
        min-height: 100px;
        width: 100%;
        border-radius: 0;
        ransition: background-size 0.9s ease;
    }

    .article-body {
        padding: 0.8rem;
        height: auto;
    }

    .article-body h2 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .article-excerpt {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .article-footer {
        font-size: 0.75rem;
    }

    .article-card-outer:hover {
        transform: translateY(-3px);
        box-shadow: 0 0 12px 4px rgba(13, 202, 240, 0.5);
        animation: glow 1.2s infinite;
    }
}