@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-soft: #262626;
  --surface-sunk: #0e0e0e;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --line: #333333;
  --line-soft: #2a2a2a;

  --accent-1: #ffb703;
  --accent-2: #fb8500;
  --accent-3: #e63946;
  --accent-ink: #121212;

  --positive: #2a9d8f;
  --negative: #e63946;
  --news-text: #d4d4d4;
  --dot: #444444;

  --r-sm: .375rem;
  --r-md: .5rem;
  --r-lg: .75rem;
  --r-xl: 1rem;
  --container: 1400px;

  --fs-meta: .8125rem;
  --fs-sm: .9375rem;
  --fs-ui: .9375rem;
  --fs-body: 1rem;
  --fs-h4: 1rem;
  --fs-h3: 1.3rem;
  --fs-h2: 1.5em;
  --fs-h1: 1.8rem;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .36);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .42), 0 10px 28px rgba(0, 0, 0, .44);
}

* {
  box-sizing: border-box;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  hyphens: auto;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color .15s;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 6em 0 .6em;
  text-wrap: balance;
}

h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child {
  margin-top: 0;
}

header>h1:first-of-type {
  margin-top: 0;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

h2 {
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h3 {
  font-size: var(--fs-h4);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
}

h4 {
  font-size: var(--fs-ui);
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 600;
}

p {
  margin: 0 0 1.1em;
  line-height: 1.7;
  color: var(--news-text);
}

p:last-child {
  margin-bottom: 0;
}

h2+p,
h3+p,
h4+p {
  margin-top: .25em;
}

p+h2,
p+h3,
p+h4 {
  margin-top: 1.6em;
}

ul,
ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li {
  margin: .25em 0;
  line-height: 1.65;
}

li>ul,
li>ol {
  margin: .25em 0;
}

ul ul {
  list-style: circle;
}

ul ul ul {
  list-style: square;
}






strong,
b {
  font-weight: 700;
  color: var(--text);
}

em,
i {
  font-style: italic;
}

small {
  font-size: .85em;
  color: var(--muted);
}

mark {
  background: rgba(255, 183, 3, .25);
  color: var(--text);
  padding: 0 .15em;
  border-radius: 2px;
}

del {
  color: var(--muted);
  text-decoration: line-through;
}

ins {
  text-decoration: underline;
  text-decoration-color: var(--accent-1);
}

blockquote {
  margin: 1.5em 0;
  padding: .75em 1.1em;
  border-left: 3px solid var(--accent-1);
  background: var(--surface-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--text);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}

:not(pre)>code {
  padding: .15em .4em;
  border-radius: 4px;
  background: var(--surface-sunk);
  color: var(--accent-1);
  border: 1px solid var(--line-soft);
}

pre {
  margin: 1.2em 0;
  padding: 1em 1.2em;
  overflow-x: auto;
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
}

hr {
  margin: 2em 0;
  border: 0;
  height: 1px;
  background: var(--line);
}

figure {
  margin: 1.5em 0;
}

figcaption {
  margin-top: .5em;
  color: var(--muted);
  font-size: .85em;
  text-align: center;
}

table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: .95em;
  line-height: 1.5;
}

th,
td {
  padding: .6em .8em;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 600;
}

tr:nth-child(even) td {
  background: rgba(255, 255, 255, .02);
}

.text {
  max-width: 72ch;
}

button {
  font: inherit;
  cursor: pointer;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  display: flex;
  flex: 0 0;
  top: 0;
  z-index: 30;
  background: rgba(18, 18, 18, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}

.headerbox {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(calc(100% - 2.5rem), var(--container));
  margin: 0 auto;
  flex-wrap: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: none;
  margin: 4px 0;
}

.brand__mark {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  color: var(--accent-1);
}

.brand__mark svg {
  width: 2.5rem;
  height: 2.5rem;
  stroke-width: 2;
}

.brand:hover .brand__mark {
  border-color: var(--accent-1);
}

.brand__text {
  display: flex;
  flex-direction: column;
}

.brand__name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.primary-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
}

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

.primary-nav ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.primary-nav a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .6rem;
  font-size: var(--fs-ui);
  font-weight: 600;
  color: var(--news-text);
}

.primary-nav a:hover {
  color: var(--accent-2);
}

.primary-nav a.active {
  color: var(--accent-1);
}

.primary-nav span {
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
}

.primary-nav a.active span {
  color: var(--accent-1);
  opacity: .7;
}

/* ─── Drawer ─── */
.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  margin-right: .75rem;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: min(320px, 85vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  overflow-y: auto;
}

.drawer.is-open {
  transform: none;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.drawer__title {
  font-weight: 700;
  font-size: var(--fs-ui);
}

.drawer__close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer__close:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
}

.drawer__nav {
  padding: 1rem;
  flex: 1;
}

.drawer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.drawer__nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .875rem;
  border-radius: var(--r-md);
  font-size: var(--fs-ui);
  font-weight: 600;
  color: var(--news-text);
}

.drawer__nav a:hover {
  background: var(--surface-soft);
  color: var(--accent-1);
}

.drawer__nav a.active {
  color: var(--accent-1);
  background: var(--surface-soft);
}

.drawer__nav a span {
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
}

/* ─── Layout ─── */
.layout {
  display: flex;
  flex: 1 0;
  align-items: flex-start;
  gap: 1rem;
  width: min(calc(100% - 2.5rem), var(--container));
  margin: 1rem auto;
}

.layout>.feed,
.layout>article {
  flex: 1 1 auto;
  min-width: 0;
}

.layout>.sidebar {
  flex: 0 0 320px;
  min-width: 0;
}

/* ─── Feed ─── */
.feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feed>header {
  padding-bottom: .5rem;
}

.story {
  position: relative;
  display: flex;
  flex-direction: row;
  min-width: 0;
}

.story::before {
  content: "";
  position: absolute;
  left: 107px;
  top: 34px;
  bottom: -1rem;
  width: 1px;
  background: var(--line);
}

.story:last-child::before {
  bottom: auto;
  height: 34px;
}

.story-date {
  position: relative;
  flex: 0 0 108px;
  text-align: right;
  padding: 1.25rem 1.25rem 0 0;
}

.story-date::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 30px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-1);
  box-shadow: 0 0 0 4px var(--bg);
}

.story-date time {
  display: block;
}

.story-date b {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.story-date span {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: var(--fs-meta);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.story-inner {
  flex: 1 1 auto;
  margin-left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  transition: box-shadow .25s;
}

.story:hover .story-inner {
  box-shadow: var(--sh-2);
}

.story-inner>div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.story-inner>.story-media {
  flex: 0 0 180px;
}

.story-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
/* Заглушка с текстом */
.noimage-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: url('/assets/images/no_image.jfif') center/cover no-repeat;
  position: relative;
  border-radius: inherit;
  overflow: hidden;
  text-decoration: none;
}

/* Тёмный градиент поверх картинки, чтобы текст читался */
.noimage-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6); /* Затемнение */
}

/* Сам текст */
.noimage-fallback span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-sm);
  text-align: center;
  padding: 1rem;
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4; /* Обрезаем текст до 4 строк */
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}








.cat {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 .75rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-meta);
  font-weight: 600;
  background: #332400;
  color: var(--accent-1);
  border: 1px solid rgba(255, 183, 3, .25);
  transition: background .18s, color .18s;
}

.cat:hover {
  background: var(--accent-1);
  color: var(--accent-ink);
  border-color: var(--accent-1);
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  color: var(--muted);
  font-size: var(--fs-meta);
}

.meta span,
.meta time {
  display: flex;
  align-items: center;
  gap: .375rem;
}

.meta svg {
  width: 1rem;
  height: 1rem;
}

.read-link {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin-left: auto;
  color: var(--accent-1);
  font-size: var(--fs-meta);
  font-weight: 600;
}

.read-link:hover {
  color: var(--accent-2);
}

.read-link svg {
  width: 1rem;
  height: 1rem;
}

.story-media {
  position: relative;
  display: flex;
  align-self: center;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: var(--r-md);
  background: var(--surface-soft);
}

.story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Article ─── */
.article {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.5rem;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
}

.article>header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.article-cover {
  width: 100%;
  margin: 1.5rem 0;
  border-radius: var(--r-lg);
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ─── Sidebar ─── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.widget {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  gap: 1rem;
}

.widget_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-bottom: 1px solid var(--accent-1);
  padding-bottom: .5rem;
  font-size: 1.2rem;
  font-weight: bold;
}

.widget_head svg {
  width: 1.8rem;
  height: 1.8rem;
  color: var(--accent-1);
}

.widget_list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.widget_card {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.widget_card:hover {
  color: var(--accent-1);
}

.widget_card h2 {
  font-size: var(--fs-sm);
  font-weight: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.widget_thumb {
  width: 100px;
  aspect-ratio: 16 / 9;
  /* Автоматически делает высоту 56.25px */
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
}

.widget_thumb--empty {
  display: block;
  background: linear-gradient(135deg, #2a2a2a, #1c1c1c);
}
/* Заглушка с текстом для сайдбара */
.noimage-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: url('/assets/images/no_image.jfif') center/cover no-repeat;
  border-radius: var(--r-sm);
  overflow: hidden;
  text-decoration: none;
  flex: none;
}

.noimage-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.noimage-fallback span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 600;
  font-size: 0.55rem;
  text-align: center;
  padding: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}






/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .5rem 0;
}

.pagination a,
.pagination span {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .875rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--news-text);
  font-size: var(--fs-ui);
  font-weight: 600;
}

.pagination a:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
}

.pagination span.current {
  color: var(--accent-ink);
  background: var(--accent-1);
  border-color: var(--accent-1);
}

/* ─── Footer ─── */
.site-footer {
  display: flex;
  flex: 0 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer>.container {
  width: min(calc(100% - 1rem), var(--container));
  margin: 0 auto;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1rem;
}

.footer-brand {
  flex: 1 1 300px;
}

.footer-col {
  flex: 1 1 180px;
}

.footer-brand p {
  max-width: 24rem;
  margin-top: 1rem;
}

.footer-col a {
  display: block;
  width: fit-content;
  margin: .5rem 0;
}

.footer-col a:hover {
  color: var(--accent-1);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  min-height: 3.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-meta);
}

.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 20;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--news-text);
  box-shadow: var(--sh-2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(.5rem);
  pointer-events: none;
  transition: .25s;
}

.to-top:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ─── 404 ─── */
.notfound {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
}

.notfound__code {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}

.notfound__title {
  font-size: var(--fs-h2);
  margin: 0 0 .75rem;
}

.notfound__text {
  max-width: 42ch;
  color: var(--muted);
  margin: 0 0 2rem;
}

.notfound__actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: var(--r-md);
  font-size: var(--fs-ui);
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
}

.btn--primary {
  background: var(--accent-1);
  color: var(--accent-ink);
  border-color: var(--accent-1);
}

.btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--accent-ink);
}

/* ─── Scrollbars ─── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-1) var(--surface-soft);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--surface-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-1);
  border-radius: 6px;
  border: 2px solid var(--surface-soft);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

::-webkit-scrollbar-corner {
  background: var(--surface-soft);
}

/* ─── Responsive ─── */
@media (max-width: 980px) {
  .primary-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .layout {
    flex-direction: column;
  }

  .layout>.sidebar {
    flex: 1 1 auto;
    width: 100%;
  }

  .footer-grid {
    flex-direction: column;
  }
}

@media (max-width: 768px) {

  .headerbox,
  .layout,
  .site-footer>.container {
    width: min(calc(100% - 2rem), var(--container));
  }

  .brand__text {
    display: none;
    /* Скрываем надпись на мобилках */
  }

  .story {
    flex-direction: column;
  }

  .story::before {
    display: none;
  }

  .story-date {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    text-align: left;
    flex: none;
    padding: 0 0 .5rem 0;
  }

  .story-date::after {
    display: none;
  }

  .story-inner {
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .story-inner>.story-media {
    order: -1;
    flex: none;
    aspect-ratio: 16/9;
  }

  .article h1 {
    font-size: 1.75rem;
  }
}