:root {
  --news-blue: #135ca8;
  --news-blue-dark: #073a72;
  --news-ink: #182a3f;
  --news-muted: #66778b;
  --news-border: #dde5ed;
  --news-surface: #fff;
  --news-background: #f3f6fa;
}

body.news-page {
  --news-hero-image-desktop: url("../img/banners/news-hero-desktop.webp");
  --news-hero-image-mobile: url("../img/banners/news-hero.jpg");
  --news-hero-position-desktop: right center;
  --news-hero-position-mobile: center;
  margin: 0;
  background: var(--news-background);
  color: var(--news-ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

body.training-plan-page {
  --news-hero-image-desktop: url("../img/news/news-hero.jpg");
  --news-hero-image-mobile: url("../img/news/news-hero.jpg");
}

.news-page *,
.news-page *::before,
.news-page *::after {
  box-sizing: border-box;
}

.news-page a {
  color: inherit;
  text-decoration: none;
}

.news-page #container.news-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  background: var(--news-background);
}

.news-page-width {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.news-hero {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(90deg, #0A315A 0%, #0B345E 25%, #123E68 42%, #315978 58%, #6B8295 100%);
  color: #fff;
}

.news-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      #0A315A 0%,
      #0A315A calc(100% - 760px),
      rgba(10, 49, 90, 0.96) calc(100% - 700px),
      rgba(10, 49, 90, 0.78) calc(100% - 620px),
      rgba(10, 49, 90, 0.52) calc(100% - 540px),
      rgba(10, 49, 90, 0.25) calc(100% - 450px),
      rgba(10, 49, 90, 0) calc(100% - 360px)
    ) 0 0 / 100% 100% no-repeat,
    linear-gradient(rgba(10, 55, 110, 0.18), rgba(10, 55, 110, 0.18)) 0 0 / 100% 100% no-repeat,
    var(--news-hero-image-desktop) var(--news-hero-position-desktop) / auto 110% no-repeat;
  content: "";
}

.news-hero__content {
  position: relative;
  z-index: 1;
  padding-block: 72px;
}

.news-hero__content > p {
  margin: 0 0 8px;
  color: #c6e4ff;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.22em;
}

.news-hero h1,
.news-hero__label {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.25;
}

.news-hero h1::before,
.news-hero__label::before {
  content: "";
  width: 52px;
  height: 3px;
  display: block;
  margin-bottom: 16px;
  background: #fff;
}

.news-breadcrumb {
  border-bottom: 1px solid var(--news-border);
  background: #fff;
  color: var(--news-muted);
  font-size: 14px;
}

.news-breadcrumb > div {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.news-breadcrumb a:hover {
  color: var(--news-blue);
}

.news-breadcrumb a,
.news-breadcrumb span[aria-hidden="true"] {
  flex: 0 0 auto;
  white-space: nowrap;
}

.news-breadcrumb span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-list-section {
  min-height: 480px;
  padding-block: 56px 76px;
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-list-item {
  min-height: 154px;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr) 112px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #e4eaf1;
  background: var(--news-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.news-list-item:hover {
  transform: translateY(-2px);
  border-color: #b8cee3;
  box-shadow: 0 14px 32px rgba(21, 60, 96, 0.09);
}

.news-list-item__cover {
  display: block;
  overflow: hidden;
  background: #dfe9f3;
}

.news-list-item__cover img {
  width: 100%;
  height: 100%;
  min-height: 152px;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.news-list-item:hover .news-list-item__cover img {
  transform: scale(1.035);
}

.news-list-item__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 34px;
}

.news-list-item__main h2 {
  margin: 0;
  color: var(--news-ink);
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 700;
  line-height: 1.55;
}

.news-list-item__main h2 a:hover {
  color: var(--news-blue);
}

.news-list-item__main p {
  margin: 9px 0 0;
  color: var(--news-muted);
  font-size: 13px;
}

.news-list-item__main .training-plan-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
}

.training-plan-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e8f3ff;
  color: #0c579d;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.training-plan-status--in_progress { background: #e7f7ee; color: #177245; }
.training-plan-status--registration_closed { background: #fff3dc; color: #8a5700; }
.training-plan-status--ended { background: #edf0f3; color: #66717d; }
.training-plan-status--unknown { background: #fff3dc; color: #8a5700; }

.news-list-item__more {
  width: max-content;
  margin-top: 13px;
  color: var(--news-blue) !important;
  font-size: 13px;
  font-weight: 700;
}

.news-list-item__more::after {
  content: " →";
}

.news-list-item__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--news-border);
  background: #f8fafc;
  color: #334b63;
  text-align: center;
}

.news-list-item__date strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1;
}

.news-list-item__date span {
  margin-top: 9px;
  color: var(--news-muted);
  font-size: 13px;
  font-weight: 700;
}

.news-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 42px;
}

.news-pagination a,
.news-pagination > span {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--news-border);
  background: #fff;
  color: #4b6076;
}

.news-pagination a:hover,
.news-pagination .active {
  border-color: var(--news-blue);
  background: var(--news-blue);
  color: #fff;
}

.news-pagination .disabled {
  background: #eef2f6;
  color: #9aa7b4;
}

.news-pagination__ellipsis {
  min-width: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.news-empty {
  padding: 92px 24px;
  border: 1px solid var(--news-border);
  background: #fff;
  text-align: center;
}

.news-empty h2 {
  margin: 0;
  font-size: 28px;
}

.news-empty p {
  margin: 10px 0 24px;
  color: var(--news-muted);
}

.news-empty a,
.news-not-found a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 4px;
  background: var(--news-blue);
  color: #fff;
  font-weight: 700;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  align-items: start;
  gap: 28px;
  margin-block: 64px 80px;
}

.article-card {
  padding: 52px 64px 46px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 55, 90, 0.08);
}

.article-header {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--news-border);
  text-align: center;
}

.article-header h1 {
  max-width: 900px;
  margin: 0 auto;
  color: var(--news-ink);
  overflow-wrap: anywhere;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-top: 18px;
  color: var(--news-muted);
  font-size: 14px;
}

.training-plan-facts {
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 30px auto 0;
  overflow: hidden;
  border: 1px solid var(--news-border);
  background: var(--news-border);
  text-align: left;
}

.training-plan-facts > div {
  min-width: 0;
  padding: 14px 18px;
  background: #f8fafc;
}

.training-plan-facts > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.training-plan-facts dt {
  color: var(--news-muted);
  font-size: 13px;
}

.training-plan-facts dd {
  margin: 4px 0 0;
  color: var(--news-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.training-plan-facts a {
  color: var(--news-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body {
  max-width: 900px;
  margin: 0 auto;
  padding-block: 42px 54px;
  color: #2f4053;
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.article-body p,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body blockquote,
.article-body pre,
.article-body ul,
.article-body ol {
  margin: 0 0 20px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--news-ink);
  line-height: 1.55;
}

.article-body h2 {
  font-size: 27px;
}

.article-body h3 {
  font-size: 23px;
}

.article-body h4 {
  font-size: 20px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.6em;
}

.article-body blockquote {
  padding: 16px 20px;
  border-left: 4px solid var(--news-blue);
  background: #f3f7fb;
  color: #506277;
}

.article-body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border-radius: 4px;
  background: #13263a;
  color: #edf5fc;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.article-body a {
  color: var(--news-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body__image,
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 26px auto;
}

.article-body table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.article-body th,
.article-body td {
  padding: 10px;
  border: 1px solid var(--news-border);
}

.article-body .ql-align-center {
  text-align: center;
}

.article-body .ql-align-right {
  text-align: right;
}

.article-body .ql-align-justify {
  text-align: justify;
}

.article-body [class*="ql-indent-"] {
  margin-left: 2em;
}

.article-footer {
  padding-top: 28px;
  border-top: 1px solid var(--news-border);
}

.article-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 22px;
  border: 1px solid var(--news-blue);
  color: var(--news-blue) !important;
  font-weight: 700;
}

.article-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.article-navigation > a,
.article-navigation > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--news-border);
  background: #f8fafc;
}

.article-navigation > a:last-child,
.article-navigation > span:last-child {
  text-align: right;
}

.article-navigation span span,
.article-navigation a span {
  color: var(--news-blue);
  font-size: 13px;
  font-weight: 700;
}

.article-navigation strong {
  margin-top: 5px;
  overflow: hidden;
  color: #334b63;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-navigation a:hover {
  border-color: #9bbddd;
  background: #f0f6fc;
}

.article-navigation .disabled {
  opacity: 0.55;
}

.related-news {
  padding: 28px 24px 20px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 55, 90, 0.08);
}

.related-news h2 {
  margin: 0;
  color: var(--news-ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.45;
}

.related-news__rule {
  width: 100%;
  height: 1px;
  margin: 14px 0 4px;
  background: var(--news-border);
}

.related-news__rule::before {
  content: "";
  width: 48px;
  height: 3px;
  display: block;
  background: var(--news-blue);
  transform: translateY(-1px);
}

.related-news__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-news__list li {
  padding: 17px 0;
  border-bottom: 1px solid var(--news-border);
}

.related-news__list li:last-child {
  border-bottom: 0;
}

.related-news__list a {
  display: -webkit-box;
  overflow: hidden;
  color: #2f4053;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-news__list a:hover {
  color: var(--news-blue);
}

.related-news__list time {
  display: block;
  margin-top: 6px;
  color: var(--news-muted);
  font-size: 13px;
}

.news-not-found {
  margin-block: 70px 90px;
  padding: 70px 24px;
  background: #fff;
  text-align: center;
}

.news-not-found > span {
  color: #d8e5f2;
  font-size: clamp(70px, 12vw, 130px);
  font-weight: 900;
  line-height: 1;
}

.news-not-found h1 {
  margin: 4px 0 8px;
  font-size: 30px;
}

.news-not-found p {
  margin: 0 0 28px;
  color: var(--news-muted);
}

.news-not-found div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.news-not-found a:last-child {
  border: 1px solid var(--news-blue);
  background: #fff;
  color: var(--news-blue);
}

@media (max-width: 800px) {
  .news-page-width {
    width: min(100% - 28px, 1180px);
  }

  .news-hero {
    min-height: 230px;
    background: #135ca8;
  }

  .news-hero::before {
    inset: 0;
    background:
      linear-gradient(rgba(10, 55, 110, 0.24), rgba(10, 55, 110, 0.24)),
      var(--news-hero-image-mobile) var(--news-hero-position-mobile) / cover no-repeat;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .news-page:not(.training-plan-page) .news-hero__content > p {
    display: none;
  }

  .news-hero__content {
    padding-block: 54px;
  }

  .training-plan-facts {
    grid-template-columns: 1fr;
  }

  .training-plan-facts > div:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .news-breadcrumb > div {
    min-height: 52px;
  }

  .news-list-section {
    padding-block: 34px 52px;
  }

  .news-list-item {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .news-list-item__cover {
    display: none;
  }

  .news-list-item__main {
    padding: 18px;
  }

  .news-list-item__main h2 {
    display: block;
    overflow: visible;
    font-size: 17px;
    -webkit-line-clamp: unset;
  }

  .news-list-item__main p,
  .news-list-item__more {
    display: none;
  }

  .news-list-item__main .training-plan-summary {
    display: flex;
    margin-top: 8px;
    gap: 6px 10px;
  }

  .training-plan-summary span:nth-child(n + 3) {
    display: none;
  }

  .news-list-item__date {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    gap: 7px;
    min-height: 34px;
    padding: 0 14px;
    border-top: 1px solid var(--news-border);
    border-left: 0;
  }

  .news-list-item__date strong {
    font-family: inherit;
    font-size: 13px;
  }

  .news-list-item__date span {
    margin: 0;
    font-size: 12px;
  }

  .news-list-item__date strong::after {
    content: " /";
  }

  .news-pagination {
    gap: 5px;
    margin-top: 30px;
  }

  .news-pagination a,
  .news-pagination > span {
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    font-size: 13px;
  }

  .article-layout {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-block: 0;
  }

  .article-card {
    padding: 36px 20px 44px;
    box-shadow: none;
  }

  .article-header {
    padding-bottom: 24px;
  }

  .article-header h1 {
    font-size: 27px;
  }

  .article-meta {
    flex-direction: column;
    gap: 4px;
  }

  .article-body {
    padding-block: 30px 40px;
    font-size: 16px;
  }

  .article-navigation {
    grid-template-columns: 1fr;
  }

  .article-navigation > a:last-child,
  .article-navigation > span:last-child {
    text-align: left;
  }

  .related-news {
    padding: 32px 20px 38px;
    border-top: 12px solid var(--news-background);
    box-shadow: none;
  }

  .news-not-found {
    width: 100%;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-list-item,
  .news-list-item__cover img {
    transition: none;
  }
}
