/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    font-size: 18px;
}

/* Хедер */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.site-title {
    font-size: 24px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.site-title a {
    color: #000000;
    text-decoration: none;
}

.site-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    list-style: none;
    text-align: right;
}

.site-menu a {
    color: #000000;
    text-decoration: none;
    text-transform: lowercase;
    font-size: 16px;
}

.site-menu a:hover {
    text-decoration: underline;
}

/* Стили для главной страницы */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    padding-bottom: 15px;
}

.post-title {
    font-size: 22px;
    font-weight: normal;
    margin-bottom: 0.2em;
}

.post-title a {
    color: #000000;
    text-decoration: none;
}

.post-title a:hover {
    text-decoration: underline;
}

.post-description {
    font-size: 0.9em;
    margin-bottom: 0.3em;
}

.post-meta {
    font-size: 14px;
    color: #666666;
    display: flex;
    gap: 15px;
}

.post-meta a {
    color: #666666;
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}


/* Стили для страницы статьи */
.article-header {
    margin-bottom: 40px;
}

h1, .article-title {
    font-size: 28px;
    font-weight: normal;
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-meta {
    font-size: 14px;
    color: #666666;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.article-meta a {
    color: #666666;
    text-decoration: none;
}

.article-meta a:hover {
    text-decoration: underline;
}

.article-content {
    font-size: 18px;
    line-height: 1.7;
}

.article-content p {
    margin-bottom: 20px;
}

/* Большая одиночная картинка в статье */
.article-main-image {
    margin: 40px 0;
    width: 100%;
}

.article-main-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.article-main-image img:hover {
    opacity: 0.9;
}

/* Динамическая Bento Grid */
.dynamic-bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 100px);
    gap: 10px;
    margin: 60px 0;
}

.bento-item {
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bento-item:hover img {
    transform: scale(1.05);
}

/* Модальное окно - БЕЛЫЙ ФОН */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    overflow: auto;
}

.modal-content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* Черные кнопки без фона */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #000000;
    font-size: 40px;
    font-weight: normal;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

.close:hover {
    opacity: 0.7;
}

/* Навигационные стрелки - черные без фона */
.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.nav-arrow {
    color: #000000;
    font-size: 40px;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    pointer-events: auto;
}

.nav-arrow:hover {
    opacity: 0.7;
}

.back-link {
    margin-top: 40px;
    font-size: 16px;
}

.back-link a {
    color: #666666;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Стили для страницы категории */
.category-header {
    margin-bottom: 30px;
}

.category-title {
    font-size: 22px;
    font-weight: normal;
    color: #666666;
}

.site-menu a.active {
    font-weight: bold;
}

/* Адаптивность для всех страниц */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding: 30px 15px;
    }
    
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .site-title {
        font-size: 22px;
    }
    
    .site-menu {
        text-align: left;
        gap: 20px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .post-title {
        font-size: 20px;
    }
    
    .article-main-image img {
        height: 300px;
    }
    
    .dynamic-bento-grid {
        grid-template-rows: repeat(4, 80px);
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .dynamic-bento-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(6, 70px);
        gap: 6px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
        padding: 20px 10px;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .site-menu {
        gap: 15px;
    }
    
    .site-menu a {
        font-size: 14px;
    }
    
    .article-title {
        font-size: 22px;
    }
    
    .post-title {
        font-size: 18px;
    }
    
    .article-meta {
        font-size: 13px;
        flex-direction: column;
        gap: 3px;
    }
    
    .post-meta {
        font-size: 13px;
        flex-direction: column;
        gap: 3px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .article-main-image img {
        height: 250px;
    }
    
    .dynamic-bento-grid {
        grid-template-rows: repeat(6, 60px);
        gap: 5px;
        margin: 40px 0;
    }
    
    .nav-arrow {
        font-size: 30px;
        padding: 10px;
    }
    
    .close {
        font-size: 30px;
        right: 15px;
        top: 15px;
    }
}

@media (max-width: 360px) {
    .dynamic-bento-grid {
        grid-template-rows: repeat(6, 50px);
    }
    
    .article-main-image img {
        height: 200px;
    }
}