.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
}
.header-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 900;
    font-size: 1.4rem;
    text-decoration: none;
    color: #000;
    letter-spacing: -1px;
}
/* Гамбургер */
.menu-toggle {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px;
}
.menu-toggle span {
    display: block; width: 25px; height: 3px; background: #000; border-radius: 2px;
}
/* Стили меню внутри модалки */
.mobile-nav ul { list-style: none; padding: 0; margin-top: 50px; }
.mobile-nav li { margin-bottom: 25px; }
.mobile-nav a { 
    font-size: 2rem; font-weight: 700; text-decoration: none; color: #000;
}
/* Базовый сброс */
* { box-sizing: border-box; }
body {
    margin: 0; padding: 0;
    font-family: -apple-system, system-ui, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
}

body {
    font-display: swap;
}
.post-gallery {
    min-height: 200px; /* Примерная высота, чтобы текст не прыгал вверх-вниз */
    background: #eee;  /* Легкий фон, пока картинка грузится */
}

/* Контейнер ленты */
.container {
    max-width: 700px;
    margin: 0 auto;
}

/* Карточка записи */
.post-preview {
    background: #fff;
    margin-bottom: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.post-preview h2 {
    font-size: 24px;
    margin: 0 0 12px;
    line-height: 1.3;
}

.excerpt {
    font-size: 16px;
    line-height: 1.5;
    color: #4b4f56;
}

/* Удаляем старую кнопку */
.read-more { display: none; }

/* Ссылка в конце текста */
.read-more-link {
    color: #007bff; /* Яркий синий цвет */
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 5px;
    text-decoration: underline;
}

.read-more-link:hover {
    color: #0056b3;
    text-decoration: none;
}

.real-excerpt {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #333;
}


/* МОДАЛЬНОЕ ОКНО — ЭФФЕКТ «ШТОРКИ» */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); /* Затемнение фона */
    backdrop-filter: blur(5px); /* Размытие заднего плана */
}

.modal-content {
    background-color: #fff;
    position: absolute;
    bottom: 0; /* Прижимаем к низу */
    width: 100%;
    height: 92%; /* Оставляем сверху зазор, чтобы было видно, что это окно */
    border-radius: 20px 20px 0 0; /* Закругляем только верх */
    padding: 40px 20px;
    overflow-y: auto;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out; /* Плавный выезд снизу */
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Кнопка закрытия — сделаем её в виде полоски сверху (как в iOS) */
.close-modal {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    background: #ccc;
    border-radius: 10px;
    cursor: pointer;
    text-indent: -9999px; /* Прячем крестик, оставляем полоску */
}

/* АДАПТИВНОСТЬ ДЛЯ МОБИЛОК */
@media (max-width: 600px) {
    body { background-color: #fff; } /* На мобилках фон белый, как в лентах соцсетей */
    
    .post-preview {
        margin-bottom: 0;
        border-bottom: 1px solid #eee;
        box-shadow: none;
        padding: 20px 15px; /* Убираем боковые отступы */
    }

    .container {
        width: 100%;
    }
}
/* Контейнер галереи */
.post-gallery {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
}

/* Если картинка одна — она займет всю ширину (100%) */
.post-gallery img:only-child {
    grid-column: 1 / -1;
}

.post-gallery img {
    width: 100%;
    height: 250px; /* Фиксированная высота для ровного ряда */
    object-fit: cover; /* Картинка заполнит область без искажения */
    border-radius: 8px;
    display: block;
    background: #eee; /* Фон на время загрузки */
}

/* Скрываем картинки, которые не загрузились */
.img-hidden {
    display: none !important;
}
.search-form {
    display: flex;
    margin-bottom: 30px;
    gap: 10px;
}
.search-field {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}
.search-submit {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}
.search-title {
    padding: 20px 0;
    font-size: 1.5rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}
.post-link {
    text-decoration: none;
    color: inherit; /* Цвет как у обычного текста */
}
.post-link:hover {
    color: #007bff;
}
/* Полный запрет на горизонтальный скролл для всей страницы */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Принудительное ограничение для ВСЕХ элементов внутри контента */
.full-content, .real-excerpt, .modal-content {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* Тотальный контроль над картинками и любыми вложенными блоками */
.full-content img, 
.full-content figure, 
.full-content div,
.post-preview img {
    max-width: 100% !important;
    width: auto !important; /* Помогает сбросить фиксированные атрибуты */
    height: auto !important;
    clear: both;
}

/* Если картинка вставлена через inline-style в HTML */
[style] {
    max-width: 100% !important;
}
.no-click {
    pointer-events: none; /* Запрещает клики */
    cursor: default;      /* Убирает указатель-палец */
    display: block;       /* Чтобы ссылка корректно обволакивала картинку */
}