/**
 * Shtyl Theme - Основные стили
 *
 * @package Shtyl_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    /* Цвета */
    --shtyl-primary: #2563eb;
    --shtyl-primary-hover: #1d4ed8;
    --shtyl-secondary: #64748b;
    --shtyl-accent: #f59e0b;
    --shtyl-text: #1e293b;
    --shtyl-text-light: #64748b;
    --shtyl-bg: #ffffff;
    --shtyl-bg-alt: #f8fafc;
    --shtyl-border: #e2e8f0;
    --shtyl-success: #22c55e;
    --shtyl-error: #ef4444;
    
    /* Размеры */
    --shtyl-container: 1200px;
    --shtyl-gap: 20px;
    --shtyl-radius: 8px;
    
    /* Шрифты */
    --shtyl-font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --shtyl-font-size-base: 16px;
    --shtyl-line-height: 1.6;
    
    /* Тени */
    --shtyl-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shtyl-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    
    /* Переходы */
    --shtyl-transition: 0.2s ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--shtyl-font-size-base);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--shtyl-font-main);
    font-size: 1rem;
    line-height: var(--shtyl-line-height);
    color: var(--shtyl-text);
    background-color: var(--shtyl-bg);
}

a {
    color: var(--shtyl-primary);
    text-decoration: none;
    transition: color var(--shtyl-transition);
}

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

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

/* ==========================================================================
   Layout
   ========================================================================== */

.shtyl-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.shtyl-main {
    flex: 1;
    padding: var(--shtyl-gap) 0;
}

.shtyl-container {
    width: 100%;
    max-width: var(--shtyl-container);
    margin: 0 auto;
    padding: 0 var(--shtyl-gap);
}

/* ==========================================================================
   Header
   ========================================================================== */

.shtyl-header {
    background: var(--shtyl-bg);
    border-bottom: 1px solid var(--shtyl-border);
    padding: 15px 0;
}

.shtyl-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--shtyl-gap);
}

.shtyl-header__branding {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shtyl-header__logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shtyl-text);
}

.shtyl-header__logo:hover {
    color: var(--shtyl-primary);
}

.shtyl-header__description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--shtyl-text-light);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.shtyl-nav__menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.shtyl-nav__menu a {
    color: var(--shtyl-text);
    font-weight: 500;
    padding: 8px 0;
    display: block;
}

.shtyl-nav__menu a:hover,
.shtyl-nav__menu .current-menu-item > a {
    color: var(--shtyl-primary);
}

/* Mobile menu toggle */
.shtyl-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.shtyl-menu-toggle__bar {
    width: 24px;
    height: 2px;
    background: var(--shtyl-text);
    transition: var(--shtyl-transition);
}

/* ==========================================================================
   Posts
   ========================================================================== */

.shtyl-posts {
    display: grid;
    gap: var(--shtyl-gap);
}

.shtyl-post {
    background: var(--shtyl-bg);
    border: 1px solid var(--shtyl-border);
    border-radius: var(--shtyl-radius);
    padding: var(--shtyl-gap);
}

.shtyl-post__title {
    margin: 0 0 10px;
    font-size: 1.25rem;
}

.shtyl-post__title a {
    color: var(--shtyl-text);
}

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

.shtyl-post__content {
    color: var(--shtyl-text-light);
    margin-bottom: 15px;
}

.shtyl-post__content p {
    margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.shtyl-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--shtyl-primary);
    color: #fff;
    border: none;
    border-radius: var(--shtyl-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--shtyl-transition);
}

.shtyl-btn:hover {
    background: var(--shtyl-primary-hover);
    color: #fff;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.shtyl-footer {
    background: var(--shtyl-bg-alt);
    border-top: 1px solid var(--shtyl-border);
    padding: 30px 0;
    margin-top: auto;
}

.shtyl-footer__bottom {
    text-align: center;
}

.shtyl-footer__copyright {
    margin: 0;
    font-size: 0.875rem;
    color: var(--shtyl-text-light);
}

/* ==========================================================================
   Widgets
   ========================================================================== */

.shtyl-widget {
    margin-bottom: var(--shtyl-gap);
}

.shtyl-widget__title {
    font-size: 1rem;
    margin: 0 0 10px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.shtyl-pagination {
    margin-top: 30px;
}

.shtyl-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.shtyl-pagination a,
.shtyl-pagination span {
    padding: 8px 14px;
    border: 1px solid var(--shtyl-border);
    border-radius: var(--shtyl-radius);
}

.shtyl-pagination a:hover {
    background: var(--shtyl-primary);
    color: #fff;
    border-color: var(--shtyl-primary);
}

.shtyl-pagination .current {
    background: var(--shtyl-primary);
    color: #fff;
    border-color: var(--shtyl-primary);
}

/* ==========================================================================
   No Content
   ========================================================================== */

.shtyl-no-content {
    text-align: center;
    padding: 60px 20px;
}

.shtyl-no-content h2 {
    margin: 0 0 10px;
}

.shtyl-no-content p {
    color: var(--shtyl-text-light);
}

/* ==========================================================================
   Responsive - Mobile First
   ========================================================================== */

@media (max-width: 768px) {
    
    /* Показать кнопку меню */
    .shtyl-menu-toggle {
        display: flex;
    }
    
    /* Скрыть меню по умолчанию */
    .shtyl-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--shtyl-bg);
        border-bottom: 1px solid var(--shtyl-border);
        display: none;
    }
    
    .shtyl-nav.is-open {
        display: block;
    }
    
    .shtyl-nav__menu {
        flex-direction: column;
        padding: var(--shtyl-gap);
        gap: 0;
    }
    
    .shtyl-nav__menu a {
        padding: 12px 0;
        border-bottom: 1px solid var(--shtyl-border);
    }
    
    .shtyl-header__inner {
        position: relative;
    }
}
