/*
Theme Name: AV Theme Modern
Version: 6.0
Text Domain: av-theme
*/

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --site-max-width: 1400px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ===== ШАПКА ===== */
.site-header {
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transition: background-color 0.3s ease;
}

.header-inner {
    max-width: var(--site-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo { flex-shrink: 0; }
.site-logo img { height: 40px; width: auto; }
.logo-text { font-size: 24px; font-weight: 700; color: var(--primary-color); white-space: nowrap; }

/* ===== МЕНЮ ГОРИЗОНТАЛЬНОЕ ===== */
.main-navigation { flex: 1; }

.main-navigation ul,
.main-navigation .nav-menu,
.main-navigation .menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
}

.main-navigation ul li,
.main-navigation .nav-menu li,
.main-navigation .menu li {
    display: inline-block !important;
    list-style: none !important;
}

.main-navigation ul li a,
.main-navigation .nav-menu li a,
.main-navigation .menu li a {
    display: block !important;
    padding: 10px 15px !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    background: transparent !important;
}

.main-navigation ul li a:hover,
.main-navigation .nav-menu li a:hover,
.main-navigation .menu li a:hover {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.header-actions { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }

.theme-toggle {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
}

.theme-toggle:hover { transform: rotate(180deg); border-color: var(--primary-color); }

.search-form {
    display: flex;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
}

.search-form input {
    border: none; background: transparent;
    padding: 10px 15px; font-size: 14px;
    color: var(--text-primary);
    width: 200px; outline: none;
}

.search-form button {
    background: var(--primary-color);
    border: none; padding: 10px 15px;
    cursor: pointer; color: white;
}

.search-form button:hover { background: var(--primary-hover); }

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: var(--site-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
}

.site-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 30px 0;
    width: 100%;
}

.main-content { min-width: 0; width: 100%; }

/* ===== КАРТОЧКИ ===== */
.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.post-card .post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg-color);
}

.post-card .post-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img { transform: scale(1.08); }

.post-card .post-content { padding: 12px; }

.post-card .post-title {
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    height: 40px;
}

.post-card .post-date { font-size: 12px; color: var(--text-secondary); }

.sticky-posts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 50px;
}

.sticky-post .post-thumbnail { aspect-ratio: 16/10; }
.sticky-post .post-title { font-size: 16px; height: 45px; }

.category-section { margin-bottom: 40px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title { font-size: 24px; font-weight: 700; color: var(--text-primary); }

.view-all {
    color: var(--primary-color);
    font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 5px;
}

.view-all:hover { gap: 10px; }

.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

/* ===== САЙДБАР ===== */
.sidebar { position: sticky; top: 90px; height: fit-content; }

.widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 18px; font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.widget-list { list-style: none; padding: 0; margin: 0; }
.widget-list li { padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.widget-list li:last-child { border-bottom: none; }
.widget-list li:hover { padding-left: 10px; }
.widget-list a { display: flex; align-items: center; gap: 12px; color: var(--text-primary); }
.widget-list a:hover { color: var(--primary-color); }
.widget-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.widget-info { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.widget-title-text { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget-date, .widget-views { font-size: 11px; color: var(--text-secondary); }

.categories-widget ul { list-style: none; padding: 0; }
.categories-widget li { padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.categories-widget li:last-child { border-bottom: none; }
.categories-widget a { display: flex; justify-content: space-between; align-items: center; color: var(--text-primary); font-size: 14px; }
.categories-widget a:hover { color: var(--primary-color); }
.categories-widget .count { background: var(--bg-color); padding: 2px 8px; border-radius: 12px; font-size: 12px; color: var(--text-secondary); }

/* ===== ПАГИНАЦИЯ ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0; flex-wrap: wrap; }
.pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600; font-size: 14px;
}
.pagination .page-numbers:hover, .pagination .page-numbers.current {
    background: var(--primary-color); color: white; border-color: var(--primary-color);
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color); color: white;
    border: none; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    cursor: pointer;
}
.btn:hover { background: var(--primary-hover); color: white; }

/* ===== СПОЙЛЕР ===== */
.spoiler { margin: 20px 0; }

.spoiler-toggle {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow);
    font-size: 14px;
}

.spoiler-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.spoiler-content {
    display: none;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-top: 10px;
    box-shadow: var(--shadow);
}

.spoiler-content.active { display: block; }

/* Скриншоты - ОРИГИНАЛЬНЫЙ РАЗМЕР */
.screenshots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
}

.screenshot-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    flex: 1 1 300px;
    max-width: 400px;
}

.screenshot-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.screenshot-item a { display: block; width: 100%; height: 100%; }

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    /* ОРИГИНАЛЬНЫЙ РАЗМЕР - без обрезки */
    aspect-ratio: auto !important;
    object-fit: contain !important;
    transition: transform 0.3s ease;
}

.screenshot-item:hover img { transform: scale(1.02); }

.screenshot-item::after {
    content: '\f08e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
}
.screenshot-item:hover::after { opacity: 1; }

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    font-size: 14px;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--primary-color); }
.breadcrumbs span { margin: 0 8px; color: var(--text-secondary); }

/* ===== SINGLE POST ===== */
.single-post-header {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.single-post-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.single-post-meta {
    color: var(--text-secondary);
    font-size: 14px;
    display: flex; gap: 20px; flex-wrap: wrap;
}

.single-post-meta span { display: flex; align-items: center; gap: 6px; }

.single-post-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.single-post-content p { margin-bottom: 15px; line-height: 1.8; }

/* Картинки в описании - БЕЗ ЭФФЕКТОВ */
.single-post-content img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    transition: none !important;
    transform: none !important;
}

.single-post-content img:hover {
    transform: none !important;
    box-shadow: none !important;
}

.post-navigation {
    display: flex; justify-content: space-between; gap: 20px;
    margin: 30px 0; padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-weight: 600; font-size: 14px; }
.post-navigation a:hover { color: var(--primary-color); }

.post-tags { margin: 20px 0; padding: 15px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.post-tags i { color: var(--primary-color); margin-right: 8px; }
.post-tags a { display: inline-block; padding: 5px 12px; background: var(--bg-color); border-radius: 20px; font-size: 12px; margin: 3px; color: var(--text-secondary); }
.post-tags a:hover { background: var(--primary-color); color: white; }

.archive-header { background: var(--card-bg); padding: 25px 30px; border-radius: var(--radius); margin-bottom: 25px; box-shadow: var(--shadow); }
.archive-description { margin-top: 10px; color: var(--text-secondary); font-size: 14px; }

.related-content { margin-top: 40px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; width: 100%; }
.related-grid .post-card .post-thumbnail { aspect-ratio: 4/3; }

/* ===== ПОДВАЛ ===== */
.site-footer {
    background: var(--card-bg);
    padding: 30px 0;
    margin-top: 60px;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.footer-inner {
    max-width: var(--site-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright { color: var(--text-secondary); font-size: 14px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-secondary); font-size: 14px; }
.footer-links a:hover { color: var(--primary-color); }

/* ===== 404 ===== */
.error-404 { text-align: center; padding: 60px 20px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.error-code { font-size: 120px; font-weight: 700; color: var(--primary-color); margin-bottom: 20px; line-height: 1; }
.error-title { font-size: 32px; margin-bottom: 15px; color: var(--text-primary); }
.error-description { font-size: 16px; color: var(--text-secondary); margin-bottom: 30px; max-width: 500px; margin: 0 auto 30px; }
.error-actions { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; align-items: center; }

.no-results { text-align: center; padding: 60px 20px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.no-results h2 { font-size: 28px; margin-bottom: 15px; color: var(--text-primary); }
.no-results p { font-size: 16px; color: var(--text-secondary); margin-bottom: 30px; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1200px) {
    .posts-grid, .related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .site-content { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .header-inner { flex-wrap: wrap; justify-content: center; }
    .main-navigation { order: 3; width: 100%; }
    .main-navigation ul, .main-navigation .nav-menu, .main-navigation .menu { justify-content: center; }
    .posts-grid, .related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .header-inner { padding: 15px; }
    .posts-grid, .related-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .sticky-posts { grid-template-columns: 1fr; }
    .single-post-title { font-size: 24px; }
    .search-form input { width: 150px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .screenshot-item { flex: 1 1 100%; max-width: 100%; }
}

@media (max-width: 480px) {
    .posts-grid, .related-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .error-code { font-size: 80px; }
}