/**
 * News section styles for the main page
 * Layout: 1 big card (left) + small cards column with scroll (right)
 */

/* ===== News section ===== */
.news-section {
  padding-top: 10px;
}


/* ===== Main layout: big card + small cards sidebar ===== */
.news-main-layout {
  display: grid;
  grid-template-columns: 50% calc(50% - 10px);
  gap: 10px;
  padding: 0 10px;
}

/* --- Big card (left) --- */
.news-big-card {
  position: relative;
  overflow: hidden;
  height: 500px;
      border-radius: 10px;
}

.news-big-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-big-link:hover .news-big-image {
  transform: scale(1.05);
}

.news-big-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  padding: 20px;
  padding-top: 60px;
}

.news-big-categories {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 5px;
  opacity: 0.9;
}

.news-big-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.news-big-desc {
  font-size: 16px;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-big-date {
  font-size: 14px;
  opacity: 0.8;
  text-align: right;
}

.news-big-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.news-big-link:hover .news-big-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

/* --- Small cards container (right, scrollable) --- */
.news-small-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
  justify-content: flex-start;
  padding: 0 5px 0 0;
}

.news-small-container .card {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 0;
  box-shadow: 1px 1px 10px #ccc;
  height: 150px;
  border-radius: 10px;

}

.news-small-container .card:hover {
  filter: none;
  transform: none;
}

.news-small-container .card .card-wrapper-image {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  overflow: hidden;
}

.news-small-container .card .card-wrapper-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-small-container .card:hover .card-wrapper-image img {
  transform: scale(1.05);
}

.news-small-container .card .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  min-height: 0;
  color: #555;
  overflow: hidden; /* Защита от переполнения */
}

/* ТЕКСТ: Максимум 2 строки */
.news-small-container .card .card-wrapper-text p,
.cards-news .card-wrapper-text p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.4;
}

.news-small-container .card .card-wrapper-text p::after {
  display: none !important;
}

/* --- Elements inside cards --- */
.card-wrapper-footer {
  padding-top: 5px;
  font-size: 11px;
  background: none;
  border-top: none;
  display: flex;
  justify-content: flex-end;
  margin-top: auto; /* Прижимает дату к самому низу */
  flex-shrink: 0;
}

.card-category {
  font-weight: bold;
}

.card-date {
  font-size: 0.8rem;
}

/* ЗАГОЛОВОК: Строго 1 строка */
.news-title-small,
.news-title,
.cards-news .card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
  margin-bottom: 5px;
  flex-shrink: 0;
}

.news-title-container {
  margin-bottom: 10px;
}

.news-date {
  font-size: 12px;
  color: #666;
}

.cards-news .card-title {
  color: #ce291c;
  font-size: 1.1rem;
}

/* --- Scrollbar styling for small container --- */
.news-small-container::-webkit-scrollbar {
  width: 6px;
}

.news-small-container::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 3px;
}

.news-small-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.news-small-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===== Hide desktop layout on tablets/phones ===== */
@media (max-width: 1023px) {
  .desktop-news-layout {
    display: none !important;
  }
}
