﻿/* News archive (Vue 3, Najiz design)
   Upload to: /_catalogs/masterpage/MOJPortalDesign2026/news-list.css */

/* ---------- Search / sort ---------- */
.news-sort-menu {
  top: 3rem;
  inset-inline-end: 0;
  z-index: 20;
  width: 12.125rem;
}
.news-sort-menu__option {
  min-height: 3.5rem;
  font: inherit;
  border-bottom: 0.0625rem solid var(--layout-neutral-200-color, #e5e7eb) !important;
}
.news-sort-menu__option:last-child { border-bottom: 0 !important; }
.news-sort-menu__option:hover,
.news-sort-menu__option:focus-visible,
.news-sort-menu__option--active { background-color: var(--layout-neutral-50-color, #f9fafb) !important; }
.news-sort-menu__option--active { color: var(--layout-primary-sa-flag-600-color, #1b8354) !important; font-weight: 600; }

.news-search-summary__clear {
  margin-inline-start: 0.5rem;
  padding: 0;
  border: 0 !important;
  background: none;
  color: var(--layout-primary-sa-flag-600-color, #1b8354);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Grid ---------- */
/* Search bar and news list share the same full width of the section */
.news-page__inner {
  box-sizing: border-box;
  width: 100%;
  padding-inline: var(--layout-spacing-xl, 1.5rem);
}
.news-results .news-grid { width: 100%; }
.news-results__anchor { scroll-margin-top: 6rem; }
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--layout-spacing-3xl, 2rem);
  list-style: none;
}

/* ---------- Card ---------- */
.news-card {
  box-sizing: border-box;
  height: 100%;
  min-height: 30.125rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.news-card:hover,
.news-card:focus-within {
  border-color: var(--layout-primary-sa-flag-600-color, #1b8354) !important;
  box-shadow: 0 0.5rem 1.5rem rgb(16 24 40 / 8%);
}
.news-card__media {
  display: block;
  flex: 0 0 15.625rem;
  height: 15.625rem;
  background: var(--layout-neutral-100-color, #f3f4f6);
}
.news-card__image { object-fit: cover; transition: transform 0.3s ease; }
.news-card:hover .news-card__image { transform: scale(1.03); }
.news-card__date { top: 0.5rem; inset-inline-start: 0.5rem; height: 1.5rem; }

.news-card__content { flex: 0 0 auto; min-height: 7rem; }
.news-card__title,
.news-card__description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.news-card__title {
  min-height: 3.5rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
}
/* !important beats the portal's "a { color: â€¦ !important }" override */
.news-card__title-link {
  color: var(--layout-neutral-950-color, #0d121c) !important;
  text-decoration: none !important;
}
.news-card__title-link:hover,
.news-card__title-link:focus-visible {
  color: var(--layout-primary-sa-flag-600-color, #1b8354) !important;
  text-decoration: underline !important;
}
.news-card__description {
  min-height: 3rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--layout-neutral-700-color, #384250);
}
[dir] a.news-card__more {
  color: var(--layout-base-white-color, #fff) !important;
  text-decoration: none !important;
}

/* ---------- Loading skeleton ---------- */
.news-card--skeleton { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.news-skeleton {
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
  background-size: 400% 100%;
  animation: news-shimmer 1.4s ease infinite;
}
.news-skeleton--media { height: 15.625rem; }
.news-skeleton--line { height: 1.25rem; }
.news-skeleton--short { width: 60%; }
@keyframes news-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Pager (same as the movable list) ---------- */
.news-pagination__arrow,
.news-pagination__overflow { width: 2.5rem; min-width: 2.5rem !important; height: 2.5rem; }
.news-pagination__page { width: 1.625rem; min-width: 1.625rem !important; height: 2.5rem; }
.news-pagination__page--active::after {
  content: ""; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 1.5rem; height: 0.1875rem;
  border-radius: 9999px; background: var(--layout-primary-color);
}
.news-page-size-menu { min-width: 9rem; inset-inline-start: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 61.875rem) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 41.25rem) {
  .news-page__inner { padding-inline: var(--layout-spacing-md, 0.75rem); }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { min-height: 0; }
  .news-card__media { flex-basis: auto; height: auto; aspect-ratio: 1.6 / 1; }
}
@media (prefers-reduced-motion: reduce) {
  .news-card__image, .news-card, .news-skeleton { transition: none; animation: none; }
}
