/*
Theme Name: Forma16
Description: Простая, строгая бизнес-тема для WordPress с минимальным набором файлов
Version: 1.0
Author: Your Name
*/

:root { 
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --content-max-width: 1000px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 0 0 20px 0;
}

/* Хидер */
.site-header {
    width: 100%;
    background-color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    position: relative;
}

.header-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.header-logo:hover {
    color: var(--secondary-color);
}

.header-logo-img {
    display: block;
    height: 36px;
    width: auto;
}

.header-nav {
    flex: 1;
    display: none;
    justify-content: center;
}

.header-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.header-nav-link {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.header-nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: none;
    color: #444;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}

.mobile-menu {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 1000;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.mobile-menu.is-open {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.header-logo-mobile .header-logo-img {
    height: 32px;
}

.mobile-menu-close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: #444;
    cursor: pointer;
}

.mobile-menu-close:hover {
    color: var(--primary-color);
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 16px 0;
}

.mobile-menu-link {
    display: block;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.mobile-menu-link:hover {
    background: #f5f5f5;
    color: var(--primary-color);
}

@media (min-width: 1024px) {
    .header-nav {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }
}

@media (max-width: 1023px) {
    body.header-menu-open {
        overflow: hidden;
    }
}

.container {
    width: 100%;
    max-width: var(--content-max-width);
    min-width: 0;
    margin: 20px auto 0;
    background-color: #ffffff;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Поиск */
.search-form {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
}

.search-form input[type="search"] {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Рубрики */
.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

/* Список постов */
.posts-list {
    list-style: none;
    margin-left: 20px;
}

.posts-list li {
    margin-bottom: 12px;
}

.posts-list a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s, padding-left 0.3s;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.posts-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.posts-list a::before {
    content: "→ ";
    opacity: 0;
    transition: opacity 0.3s;
}

.posts-list a:hover::before {
    opacity: 1;
}

/* Страница поста — тот же .container, что и на архиве */
.post-content-wrapper {
    /* обёртка поста внутри колонки */
}

.post-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
}

.post-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.post-meta {
    color: #666;
    font-size: 14px;
}

.post-content {
    font-size: 18px;
    line-height: 1.8;
    color: #444;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content a {
    color: var(--secondary-color);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--primary-color);
}

.back-link {
    display: inline-block;
    margin-top: 40px;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-link:hover {
    background-color: var(--primary-color);
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .post-title {
        font-size: 24px;
    }
    
    .category-title {
        font-size: 20px;
    }
}
