/*
Theme Name: TifloGroup
Theme URI: https://tiflogroop.com/
Author: TifloGroup
Author URI: https://tiflogroop.com/
Version: 1.0
Requires at least: 6.9
Requires PHP: 8.4
License: GPLv2 or later
*/

/* ==========================================================================
   Базовые сбросы и настройки
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #1e1e1e;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Типографика
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    color: #111;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem 0;
}

a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover,
a:focus {
    color: #004466;
    text-decoration: underline;
}

/* Доступность: фокус-стили */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Контейнер и сетка (flexbox)
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Сетка для контента и сайдбара (используется в шаблонах)
   ========================================================================== */
.content-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.content-with-sidebar {
    flex: 1 1 70%;
    min-width: 0;
}

.content-full {
    flex: 1 1 100%;
    min-width: 0;
}

.sidebar-area {
    flex: 1 1 25%;
    min-width: 0;
}

@media (max-width: 768px) {
    .content-wrap {
        flex-direction: column;
    }
    .content-with-sidebar,
    .content-full,
    .sidebar-area {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Шапка (header)
   ========================================================================== */
.site-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}
.site-title a {
    color: #111;
}
.site-title a:hover,
.site-title a:focus {
    color: #0073aa;
    text-decoration: none;
}

.site-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
}

/* ==========================================================================
   Навигационное меню (классическое, без блоков)
   ========================================================================== */
.main-navigation {
    margin-top: 0.5rem;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 0.5rem 0;
    color: #1e1e1e;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.main-navigation a:hover,
.main-navigation a:focus {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.main-navigation .current-menu-item > a,
.main-navigation .current-page-ancestor > a {
    border-bottom-color: #0073aa;
    color: #0073aa;
}

.main-navigation .menu-item-has-children > a::after {
    content: " ▼";
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 999;
    border-radius: 4px;
    flex-direction: column;
    gap: 0;
}

.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
    display: flex;
}

.main-navigation .sub-menu a {
    padding: 0.5rem 1rem;
    border-bottom: none;
    font-weight: 400;
}

.main-navigation .sub-menu a:hover,
.main-navigation .sub-menu a:focus {
    background: #f1f1f1;
    border-bottom: none;
}

/* Мобильная кнопка-гамбургер */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #ccc;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: #f1f1f1;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-block;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0;
    }

    .main-navigation ul.toggled {
        display: flex;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .main-navigation a {
        padding: 0.75rem 0;
    }

    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        border-left: 2px solid #0073aa;
        border-radius: 0;
        display: none;
    }

    .main-navigation .sub-menu.toggled {
        display: flex;
    }

    .main-navigation li:hover > .sub-menu,
    .main-navigation li:focus-within > .sub-menu {
        display: none;
    }
}

/* ==========================================================================
   Содержимое (записи, страницы)
   ========================================================================== */
.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.entry-title a {
    color: #111;
}
.entry-title a:hover,
.entry-title a:focus {
    color: #0073aa;
}

.entry-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}
.entry-meta a {
    color: #6c757d;
}
.entry-meta a:hover,
.entry-meta a:focus {
    color: #0073aa;
}

.entry-content {
    margin-bottom: 2rem;
}
.entry-content p,
.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
}
.entry-content ul,
.entry-content ol {
    padding-left: 2rem;
}
.entry-content li {
    margin-bottom: 0.5rem;
}

.post-thumbnail {
    margin-bottom: 1.5rem;
}
.post-thumbnail img {
    border-radius: 4px;
}

/* Стили для блоков WP (классический редактор) */
.wp-block-image img {
    border-radius: 4px;
}
.wp-block-quote {
    border-left: 4px solid #0073aa;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #555;
}
.wp-block-pullquote {
    padding: 1.5rem;
    border-top: 3px solid #0073aa;
    border-bottom: 3px solid #0073aa;
    text-align: center;
}
.wp-block-button .wp-block-button__link {
    background: #0073aa;
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.wp-block-button .wp-block-button__link:hover,
.wp-block-button .wp-block-button__link:focus {
    background: #004466;
}

/* ==========================================================================
   Сайдбар (виджеты)
   ========================================================================== */
.sidebar-area .widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget ul li {
    margin-bottom: 0.5rem;
}
.widget ul li a {
    color: #1e1e1e;
}
.widget ul li a:hover,
.widget ul li a:focus {
    color: #0073aa;
}

/* ==========================================================================
   Комментарии
   ========================================================================== */
.comments-area {
    margin-top: 3rem;
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}
.comment-list li {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}
.comment-list .children {
    list-style: none;
    padding-left: 2rem;
    margin: 1rem 0 0 0;
}

.comment-author {
    font-weight: 600;
}
.comment-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}
.comment-content p {
    margin-bottom: 0.75rem;
}
.comment-awaiting-moderation {
    color: #856404;
    background: #fff3cd;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
}

.comment-reply-link {
    font-size: 0.875rem;
    color: #0073aa;
}
.comment-reply-link:hover,
.comment-reply-link:focus {
    color: #004466;
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #0073aa;
    outline: none;
}
.comment-form .submit {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-form .submit:hover,
.comment-form .submit:focus {
    background: #004466;
}
.comment-notes {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ==========================================================================
   Пагинация
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin: 2rem 0;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #1e1e1e;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers:focus {
    background: #f1f1f1;
    border-color: #0073aa;
}
.pagination .current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}
.pagination .dots {
    border: none;
    background: transparent;
}

/* ==========================================================================
   Форма поиска
   ========================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.search-form label {
    flex: 1 1 70%;
    min-width: 150px;
}
.search-form .search-field {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.search-form .search-field:focus {
    border-color: #0073aa;
    outline: none;
}
.search-form .search-submit {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.search-form .search-submit:hover,
.search-form .search-submit:focus {
    background: #004466;
}

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6c757d;
}
.site-footer a {
    color: #6c757d;
}
.site-footer a:hover,
.site-footer a:focus {
    color: #0073aa;
    text-decoration: underline;
}
.site-footer .site-info {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Доступность (Screen Reader Text)
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background: #f1f1f1;
    clip: auto !important;
    clip-path: none;
    color: #0073aa;
    display: block;
    font-size: 1rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 1rem 1.5rem;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   Вспомогательные классы
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ==========================================================================
   Медиа-запросы для мелких экранов
   ========================================================================== */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    .site-title { font-size: 1.5rem; }
    .entry-title { font-size: 1.5rem; }
    .comment-list .children {
        padding-left: 1rem;
    }
}