/*
Theme Name: Kremlin TSJ
Description: A custom theme inspired by the clean, authoritative design of kremlin.ru.
Version: 1.9
Author: Gemini
*/

:root {
    --primary-color: #2c3e50;
    --bg-alt: #f4f7f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; overflow-x: hidden; background-color: var(--bg-alt); }
body { text-align: center !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.site-wrapper {
    display: inline-block; text-align: left; width: 100%; max-width: 1440px;
    background: #ffffff; margin: 0 auto !important; box-shadow: 0 0 40px rgba(0,0,0,0.08); min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto !important; padding: 0 30px; width: 100%; }

/* HEADER */
.site-header { border-bottom: 4px solid var(--primary-color); position: relative; }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 25px 0; }
.site-branding { display: flex; align-items: center; gap: 15px; }
.site-logo-icon { width: 45px; height: 45px; background: var(--primary-color); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 22px; }
.site-title { margin: 0; font-size: 20px; text-transform: uppercase; font-weight: 700; }

.header-search form { display: flex; border: 1px solid #ddd; }
.header-search input { border: none; padding: 8px 12px; width: 150px; outline: none; }
.header-search button { background: var(--primary-color); color: #fff; border: none; padding: 8px 15px; cursor: pointer; }

/* NAVIGATION */
.main-navigation { background: #fff; border-top: 1px solid #eee; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; width: 100%; }
.main-navigation li { flex: 1; text-align: center; border-right: 1px solid #f0f0f0; }
.main-navigation li:last-child { border-right: none; }
.main-navigation a { display: block; padding: 18px 5px; font-size: 13px; font-weight: 700; text-transform: uppercase; color: #444; position: relative; transition: all 0.3s ease; }
.main-navigation a::after { content: ""; position: absolute; bottom: 0; left: 0; width: 0; height: 4px; background: var(--primary-color); transition: width 0.3s ease; }
.main-navigation li:hover > a::after, .main-navigation li.current-menu-item > a::after { width: 100%; }

.mobile-search { display: none; padding: 15px; background: #f9f9f9; border-bottom: 1px solid #eee; }

/* BURGER ICON */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; width: 44px; height: 44px; position: relative; }
.menu-toggle .bar { display: block; width: 25px; height: 3px; background: #333; margin: 5px auto; transition: 0.3s; }
.menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    .menu-toggle { display: block; }
    .main-navigation { display: none; width: 100%; border-top: none; }
    .main-navigation.toggled { display: block; }
    .main-navigation ul { flex-direction: column; }
    .main-navigation li { text-align: left; border-right: none; border-bottom: 1px solid #eee; }
    .main-navigation a { padding: 15px 20px; }
    .mobile-search { display: block; }
    .mobile-search input { width: 100%; padding: 12px; border: 1px solid #ddd; outline: none; }
}

/* CONTENT */
.site-content { padding: 40px 0; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post-item { border-bottom: 1px solid #eee; padding-bottom: 25px; margin-bottom: 15px; }
.post-title { font-size: 18px; margin: 10px 0; font-weight: 700; }
.post-thumbnail { margin: 15px 0; }

@media (max-width: 1024px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .post-grid { grid-template-columns: 1fr; } }

/* Стили для важных новостей */
.important-news {
    color: #d32f2f !important; /* Красный цвет */
    font-weight: 800 !important;
}

.important-badge {
    background: #d32f2f;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 10px;
    vertical-align: middle;
    text-transform: uppercase;
}

/* --- КРАСИВЫЕ ССЫЛКИ В ЗАГОЛОВКАХ --- */
.post-title a {
    color: #111;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 0.3s ease, color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-color);
    background-size: 100% 2px;
}

/* Красивые ссылки в тексте */
.entry-content a {
    border-bottom: 1px solid rgba(0, 85, 164, 0.2);
    transition: all 0.2s ease;
}

.entry-content a:hover {
    border-bottom-color: var(--primary-color);
    background: rgba(0, 85, 164, 0.03);
}

/* --- КЛИКАБЕЛЬНЫЕ КАРТОЧКИ НОВОСТЕЙ --- */
.post-item {
    position: relative; /* Делаем блок базой для позиционирования */
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    border-color: var(--primary-color) !important;
}

.post-item .post-title a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Растягиваем невидимую ссылку на весь блок */
}

/* Подсветка заголовка при наведении на весь блок */
.post-item:hover .post-title a {
    color: var(--primary-color);
    background-size: 100% 2px;
}

/* Убеждаемся, что другие ссылки (источники) кликабельны поверх */
.post-item a:not(.post-title a) {
    position: relative;
    z-index: 2;
}
