/**
 * Стили в стиле CMS Made Simple
 * Восстановленное оформление для сайта
 */

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Контейнер */
#page {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: #fff;
    padding: 0;
}

/* Основная структура с боковыми колонками - Grid Layout */
#page-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    grid-template-areas: "left-sidebar content-wrapper right-sidebar";
    min-height: 500px;
    max-width: 100vw;
    margin: 0 auto;
    width: 100%;
    gap: 0;
}

#left-sidebar {
    grid-area: left-sidebar;
    background: #fff8f0;
    padding: 20px 15px;
    border-right: 1px solid #ffcc99;
    box-sizing: border-box;
}

#right-sidebar {
    grid-area: right-sidebar;
    background: #fff8f0;
    padding: 20px 15px;
    border-left: 1px solid #ffcc99;
    box-sizing: border-box;
}

#content-wrapper {
    grid-area: content-wrapper;
    min-width: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Шапка */
#header {
    background: #fff;
    border-bottom: 3px solid #ff6600;
    padding: 15px 20px;
    margin-bottom: 20px;
    position: relative;
}

/* Баннер со слайдером */
.banner {
    width: 100vw;
    height: 300px;
    margin: 0 calc(-50vw + 50%) 15px calc(-50vw + 50%);
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 50%, #ffaa66 100%);
}

.banner .sequence-canvas {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
    height: 100%;
}

.banner .sequence-canvas li {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.5s ease;
}

.banner .sequence-canvas li.animate-in {
    opacity: 1 !important;
    z-index: 4;
    display: flex !important;
}

.banner .sequence-canvas li.animate-out {
    opacity: 0;
    z-index: 1;
}

.banner .sequence-canvas li .image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
}

.banner .sequence-canvas li .title {
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 10px 0;
    z-index: 10;
    position: relative;
}

.banner .sequence-canvas li .subtitle {
    color: #fff;
    font-size: 18px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    margin: 5px 0;
    z-index: 10;
    position: relative;
}

/* Скрытые элементы для совместимости */
#header-palm,
#header-human {
    display: none;
}

#header h1 {
    margin: 0;
    padding: 0;
    font-size: 28px;
    font-weight: normal;
}

#header h1 a {
    color: #ff6600;
    text-decoration: none;
}

#header h1 a:hover {
    text-decoration: underline;
}

/* Навигация */
#nav {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    margin-bottom: 20px;
}

#nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#nav ul li {
    display: inline-block;
    margin-right: 20px;
    position: relative;
}

#nav ul li a {
    color: #333;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
}

#nav ul li a:hover,
#nav ul li a.active {
    color: #ff6600;
    background: #ffe5d0;
    border-radius: 3px;
}

/* Выпадающее меню */
#nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ffcc99;
    border-radius: 3px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
    padding: 10px 0;
}

#nav ul li:hover ul {
    display: block;
}

#nav ul li ul li {
    display: block;
    margin: 0;
    width: 100%;
}

#nav ul li ul li a {
    padding: 8px 15px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

#nav ul li ul li a:hover {
    background: #ffe5d0;
    color: #ff6600;
    border-left: 3px solid #ff6600;
}

#nav ul li ul li:last-child a {
    border-bottom: none;
}

/* Боковое меню */
.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav ul li {
    margin-bottom: 5px;
}

.sidebar-nav ul li a {
    display: block;
    padding: 8px 10px;
    color: #333;
    text-decoration: none;
    border-left: 3px solid transparent;
    background: #fff;
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li a.active {
    color: #ff6600;
    background: #ffe5d0;
    border-left-color: #ff6600;
}

/* Контент */
#content {
    padding: 0 20px 20px 20px;
    min-height: 400px;
}

#content h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6600;
}

#content h2 {
    font-size: 20px;
    color: #333;
    margin: 20px 0 15px 0;
}

/* Статьи */
.article-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.article-item:last-child {
    border-bottom: none;
}

.article-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.article-title a {
    color: #ff6600;
    text-decoration: none;
}

.article-title a:hover {
    text-decoration: underline;
}

.article-meta {
    color: #666;
    font-size: 12px;
    margin-bottom: 15px;
}

.article-meta span {
    margin-right: 15px;
}

.article-content {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: #ff6600;
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    text-decoration: underline;
}

/* Пагинация */
.pagination {
    margin-top: 40px;
    text-align: center;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    background: #fff;
}

.pagination a:hover {
    background: #ff6600;
    color: #fff;
    border-color: #ff6600;
}

.pagination .current {
    background: #ff6600;
    color: #fff;
    border-color: #ff6600;
}

/* Поиск */
.search-box {
    margin-bottom: 20px;
    text-align: right;
}

.search-box a {
    display: inline-block;
    padding: 8px 15px;
    background: #ff6600;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
}

.search-box a:hover {
    background: #cc5200;
}

.search-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 3px;
}

.search-form input[type="text"] {
    width: 70%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
}

.search-form input[type="submit"] {
    padding: 12px 30px;
    font-size: 16px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 10px;
}

.search-form input[type="submit"]:hover {
    background: #cc5200;
}

.search-info {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.result-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.result-title a {
    color: #ff6600;
    text-decoration: none;
}

.result-title a:hover {
    text-decoration: underline;
}

.result-meta {
    color: #666;
    font-size: 12px;
    margin-bottom: 15px;
}

.result-meta span {
    margin-right: 15px;
}

.result-snippet {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.result-snippet mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Подвал */
#footer {
    background: #fff8f0;
    border-top: 2px solid #ff6600;
    padding: 30px 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: #666;
    clear: both;
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
}

#footer p {
    margin: 5px 0;
}

/* Пустое состояние */
.empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Боковые колонки контент */
#content {
    padding: 0 20px 20px 20px;
    min-height: 400px;
    background: #fff;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
    word-break: normal;
}

/* Адаптивность */
@media (max-width: 1024px) {
    #header,
    #nav,
    #page-wrapper,
    #footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    #page-wrapper {
        grid-template-columns: 180px 1fr 180px;
    }
    
    #left-sidebar,
    #right-sidebar {
        padding: 15px 10px;
    }
    
    #header-banner {
        height: 150px;
        margin: 0 calc(-50vw + 50%) 10px calc(-50vw + 50%);
    }
    
    #header-banner::before {
        font-size: 24px;
    }
    
    #header-palm img {
        max-height: 90px;
    }
    
    #header-human img {
        max-height: 110px;
    }
}

@media (max-width: 768px) {
    #header,
    #nav,
    #page-wrapper,
    #footer {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    #page-wrapper {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "left-sidebar"
            "content-wrapper"
            "right-sidebar";
    }
    
    #left-sidebar,
    #right-sidebar {
        border-right: none;
        border-left: none;
        border-bottom: 1px solid #ffcc99;
        padding: 15px;
    }
    
    #right-sidebar {
        border-bottom: none;
        border-top: 1px solid #ffcc99;
    }
    
    #content-wrapper {
        width: 100%;
    }
    
    #header {
        padding: 10px 15px;
    }
    
    .banner {
        height: 150px;
        margin: 0 calc(-50vw + 50%) 10px calc(-50vw + 50%);
    }
    
    .banner .sequence-canvas li .title {
        font-size: 18px;
        white-space: normal;
        padding: 0 10px;
    }
    
    .banner .sequence-canvas li .subtitle {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .banner .sequence-canvas li .image {
        max-height: 80px;
    }
    
    #header h1 {
        font-size: 22px;
    }
    
    #nav {
        padding: 8px 15px;
    }
    
    #nav ul li {
        margin-right: 10px;
    }
    
    #nav ul li a {
        padding: 5px 8px;
        font-size: 14px;
    }
    
    #content {
        padding: 0 15px 15px 15px;
    }
    
    #content h1 {
        font-size: 20px;
    }
    
    .article-title {
        font-size: 18px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .banner {
        height: 120px;
        margin: 0 calc(-50vw + 50%) 10px calc(-50vw + 50%);
    }
    
    .banner .sequence-canvas li .title {
        font-size: 14px;
    }
    
    .banner .sequence-canvas li .subtitle {
        font-size: 12px;
    }
    
    .banner .sequence-canvas li .image {
        max-height: 60px;
    }
    
    #header h1 {
        font-size: 18px;
    }
    
    #nav ul {
        display: flex;
        flex-direction: column;
    }
    
    #nav ul li {
        margin-right: 0;
        margin-bottom: 5px;
        width: 100%;
    }
    
    #nav ul li a {
        display: block;
        width: 100%;
    }
    
    /* Выпадающее меню на мобильных */
    #nav ul li ul {
        position: static;
        display: none;
        margin-top: 5px;
        box-shadow: none;
        border: 1px solid #ffcc99;
    }
    
    #nav ul li:hover ul,
    #nav ul li:focus-within ul {
        display: block;
    }
    
    .article-title {
        font-size: 16px;
    }
    
    .article-content {
        font-size: 14px;
    }
    
    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination a,
    .pagination span {
        padding: 5px 8px;
        margin: 2px;
        font-size: 12px;
    }
}

