/* Загальні стилі для новин */
.news-item {
    background: #fff;
    padding: 1rem;
    margin: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: left;
    width: calc(50% - 2rem);
    box-sizing: border-box;
    animation: fadeIn 1s ease-in-out;
}

.news-item h3 {
    color: #9a1915;
    margin-bottom: 0.5rem;
}

.news-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.news-date {
    color: #777;
    font-size: 0.9em;
}

#news-container {
    display: flex;
    width: 90%;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

/* Стилі для новин на головній сторінці */
.latest-news-item {
    display: flex;
    background: #fff;
    padding: 0.5rem;
    margin: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: justify;
    width: calc(40% - 1rem);
    box-sizing: border-box;
    animation: fadeIn 1s ease-in-out;
    flex-direction: column;
    justify-content: space-around;
}
.latest-news-item p {
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Кількість видимих рядків */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.2em * 4); /* Висота одного рядка множиться на кількість рядків */
}

.latest-news-item h3 {
    color: #9a1915;
    margin-bottom: 0.5rem;
    font-size: 1rem;
	text-align: center;
}

.latest-news-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.latest-news-date {
    color: #777;
    font-size: 0.8em;
}

#latest-news {
    display: flex;
    width: 90%;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

@media (max-width: 768px) {
    .news-item, .latest-news-item {
        width: calc(100% - 2rem);
    }

    #news-container, #latest-news {
        width: 100%;
    }
}

.news-content {
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Кількість видимих рядків */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.2em * 4); /* Висота одного рядка множиться на кількість рядків */
}

.read-more {
    font-weight: bold;
    cursor: pointer;
}

.latest-news-date {
    margin-top: 10px;
    font-size: 0.9em;
    color: gray;
}

/* Codex technical refinements */
.read-more {
    align-self: center;
    background: #9a1915;
    border: 0;
    border-radius: 5px;
    color: #fff;
    padding: 0.55rem 1rem;
    transition: background-color 0.3s;
}

.read-more:hover {
    background: #6b1514;
}
