/* Dynamic news, pagination and article modal */

.news-card {
  cursor: pointer;
}

.news-card__title a,
.news-card .post-card__thumb {
  cursor: pointer;
}

.news-state {
  grid-column: 1 / -1;
  padding: 40px 10px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
}

.news-state--error {
  color: #8a2b2b;
}

.news-state a {
  color: var(--primary);
  text-decoration: underline;
}

.news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 13px;
  color: var(--muted);
}

.news-pagination__count {
  white-space: nowrap;
}

.news-pagination__pages {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.news-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--secondary);
  background: var(--white);
  font-family: var(--font-ui);
  font-size: 13px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.news-page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.news-page-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.news-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.news-page-btn--arrow {
  gap: 6px;
  padding: 0 14px;
}

.news-page-btn--arrow svg {
  width: 13px;
  height: 13px;
}

.news-page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ Modal */
.news-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(36, 39, 82, 0.78);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), visibility 0.22s;
}

.news-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.news-modal__dialog {
  position: relative;
  width: min(880px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.news-modal__image {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
}

.news-modal__body {
  padding: 34px 38px 38px;
}

.news-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-modal__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.35;
  letter-spacing: 0.3px;
  color: var(--primary);
  margin-bottom: 18px;
}

.news-modal__text {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: #2f2f3a;
}

.news-modal__text p {
  margin-bottom: 14px;
}

.news-modal__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.news-modal__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s var(--ease);
}

.news-modal__link:hover {
  background: #1c1369;
}

.news-modal__link svg {
  width: 14px;
  height: 14px;
}

.news-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--secondary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.news-modal__close svg {
  width: 16px;
  height: 16px;
}

body.news-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .news-modal {
    padding: 0;
    align-items: flex-end;
  }

  .news-modal__dialog {
    max-height: 94vh;
  }

  .news-modal__image {
    aspect-ratio: 16 / 9;
  }

  .news-modal__body {
    padding: 24px 20px 28px;
  }

  .news-modal__title {
    font-size: 1.35rem;
  }

  .news-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 34px;
  }

  .news-pagination__count {
    text-align: center;
    order: 2;
  }

  .news-page-btn {
    min-width: 34px;
    height: 34px;
  }
}




/* Pinned news and list excerpts */
.news-pin {
  display: inline-block;
  margin-right: 6px;
  color: var(--primary);
  vertical-align: -1px;
}

.news-pin svg {
  display: inline-block;
}

.news-card.is-pinned {
  box-shadow: inset 3px 0 0 var(--accent);
}

.news-card__excerpt {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-filter-submit {
  align-self: end;
  height: 40px;
  border: 0;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.news-page-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}

[data-news-grid][aria-busy="true"] {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

/* Ensure every upload is cropped to the 4:3 card format */
.news-card .post-card__thumb {
  position: relative;
}

.news-card .post-card__thumb img {
  position: absolute;
  inset: 0;
}


/* ----------------------------------------------------------- Article page */
.news-article {
  max-width: 960px;
  padding-top: 42px;
  padding-bottom: 70px;
}

.news-article__head {
  max-width: 820px;
}

.news-article__meta {
  margin-bottom: 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.news-article h1 {
  font-family: var(--font-head);
  font-size: 2.15rem;
  line-height: 1.3;
  letter-spacing: 0.2px;
  color: var(--primary);
  margin: 0 0 22px;
}

.news-article__media {
  margin: 0 0 28px;
  background: var(--grey);
}

.news-article__media img {
  display: block;
  width: 100%;
  height: auto;
}

.news-article__text {
  max-width: 760px;
}

.news-article__text p {
  margin-bottom: 16px;
}

.news-article__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.news-article__actions .btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 22px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.news-article__actions .btn:hover {
  background: var(--secondary);
}

.news-article__actions .btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.news-related {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.news-related h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 14px;
}

.news-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-related li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f3;
}

.news-related a {
  color: var(--secondary);
  font-weight: 500;
}

.news-related a:hover {
  color: var(--accent);
}

.news-related time {
  display: block;
  margin-top: 3px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 767px) {
  .news-article h1 {
    font-size: 1.55rem;
  }

  .news-article {
    padding-top: 26px;
    padding-bottom: 48px;
  }
}
