108 lines
2.1 KiB
CSS
Executable File
108 lines
2.1 KiB
CSS
Executable File
.news-block {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 1rem;
|
||
margin-top: 12px;
|
||
margin-bottom: 12px;
|
||
}
|
||
|
||
.news-item {
|
||
flex: 1 1 calc(33.333% - 1rem);
|
||
max-width: calc(33.333% - 1rem); /* добавьте эту строку */
|
||
min-width: 250px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
/* Стандартный формат - заполняет всю ширину с обрезкой */
|
||
.post-thumbnail {
|
||
width: 100%;
|
||
height: 200px;
|
||
overflow: hidden;
|
||
position: relative;
|
||
}
|
||
|
||
.post-thumbnail a {
|
||
display: block;
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.post-thumbnail img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
object-position: center;
|
||
}
|
||
|
||
/* Портретный формат для всех остальных рубрик (витрина книг) */
|
||
body.image-portrait .post-thumbnail {
|
||
height: 300px;
|
||
background: #f5f5f5;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
body.image-portrait .post-thumbnail a {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 10px;
|
||
}
|
||
|
||
body.image-portrait .post-thumbnail img {
|
||
object-fit: contain;
|
||
}
|
||
|
||
.news-item-title {
|
||
font-size: medium;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.news-item-info {
|
||
margin-top: 8px;
|
||
font-size: medium;
|
||
}
|
||
|
||
.news-item-info-part a {
|
||
color: #909294;
|
||
}
|
||
|
||
.news-item-info-part a:hover {
|
||
color: #666;
|
||
}
|
||
|
||
/* Планшет - 2 карточки */
|
||
@media (max-width: 1024px) {
|
||
.news-item {
|
||
flex: 1 1 calc(50% - 1rem);
|
||
max-width: calc(50% - 1rem); /* добавьте эту строку */
|
||
}
|
||
|
||
body.image-portrait .post-thumbnail {
|
||
height: 350px;
|
||
}
|
||
}
|
||
|
||
/* Мобильные - 1 карточка */
|
||
@media (max-width: 768px) {
|
||
.h-telega {
|
||
display: none;
|
||
}
|
||
|
||
.news-item {
|
||
flex: 1 1 100%;
|
||
max-width: 100%; /* добавьте эту строку */
|
||
min-width: unset;
|
||
}
|
||
|
||
.post-thumbnail {
|
||
height: 250px;
|
||
}
|
||
|
||
body.image-portrait .post-thumbnail {
|
||
height: 400px;
|
||
}
|
||
}
|