.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px;
}

.article-card {
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card img {
    width: 100%;
    height: 400px;
    object-fit: cover; /* Чтобы фото не искажалось */
    border-radius: 4px;
}

.article-card h2 {
    font-family: 'Playfair Display', serif; /* Или твой основной шрифт */
    font-size: 1.5rem;
    margin: 15px 0 10px;
}

.article-date {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

/* Обертка для карточки и кнопок админа */
.article-card-wrapper {
    position: relative;
}

/* Стили для карточки-кнопки "Плюс" */
.add-article-card {
    border: 2px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
    min-height: 300px; /* подстройте под высоту ваших карточек */
}

.add-article-card:hover {
    border-color: #000;
    background: #f0f0f0;
}

.add-btn-content {
    text-align: center;
    color: #888;
}

.add-btn-content i {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

/* Контейнер кнопок управления */
.admin-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.admin-controls a, 
.admin-controls button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    color: #333;
    transition: 0.2s;
}

.btn-edit:hover { color: #2ecc71; transform: scale(1.1); }
.btn-delete:hover { color: #e74c3c; transform: scale(1.1); }

/* Для страницы отдельной статьи */

main#start_main {
    margin: 0 auto;
    padding-bottom: 50px;
    width: 90%;
}

/* --- Шапка статьи (Фото и Заголовки) --- */
.main-photo {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 8px 0px 8px 10px;
}

.main-photo h1.new-title {
    color: #000; 
    font-size: 55px;
    margin-left: 0;
    line-height: 1.1;
    width: 100%;
    text-align: center;
}

.main-photo h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 300;
    font-style: italic;
}

.main-photo .new-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

/* --- Динамический контент (Зигзаг через обтекание) --- */
.article-dynamic-content {
    clear: both;
    margin: 18px 50px 18px 10px;
}

/* Общие правила для параграфов */
.article-dynamic-content p {
    font-size: 22px;
    line-height: 1.6;
    margin-bottom: 30px;
    clear: both; /* Каждый новый абзац начинается с новой строки */
    display: block; /* Возвращаем стандартное отображение */
}

/* Картинка слева */
.article-dynamic-content img[style*="float: left"] {
    float: left;
    width: 45% !important;
    margin-right: 40px;
    margin-bottom: 10px;
    margin-top: 10px; /* Немного опускаем картинку, чтобы выровнять с текстом */
    border-radius: 12px;
}

/* Картинка справа */
.article-dynamic-content img[style*="float: right"] {
    float: right;
    width: 45% !important;
    margin-left: 40px;
    margin-bottom: 10px;
    margin-top: 10px;
    border-radius: 12px;
}

/* Очистка флоатов в конце контента */
.article-dynamic-content::after {
    content: "";
    display: table;
    clear: both;
}

/* --- Подвал статьи (Кнопка Назад) --- */
.article-footer {
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    clear: both; /* Обязательно, чтобы кнопка не уехала под картинки */
}

.back-link {
    color: #000;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: #666;
}

/* Панель управления в предпросмотре админа */
.preview-admin-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    padding: 20px;
    border-top: 2px solid #dee2e6;
    z-index: 1000;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

.schedule-box {
    display: none; /* Скрыто по умолчанию */
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ccc;
}