/* =============================================
   Финальная мозаика Masonry (CSS Grid)
   Плитки разной высоты прилегают плотно
   ============================================= */

/* --- 1. Сбрасываем фон и делаем контейнер сеткой --- */
.grid-child.container-top-b {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 15px;
    background: transparent !important;
}

/* --- 2. Плитка --- */
.mosaic-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: transparent;
    display: block;
    margin: 0 0 15px 0;
    float: left;
    width: calc(33.333% - 10px);
}

.mosaic-item > a {
    display: block;
    position: relative;
    text-decoration: none;
    color: #fff;
    height: 100%;
}

.mosaic-item__image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease, filter 0.5s ease;
    vertical-align: bottom;
}

/* --- 3. Эффекты при наведении --- */
.mosaic-item:hover .mosaic-item__image {
    transform: scale(1.15);
    filter: brightness(0.5);
}

.mosaic-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.mosaic-item:hover .mosaic-item__overlay {
    opacity: 1;
}

/* --- 4. Типографика --- */
.mosaic-item__title {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    line-height: 1.3;
    font-weight: 600;
}
.mosaic-item__text {
    margin: 0 0 18px 0;
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.5;
}
.mosaic-item__tags {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}
.mosaic-item__tag i {
    margin-right: 5px;
}

/* --- 5. Адаптивность мозаики --- */
@media (max-width: 992px) {
    .grid-child.container-top-b {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-child.container-top-b {
        grid-template-columns: 1fr;
    }
}

/* Центрирование модуля в позиции copyright */
.container-footer .grid-child {
    justify-content: center;
}

/* =============================================
   ПОДКАТЕГОРИИ В БЛОГЕ - 2 КОЛОНКИ
   ============================================= */

.com-content-category-blog .com-content-category-blog__children {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    list-style: none;
    padding-left: 0;
}

.com-content-category-blog .com-content-category-blog__child {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.com-content-category-blog .com-content-category-blog__child:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.com-content-category-blog__child-image {
    width: 100%;
}

.com-content-category-blog__child-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Базовые стили заголовка */
.com-content-category-blog .com-content-category-blog__child .item-title {
    padding: 1rem 1rem 0 1rem;
}

/* Стили описания */
.com-content-category-blog .com-content-category-blog__description {
    padding: 0 1rem 1rem 1rem;
}

@media (max-width: 767.98px) {
    .com-content-category-blog .com-content-category-blog__children {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   ЦЕНТРИРОВАНИЕ ЗАГОЛОВКОВ ПОДКАТЕГОРИЙ И ОТСТУПЫ
   ============================================= */

/* Центрируем заголовок подкатегории и добавляем отступ снизу (до изображения) */
.com-content-category-blog .com-content-category-blog__child .item-title {
    text-align: center;
    margin-bottom: 1rem;   /* Отступ от заголовка до изображения */
    margin-top: 0;
}

/* Центрируем описание подкатегории */
.com-content-category-blog .com-content-category-blog__description {
    text-align: center;
}

/* Скрываем заголовок "Подкатегории" */
.com-content-category-blog > .page-header {
    display: none;
}

/* ==========================================
   Заглушки для рекламных блоков — Cassiopeia
   Адаптивная высота, без фиксации
   ========================================== */

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;              /* минимальная, чтобы блок не схлопнулся пустым */
    height: auto;                  /* растягивается по содержимому */
    padding: 1.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px dashed rgba(0, 0, 0, 0.35);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    color: var(--cassiopeia-color-dark, #222);
    background-color: #f8f9fa;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    width: 100%;
}

.ad-placeholder small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.8;
}

/* Цвета по позициям — без min-height, только фон */
.ad-banner {
    background-color: #ffeaa5;
}

.ad-main-top {
    background-color: #b8e994;
}

.ad-main-bottom {
    background-color: #dda0dd;
}

.ad-sidebar-left,
.ad-sidebar-right {
    background-color: #fab1a0;
}

.ad-bottom-a,
.ad-bottom-b {
    background-color: #90caf9;
}

/* На десктопе можно чуть увеличить минимальную высоту для визуала */
@media (min-width: 768px) {
    .ad-placeholder {
        min-height: 100px;
    }
    .ad-sidebar-left,
    .ad-sidebar-right {
        min-height: 150px;         /* скромнее, чем было 300px */
    }
    .ad-banner {
        min-height: 120px;
    }
}

/* Мобильные — всё компактно */
@media (max-width: 767.98px) {
    .ad-placeholder {
        min-height: 70px;
        padding: 0.75rem;
    }
    .ad-sidebar-left,
    .ad-sidebar-right {
        min-height: 100px;
    }
}
/* Адаптивные вердикты для статьи */
.verdict-badge {
    display: inline-block;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    font-size: 1rem;
    padding: 0.35em 0.65em;
    line-height: 1.4;
}

@media (max-width: 575.98px) {
    .verdict-badge {
        font-size: 0.9rem;
        padding: 0.3em 0.55em;
        display: block;
        text-align: center;
    }
    
    .verdict-badge-wrapper {
        margin-top: 0.75rem;
    }
}
