/* 1. ОБЩИЕ СТИЛИ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #f7c6d8; font-family: sans-serif; line-height: 1.5; overflow-x: hidden; }

/* 2. ШАПКА (HEADER) */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 5%; 
    background: rgba(255,255,255,0.1);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo { color: white; font-size: 30px; font-weight: bold; text-decoration: none; }

.tagline { 
    color: #ffffff; 
    font-size: 14px; 
    font-weight: bold; 
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #ff2f92, -1px -1px 0px #ff2f92, 1px -1px 0px #ff2f92, -1px 1px 0px #ff2f92;
}

.top-actions { display: flex; gap: 15px; align-items: center; }

.social-icon {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 1px 1px 2px #ff2f92;
    transition: 0.3s;
}

.social-icon:hover { color: #ff2f92; text-shadow: none; }

/* 3. ПОИСК */
.search-wrapper {
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.5s ease;
    display: flex;
    align-items: center;
}

.search-wrapper.active {
    max-width: 200px;
    margin-right: 10px;
}

.search-input {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #ff2f92;
    outline: none;
    width: 100%;
}

.search-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
}
/* 4. СЕТКА ГЛАВНОЙ */
.layout { 
    display: grid; 
    /* Основная сетка: Контент слева, Сайдбар справа (300px) */
    grid-template-columns: 1fr 300px; 
    gap: 30px; 
    padding: 20px 5%; 
    max-width: 1400px; /* Чтобы на сверхшироких экранах не расползалось */
    margin: 0 auto;
}

.articles { 
    display: grid; 
    /* ЖЕСТКО 4 В РЯД */
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
}

/* Фикс для карточек, чтобы они были одинаковыми */
.card { 
    background: white; 
    border-radius: 15px; 
    overflow: hidden; 
    text-decoration: none; 
    color: #333; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.card img { 
    width: 100%; 
    height: 160px; /* Фиксируем высоту картинок в сетке */
    object-fit: cover; 
}
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; height: 150px; object-fit: cover; }
.card-content { padding: 15px; }

/* ОБНОВЛЕННЫЙ ДИЗАЙН БЛОКА НОВОСТЕЙ В СТАТЬЯХ */

.sidebar-block {
    background: #ffffff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 47, 146, 0.08); /* Очень мягкая розовая тень */
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky; /* Блок будет "прилипать" при скролле (если родитель позволяет) */
    top: 20px;
}

/* Заголовок с акцентом */
.sidebar-header h3 {
    font-size: 20px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Розовая точка перед заголовком */
.sidebar-header h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ff2f92;
    border-radius: 50%;
}

/* Список новостей */
.news-card {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid #f8f8f8; /* Очень светлая линия */
    transition: all 0.3s ease;
}

/* Убираем линию у последней новости */
.news-card:last-child {
    border-bottom: none;
}

/* Эффект "парения" при наведении */
.news-card:hover {
    color: #ff2f92;
    transform: translateX(5px); /* Легкий сдвиг вправо */
}

/* Оформление даты в блоке */
.datetime {
    display: block;
    font-size: 12px;
    color: #ff2f92;
    font-weight: bold;
    margin-bottom: 8px;
    opacity: 0.8;
}

.carousel { 
    height: 400px; 
    overflow: hidden; 
    position: relative; 
    margin-top: 10px;
}

.carousel-track {
    display: flex;
    flex-direction: column;
    animation: slideUp 15s linear infinite;
}

@keyframes slideUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.carousel:hover .carousel-track {
    animation-play-state: paused;
}

.news-card {
    display: block;
    padding: 15px 10px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    background: #fff;
    margin-bottom: 5px;
}

.news-card:hover {
    color: #ff2f92;
    background: #fff0f5;
    border-left: 4px solid #ff2f92;
    padding-left: 15px;
}

/* 6. СЕТКА СТАТЬИ */
.layout-article { 
    display: grid; 
    grid-template-columns: 60px 1fr 300px; 
    gap: 20px; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
}
/* 7. БЕГУЩАЯ СТРОКА */
.highlight { background: #ff2f92; padding: 10px 0; overflow: hidden; margin: 20px 0; }
.slider-track { display: flex; gap: 60px; animation: scroll 20s linear infinite; width: max-content; }
.slide { color: white; white-space: nowrap; font-weight: bold; text-transform: uppercase; }

@keyframes scroll { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-50%); } 
}
/* 8. ФУТЕР */
.footer { 
    background: #ff2f92; 
    color: white; 
    padding: 25px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.footer-actions { display: flex; gap: 15px; }

.footer-btn { 
    background: rgba(255, 255, 255, 0.2); 
    color: white; 
    padding: 10px 20px; 
    border-radius: 20px; 
    text-decoration: none; 
    font-size: 14px; 
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.5); 
    transition: 0.3s;
    cursor: pointer;
}

.footer-btn:hover {
    background: #ffffff;
    color: #ff2f92;
    transform: scale(1.05);
}
/* Для планшетов (делаем 2 в ряд) */
@media (max-width: 1100px) {
    .articles { grid-template-columns: repeat(2, 1fr); }
    .layout { grid-template-columns: 1fr 250px; }
}

/* Для телефонов (делаем 1 в ряд) */
@media (max-width: 850px) {
    .layout { 
        grid-template-columns: 1fr; /* Сайдбар падает вниз */
    }
    .articles { 
        grid-template-columns: 1fr; /* Статьи по одной в ряд */
    }
    .sidebar { display: block; width: 100%; } /* Показываем сайдбар под статьями */
    .logo-group { flex-direction: column; align-items: flex-start; gap: 5px; }
    
    .header { padding: 15px 20px; } /* Уменьшаем отступы в шапке */
}
/* 10. ОФОРМЛЕНИЕ СТАТЕЙ */
.article-main {
    background: white; 
    padding: 30px; 
    border-radius: 15px;
    max-width: 800px; 
    margin: 0 auto;
    line-height: 1.8; 
    color: #444; 
    font-size: 18px;
}

.article-main h1 {
    font-size: 36px;
    color: #ff2f92; 
    margin-bottom: 25px;
    line-height: 1.2;
    text-align: center;
}

.article-main h2 {
    font-size: 26px;
    color: #333;
    margin-top: 40px;
    margin-bottom: 20px;
    border-left: 5px solid #ff2f92; 
    padding-left: 15px;
}

.article-main p { margin-bottom: 20px; text-align: justify; }

.article-main blockquote {
    background: #fff0f5;
    border-radius: 10px;
    padding: 20px;
    font-style: italic;
    border-left: 8px solid #ff2f92;
    margin: 30px 0;
    color: #555;
}

.back-link {
    display: inline-block;
    margin-top: 40px;
    color: #ff2f92;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}
/* --- ФИКС КАРТИНОК В СТАТЬЯХ --- */

.article-main img {
    max-width: 100%;    /* Картинка никогда не будет шире, чем текст */
    height: auto;       /* Сохраняем пропорции, чтобы не было искажений */
    display: block;     /* Убираем лишние отступы снизу */
    margin: 25px auto;  /* Центрируем картинку и даем отступы сверху/снизу */
    border-radius: 15px; /* Красивые скругленные углы, как у блоков */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* Легкая тень для объема */
}
/* --- СТИЛИ ТОЛЬКО ДЛЯ БЛОКА НОВОСТЕЙ ВНУТРИ СТАТЕЙ --- */

/* Нацеливаемся на aside, который находится внутри сетки статьи */
.layout-article aside.sidebar-block, 
.layout-article .sidebar-block {
    background: #ffffff !important; /* !important гарантирует, что цвет применится */
    padding: 25px !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(255, 47, 146, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Оформление заголовка в статьях */
.layout-article .sidebar-header h3 {
    font-size: 22px !important;
    color: #333 !important;
    border-bottom: 2px solid #fff0f5 !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
}

/* Оформление карточек новостей в статьях */
.layout-article .news-card {
    display: block !important;
    background: #fdfdfd !important;
    margin-bottom: 12px !important;
    padding: 15px !important;
    border-radius: 12px !important;
    border-left: 4px solid transparent !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03) !important;
    text-decoration: none !important;
    color: #444 !important;
    transition: 0.3s !important;
}

/* Эффект при наведении (только в статьях) */
.layout-article .news-card:hover {
    background: #fff0f5 !important;
    color: #ff2f92 !important;
    border-left: 4px solid #ff2f92 !important;
    transform: translateX(8px) !important;
}

/* Останавливаем движение карусели в статьях, чтобы было удобно читать */
.layout-article .carousel-track {
    animation: none !important;
    display: block !important;
    transform: none !important;
}

.layout-article .carousel {
    height: auto !important;
    overflow: visible !important;
}
/* СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ СТРАНИЦ НОВОСТЕЙ */

/* Ограничиваем ширину текста, чтобы удобно было читать */
.layout-article .article-main {
    max-width: 850px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}

/* Красивая категория (ТЕХНОЛОГИИ) */
.layout-article .article-main .datetime {
    background: #fff0f5;
    color: #ff2f92;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 20px;
}

/* Заголовок новости */
.layout-article .article-main h1 {
    font-size: 32px;
    line-height: 1.3;
    color: #222;
    margin-bottom: 25px;
}

/* Главное изображение в новости */
.layout-article .main-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    margin: 20px 0 30px 0;
    object-fit: cover;
}

/* Стилизация списка характеристик (Что нового?) */
.layout-article ul {
    list-style: none;
    padding-left: 0;
}

.layout-article li {
    padding: 10px 15px;
    background: #fafafa;
    margin-bottom: 8px;
    border-radius: 10px;
    border-left: 4px solid #ff2f92;
}

.layout-article li b {
    color: #ff2f92;
}

/* Блок "Другие новости" внизу страницы */
.layout-article .sidebar-block {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}