/*!
Theme Name: news
Theme URI: http://underscores.me/
Author: Underscores.me
Author URI: http://underscores.me/
Description: Description
Version: 1.0.0
Tested up to: 5.4
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: news
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.

news is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.

Normalizing styles have been helped along thanks to the fine work of
Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Generic
	- Normalize
	- Box sizing
# Base
	- Typography
	- Elements
	- Links
	- Forms
## Layouts
# Components
	- Navigation
	- Posts and pages
	- Comments
	- Widgets
	- Media
	- Captions
	- Galleries
# plugins
	- Jetpack infinite scroll
# Utilities
	- Accessibility
	- Alignments

--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Generic
--------------------------------------------------------------*/

/* Normalize
--------------------------------------------- */

/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
	 ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */
/* 1. ПЕРЕМЕННЫЕ */
:root {
    --primary: #1e40af;
    --accent: #f59e0b;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --header-h: 70px;
    --bg-body: #ffffff;
    --bg-alt: #f8fafc;
}



* { box-sizing: border-box; margin: 0; padding: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }




/* --- ТИПОГРАФИКА И КОНТЕНТ --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

body {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

h1 { font-size: 42px; margin-top: 20px; }
h2 { font-size: 30px; margin-top: 40px; }
h3 { font-size: 22px; margin-top: 30px; }

p { margin-bottom: 1.6rem; }

/* Хлебные крошки */
.breadcrumb {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 15px;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; color: #ccc; }

/* Теги поста */
.post-tags { margin: 40px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-link {
    font-size: 14px;
    font-weight: 700;
    background: var(--bg-alt);
    padding: 6px 14px;
    border-radius: 4px;
    color: var(--text-main);
    text-decoration: none;
}
.tag-link:hover { background: var(--primary); color: #fff; }

/* --- ПОХОЖИЕ СТАТЬИ (RELATED SECTION) --- */
.related-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 0;
    border-top: 2px solid var(--border);
    margin-top: 60px;
}

.related-heading {
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.related-list { list-style: none; padding: 0; }
.related-list li {
    margin-bottom: 12px;
    line-height: 1.4;
}
.related-list li a {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.2s;
}
.related-list li a:hover { color: var(--primary); }

/* --- ФОРМА КОММЕНТАРИЕВ --- */
#respond {
    padding: 50px 0;
    border-top: 1px solid var(--border);
}

#reply-title { font-size: 24px; font-weight: 800; margin-bottom: 25px; }

#commentform input[type="text"], 
#commentform input[type="email"], 
#commentform textarea {
    width: 100%;
    padding: 15px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 16px;
    margin-bottom: 15px;
    outline: none;
    border-radius: 4px;
}

#commentform input:focus, 
#commentform textarea:focus { 
    border-color: var(--primary); 
    background: #fff; 
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

#commentform #submit {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 35px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.2s;
}
#commentform #submit:hover { background: #1e3a8a; transform: translateY(-1px); }

/* --- АДАПТИВ ТИПОГРАФИКИ --- */
@media (max-width: 768px) {
    h1 { font-size: 32px; }
    h2 { font-size: 26px; }
    body { font-size: 17px; }
    
    .related-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .container { padding: 0 15px; }
}

/* --- СЕТКА LAYOUT --- */
.layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* Основной контент + Сайдбар */
    gap: 50px; /* Разрыв между колонками */
    align-items: start;
    padding: 50px 0;
}

.content {
    min-width: 0; /* Предотвращает раздувание контента */
}

.sidebar {
    width: 300px;
    position: sticky;
    top: 100px; /* Сайдбар «липнет» при скролле */
}

/* Адаптив для мобилок */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr; /* Колонки друг под другом */
        gap: 40px;
        padding: 40px 0;
    }

    .sidebar {
        width: 100%;
        position: static;
    }
}






/* 2. HEADER BAR (ФИКСИРОВАННАЯ ШАПКА) */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    position: relative;
}

.logo a {
    font-size: 22px;
    font-weight: 900;
    text-decoration: none;
    color: var(--text-main);
    text-transform: uppercase;
}
.logo a span { color: var(--primary); }

/* 3. DESKTOP NAVIGATION */
.nav-wrapper { display: flex; align-items: center; gap: 40px; flex-direction: row-reverse;
    width: 100%;
    padding-left: 10%;
    justify-content: space-between;
}
.nav-list { display: flex; list-style: none; }
.nav-list > li > a {
    display: block; padding: 10px 15px;
    font-size: 14px; font-weight: 700;
    text-transform: uppercase; text-decoration: none;
    color: var(--text-main); transition: 0.2s;
}
.nav-list > li > a:hover { color: var(--primary); }

/* MEGA MENU (Desktop) */
.has-mega {  }
.mega-menu {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: #fff; border-top: 3px solid var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    visibility: hidden; opacity: 0; transition: 0.2s;
}
.has-mega:hover .mega-menu { visibility: visible; opacity: 1; transform: translateY(0); }
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 25px; }
.mega-col h3 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.mega-col ul { list-style: none; }
.mega-col li a { text-decoration: none; color: #444; font-size: 14px; display: block; padding: 5px 0; }

/* 4. ACTIONS (КНОПКИ) */
.header-actions { display: flex; align-items: center; gap: 15px; }
.btn-login { font-size: 14px; font-weight: 700; text-decoration: none; color: var(--text-main); }
.btn-login:hover { color: red; }
.btn-join {
    background: var(--primary); color: #fff;
    padding: 10px 20px; border-radius: 4px;
    font-size: 13px; font-weight: 700; text-transform: uppercase; text-decoration: none;
}
.btn-join :hover{
	background: #1e3a8a;
}

/* 5. MOBILE (АДАПТИВ) */
.burger { display: none; width: 25px; flex-direction: column; gap: 6px; cursor: pointer; }
.burger span { height: 2px; width: 100%; background: var(--text-main); transition: 0.3s; }

@media (max-width: 1024px) {
    .burger { display: flex; }
    
    /* Оверлей меню выезжает ПОД шапкой */
    .nav-wrapper {
    	display: block!important;
        position: fixed; top: var(--header-h); left: -100%;
        width: 100%; height: calc(100vh - var(--header-h));
        background: #fff; flex-direction: column;
        align-items: stretch; padding: 20px;
        transition: 0.3s ease; overflow-y: auto; /* ВКЛЮЧАЕМ СКРОЛЛ */
        z-index: 999;
    }
    
    .nav-active .nav-wrapper { left: 0; }
    .nav-active .burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-active .burger span:nth-child(2) { opacity: 0; }
    .nav-active .burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Кнопки вверху оверлея */
    .header-actions { flex-direction: column; width: 100%; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
    .header-actions a { width: 100%; text-align: center; }

    /* Список меню */
    .nav-list { flex-direction: column; }
    .nav-list > li { border-bottom: 1px solid var(--border); }
    .nav-list > li > a { padding: 15px 0; font-size: 18px; display: flex; justify-content: space-between; }
    .nav-list > li > a::after { content: '+'; color: var(--primary); }

    /* Аккордеон */
    .mega-menu { position: static; width: 100%; display: none; opacity: 1; visibility: visible; box-shadow: none; border: none; }
    .is-open .mega-menu { display: block; background: var(--bg-alt); margin: 0 -20px; padding: 20px; }
    .is-open > a::after { content: '−'; }
}







/* --- SIDEBAR WIDGETS --- */
.sidebar {
    padding-top: 0;
}

.widget {
    margin-bottom: 40px;
    background: var(--bg-alt);
    padding: 25px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
.widget h2{
	margin-top: 0;
}
/* Заголовки виджетов (Свежие записи, Рубрики) */
.widget-title, .wp-block-heading {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: block;
}

/* Списки (Свежие записи, Категории) */
.wp-block-latest-posts, .wp-block-categories-list {
    list-style: none;
    padding: 0;
}

.wp-block-latest-posts li, .wp-block-categories-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.wp-block-latest-posts li:last-child, 
.wp-block-categories-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Ссылки внутри виджетов */
.widget a {
    color: var(--text-main);
    display: block;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: 0.2s;
}

.widget a:hover {
    color: var(--primary);
}

/* ПОИСК */
.wp-block-search {
    display: flex;
    gap: 5px;
}

.wp-block-search__input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.wp-block-search__button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}

.wp-block-search__button:hover { background: #1e3a8a; }



.site-footer {
    background: #0f172a;
    color: #ffffff;
    padding: 60px 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-brand a {
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
}
.footer-brand span { color: var(--primary); }
.footer-brand p { color: #64748b; font-size: 14px; margin-top: 10px; }

.footer-links h3 {
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #94a3b8;
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}
.footer-links a:hover { color: var(--accent); }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; }
}