/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    opacity: 0.9;
}

.header-contacts p {
    margin: 5px 0;
    font-size: 14px;
}

/* Navigation */
.main-nav {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: background 0.3s;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.2);
}

.has-submenu > a::after {
    content: ' \25BC';
    font-size: 10px;
    margin-left: 5px;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border-radius: 5px;
    min-width: 220px;
    z-index: 1000;
    padding: 5px 0;
}

.main-nav li:hover > .submenu {
    display: block;
}

.submenu li {
    position: relative;
}

.submenu a {
    color: #333;
    padding: 10px 15px;
    border-radius: 0;
}

.submenu a:hover {
    background: #f0f0f0;
}

/* Вложенные подменю (3+ уровень) */
.submenu .submenu {
    top: 0;
    left: 100%;
    margin-left: 2px;
}

.submenu .has-submenu > a::after {
    content: ' \25B6';
    float: right;
}

/* Search Bar */
.search-bar {
    margin-top: 15px;
}

.search-bar form {
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
}

.search-bar button {
    padding: 10px 20px;
    background: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s;
}

.search-bar button:hover {
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-card.fixed {
    border: 2px solid #667eea;
}

.post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-content h3 {
    margin-bottom: 10px;
}

.post-content h3 a {
    color: #333;
    text-decoration: none;
}

.post-content h3 a:hover {
    color: #667eea;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-thumbnail {
    flex-shrink: 0;
}

.post-thumbnail img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.post-info {
    flex: 1;
}

.post-info h3 {
    margin-bottom: 10px;
}

.post-info h3 a {
    color: #333;
    text-decoration: none;
}

.post-info h3 a:hover {
    color: #667eea;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.read-more:hover {
    text-decoration: underline;
}

/* Single Post */
.single-post {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-header h1 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #333;
}

.post-image-full {
    margin: 20px 0;
}

.post-image-full img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 10px;
}

.post-content-full {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin: 30px 0;
}

.post-content-full p {
    margin-bottom: 15px;
}

.post-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.tag {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}

.tag:hover {
    background: #764ba2;
}

/* Related Posts */
.related-posts {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.related-posts h2 {
    margin-bottom: 20px;
}

/* Category Page */
.breadcrumbs {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 10px;
    color: #999;
}

.breadcrumbs .current {
    color: #333;
    font-weight: 600;
}

.category-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.subcategory-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.subcategory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.subcategory-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Search Page */
.search-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-query {
    font-size: 18px;
    margin: 10px 0;
}

.search-count {
    color: #666;
}

.search-result-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-thumbnail img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.result-content h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.result-content h2 a {
    color: #333;
    text-decoration: none;
}

.result-content h2 a:hover {
    color: #667eea;
}

.no-results {
    background: white;
    padding: 60px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.no-results p {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: white;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pagination a:hover {
    background: #667eea;
    color: white;
}

.pagination .current {
    background: #667eea;
    color: white;
    font-weight: 600;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p {
    margin: 8px 0;
    font-size: 14px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 8px 0;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-section a:hover {
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .main-nav ul {
        flex-direction: column;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-item {
        flex-direction: column;
    }

    .post-thumbnail img {
        width: 100%;
    }

    .search-result-item {
        flex-direction: column;
    }

    .result-thumbnail img {
        width: 100%;
        height: 200px;
    }

    .single-post {
        padding: 20px;
    }

    .post-header h1 {
        font-size: 24px;
    }
}

.no-posts {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}
