/* QazNews — layout/sizes aligned with inform.kz; visual polish later */

:root {
  --font-content: "Inter", sans-serif;
  --font-ui: "Montserrat", sans-serif;
  --container-width: 1210px;
  --container-padding: 15px;
  --laptop-size: 1199px;
  --tablet-size: 959px;
  --mobile-size: 599px;
  --brand-red: #960020;
  --brand-blue: #03214a;
  --brand-gradient: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-blue) 100%);
  --section-gradient: linear-gradient(135deg, rgba(150, 0, 32, 0.1) 0%, rgba(3, 33, 74, 0.1) 100%);
  --page-bg: #fff;
  --text-color: #1a1a18;
  --text-grey: #b5b5b5;
  --grey: #6d787a;
  --accent-hover: var(--brand-red);
  --search-btn: #000;
  --latest-news__title: #1a1a18;
  --footer-bg: #f5f7f7;
  --sport-news-bg: var(--section-gradient);
  --header-nav: #1a1a18;
  --header-langs-bg: #f2fbff;
  --header-shadow: 0 5px 3px 0 rgba(0, 0, 0, 0.01), 0 2px 2px 0 rgba(0, 0, 0, 0.01);
  --tag-bg: #f6f6f6;
  --border-color: #f0f0f0;
  --border-footer: #e8e8e8;
  --border-white: #fff;
  --border-lang: #e9e9f2;
  --border-sport: #d8d8d8;
  --article-link: var(--brand-red);
  --block-head-icon-bg: var(--brand-gradient);
  --block-head-icon-arrow: #fff;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-bg);
  color: var(--text-color);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

:where(a) {
  color: inherit;
  text-decoration: none;
}

:where(img) {
  max-width: 100%;
  height: auto;
  display: block;
}

/* :where() — нулевая специфичность, чтобы #wpadminbar не ломался */
:where(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(button) {
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.main {
  min-height: 50vh;
}

section {
  padding: 0 0 30px;
}

/* —— Header —— */
.header__top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--page-bg);
  box-shadow: var(--header-shadow);
}

body.admin-bar .header__top {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .header__top {
    top: 46px;
  }
}

.header__top-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo-img {
  display: block;
  width: auto;
  height: 28px;
}

.header__logo-text {
  font-family: var(--font-content);
  font-size: 25px;
  font-weight: 600;
  line-height: 150%;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.header__top-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: flex-end;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 10px;
  color: var(--header-nav);
  font-family: var(--font-content);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border-radius: 8px;
}

.header__nav-link:hover {
  color: var(--brand-red);
}

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

.header__langs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--header-langs-bg);
  border: 1px solid var(--border-lang);
  border-radius: 8px;
}

.header__langs-link {
  padding: 4px 8px;
  font-family: var(--font-content);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--grey);
}

.header__langs-link.is-current {
  background: #fff;
  color: var(--text-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.header__searchBtn {
  color: var(--search-btn);
  display: flex;
  padding: 4px;
}

.header__menuBtn {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 22px;
  padding: 4px 0;
}

.header__menuBtn span {
  display: block;
  height: 2px;
  background: var(--text-color);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header__bottom {
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--border-color);
}

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

.header__tags-link {
  display: inline-flex;
  padding: 6px 12px;
  background: var(--tag-bg);
  border-radius: 8px;
  font-family: var(--font-content);
  font-size: 13px;
  font-weight: 500;
}

.header__tags-link:hover {
  color: var(--brand-blue);
}

.header__search {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--footer-bg);
}

.header__search[hidden] {
  display: none;
}

.header__search-form {
  display: flex;
  gap: 10px;
}

.header__search-input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: var(--font-content);
  font-size: 15px;
  background: #fafafa;
}

.header__search-submit {
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

/* —— Cards / meta —— */
.meta-date {
  display: block;
  color: #8f8f8f;
  font-family: var(--font-content);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.3px;
}

.card-title {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text-color);
  transition: color 0.15s ease;
}

.card-title--lg {
  font-size: 20px;
  font-weight: 600;
  line-height: 140%;
}

.card-title--md {
  font-size: 17px;
  letter-spacing: -0.51px;
  font-weight: 500;
  line-height: 140%;
}

.card-title--sm {
  font-size: 16px;
  line-height: 140%;
  letter-spacing: -0.48px;
  font-weight: 500;
}

a:hover .card-title {
  color: var(--brand-blue);
}

/* —— Lead news —— */
.lead-news {
  padding-top: 30px;
}

.lead-news__wrapper {
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: 40px;
}

.lead-news__main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lead-news__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background: var(--footer-bg);
}

.lead-news__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lead-news__main:hover .lead-news__media img {
  transform: scale(1.05);
}

.lead-news__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-news__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 20px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.news-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.news-row__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.news-row__media {
  width: 120px;
  height: 80px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--footer-bg);
}

.news-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* —— Top stories —— */
.top-stories__wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 30px;
  padding: 30px 0 30px 30px;
  border-radius: 10px;
  background: var(--sport-news-bg);
  align-items: stretch;
}

.top-stories__item {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 30px;
  border-right: 1px solid var(--border-white);
  height: 100%;
}

.top-stories__item:last-child {
  border-right: 0;
}

.top-stories__content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.top-stories__category {
  font-family: var(--font-content);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-red);
}

.top-stories__image {
  border-radius: 5px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #fff;
}

.top-stories__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-stories__item .card-title {
  font-weight: 600;
}

/* —— News layout (latest + sections) —— */
.news-layout {
  padding-top: 30px;
}

.news-layout__wrapper {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  align-items: start;
}

.news-layout__sidebar {
  border-radius: 10px;
  background: var(--footer-bg);
  position: sticky;
  top: 80px;
}

.latest-news {
  display: flex;
  padding: 30px;
  flex-direction: column;
  gap: 25px;
}

.latest-news__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.latest-news__title {
  margin: 0;
  color: var(--latest-news__title);
  font-size: 22px;
  font-weight: 600;
  line-height: 130%;
}

.latest-news__title a {
  color: inherit;
}

.latest-news__more {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand-blue);
}

.latest-news__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.latest-news__icon svg {
  width: 16px;
  height: 16px;
  transform-origin: center;
}

.latest-news__more:hover .latest-news__icon svg {
  animation: more-arrow-spin 0.4s ease-in-out;
}

.latest-news__list {
  display: flex;
  flex-direction: column;
}

.latest-news__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid var(--border-white);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.latest-news__item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-layout__inner {
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow: hidden;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.block-head__title {
  position: relative;
  font-size: 22px;
  font-weight: 600;
  line-height: 130%;
  transition: color 0.15s ease;
}

.block-head__title:hover {
  color: var(--brand-blue);
}

.block-head__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey);
}

.block-head__more-text {
  color: var(--brand-red);
}

.block-head__more-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-red);
}

.block-head__more-icon svg {
  width: 16px;
  height: 16px;
  transform-origin: center;
}

.block-head__more:hover .block-head__more-icon svg {
  animation: more-arrow-spin 0.4s ease-in-out;
}

@keyframes more-arrow-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

.news-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.news-column__media {
  width: 100%;
  aspect-ratio: 245 / 160;
  border-radius: 5px;
  overflow: hidden;
  background: var(--footer-bg);
}

.news-column__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-column:hover .news-column__media img {
  transform: scale(1.05);
}

.news-column__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-column__category {
  font-family: var(--font-content);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-red);
}

/* —— Article (inform.kz single) —— */
.articles-feed {
  padding: 30px 0 50px;
}

.articles-feed__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
}

.articles-feed__main {
  min-width: 0;
  border-right: 1px solid var(--border-color);
  padding-right: 30px;
}

.articles-feed__aside {
  position: sticky;
  top: 80px;
}

.articles-feed .article {
  padding: 0 0 50px;
}

.articles-feed .article + .article {
  border-top: 1px solid var(--border-color);
  padding-top: 40px;
}

.article {
  padding: 30px 0 50px;
}

.article__wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
}

.articles-feed .article__main {
  border-right: none;
  padding-right: 0;
}

.article__main {
  min-width: 0;
  border-right: 1px solid var(--border-color);
  padding-right: 30px;
}

.article__aside {
  position: sticky;
  top: 80px;
}

.articles-feed__loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0 10px;
  color: var(--grey);
  font-size: 14px;
}

.articles-feed__loader[hidden] {
  display: none;
}

.articles-feed__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: qaznews-spin 0.7s linear infinite;
}

@keyframes qaznews-spin {
  to {
    transform: rotate(360deg);
  }
}

.article__head {
  margin-bottom: 20px;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article__category {
  font-family: var(--font-content);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-red);
}

.article__title {
  margin: 0 0 10px;
  color: var(--text-color);
  font-size: 26px;
  font-weight: 600;
  line-height: 160%;
  letter-spacing: -1.04px;
}

.article__lead {
  margin: 0 0 22px;
  color: var(--text-color);
  font-family: var(--font-content);
  font-size: 19px;
  font-weight: 600;
  line-height: 150%;
}

.article__cover {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 25px;
}

.article__cover-img {
  width: 100%;
  border-radius: 5px;
}

.article__cover-caption {
  font-family: var(--font-content);
  font-size: 13px;
  color: var(--grey);
}

.article__content {
  padding: 0 0 25px;
  color: var(--text-color);
  border-bottom: 1px dashed var(--border-color);
  font-family: var(--font-content);
  font-size: 16px;
  line-height: 160%;
}

.article__content > *:first-child {
  margin-top: 0;
}

.article__content p {
  margin: 0 0 1.1em;
}

.article__content ul,
.article__content ol {
  margin: 0 0 1.25em;
  padding: 0 0 0 0.25em;
  list-style: none;
}

.article__content li {
  position: relative;
  margin: 0 0 0.55em;
  padding-left: 1.75em;
  line-height: 160%;
}

.article__content li:last-child {
  margin-bottom: 0;
}

.article__content ul > li::before {
  content: "";
  position: absolute;
  left: 0.35em;
  top: 0.65em;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--brand-red);
}

.article__content ol {
  counter-reset: qaznews-ol;
}

.article__content ol > li {
  counter-increment: qaznews-ol;
}

.article__content ol > li::before {
  content: counter(qaznews-ol);
  position: absolute;
  left: 0;
  top: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.15em;
  border-radius: 999px;
  background: var(--section-gradient);
  color: var(--brand-red);
  font-family: var(--font-ui);
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
}

.article__content li ul,
.article__content li ol {
  margin: 0.55em 0 0.2em;
}

.article__content h2 {
  color: var(--text-color);
  font-size: 19px;
  font-weight: 600;
  line-height: 160%;
  letter-spacing: -0.78px;
  margin: 30px 0 12px;
}

.article__content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--brand-red);
  background: var(--footer-bg);
  font-size: 17px;
  font-weight: 500;
}

.article__content a {
  color: var(--article-link);
}

.article__content img {
  border-radius: 5px;
  margin: 20px 0;
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 25px 30px 10px;
}

.article__tag {
  display: inline-flex;
  padding: 8px 14px;
  background: var(--tag-bg);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.article__authors {
  display: flex;
  gap: 20px;
  padding: 25px 30px;
}

.author-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
}

.author-card__avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.author-card__name {
  font-weight: 600;
  font-size: 15px;
}

.author-card__role {
  font-size: 12px;
  color: var(--grey);
}

.articles-feed__aside .related-news,
.article__aside .related-news {
  display: flex;
  padding: 20px;
  flex-direction: column;
  gap: 15px;
  background: var(--footer-bg);
  border-radius: 10px;
}

.related-news__list {
  display: flex;
  flex-direction: column;
}

.related-news .latest-news__item {
  border-bottom-color: #e8e8e8;
}

/* —— Archive —— */
.news-category {
  padding: 30px 0 50px;
}

.news-category__title {
  margin: 0 0 30px;
  font-size: 28px;
  font-weight: 600;
}

.news-category__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.news-category__pagination {
  margin-top: 40px;
}

.news-category__pagination .nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.news-category__pagination a,
.news-category__pagination span {
  display: inline-flex;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ffecec;
  font-size: 14px;
  font-weight: 600;
}

.news-category__pagination .current {
  background: var(--brand-gradient);
  color: #fff;
}

/* —— Footer —— */
.footer {
  margin-top: auto;
  background: var(--footer-bg);
  padding: 40px 0 30px;
}

.footer__wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
}

.footer__logo-img {
  display: block;
  width: auto;
  height: 28px;
}

.footer__main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.footer__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__link {
  font-family: var(--font-content);
  font-size: 14px;
  color: var(--grey);
}

.footer__link:hover {
  color: var(--text-color);
}

.footer__copyright {
  font-size: 13px;
  color: var(--grey);
  padding-top: 20px;
  border-top: 1px solid var(--border-footer);
}

.error-page {
  padding: 80px 0;
  text-align: center;
}

.error-page__title {
  font-size: 80px;
  margin: 0;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page__link {
  display: inline-flex;
  margin-top: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 600;
}

/* —— Responsive (inform.kz breakpoints) —— */
@media (max-width: 1199px) {
  .news-layout__wrapper {
    grid-template-columns: 1fr;
  }

  .news-layout__sidebar {
    position: static;
  }

  .top-stories__wrapper {
    grid-template-columns: 1fr 1fr;
  }

  .category-block__grid,
  .news-category__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header__nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1001;
    background: var(--page-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--header-shadow);
    padding: 12px var(--container-padding) 16px;
  }

  .header__nav.is-open {
    display: block;
  }

  .header__nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .header__nav-link {
    width: 100%;
    padding: 10px 12px;
  }

  .header__menuBtn {
    display: flex;
  }

  .header__menuBtn.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .header__menuBtn.is-open span:nth-child(2) {
    opacity: 0;
  }

  .header__menuBtn.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 1000px) {
  .articles-feed__layout,
  .article__wrapper {
    grid-template-columns: 1fr;
  }

  .articles-feed__main,
  .article__main {
    padding-right: 0;
    border-right: none;
  }

  .articles-feed__aside,
  .article__aside {
    position: static;
  }

  .articles-feed__aside .related-news,
  .article__aside .related-news {
    display: flex;
  }
}

@media (max-width: 850px) {
  .lead-news__wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .article__title {
    font-size: 22px;
    line-height: 150%;
    letter-spacing: -0.88px;
  }

  .article__content,
  .article__tags,
  .article__authors {
    padding-left: 0;
    padding-right: 0;
  }

  .top-stories__wrapper {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 25px 15px;
  }

  .top-stories__item {
    padding-right: 0;
    border-right: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-white);
  }

  .category-block__grid,
  .news-category__grid {
    grid-template-columns: 1fr;
  }

  .header__bottom {
    display: none;
  }

  .footer__main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 599px) {
  .header__logo-img,
  .footer__logo-img {
    height: 22px;
  }

  .header__logo-text {
    font-size: 18px;
  }

  .news-row {
    grid-template-columns: 1fr 90px;
    gap: 12px;
  }

  .news-row__media {
    width: 90px;
    height: 60px;
  }

  .card-title--md {
    font-size: 15px;
  }

  .latest-news {
    padding: 20px;
  }
}
