:root {
  --blog-bg: #050b16;
  --blog-panel: rgba(10, 20, 38, 0.92);
  --blog-panel-soft: rgba(15, 29, 52, 0.82);
  --blog-border: rgba(112, 180, 255, 0.2);
  --blog-border-strong: rgba(112, 180, 255, 0.42);
  --blog-text: #f7faff;
  --blog-text-soft: #c4d1e6;
  --blog-text-muted: #8fa1be;
  --blog-blue: #2e79ef;
  --blog-blue-light: #75baff;
  --blog-radius: 22px;
  --blog-radius-small: 13px;
}

body.page-blog {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 4%, rgba(46, 121, 239, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 28%, rgba(20, 184, 166, 0.08), transparent 22rem),
    linear-gradient(180deg, #030914 0%, var(--blog-bg) 46%, #07101e 100%);
  color: var(--blog-text);
}

.page-blog .conteiner {
  min-height: 100vh;
}

.blog-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.blog-main--article {
  width: min(1100px, calc(100% - 40px));
}

.blog-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: var(--blog-text-muted);
  font-size: 14px;
}

.blog-breadcrumbs a {
  color: var(--blog-blue-light);
  text-decoration: none;
}

.blog-breadcrumbs a:hover,
.blog-breadcrumbs a:focus-visible {
  text-decoration: underline;
}

.blog-hero {
  overflow: hidden;
  position: relative;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--blog-border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(17, 38, 70, 0.94), rgba(7, 17, 33, 0.96)),
    var(--blog-panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

.blog-hero::after {
  position: absolute;
  inset: auto -90px -130px auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(46, 121, 239, 0.18);
  content: "";
  filter: blur(2px);
  pointer-events: none;
}

.blog-eyebrow {
  margin: 0 0 12px;
  color: var(--blog-blue-light);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero h1,
.blog-article__header h1 {
  max-width: 900px;
  margin: 0;
  color: var(--blog-text);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.blog-hero__lead,
.blog-article__lead {
  max-width: 800px;
  margin: 20px 0 0;
  color: var(--blog-text-soft);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.6;
}

.blog-hero__actions,
.blog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.blog-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--blog-border-strong);
  border-radius: 11px;
  background: rgba(15, 35, 64, 0.88);
  color: #e8f3ff;
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.blog-button--primary {
  border-color: #3e8cff;
  background: linear-gradient(180deg, #3188ff, #1767d4);
  color: #fff;
}

.blog-hero__actions {
  gap: 14px;
}

.blog-hero__actions .blog-button {
  min-height: 48px;
  padding: 12px 22px;
  border-color: #5e94cc;
  background: #173f70;
  box-shadow: 0 7px 18px rgba(2, 10, 24, 0.22);
  color: #f7fbff;
  font-size: 15px;
  font-weight: 750;
}

.blog-hero__actions .blog-button--primary {
  border-color: #72bdff;
  background: linear-gradient(180deg, #3b98ff, #176bdc);
  box-shadow: 0 9px 22px rgba(13, 91, 201, 0.34);
}

.blog-hero__actions .blog-button:not(.blog-button--primary):hover,
.blog-hero__actions .blog-button:not(.blog-button--primary):focus-visible {
  border-color: #8bc5ff;
  background: #20558f;
}

.blog-hero__actions .blog-button:focus-visible {
  outline: 3px solid rgba(144, 205, 255, 0.48);
  outline-offset: 3px;
}

.blog-button:hover,
.blog-button:focus-visible {
  border-color: #75baff;
  transform: translateY(-1px);
}

.blog-section {
  margin-top: 38px;
}

.blog-section__head {
  max-width: 820px;
  margin-bottom: 20px;
}

.blog-section h2,
.blog-article__body h2 {
  margin: 0;
  color: var(--blog-text);
  font-size: clamp(27px, 3.6vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.022em;
}

.blog-section__head p {
  margin: 12px 0 0;
  color: var(--blog-text-soft);
  font-size: 17px;
  line-height: 1.65;
}

.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.blog-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  background: var(--blog-panel);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.blog-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 26px;
}

.blog-card__media {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  background: #07101e;
}

.blog-card__media img {
  display: block;
  width: 100%;
  height: auto;
}

.blog-card__meta,
.blog-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
  color: var(--blog-text-muted);
  font-size: 14px;
}

.blog-card h2,
.blog-card h3 {
  margin: 0;
  color: var(--blog-text);
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.25;
}

.blog-card p {
  margin: 14px 0 0;
  color: var(--blog-text-soft);
  font-size: 16px;
  line-height: 1.65;
}

.blog-card__link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 22px;
  padding: 10px 2px;
  color: var(--blog-blue-light);
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
}

.blog-card__link::after {
  margin-left: 8px;
  content: "→";
}

.blog-card__link:hover,
.blog-card__link:focus-visible {
  text-decoration: underline;
}

.blog-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.blog-topic {
  padding: 20px;
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  background: var(--blog-panel-soft);
}

.blog-topic h3 {
  margin: 0;
  color: var(--blog-text);
  font-size: 19px;
}

.blog-topic p {
  margin: 9px 0 0;
  color: var(--blog-text-soft);
  font-size: 15px;
  line-height: 1.6;
}

.blog-article {
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 28px;
  background: rgba(7, 16, 31, 0.94);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

.blog-article__header {
  padding: clamp(28px, 5vw, 58px);
  border-bottom: 1px solid var(--blog-border);
  background: linear-gradient(135deg, rgba(18, 42, 78, 0.94), rgba(7, 17, 33, 0.95));
}

.blog-article__header h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.blog-article__meta {
  margin: 16px 0 0;
}

.blog-article__body {
  width: min(820px, calc(100% - 44px));
  margin: 0 auto;
  padding: 42px 0 54px;
}

.blog-article__body h2 {
  margin-top: 42px;
}

.blog-article__body h3 {
  margin: 28px 0 0;
  color: var(--blog-text);
  font-size: 22px;
  line-height: 1.3;
}

.blog-article__body p,
.blog-article__body li,
.blog-article__body td,
.blog-article__body th,
.blog-article__body figcaption {
  color: var(--blog-text-soft);
  font-size: 17px;
  line-height: 1.72;
}

.blog-article__body p {
  margin: 16px 0 0;
}

.blog-article__body ul,
.blog-article__body ol {
  margin: 16px 0 0;
  padding-left: 24px;
}

.blog-article__body li + li {
  margin-top: 8px;
}

.blog-article__body a {
  color: var(--blog-blue-light);
}

.blog-article__body strong {
  color: var(--blog-text);
}

.blog-note {
  margin: 24px 0 0;
  padding: 20px 22px;
  border: 1px solid var(--blog-border-strong);
  border-left: 4px solid var(--blog-blue-light);
  border-radius: var(--blog-radius-small);
  background: rgba(17, 38, 68, 0.84);
}

.blog-note p:first-child {
  margin-top: 0;
}

.blog-figure {
  overflow: hidden;
  margin: 28px 0 0;
  border: 1px solid var(--blog-border);
  border-radius: 18px;
  background: #07101e;
}

.blog-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.blog-figure__link {
  display: block;
  cursor: zoom-in;
}

.blog-figure__link:focus-visible {
  outline: 3px solid rgba(144, 205, 255, 0.72);
  outline-offset: -3px;
}

.blog-figure--narrow {
  max-width: 520px;
  margin-right: auto;
  margin-left: auto;
}

.blog-figure figcaption {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--blog-border);
  font-size: 14px;
}

.blog-figure__open {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 760;
}

body.blog-lightbox-open {
  overflow: hidden;
}

.blog-lightbox[hidden] {
  display: none;
}

.blog-lightbox {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  width: 100%;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  padding:
    max(14px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  color: #f8fbff;
  background: rgba(2, 6, 15, 0.92);
  backdrop-filter: blur(8px);
}

.blog-lightbox__toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.blog-lightbox__title {
  overflow: hidden;
  margin: 0;
  color: #f8fbff;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-lightbox__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.blog-lightbox__original,
.blog-lightbox__close {
  min-height: 44px;
  border: 1px solid rgba(121, 181, 255, 0.45);
  border-radius: 10px;
  color: #f8fbff;
  background: rgba(9, 20, 38, 0.94);
}

.blog-lightbox__original {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.blog-lightbox__close {
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  font: inherit;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.blog-lightbox__original:hover,
.blog-lightbox__close:hover {
  border-color: rgba(144, 205, 255, 0.85);
  background: rgba(24, 62, 111, 0.96);
}

.blog-lightbox__original:focus-visible,
.blog-lightbox__close:focus-visible {
  outline: 3px solid rgba(144, 205, 255, 0.78);
  outline-offset: 3px;
}

.blog-lightbox__stage {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  cursor: zoom-out;
}

.blog-lightbox__image {
  box-sizing: border-box;
  display: block;
  width: auto;
  max-width: min(96vw, 1920px);
  height: auto;
  max-height: calc(100dvh - 154px);
  border: 1px solid rgba(121, 181, 255, 0.34);
  border-radius: 10px;
  background: rgba(6, 14, 28, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.54);
  cursor: default;
  touch-action: pinch-zoom;
}

.blog-lightbox__caption {
  overflow: hidden;
  max-width: min(100%, 1180px);
  margin: 0 auto;
  color: #c7d7ec;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .blog-lightbox {
    gap: 8px;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .blog-lightbox__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .blog-lightbox__toolbar {
    justify-content: flex-end;
  }

  .blog-lightbox__original {
    padding: 0 12px;
    font-size: 12px;
  }

  .blog-lightbox__image {
    max-width: 100%;
    max-height: calc(100dvh - 132px);
    border-radius: 8px;
  }

  .blog-lightbox__caption {
    display: -webkit-box;
    max-height: 42px;
    overflow: hidden;
    font-size: 12px;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

.blog-table-hint {
  display: none;
}

.blog-table-wrap {
  overflow-x: auto;
  margin-top: 22px;
  border: 1px solid var(--blog-border);
  border-radius: 16px;
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: var(--blog-panel-soft);
}

.blog-table th,
.blog-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--blog-border);
  text-align: left;
  vertical-align: top;
}

.blog-table th {
  color: var(--blog-text);
  font-size: 14px;
}

.blog-table tr:last-child td {
  border-bottom: 0;
}

.blog-cta {
  margin-top: 42px;
  padding: 28px;
  border: 1px solid var(--blog-border-strong);
  border-radius: var(--blog-radius);
  background: linear-gradient(135deg, rgba(26, 68, 130, 0.74), rgba(10, 25, 47, 0.9));
}

.blog-cta h2 {
  margin-top: 0;
}

.blog-cta p {
  max-width: 720px;
}

.blog-cta .blog-actions {
  gap: 14px;
}

.blog-cta .blog-button {
  min-width: 172px;
  min-height: 48px;
  padding: 12px 22px;
  border-color: #5e94cc;
  background: #173f70;
  box-shadow: 0 7px 18px rgba(2, 10, 24, 0.22);
  color: #f7fbff;
  font-size: 15px;
  font-weight: 750;
}

.blog-cta .blog-button--primary {
  border-color: #72bdff;
  background: linear-gradient(180deg, #3b98ff, #176bdc);
  box-shadow: 0 9px 22px rgba(13, 91, 201, 0.34);
}

.blog-cta .blog-button:not(.blog-button--primary):hover,
.blog-cta .blog-button:not(.blog-button--primary):focus-visible {
  border-color: #8bc5ff;
  background: #20558f;
}

.blog-cta .blog-button:focus-visible {
  outline: 3px solid rgba(144, 205, 255, 0.48);
  outline-offset: 3px;
}

.blog-related {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  background: var(--blog-panel);
}

.blog-related h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 25px;
}

.blog-related ul {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.blog-related__grid a {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 7px;
  padding: 16px 18px;
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  background: var(--blog-panel-soft);
  color: var(--blog-text);
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.blog-related__grid a:hover {
  border-color: var(--blog-border-strong);
  transform: translateY(-1px);
}

.blog-related__grid a:focus-visible {
  border-color: var(--blog-border-strong);
  outline: 3px solid rgba(96, 165, 250, 0.45);
  outline-offset: 3px;
}

.blog-related__grid strong {
  color: var(--blog-text);
  font-size: 16px;
  line-height: 1.35;
}

.blog-related__grid span {
  color: var(--blog-text-soft);
  font-size: 14px;
  line-height: 1.55;
}

html[data-theme="light"] body.page-blog {
  --blog-bg: #eef4fb;
  --blog-panel: rgba(255, 255, 255, 0.96);
  --blog-panel-soft: #f7faff;
  --blog-border: rgba(37, 99, 235, 0.17);
  --blog-border-strong: rgba(37, 99, 235, 0.36);
  --blog-text: #102033;
  --blog-text-soft: #475569;
  --blog-text-muted: #64748b;
  --blog-blue-light: #0f55ad;
  background:
    radial-gradient(circle at 12% 4%, rgba(46, 121, 239, 0.12), transparent 26rem),
    linear-gradient(180deg, #f8fbff 0%, var(--blog-bg) 100%);
}

html[data-theme="light"] .blog-hero,
html[data-theme="light"] .blog-article__header {
  background: linear-gradient(135deg, #ffffff, #edf5ff);
}

html[data-theme="light"] .blog-article {
  background: rgba(255, 255, 255, 0.98);
}

html[data-theme="light"] .blog-note,
html[data-theme="light"] .blog-cta {
  background: #edf5ff;
}

html[data-theme="light"] .blog-hero__actions .blog-button:not(.blog-button--primary) {
  border-color: #75a8d9;
  background: #fff;
  box-shadow: 0 7px 18px rgba(24, 75, 126, 0.12);
  color: #0d3763;
}

html[data-theme="light"] .blog-hero__actions .blog-button:not(.blog-button--primary):hover,
html[data-theme="light"] .blog-hero__actions .blog-button:not(.blog-button--primary):focus-visible {
  border-color: #287ccd;
  background: #e0efff;
}

html[data-theme="light"] .blog-cta .blog-button:not(.blog-button--primary) {
  border-color: #75a8d9;
  background: #fff;
  box-shadow: 0 7px 18px rgba(24, 75, 126, 0.12);
  color: #0d3763;
}

html[data-theme="light"] .blog-cta .blog-button:not(.blog-button--primary):hover,
html[data-theme="light"] .blog-cta .blog-button:not(.blog-button--primary):focus-visible {
  border-color: #287ccd;
  background: #e0efff;
}

html[data-theme="light"] .blog-card__media,
html[data-theme="light"] .blog-figure {
  background: #eef4fb;
}

@media (max-width: 850px) {
  .blog-card--featured {
    grid-template-columns: 1fr;
  }

  .blog-topic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .blog-main,
  .blog-main--article {
    width: min(100% - 24px, 1100px);
    padding: 22px 0 48px;
  }

  .blog-hero,
  .blog-article__header {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .blog-hero h1,
  .blog-article__header h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  .blog-card-grid {
    grid-template-columns: 1fr;
  }

  .blog-card--featured {
    grid-column: auto;
  }

  .blog-card {
    padding: 20px;
  }

  .blog-article {
    border-radius: 20px;
  }

  .blog-article__body {
    width: min(100% - 36px, 820px);
    padding: 30px 0 40px;
  }

  .blog-article__body p,
  .blog-article__body li,
  .blog-article__body td,
  .blog-article__body th {
    font-size: 16px;
  }

  .blog-table-hint {
    display: block;
    margin-top: 14px;
    color: var(--blog-text-muted);
    font-size: 14px;
    line-height: 1.5;
  }

  .blog-table-hint + .blog-table-wrap {
    margin-top: 10px;
  }

  .blog-button {
    width: 100%;
  }

  .blog-related {
    padding: 20px;
  }

  .blog-related__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
