/* UZ24 M24 — visual language inspired by m24.ru */

:root {
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-heading: familyProximaNova, "Proxima Nova", "Source Sans 3", sans-serif;
  --red: #e31e24;
  --red-dark: #c4181e;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e8e8e8;
  --soft: #f6f6f6;
  --white: #ffffff;
  --container: 1200px;
  --pad: 16px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

:where(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

:where(h1, h2, h3, h4) {
  margin: 0;
  font-family: var(--font-heading);
}

.m-hero__title,
.m-section-head__title,
.m-archive__title,
.m-footer__title,
.article__title,
.error-page__title {
  font-family: var(--font-heading);
}

:where(p) {
  margin: 0;
}

.container {
  width: min(100% - 2 * var(--pad), var(--container));
  margin-inline: auto;
}

/* —— Header —— */
.m-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  animation: m-fade-down 0.45s var(--ease) both;
}

.m-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-h);
}

.m-header__logo-img {
  height: 32px;
  width: auto;
}

.m-header__nav {
  flex: 1;
  min-width: 0;
}

.m-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.m-nav::-webkit-scrollbar {
  display: none;
}

.m-nav__link {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.m-nav__link:hover,
.m-nav__item.current-menu-item .m-nav__link {
  color: var(--red);
  border-bottom-color: var(--red);
}

.m-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.m-header__icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}

.m-header__icon-btn:hover {
  background: var(--soft);
  color: var(--red);
}

.m-header__burger {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  gap: 5px;
  flex-direction: column;
}

.m-header__burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.m-header__burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.m-header__burger.is-open span:nth-child(2) {
  opacity: 0;
}
.m-header__burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.m-header__search {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  background: var(--white);
}

.m-search {
  display: flex;
  gap: 8px;
}

.m-search__input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.m-search__input:focus {
  outline: 2px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-color: var(--red);
}

.m-search__submit {
  height: 44px;
  padding: 0 18px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
  transition: background 0.2s;
}

.m-search__submit:hover {
  background: var(--red-dark);
}

/* —— Hero (m24 lead) —— */
.m-hero {
  padding: 20px 0 8px;
}

.m-hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: stretch;
  animation: m-rise 0.55s var(--ease) both;
}

.m-hero__lead {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0a0a0a;
  min-height: 420px;
}

.m-hero__media {
  position: absolute;
  inset: 0;
}

.m-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.6s var(--ease);
}

.m-hero__lead:hover .m-hero__img {
  transform: scale(1.06);
}

.m-hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.78) 100%);
}

.m-hero__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 28px;
  color: #fff;
  z-index: 1;
}

.m-hero__title {
  margin: 10px 0 8px;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.m-hero__side {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.m-hero__side .m-row {
  flex: 1 1 0;
  align-items: center;
}

.m-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.m-row:hover {
  background: var(--soft);
}

.m-row__media {
  position: relative;
  overflow: hidden;
  background: var(--soft);
  aspect-ratio: 16 / 9;
}

.m-row__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.m-row:hover .m-row__img {
  transform: scale(1.05);
}

.m-row__title {
  display: inline;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 400;
  line-height: 22px;
  color: #252525;
}

.m-row:hover .m-row__title {
  color: var(--red);
}

/* —— Promo strip —— */
.m-promo {
  padding: 12px 0 8px;
}

.m-promo__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.m-promo__item {
  display: grid;
  gap: 10px;
  align-content: start;
  align-items: start;
}

.m-promo__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--soft);
}

.m-promo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.m-promo__item:hover .m-promo__img {
  transform: scale(1.04);
}

h3.m-promo__title,
.m-promo__title {
  display: inline;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 400;
  line-height: 22px;
  color: #252525;
}

.m-promo__item:hover .m-promo__title {
  color: var(--red);
}

/* —— Home: feed + categories —— */
.m-home {
  padding: 20px 0 48px;
}

.m-home__grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

.m-feed {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow: auto;
  padding-right: 8px;
  border-right: 1px solid var(--line);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.m-feed::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.m-feed--aside {
  position: static;
  max-height: none;
  overflow: visible;
  border-right: 0;
  padding-right: 0;
  scrollbar-width: auto;
  -ms-overflow-style: auto;
}

.m-feed__list {
  display: flex;
  flex-direction: column;
}

.m-feed__item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.m-feed__item:hover .m-feed__title {
  color: var(--red);
}

.m-feed__title {
  display: inline;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 18px;
  color: #252525;
}

.m-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--red);
}

.m-section-head__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.m-section-head__more {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.m-block {
  margin-bottom: 36px;
}

.m-block__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}

.m-card {
  display: grid;
  gap: 10px;
  align-content: start;
  align-items: start;
}

.m-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--soft);
}

.m-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.m-card:hover .m-card__img {
  transform: scale(1.04);
}

.m-card__title {
  display: inline;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 400;
  line-height: 22px;
  color: #252525;
}

.m-card:hover .m-card__title {
  color: var(--red);
}

.m-chip {
  display: inline-block;
  padding: 3px 8px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 2px;
}

.m-chip--on-media {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  margin: 0;
}

.m-chip--ghost {
  background: transparent;
  color: var(--red);
  padding: 0;
}

.m-time {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.m-time--above {
  display: block;
  position: relative;
  overflow: hidden;
  margin: 0 0 4px;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 14px;
  color: #252525;
}

.m-time--feed {
  color: var(--red);
  font-size: 13px;
  padding-top: 1px;
}

/* —— Archive —— */
.m-archive {
  padding: 28px 0 48px;
}

.m-archive__title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--red);
}

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

.m-archive__pagination {
  margin-top: 28px;
}

.m-archive__pagination .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.m-archive__pagination a,
.m-archive__pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.m-archive__pagination .current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* —— Single / feed —— */
.articles-feed {
  padding: 24px 0 56px;
}

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

.articles-feed__aside {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow: auto;
}

.article {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.article__main {
  min-width: 0;
  width: 100%;
}

.article__cover {
  width: 100%;
  margin: 0 0 22px;
}

.article__cover-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.article__cover-caption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.article__category {
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.article__title {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.article__lead {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  color: #333;
  margin-bottom: 22px;
  padding-left: 14px;
  border-left: 3px solid var(--red);
}

.article__content {
  font-size: 17px;
  line-height: 1.7;
  color: #222;
}

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

.article__content h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 1.4em 0 0.6em;
}

.article__content a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article__content figure {
  margin: 1.25em 0;
}

.article__content img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 1.25em auto;
}

.article__authors {
  margin-top: 28px;
}

.author-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--soft);
}

.author-card__avatar img {
  border-radius: 50%;
}

.author-card__name {
  font-weight: 700;
}

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

.article__views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.articles-feed__loader {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 16px 0;
}

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

/* —— Footer —— */
.m-footer {
  background: #141414;
  color: #ddd;
  padding: 40px 0 28px;
  margin-top: 24px;
}

.m-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #2a2a2a;
}

.m-footer__tagline {
  color: #999;
  font-size: 14px;
}

.m-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 28px;
}

.m-footer__col {
  flex: 1 1 calc(50% - 14px);
  min-width: min(100%, 220px);
  max-width: 100%;
  box-sizing: border-box;
}

.m-footer__title {
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.m-footer__list {
  display: grid;
  gap: 8px;
}

.m-footer__link {
  color: #bbb;
  font-size: 14px;
  transition: color 0.2s;
}

.m-footer__link:hover {
  color: #fff;
}

.m-footer__bottom {
  font-size: 13px;
  color: #777;
}

/* —— Motion —— */
@keyframes m-fade-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes m-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* —— Responsive —— */
@media (max-width: 1024px) {
  .m-hero__grid {
    grid-template-columns: 1fr;
  }

  .m-hero__lead {
    min-height: 320px;
  }

  .m-home__grid,
  .articles-feed__layout {
    grid-template-columns: 1fr;
  }

  .articles-feed__aside {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .m-feed {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .m-promo__grid,
  .m-archive__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .m-footer__col {
    flex-basis: 100%;
  }

  .m-header__burger {
    display: grid;
  }

  .m-header__nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 16px;
  }

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

  .m-nav {
    flex-direction: column;
    gap: 0;
  }

  .m-nav__link {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .m-promo__grid,
  .m-block__grid,
  .m-archive__grid {
    grid-template-columns: 1fr;
  }

  .m-row {
    grid-template-columns: 96px 1fr;
  }

  .m-hero__lead {
    min-height: 280px;
  }

  .m-hero__caption {
    padding: 16px;
  }
}
