/* ---------- Новини і медіа: archive (category.php), cards, single post (single.php) ---------- */

/* ---------- Tags ---------- */

.nw_tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.nw_tag--blue {
  background: var(--palette-v2-d3);
  color: var(--palette-v2-white);
}

.nw_tag--red {
  background: var(--palette-v2-red-accent);
  color: var(--palette-v2-white);
}

.nw_tag--cyan {
  background: var(--palette-v2-br);
  color: var(--palette-v2-bg);
}

.nw_tag--lg {
  height: 36px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  transition: filter var(--transition);
}

a.nw_tag:hover {
  color: inherit;
  filter: brightness(1.12);
}

a.nw_tag--blue:hover,
a.nw_tag--red:hover {
  color: var(--palette-v2-white);
}

a.nw_tag--cyan:hover {
  color: var(--palette-v2-bg);
}

/* ---------- Archive ---------- */

.main_news .ab_sec {
  --pad: 80px;
}

.nw_chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.nw_chip {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--palette-v2-d3);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--palette-v2-white);
  transition: background-color var(--transition), color var(--transition);
}

.nw_chip:hover {
  background: var(--palette-v2-blue-700);
  color: var(--palette-v2-white);
}

.nw_chip.is-active,
.nw_chip.is-active:hover {
  background: var(--palette-v2-br);
  color: var(--palette-v2-bg);
}

.nw_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.nw_more {
  display: flex;
  justify-content: center;
  margin-top: 74px;
}

.nw_more_btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.nw_empty {
  font-size: 18px;
  line-height: 28px;
  color: var(--palette-v2-t2);
}

/* ---------- Card ---------- */

.nw_card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  background: var(--palette-v2-white);
  color: var(--palette-v2-bg);
  transition: background-color var(--transition);
}

.nw_card:hover {
  background: #f1fafd;
  color: var(--palette-v2-bg);
}

.nw_card_img {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 560 / 315;
  background: var(--palette-v2-lt-50);
}

/* absolute and 1px taller: with a fractional card height the light background showed as a thin line under the photo */
.nw_card_img img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: calc(100% + 1px);
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nw_card:hover .nw_card_img img {
  transform: scale(1.03);
}

.nw_card_body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
  padding: 24px 28px 30px;
}

.nw_card_meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nw_video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 22px;
}

.nw_card_title {
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 30px;
}

.nw_card_src {
  margin-top: auto;
  font-size: 14px;
  line-height: 22px;
}

/* ---------- Compact card (sidebar) ---------- */

.nw_cc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--palette-v2-d1);
  color: var(--palette-v2-t1);
  transition: background-color var(--transition);
}

.nw_cc:hover {
  background: var(--palette-v2-d2);
  color: var(--palette-v2-t1);
}

.nw_cc_meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nw_cc_date {
  font-size: 14px;
  line-height: 22px;
}

.nw_cc_title {
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 26px;
}

/* ---------- Single post ---------- */

.np_sec.ab_sec {
  padding: 48px 0 70px;
}

.np_head .crumbs {
  margin-bottom: 30px;
}

.np_title {
  margin: 16px 0 0;
  font-weight: 800;
  font-size: 64px;
  line-height: 72px;
  color: var(--palette-v2-t1);
}

.np_meta {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 28px;
  color: var(--palette-v2-t2);
}

.np_meta a {
  color: var(--palette-v2-br);
}

.np_meta a:hover {
  color: var(--palette-v2-t1);
}

.np_grid {
  display: grid;
  grid-template-columns: minmax(0, 1180fr) minmax(0, 460fr);
  gap: 80px;
  align-items: start;
  margin-top: 48px;
}

/* «Наступні новини» stay in place while the article scrolls (designer review); .ab_sec clips overflow */
.np_sec.ab_sec {
  overflow: clip;
}

.np_side {
  position: sticky;
  top: 128px;
}

.np_article {
  display: flex;
  flex-direction: column;
  gap: 37px;
  min-width: 0;
}

.np_lead {
  margin: 0;
  font-size: 24px;
  line-height: 38px;
  color: var(--palette-v2-t1);
}

.np_quote {
  margin: 0;
  padding: 26px 32px;
  border-left: 5px solid var(--palette-v2-red-accent);
  background: linear-gradient(90deg, var(--palette-v2-d2) 0%, transparent 100%);
}

.np_quote_txt {
  margin: 0;
  font-weight: 600;
  font-style: italic;
  font-size: 28px;
  line-height: 40px;
  color: var(--palette-v2-t1);
}

.np_quote_author {
  margin-top: 12px;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--palette-v2-t3-tint);
}

.np_media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1180 / 664;
  border-radius: 24px;
  background: var(--palette-v2-d2);
}

.np_media img,
.np_media iframe,
.np_media video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.np_media_link {
  display: block;
  height: 100%;
}

.np_play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: var(--palette-v2-br);
  color: var(--palette-v2-bg);
  transition: transform var(--transition);
}

.np_media_link:hover .np_play {
  transform: scale(1.08);
}

.np_content {
  font-size: 18px;
  line-height: 28px;
  color: var(--palette-v2-t1);
}

.np_content > * {
  margin: 0 0 28px;
}

.np_content > *:last-child {
  margin-bottom: 0;
}

.np_content h2 {
  margin: 37px 0;
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 36px;
  color: var(--palette-v2-t1);
}

.np_content h3,
.np_content h4 {
  margin: 37px 0 16px;
  font-family: "Nata Sans", sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 26px;
  color: var(--palette-v2-t1);
}

.np_content h2:first-child,
.np_content h3:first-child {
  margin-top: 0;
}

.np_content a {
  color: var(--palette-v2-br);
  text-decoration: underline;
}

.np_content ul,
.np_content ol {
  padding-left: 24px;
}

.np_content ul {
  list-style: disc;
}

.np_content ol {
  list-style: decimal;
}

.np_content li + li {
  margin-top: 8px;
}

.np_content li::marker {
  color: var(--palette-v2-red-accent);
}

.np_content img {
  max-width: 100%;
  height: auto;
  border-radius: 24px;
}

.np_content figure {
  max-width: 100%;
}

.np_share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 74px;
  padding-top: 29px;
  border-top: 1px solid rgba(155, 221, 238, 0.2);
}

.np_share_title {
  font-weight: 600;
  font-size: 18px;
  line-height: 28px;
  color: var(--palette-v2-t1);
}

.np_share_list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.np_share_btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 20px;
  border: 1px solid var(--palette-v2-t3-tint);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--palette-v2-t2);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.np_share_btn:hover,
.np_share_btn.is-done {
  background: var(--palette-v2-t3-tint);
  color: var(--palette-v2-bg);
}

.np_side_title {
  margin: 0 0 20px;
  font-weight: 800;
  font-size: 26px;
  line-height: 34px;
  color: var(--palette-v2-t1);
}

.np_side_list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.np_side_btn {
  margin-top: 12px;
  padding: 0 12px;
}

/* ---------- Laptop ---------- */

@media (max-width: 1600px) {
  .np_grid {
    gap: 56px;
  }

  .np_title {
    font-size: 56px;
    line-height: 64px;
  }
}

@media (max-width: 1280px) {
  .nw_card_body {
    padding: 20px 24px 24px;
  }

  .nw_card_title {
    font-size: 20px;
    line-height: 28px;
  }

  .np_grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: 40px;
  }
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
  .main_news .ab_sec {
    --pad: 40px;
  }

  .nw_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .nw_more {
    margin-top: 40px;
  }

  .nw_card_title {
    font-size: 22px;
    line-height: 30px;
  }

  .np_sec.ab_sec {
    padding: 40px 0;
  }

  .np_title {
    font-size: 44px;
    line-height: 52px;
  }

  .np_grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    margin-top: 40px;
  }

  .np_side {
    position: static;
  }

  .np_article {
    gap: 32px;
  }

  .np_lead {
    font-size: 20px;
    line-height: 32px;
  }

  .np_quote_txt {
    font-size: 24px;
    line-height: 34px;
  }

  .np_content {
    font-size: 16px;
    line-height: 26px;
  }

  .np_content h2 {
    margin: 32px 0;
    font-size: 26px;
    line-height: 34px;
  }

  .np_share {
    gap: 16px 32px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .nw_chips {
    margin-bottom: 24px;
  }

  .nw_grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .nw_more_btn {
    width: 100%;
  }

  .nw_card {
    border-radius: 24px;
  }

  .nw_card_body {
    padding: 20px;
  }

  .nw_card_title {
    font-size: 20px;
    line-height: 28px;
  }

  .np_sec.ab_sec {
    padding: 24px 0 36px;
  }

  .np_head .crumbs {
    margin-bottom: 16px;
  }

  .np_title {
    margin-top: 12px;
    font-size: 32px;
    line-height: 40px;
  }

  .np_meta {
    margin-top: 12px;
    font-size: 16px;
    line-height: 26px;
  }

  .np_grid {
    gap: 40px;
    margin-top: 24px;
  }

  .np_article {
    gap: 24px;
  }

  .np_lead {
    font-size: 18px;
    line-height: 28px;
  }

  .np_quote {
    padding: 20px 24px;
  }

  .np_quote_txt {
    font-size: 20px;
    line-height: 30px;
  }

  .np_media {
    aspect-ratio: 324 / 200;
    border-radius: 20px;
  }

  .np_play {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
  }

  .np_content h2 {
    margin: 24px 0;
    font-size: 24px;
    line-height: 32px;
  }

  .np_share {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 24px;
  }

  .np_side_title {
    font-size: 24px;
    line-height: 32px;
  }

  .np_side_btn {
    width: 100%;
  }
}
.np_meta_src { color: var(--palette-v2-br); }
