/* ==========================================================================
   TgSuperstars EN v2 — blog layer: articles, /en/blog/, contacts/about, legal, 404.
   Printed LAST: en.css (article body, km design of the RU blog) -> en-v2-chrome.css (v2 header/footer/FAB)
   -> this file. Here only the bridge between en.css and the v2 chrome, the RU section strip (.km-stickytop)
   and layout fixes (no empty right half, no horizontal scroll at 390). Blue accents stay: the RU blog has them.
   Scoped to body.tgs-v2-blog so commercial v2 pages (which do not load en.css) are untouched.
   ========================================================================== */

/* ---- Chrome vs en.css ------------------------------------------------- */
/* Header/footer text: the same system stack as on the RU site and EN commercial v2 (tgs-styles preflight);
   the article itself keeps Inter/Manrope as the RU blog (km) does. */
body.tgs-en.tgs-v2-blog {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.5;
  background: #0F0F1A;
}
.tgs-v2-blog .en-page { font-family: var(--en-font-body); line-height: 1.55; }
/* en.css hides the RU FAB with !important; v2 prints its own FAB (same as commercial v2 and RU). */
body.tgs-en.tgs-v2 .support-fab { display: inline-flex !important; }
body.tgs-en.tgs-v2 .en-page a:focus-visible,
body.tgs-en.tgs-v2 .en-page button:focus-visible,
body.tgs-en.tgs-v2 .en-page summary:focus-visible { outline-color: #2aabee; }

/* en-v2-chrome.css sets scroll-padding-top: 96px for commercial pages; here the en.css offset wins again
   (TOC, FAQ and #hash loads land below the sticky header, and below the section strip on articles). */
html { scroll-padding-top: var(--en-anchor-offset); }

/* ---- Hero: sizes of the RU blog (.km-hero) ----------------------------- */
.tgs-v2-blog .en-hero { padding: 56px 0 64px; }
.tgs-v2-blog .en-hero--plain,
.tgs-v2-blog .en-hero--blog { padding: 52px 0 52px; }
.tgs-v2-blog .en-crumbs { margin-bottom: 24px; }
.tgs-v2-blog .en-badges { margin-bottom: 20px; }
.tgs-v2-blog .en-hero__title { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; margin-bottom: 20px; }
.tgs-v2-blog .en-hero__lead { font-size: 18px; line-height: 1.6; }

/* ---- Section strip under the header (copy of RU .km-stickytop) ---------- */
.tgs-bstrip {
  position: relative;
  z-index: 40;
  background: rgba(6, 7, 15, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--en-border);
}
.tgs-bstrip__row { display: flex; align-items: center; gap: 16px; min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.tgs-bstrip__title {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  color: var(--en-text); font-family: var(--en-font-display); font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
}
.tgs-bstrip__title i { color: var(--en-blue); font-size: 19px; line-height: 1; }
.tgs-bstrip__title small { margin-left: 2px; color: var(--en-muted); font-size: 14px; font-weight: 500; }
.tgs-bstrip__toc {
  flex: 1 1 auto; min-width: 0;
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.tgs-bstrip__toc::-webkit-scrollbar { display: none; }
.tgs-bstrip__toc a {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px;
  color: var(--en-text-2); font-family: var(--en-font-body); font-size: 13.5px; font-weight: 500; line-height: 1.2;
  text-decoration: none; white-space: nowrap; scroll-snap-align: start;
  transition: background 0.18s ease, color 0.18s ease;
}
.tgs-bstrip__toc a:hover { background: var(--en-surface-2); color: var(--en-text); }
.tgs-bstrip__toc a.is-active { background: var(--en-blue-soft); color: var(--en-blue); }
.tgs-bstrip__cta {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; border: 1px solid transparent; border-radius: 9px;
  background: linear-gradient(180deg, #3eb6ef 0%, #2aabee 100%);
  box-shadow: 0 14px 36px -14px rgba(42, 171, 238, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #052033; font-family: var(--en-font-display); font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background 0.18s ease;
}
.tgs-bstrip__cta:hover { background: linear-gradient(180deg, #54bef0 0%, #34b1ec 100%); }
@media (min-width: 1024px) {
  /* sticky right under the sticky v2 header (height measured by en-blog-v2.js) */
  .tgs-bstrip { position: sticky; top: var(--tgs-hdr-h, 73px); }
  :root:has(body.tgs-v2-blog--article) { --en-anchor-offset: calc(var(--tgs-hdr-h, 73px) + 76px); }
}
@media (max-width: 767px) {
  /* as the RU strip on phones: icon + short caption ("Telegram Stars"), then the pills and the button */
  .tgs-bstrip__row { gap: 10px; min-height: 52px; }
  .tgs-bstrip__title { gap: 6px; max-width: 38%; font-size: 13px; }
  .tgs-bstrip__topic { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tgs-bstrip__title small { display: none; }
  .tgs-bstrip__title i { font-size: 18px; }
  .tgs-bstrip__toc a { padding: 7px 11px; font-size: 13px; }
  .tgs-bstrip__cta { padding: 8px 11px; font-size: 12.5px; }
}
@media (max-width: 359px) {
  .tgs-bstrip__topic { display: none; }
}

/* Reading progress (RU .km-progress) */
.tgs-bprogress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; background: rgba(255, 255, 255, 0.04); pointer-events: none; }
.tgs-bprogress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #2aabee, #8e6ff7); }

/* ---- Article hero: two columns as the RU blog (text left, visual/quick picks right) ---- */
.tgs-bhero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.tgs-bhero__aside { display: grid; gap: 14px; align-content: start; min-width: 0; }
.tgs-bhero__aside > .en-kpi { margin: 0; }
@media (min-width: 1024px) {
  .tgs-bhero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 56px; align-items: center; }
  .tgs-bhero__aside { padding-top: 40px; } /* level with the H1, below crumbs + badges */
  .tgs-bhero__aside > .en-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tgs-bhero__aside > .en-kpi > p:last-child:nth-child(odd),
  .tgs-bhero__aside > .en-kpi > div:last-child:nth-child(odd),
  .tgs-bhero__aside > .en-kpi > ul > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .tgs-bhero__aside { max-width: 640px; }
}
.tgs-bhero-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--en-border-strong);
  border-radius: var(--en-radius-lg);
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(42, 171, 238, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(29, 34, 65, 0.92), rgba(17, 20, 42, 0.92));
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}
.tgs-bhero-card--premium {
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(142, 111, 247, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(29, 34, 65, 0.92), rgba(17, 20, 42, 0.92));
}
.tgs-bhero-card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.tgs-bhero-card__icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--en-blue-soft); color: var(--en-blue); font-size: 23px; line-height: 1;
}
.tgs-bhero-card--premium .tgs-bhero-card__icon,
.tgs-bhero-card--support .tgs-bhero-card__icon { background: var(--en-violet-soft); color: var(--en-violet); }
.tgs-bhero-card__eyebrow {
  display: block; margin-bottom: 2px;
  color: var(--en-muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.tgs-bhero-card__title {
  margin: 0; color: var(--en-text); font-family: var(--en-font-display);
  font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance;
}
.tgs-bhero-card__text { margin: 0 0 18px; color: var(--en-text-2); font-size: 15px; line-height: 1.55; }
.tgs-bhero-card__packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tgs-bhero-card__packs.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tgs-bhero-pack {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--en-border); border-radius: 12px;
  background: rgba(6, 7, 15, 0.45); color: var(--en-muted); font-size: 13px; line-height: 1.35;
  text-decoration: none; transition: border-color 0.18s ease, background 0.18s ease;
}
.tgs-bhero-pack strong { color: var(--en-text); font-family: var(--en-font-display); font-size: 19px; font-weight: 700; line-height: 1.2; }
.tgs-bhero-pack:hover { border-color: rgba(42, 171, 238, 0.55); background: rgba(42, 171, 238, 0.08); }
.tgs-bhero-card--premium .tgs-bhero-pack:hover { border-color: rgba(142, 111, 247, 0.6); background: rgba(142, 111, 247, 0.1); }
.tgs-bhero-card__facts { display: grid; gap: 7px; margin: 0 0 18px; padding: 0; list-style: none; }
.tgs-bhero-card__facts li { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--en-text-2); font-size: 13.5px; line-height: 1.45; }
.tgs-bhero-card__facts i { flex-shrink: 0; margin-top: 1px; color: #6cc7f3; font-size: 16px; line-height: 1.2; }
.tgs-bhero-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tgs-bhero-card__actions .en-btn { flex: 1 1 auto; padding: 12px 16px; font-size: 14.5px; }
.tgs-bhero-card__actions .en-btn--primary { flex-grow: 2; }
@media (max-width: 767px) {
  .tgs-bhero__grid { gap: 22px; }
  .tgs-bhero-card { padding: 18px; }
  .tgs-bhero-card__facts { display: none; } /* phones: packs + buttons only, the text starts sooner */
  .tgs-bhero-card__packs.is-3 .tgs-bhero-pack { padding: 10px 11px; }
  .tgs-bhero-card__packs.is-3 .tgs-bhero-pack strong { font-size: 16.5px; }
}

/* ---- Legal pages: compact hero (the RU offer has none) - no background band, first cell of the text column,
   the TOC starts level with the H1 ---- */
.tgs-v2-blog--legal .tgs-lhero { padding: 0; margin: 0 0 32px; overflow: visible; border: 0; background: none; }
.tgs-v2-blog--legal .tgs-lhero::before { content: none; }
.tgs-v2-blog--legal .tgs-llayout { padding-top: 40px; }
.tgs-v2-blog--legal .tgs-lhero .en-hero__title { font-size: clamp(32px, 3.4vw, 46px); margin-bottom: 16px; }
.tgs-v2-blog--legal .tgs-lhero .en-hero__lead { font-size: 17px; }
@media (min-width: 1024px) {
  .tgs-v2-blog--legal .tgs-llayout > .tgs-lhero { grid-column: 1; grid-row: 1; max-width: var(--en-prose-w); }
  .tgs-v2-blog--legal .tgs-llayout > .en-toc { grid-column: 2; grid-row: 1 / span 2; }
  .tgs-v2-blog--legal .tgs-llayout > .en-layout__main { grid-row: 2; }
  .tgs-v2-blog--legal .tgs-llayout { row-gap: 0; }
}
@media (max-width: 1023px) {
  .tgs-v2-blog--legal .tgs-llayout > .tgs-lhero { grid-column: 1; grid-row: auto; margin-bottom: 24px; }
}
@media (max-width: 767px) {
  .tgs-v2-blog--legal .tgs-llayout { padding-top: 24px; }
  .tgs-v2-blog--legal .tgs-lhero { padding: 0; }
}

/* ---- Wide tables on phones: fade at the right edge + a hint while there is more to scroll
   (same as the commercial v2 pages; the hint is added by en-blog-v2.js) ---- */
.tgs-v2-blog .en-prose .en-tscroll.is-scroll:not(.is-end) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), rgba(0, 0, 0, 0.25));
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), rgba(0, 0, 0, 0.25));
}
.tgs-v2-blog .tgs-v2-swipe {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px !important;
  color: #a5a8b8; font-size: 12.5px; line-height: 1.3;
}
.tgs-v2-blog .tgs-v2-swipe i { color: #a78bfa; font-size: 15px; }
.tgs-v2-blog .tgs-v2-swipe[hidden] { display: none; }

/* ---- Blog list: cards right after the hero, intro + sources in a centred card ---- */
.tgs-v2-blog .en-blog-list { padding: 48px 0 24px; }
.tgs-v2-bcard-wrap { padding: 24px 0 8px; }
.tgs-v2-bcard {
  max-width: 920px; margin: 0 auto; padding: 40px 48px 44px;
  border: 1px solid var(--en-border); border-radius: var(--en-radius-xl);
  background: linear-gradient(180deg, rgba(22, 26, 51, 0.6), rgba(17, 20, 42, 0.35));
}
.tgs-v2-bcard .en-prose { max-width: none; }
.tgs-v2-bcard > .en-faq:first-child,
.tgs-v2-bcard > .en-sources:first-child { margin-top: 0; }
.tgs-v2-bcard .en-sources { margin-top: 40px; }
@media (min-width: 768px) {
  .tgs-v2-bcard .en-sources__list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

/* ---- Plain page without a TOC: centred text column ---------------------- */
.tgs-v2-center { margin-left: auto; margin-right: auto; }
.tgs-v2-center .en-prose { max-width: none; }
/* ...and its hero on the same axis as the text column (otherwise H1 hugs the left edge, text sits in the middle) */
.tgs-v2-centered .en-hero > .en-shell { max-width: calc(var(--en-prose-w) + 64px); }
@media (max-width: 767px) { .tgs-v2-centered .en-hero > .en-shell { max-width: none; } }
.tgs-v2-centered .en-contact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* ...and the closing CTA card on the same column width (/en/about/: it was wider than the text) */
.tgs-v2-centered .en-section--cta > .en-shell { max-width: calc(var(--en-prose-w) + 64px); }
.tgs-v2-centered .en-cta { grid-template-columns: auto minmax(0, 1fr); padding: 32px; }
.tgs-v2-centered .en-cta__actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
@media (max-width: 767px) {
  .tgs-v2-centered .en-section--cta > .en-shell { max-width: none; }
  .tgs-v2-centered .en-cta { grid-template-columns: minmax(0, 1fr); padding: 28px 24px; }
  .tgs-v2-centered .en-cta__actions { grid-column: 1; }
}

/* ---- Contacts / 404 cards ---------------------------------------------- */
.tgs-v2-blog .en-contact-card:hover { border-color: rgba(142, 111, 247, 0.55); }

/* ---- 404 (RU 404: code, H1, lead, two buttons) --------------------------- */
.en-page--404 { min-height: 0; }
.en-page--404 .en-plain { padding-bottom: 88px; }
.tgs-v2-404 { text-align: center; }
.tgs-v2-404 .en-hero__title,
.tgs-v2-404 .en-hero__lead { margin-left: auto; margin-right: auto; }
.tgs-v2-404__code {
  margin: 0 0 6px; color: #8E6FF7; font-family: var(--en-font-display); font-size: 15px; font-weight: 800; letter-spacing: 0.12em;
}
.tgs-v2-404__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.tgs-v2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 8px;
  background: #2D2D3A; color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none;
  transition: filter 0.18s ease, background 0.18s ease;
}
.tgs-v2-btn i { font-size: 18px; line-height: 1; }
.tgs-v2-btn:hover { background: #3a3a4a; }
.tgs-v2-btn--primary { background: #8E6FF7; }
.tgs-v2-btn--primary:hover { background: #8E6FF7; filter: brightness(1.08); }
.tgs-v2-404__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  max-width: 1040px; margin: 0 auto;
}
@media (max-width: 1023px) { .tgs-v2-404__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tgs-v2-404__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Phones ------------------------------------------------------------ */
@media (max-width: 767px) {
  .tgs-v2-blog .en-hero { padding: 28px 0 40px; }
  .tgs-v2-blog .en-hero--plain,
  .tgs-v2-blog .en-hero--blog { padding: 28px 0 36px; }
  .tgs-v2-blog .en-hero__lead { font-size: 16.5px; }
  .tgs-v2-blog .en-blog-list { padding: 28px 0 16px; }
  .tgs-v2-bcard-wrap { padding: 16px 0 0; }
  .tgs-v2-bcard { padding: 24px 18px 26px; border-radius: 20px; }
  .tgs-v2-404__actions .tgs-v2-btn { flex: 1 1 100%; }
  .tgs-v2-centered .en-contact-cards { grid-template-columns: minmax(0, 1fr); }
  /* KPI tiles go 2 per row on phones: an odd last tile spans the row instead of leaving a hole */
  .tgs-v2-blog .en-kpi > p:last-child:nth-child(odd),
  .tgs-v2-blog .en-kpi > div:last-child:nth-child(odd),
  .tgs-v2-blog .en-kpi > ul > li:last-child:nth-child(odd),
  .tgs-v2-blog .en-kpi > ol > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---- 24.09: короткая подпись темы в полосе на узких экранах (Premium не влезал) ---- */
.tgs-bstrip__short { display: none; }
@media (max-width: 400px) {
  .tgs-bstrip__full { display: none; }
  .tgs-bstrip__short { display: inline; }
}
/* ---- 24.09: 5-колоночные таблицы на десктопе — по ширине колонки текста (без маски и подсказки про свайп;
   en.css держит min-width 780px ради мобильной прокрутки) ---- */
@media (min-width: 1024px) {
  .tgs-v2-blog .en-prose .en-tscroll > table:has(tr > :nth-child(5)) { min-width: 0; width: 100%; }
}
