/* Gamefix — blog & article stylesheet (self-contained).
   Используется PHP-листингом (/<lang>/blog/) и статичными статьями,
   которые генерирует autopost. Тема совпадает с основным сайтом. */
:root {
  --bg: #0a0a0c;
  --bg-elev: #111114;
  --bg-elev-2: #16161b;
  --bg-card: #121217;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --fg: #f2f2f4;
  --fg-dim: #9a9aa3;
  --fg-muted: #5a5a63;
  --accent: #ff5722;
  --accent-hot: #ff7a3e;
  --accent-glow: rgba(255, 87, 34, 0.35);
  --steam: #66c0f4;
  --rog: #ff2e5f;
  --ok: #4ade80;
  --font-sans: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: #000; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* ============================== HEADER ============================== */
.hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 14px 0;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hdr-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 24px; }
@media (max-width: 720px) { .hdr-inner { padding: 0 20px; gap: 12px; } }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; background: #fff; border-radius: 6px; padding: 2px; flex-shrink: 0; box-shadow: 0 0 0 1px var(--border-strong), 0 0 24px -6px var(--accent-glow); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-size: 17px; letter-spacing: -0.01em; }
.brand-dot { color: var(--accent); }
.nav { display: flex; gap: 28px; margin-left: 24px; }
.nav a { color: var(--fg-dim); font-size: 14px; font-weight: 500; transition: color .15s ease; letter-spacing: -0.005em; }
.nav a:hover, .nav a.is-active { color: var(--fg); }
.hdr-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.hdr-phone { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--fg-dim); letter-spacing: 0.02em; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; transition: color .15s, border-color .15s, background .15s; white-space: nowrap; }
.hdr-phone:hover { color: var(--accent); border-color: var(--accent); background: rgba(255,87,34,0.06); }
@media (max-width: 900px) { .hdr-phone span { display: none; } }
@media (max-width: 520px) { .hdr-phone { display: none; } }
.lang-switch { display: inline-flex; gap: 0; padding: 3px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.lang-btn { padding: 6px 10px; border-radius: 999px; color: var(--fg-muted); letter-spacing: 0.06em; transition: color .15s, background .15s; }
.lang-btn:hover { color: var(--fg-dim); }
.lang-btn--active { background: var(--fg); color: #000; }
.lang-switch--compact .lang-btn { padding: 5px 9px; }
.menu-toggle { display: none; flex-direction: column; gap: 4px; padding: 10px; }
.menu-toggle span { display: block; width: 18px; height: 1.5px; background: var(--fg); }

/* ============================== BUTTONS ============================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; font-family: var(--font-sans); letter-spacing: -0.005em; transition: transform .15s ease, background .15s ease, box-shadow .2s ease, border-color .15s; border: 1px solid transparent; white-space: nowrap; }
.btn--sm { padding: 8px 12px; font-size: 12.5px; border-radius: 7px; }
.btn--lg { padding: 14px 22px; font-size: 15px; }
.btn--primary { background: var(--accent); color: #0a0a0c; box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset, 0 8px 24px -8px var(--accent-glow); }
.btn--primary:hover { background: var(--accent-hot); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--fg); background: rgba(255,255,255,0.03); }

.kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); }
.kicker-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* ============================== NEWS LISTING ============================== */
.blog { padding: 130px 0 100px; min-height: 80vh; }
.blog-head { margin-bottom: 48px; }
.blog-title { font-size: clamp(40px, 5.5vw, 64px); font-weight: 600; letter-spacing: -0.03em; margin: 14px 0 12px; line-height: 1; }
.blog-sub { color: var(--fg-dim); max-width: 640px; font-size: 16px; margin: 0; text-wrap: pretty; }
/* Telegram-кнопка под заголовком — это фирменный .btn--primary + отступ и иконка. */
.blog-tg { margin-top: 22px; }
.blog-tg svg { flex-shrink: 0; margin-right: -2px; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: border-color .2s, transform .25s; min-height: 320px;
}
.news-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.news-card__media { aspect-ratio: 16 / 9; background: var(--bg-elev-2); overflow: hidden; position: relative; }
.news-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .news-card__media img { transform: scale(1.04); }
.news-card__media--empty { display: grid; place-items: center; color: var(--fg-muted); }
.news-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.news-card__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); letter-spacing: 0.04em; }
.news-card__tag { padding: 3px 8px; border-radius: 4px; background: rgba(255,87,34,0.1); border: 1px solid rgba(255,87,34,0.3); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.news-card__title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 10px; text-wrap: balance; }
.news-card__excerpt { color: var(--fg-dim); font-size: 14px; margin: 0 0 16px; line-height: 1.5; flex: 1; text-wrap: pretty; }
.news-card__cta { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.news-card__cta svg { transition: transform .2s; }
.news-card:hover .news-card__cta svg { transform: translateX(3px); }

.blog-empty { padding: 80px 0; text-align: center; color: var(--fg-muted); font-family: var(--font-mono); }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card);
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); transition: all .15s;
}
.pager a:hover { border-color: var(--border-strong); color: var(--fg); }
.pager .is-current { background: var(--fg); color: #0a0a0c; border-color: var(--fg); font-weight: 600; }
.pager .is-disabled { opacity: 0.35; pointer-events: none; }

/* ============================== HOMEPAGE TEASER ============================== */
.news-teaser { padding: 100px 0 60px; }
.news-teaser .sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.news-teaser .sec-title { font-size: clamp(28px, 4vw, 44px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; margin: 12px 0 0; }
.news-teaser[hidden] { display: none; }

/* ============================== ARTICLE ============================== */
.article-wrap { padding: 120px 0 100px; }
.article { max-width: 760px; margin: 0 auto; }
.article__back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 28px; transition: color .15s; }
.article__back:hover { color: var(--accent); }
.article__title { font-size: clamp(30px, 4.4vw, 44px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 14px; text-wrap: balance; }
.article__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); letter-spacing: 0.04em; }
.article__meta .news-card__tag { font-size: 11px; }
.article__cover { width: 100%; border-radius: 16px; border: 1px solid var(--border); margin: 0 0 32px; }
.article__body { font-size: 17px; line-height: 1.7; color: #d8d8de; }
.article__body h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 40px 0 14px; color: var(--fg); text-wrap: balance; }
.article__body h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; margin: 32px 0 12px; color: var(--fg); }
.article__body p { margin: 0 0 18px; }
.article__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article__body a:hover { color: var(--accent-hot); }
.article__body ul, .article__body ol { margin: 0 0 18px; padding-left: 24px; }
.article__body li { margin-bottom: 8px; }
.article__body img { border-radius: 12px; border: 1px solid var(--border); margin: 24px 0; }
.article__body blockquote { margin: 24px 0; padding: 14px 22px; border-left: 3px solid var(--accent); background: var(--bg-elev); border-radius: 0 10px 10px 0; color: var(--fg-dim); }
.article__backlink { margin-top: 44px; padding: 22px 24px; border-radius: 14px; background: linear-gradient(165deg, rgba(255,87,34,0.08), rgba(255,87,34,0.02)); border: 1px solid rgba(255,87,34,0.25); color: var(--fg-dim); font-size: 15px; line-height: 1.6; }
.article__backlink a { color: var(--accent); }

/* ============================== FOOTER ============================== */
.ftr { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-elev); }
.ftr-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.ftr-brand { margin-bottom: 48px; }
.ftr-tag { color: var(--fg-muted); margin: 14px 0 0; font-family: var(--font-mono); font-size: 13px; }
.ftr-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.ftr-ttl { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-muted); margin-bottom: 12px; }
.ftr-col a { color: var(--fg); font-size: 15px; transition: color .15s; }
.ftr-col a:hover { color: var(--accent); }
.ftr-bot { display: flex; justify-content: space-between; padding-top: 28px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); flex-wrap: wrap; gap: 12px; }
.ftr-made { color: var(--fg-dim); }
@media (max-width: 720px) { .ftr-inner { padding: 0 20px; } }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 1024px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 20px 32px; background: var(--bg-elev); border-bottom: 1px solid var(--border); flex-direction: column; gap: 20px; }
  .nav--open { display: flex; }
  .menu-toggle { display: flex; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .ftr-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hdr-inner { padding: 0 16px; gap: 8px; }
  .blog { padding: 96px 0 60px; }
  .article-wrap { padding: 96px 0 60px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { min-height: unset; }
  .article__body { font-size: 16px; }
  .ftr-cols { grid-template-columns: 1fr; }
  .ftr-inner { padding: 0 16px; }
  .brand-name { font-size: 15px; }
}

/* ============================== A11Y: FOCUS / SKIP-LINK ============================== */
/* Видимый фокус для клавиатурной навигации (не трогаем мышиный :hover). */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.nav a:focus-visible, .lang-btn:focus-visible, .news-card:focus-visible,
.pager a:focus-visible, .article__back:focus-visible, .news-card__cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.news-card:focus-visible { outline-offset: 2px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: #0a0a0c; font-weight: 600; font-size: 14px;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ============================== ENTRANCE ANIMATION ============================== */
@media (prefers-reduced-motion: no-preference) {
  .news-grid .news-card {
    animation: gf-fade-up .5s cubic-bezier(.16,1,.3,1) both;
  }
  .news-grid .news-card:nth-child(2) { animation-delay: .05s; }
  .news-grid .news-card:nth-child(3) { animation-delay: .1s; }
  .news-grid .news-card:nth-child(4) { animation-delay: .15s; }
  .news-grid .news-card:nth-child(5) { animation-delay: .2s; }
  .news-grid .news-card:nth-child(6) { animation-delay: .25s; }
}
@keyframes gf-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================== REDUCED MOTION ============================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .news-card:hover, .news-teaser .nt-card:hover { transform: none; }
  .news-card:hover .news-card__media img { transform: none; }
}
