370 lines
6.8 KiB
CSS
370 lines
6.8 KiB
CSS
|
|
/* styles/components/ContentGrid.css */
|
|||
|
|
|
|||
|
|
/* Глобальные стили (только для этого компонента) */
|
|||
|
|
.posts-section {
|
|||
|
|
max-width: 1400px;
|
|||
|
|
margin: 0 auto;
|
|||
|
|
padding: 0 20px 20px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.posts-section h2 {
|
|||
|
|
margin-bottom: 30px;
|
|||
|
|
color: #333;
|
|||
|
|
font-size: 24px;
|
|||
|
|
padding-top: 20px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.posts-grid {
|
|||
|
|
display: flex;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
gap: 20px;
|
|||
|
|
width: 100%;
|
|||
|
|
margin: 0;
|
|||
|
|
padding: 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* ОСНОВНОЙ СТИЛЬ: ВСЕ ПЛИТКИ КВАДРАТНЫЕ */
|
|||
|
|
.post-card {
|
|||
|
|
flex: 1 0 calc(25% - 15px); /* 4 колонки по умолчанию */
|
|||
|
|
background: white;
|
|||
|
|
border-radius: 10px;
|
|||
|
|
overflow: hidden;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
|
|||
|
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
|||
|
|
min-width: 0;
|
|||
|
|
aspect-ratio: 1 / 1;
|
|||
|
|
position: relative;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Большие плитки на десктопе - ТОЖЕ КВАДРАТНЫЕ */
|
|||
|
|
@media (min-width: 1200px) {
|
|||
|
|
.post-card-large {
|
|||
|
|
flex: 0 0 calc(50% - 10px) !important; /* Занимает 2 колонки */
|
|||
|
|
aspect-ratio: 2 / 1 !important; /* Ширина в 2 раза больше высоты */
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card:hover {
|
|||
|
|
transform: translateY(-5px);
|
|||
|
|
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card-link {
|
|||
|
|
display: block;
|
|||
|
|
text-decoration: none;
|
|||
|
|
color: inherit;
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
position: absolute;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-image-container {
|
|||
|
|
position: relative;
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
overflow: hidden;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-image {
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
object-fit: cover;
|
|||
|
|
display: block;
|
|||
|
|
transition: transform 0.3s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card:hover .post-image {
|
|||
|
|
transform: scale(1.05);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-image-placeholder {
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Бейдж рубрики */
|
|||
|
|
.post-category-badge {
|
|||
|
|
position: absolute;
|
|||
|
|
top: 15px;
|
|||
|
|
right: 15px;
|
|||
|
|
background: #2563eb;
|
|||
|
|
color: white;
|
|||
|
|
padding: 5px 10px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
font-size: 11px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
text-transform: uppercase;
|
|||
|
|
letter-spacing: 0.5px;
|
|||
|
|
z-index: 2;
|
|||
|
|
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
|||
|
|
max-width: 80%;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
overflow: hidden;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
text-align: right;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (min-width: 1200px) {
|
|||
|
|
.post-card-large .post-category-badge {
|
|||
|
|
font-size: 12px;
|
|||
|
|
padding: 6px 12px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Оверлей с текстом */
|
|||
|
|
.post-content-overlay {
|
|||
|
|
position: absolute;
|
|||
|
|
bottom: 0;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
padding: 20px 15px 15px;
|
|||
|
|
background: linear-gradient(
|
|||
|
|
to top,
|
|||
|
|
rgba(0, 0, 0, 0.9) 0%,
|
|||
|
|
rgba(0, 0, 0, 0.7) 50%,
|
|||
|
|
rgba(0, 0, 0, 0) 100%
|
|||
|
|
);
|
|||
|
|
color: white;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
gap: 8px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (min-width: 1200px) {
|
|||
|
|
.post-card-large .post-content-overlay {
|
|||
|
|
padding: 25px 20px 20px;
|
|||
|
|
gap: 10px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-meta-overlay {
|
|||
|
|
margin-bottom: 3px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-date-overlay {
|
|||
|
|
font-size: 12px;
|
|||
|
|
color: rgba(255, 255, 255, 0.9);
|
|||
|
|
opacity: 0.9;
|
|||
|
|
display: block;
|
|||
|
|
font-weight: 400;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (min-width: 1200px) {
|
|||
|
|
.post-card-large .post-date-overlay {
|
|||
|
|
font-size: 13px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-title-overlay {
|
|||
|
|
font-size: 16px;
|
|||
|
|
line-height: 1.3;
|
|||
|
|
font-weight: 600;
|
|||
|
|
margin: 0;
|
|||
|
|
color: white;
|
|||
|
|
display: -webkit-box;
|
|||
|
|
-webkit-line-clamp: 3;
|
|||
|
|
-webkit-box-orient: vertical;
|
|||
|
|
overflow: hidden;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (min-width: 1200px) {
|
|||
|
|
.post-card-large .post-title-overlay {
|
|||
|
|
font-size: 18px;
|
|||
|
|
line-height: 1.4;
|
|||
|
|
-webkit-line-clamp: 3;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.author-name {
|
|||
|
|
font-size: 12px;
|
|||
|
|
color: rgba(255, 255, 255, 0.85);
|
|||
|
|
margin-top: 3px;
|
|||
|
|
font-weight: 400;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (min-width: 1200px) {
|
|||
|
|
.post-card-large .author-name {
|
|||
|
|
font-size: 13px;
|
|||
|
|
margin-top: 5px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Для скринридеров */
|
|||
|
|
.sr-only {
|
|||
|
|
position: absolute;
|
|||
|
|
width: 1px;
|
|||
|
|
height: 1px;
|
|||
|
|
padding: 0;
|
|||
|
|
margin: -1px;
|
|||
|
|
overflow: hidden;
|
|||
|
|
clip: rect(0, 0, 0, 0);
|
|||
|
|
white-space: nowrap;
|
|||
|
|
border: 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Стили для индикаторов загрузки */
|
|||
|
|
.loading-indicator {
|
|||
|
|
text-align: center;
|
|||
|
|
padding: 40px 0;
|
|||
|
|
color: #666;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.loading-spinner {
|
|||
|
|
display: inline-block;
|
|||
|
|
width: 40px;
|
|||
|
|
height: 40px;
|
|||
|
|
border: 3px solid #f3f3f3;
|
|||
|
|
border-top: 3px solid #2563eb;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
animation: spin 1s linear infinite;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@keyframes spin {
|
|||
|
|
0% { transform: rotate(0deg); }
|
|||
|
|
100% { transform: rotate(360deg); }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.no-more-posts {
|
|||
|
|
text-align: center;
|
|||
|
|
padding: 30px 0;
|
|||
|
|
color: #666;
|
|||
|
|
font-size: 16px;
|
|||
|
|
border-top: 1px solid #eee;
|
|||
|
|
margin-top: 20px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Адаптивность */
|
|||
|
|
|
|||
|
|
/* Для ноутбуков: 3 в ряд (без больших плиток) */
|
|||
|
|
@media (min-width: 992px) and (max-width: 1199px) {
|
|||
|
|
.posts-grid {
|
|||
|
|
align-items: stretch;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card {
|
|||
|
|
flex: 1 0 calc(33.333% - 14px);
|
|||
|
|
aspect-ratio: 1 / 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card-large {
|
|||
|
|
flex: 1 0 calc(33.333% - 14px) !important;
|
|||
|
|
aspect-ratio: 1 / 1 !important;
|
|||
|
|
margin-left: 0 !important;
|
|||
|
|
order: initial !important;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Для планшетов: 2 в ряд */
|
|||
|
|
@media (min-width: 768px) and (max-width: 991px) {
|
|||
|
|
.posts-grid {
|
|||
|
|
gap: 15px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card {
|
|||
|
|
flex: 1 0 calc(50% - 10px);
|
|||
|
|
aspect-ratio: 1 / 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card-large {
|
|||
|
|
flex: 1 0 calc(50% - 10px) !important;
|
|||
|
|
aspect-ratio: 1 / 1 !important;
|
|||
|
|
margin-left: 0 !important;
|
|||
|
|
order: initial !important;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-title-overlay {
|
|||
|
|
font-size: 15px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Для мобильных: 1 в ряд */
|
|||
|
|
@media (max-width: 767px) {
|
|||
|
|
.posts-grid {
|
|||
|
|
gap: 15px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card {
|
|||
|
|
flex: 1 0 100%;
|
|||
|
|
aspect-ratio: 2 / 1; /* На мобильных горизонтальные плитки */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card-large {
|
|||
|
|
flex: 1 0 100% !important;
|
|||
|
|
aspect-ratio: 2 / 1 !important;
|
|||
|
|
margin-left: 0 !important;
|
|||
|
|
order: initial !important;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.posts-section {
|
|||
|
|
padding: 0 15px 15px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.posts-section h2 {
|
|||
|
|
padding-top: 15px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-content-overlay {
|
|||
|
|
padding: 15px 12px 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-title-overlay {
|
|||
|
|
font-size: 15px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-category-badge {
|
|||
|
|
top: 12px;
|
|||
|
|
right: 12px;
|
|||
|
|
font-size: 10px;
|
|||
|
|
padding: 4px 8px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.loading-spinner {
|
|||
|
|
width: 30px;
|
|||
|
|
height: 30px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.no-more-posts {
|
|||
|
|
padding: 20px 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Для очень маленьких экранов */
|
|||
|
|
@media (max-width: 480px) {
|
|||
|
|
.post-card {
|
|||
|
|
aspect-ratio: 3 / 2; /* Немного более вертикальные на маленьких экранах */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-card-large {
|
|||
|
|
aspect-ratio: 3 / 2 !important;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-content-overlay {
|
|||
|
|
padding: 12px 10px 10px;
|
|||
|
|
gap: 5px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-title-overlay {
|
|||
|
|
font-size: 14px;
|
|||
|
|
-webkit-line-clamp: 3;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.post-category-badge {
|
|||
|
|
top: 10px;
|
|||
|
|
right: 10px;
|
|||
|
|
padding: 3px 6px;
|
|||
|
|
font-size: 9px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Стиль для пустого состояния */
|
|||
|
|
.no-posts {
|
|||
|
|
text-align: center;
|
|||
|
|
padding: 40px;
|
|||
|
|
color: #666;
|
|||
|
|
font-size: 18px;
|
|||
|
|
}
|