/* ==========================================================================
   СЕКЦІЯ "ВИ ПРОПУСТИЛИ" (FLEXBOX ВАРІАНТ)
   ========================================================================== */

.related-posts-box {
    margin: 40px 0;
    padding: 20px;
    background: #fff;
    border-top: 3px solid var(--green, #4CAF50);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.missed-header {
	position: relative;
    margin-bottom: 25px;
}

.missed-header::after {
	content: "";
	
	width: 100%;
	height: 2px;
	
	background-color: var(--green);
	position: absolute;
	top: 100%;
	left: 0;
	
	z-index: 2;
}

.missed-title {
    background: var(--green, #4CAF50);
    color: #fff;
    padding: 10px 30px 10px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    clip-path: polygon(0 0, 95% 0, 100% 100%, 0% 100%);
    display: inline-block;
}

/* ФЛЕКС-КОНТЕЙНЕР: Головна зміна тут */
.missed-grid {
    display: flex !important;
    flex-wrap: wrap; /* Дозволяємо перенос на мобільних */
    gap: 20px;
    width: 100%;
}

/* КАРТКА ЗАПИСУ: Розрахунок ширини */
.missed-card {
    position: relative;
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    
    /* Мобільні: 1 колонка (мінус gap) */
    flex: 1 1 100%; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.missed-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.missed-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, rgba(0,0,0,0.3) 100%);
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 1;
}

.missed-cat {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--green, #4CAF50);
    color: #fff;
    font-size: 10px;
    padding: 3px 10px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 2;
}

.missed-card h3 {
    margin: 0 0 8px 0;
    z-index: 2;
}

.missed-card h3 a {
    color: #fff !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.missed-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #ccc;
    z-index: 2;
}

/* ==========================================================================
   АДАПТИВНІСТЬ ЧЕРЕЗ FLEX-BASIS
   ========================================================================== */

/* Планшети (від 768px - 2 колонки) */
@media screen and (min-width: 768px) {
    .missed-card {
        /* Розрахунок: (100% / 2) - половина gap */
        flex: 1 1 calc(50% - 10px); 
    }
}

/* Ноутбуки (від 1024px - СТРОГО ОДИН РЯДОК ПО 3) */
@media screen and (min-width: 1024px) {
    .missed-grid {
        flex-wrap: nowrap !important; /* ЗАБОРОНЯЄМО ПЕРЕНОС */
    }
    
    .missed-card {
        /* Розрахунок: (100% / 3) - частина gap */
        flex: 1 1 calc(33.333% - 14px); 
        max-width: calc(33.333% - 14px);
    }
}

/* Великі монітори (від 1500px+) */
@media screen and (min-width: 1500px) {
    .missed-grid {
        gap: 30px;
    }
    
    .missed-card {
        height: 300px;
        flex: 1 1 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
    }

    .missed-card h3 a {
        font-size: 18px;
    }
}