/* File: blog.css */
/* Description: Styles for the main blog listing page. */

/* --- 1. Blog Header (Breadcrumbs & Search) --- */
.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumbs-nav {
    font-size: 14px;
    color: #555;
}

.breadcrumbs-nav a {
    color: #555;
    text-decoration: none;
}

.breadcrumbs-nav a:hover {
    color: #ff8300;
}

.blog-search {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.blog-search input {
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.blog-search button {
    border: none;
    background-color: #f4f4f4;
    padding: 8px 12px;
    cursor: pointer;
    color: #555;
}

.blog-search button:hover {
    background-color: #e0e0e0;
}

/* --- 2. Main Blog Layout (Sidebar + Posts) --- */
.blog-layout {
    display: grid;
    grid-template-columns: 280px 1fr; /* Левая колонка для рекламы, правая для статей */
    gap: 30px;
    margin-bottom: 30px;
}

.ad-placeholder-vertical {
    position: sticky;
    top: 100px;
    min-height: 600px;
    align-self: start; /* Важно для работы sticky в grid */
}

/* Чтобы изображения и HTML контент заполняли высоту */
.ad-placeholder-vertical img {
    max-width: 100%;
    height: auto;
}

/* --- Post Grids --- */
.posts-grid {
    display: grid;
    gap: 30px;
}

.posts-grid--2-col {
    grid-template-columns: repeat(2, 1fr);
}

.posts-grid--3-col {
    grid-template-columns: repeat(3, 1fr);
}

/* --- Full-width Ad Banner --- */
.ad-banner-fullwidth {
    margin-bottom: 30px;
}

/* --- Load More Button --- */
.load-more-container {
    text-align: center;
    padding: 20px 0 40px;
}

#load-more-btn {
    background-color: #e43d30;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    min-width: 150px; /* Чтобы кнопка не "прыгала" в размере */
    min-height: 45px;
}

#load-more-btn:hover {
    background-color: #c33429;
}

/* Spinner Styles */
.spinner {
    display: none; /* Скрыт по умолчанию */
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* State when loading */
#load-more-btn.loading .spinner {
    display: block;
}
#load-more-btn.loading .btn-text {
    visibility: hidden; /* Скрываем текст, но сохраняем размер кнопки */
}


/* --- Media Queries for Adaptability --- */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 220px 1fr; /* Уменьшаем сайдбар */
        gap: 20px;
    }
    .posts-grid--3-col {
        grid-template-columns: repeat(2, 1fr); /* 3 колонки -> 2 колонки */
    }
}

@media (max-width: 768px) {
    .blog-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .blog-layout {
        grid-template-columns: 1fr; /* Схлопываем в одну колонку */
    }
    .ad-placeholder-vertical {
        display: none; /* Скрываем вертикальный баннер на мобильных */
    }
    .sidebar-left {
        display: none; /* Или можно скрыть на мобильных, т.к. реклама может мешать */
    }
    .posts-grid--2-col,
    .posts-grid--3-col {
        grid-template-columns: 1fr; /* Все сетки в одну колонку */
    }
}

/* File: blog.css */
/* Description: Styles for the main blog listing page. */

/* --- 1. Blog Header (Breadcrumbs & Search) --- */
.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumbs-nav {
    font-size: 14px;
    color: #555;
}

.breadcrumbs-nav a {
    color: #555;
    text-decoration: none;
}

.breadcrumbs-nav a:hover {
    color: #ff8300;
}

.blog-search {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}
    line-height: 1.4;
    transition: color 0.2s;
}

.blog-card:hover h3 {
    color: #ff8300;
}

.card-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #777;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* --- Breadcrumbs in Blog Header --- */
.breadcrumbs-nav span {
    color: #333;
    font-weight: 500;
}