/* Blog surface only. Compatibility overrides also cover earlier inline article styles. */
body.ms-blog-surface {
  --blog-text: #eef0f6;
  --blog-muted: #c8c8d2;
  --blog-link: #b9aeff;
  --blog-line: #414151;
  height: auto;
  min-height: 100vh;
}
html:has(body.ms-blog-surface) { scroll-snap-type: none; scroll-padding-top: 0; }
body.ms-blog-surface main :is(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--blog-link) !important;
  outline-offset: 4px;
}
.ms-blog-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 20px 48px; }
body.ms-blog-surface article.ms-blog-article {
  width: 100%; max-width: none !important; margin: 0 !important; padding: 0 !important;
}
.ms-blog-breadcrumbs { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-size: 14px; color: var(--blog-muted); }
.ms-blog-breadcrumbs a { display: inline-flex; align-items: center; min-height: 32px; }
body.ms-blog-surface .ms-article-header { position: static; height: auto; min-height: 0; margin: 0 0 24px; padding: 0; background: none; border: 0; }
body.ms-blog-surface .ms-article-title { max-width: 1100px; margin: 0; font-size: clamp(30px, 3.7vw, 44px); line-height: 1.16; font-weight: 600; color: var(--blog-text); text-wrap: balance; }
.ms-article-layout { display: block; }
.ms-blog-content { min-width: 0; max-width: 960px; color: var(--blog-muted); font-size: 18px; line-height: 1.6; overflow-wrap: break-word; }
body.ms-blog-surface .ms-blog-content .maybesmart-editorial { max-width: none !important; margin: 0 !important; line-height: inherit !important; }
body.ms-blog-surface .ms-blog-content :is(p, ul, ol) { margin-top: 0 !important; margin-bottom: 16px !important; }
body.ms-blog-surface .ms-blog-content :is(ul, ol) { padding-left: 24px; }
body.ms-blog-surface .ms-blog-content li { margin: 6px 0 !important; }
body.ms-blog-surface .ms-blog-content h2 { margin: 32px 0 14px !important; font-size: clamp(25px, 2.5vw, 30px) !important; line-height: 1.25 !important; color: var(--blog-text); scroll-margin-top: 140px !important; }
body.admin-bar.ms-blog-surface .ms-blog-content h2 { scroll-margin-top: 172px !important; }
body.ms-blog-surface .ms-blog-content h3 { margin: 24px 0 12px !important; font-size: 22px; line-height: 1.3 !important; color: var(--blog-text); }
body.ms-blog-surface .ms-blog-content a { color: var(--blog-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #7465aa; }
body.ms-blog-surface .ms-blog-content a:hover { text-decoration-color: currentColor; }
body.ms-blog-surface .ms-blog-content figure { margin: 24px 0 !important; }
body.ms-blog-surface .ms-blog-content img { max-width: 100%; height: auto; border-radius: 8px; }
/* Only the lead photo is cropped; diagrams and other images retain their dimensions. */
body.ms-blog-surface .maybesmart-editorial > figure:first-of-type img,
body.ms-blog-surface .ms-article-cover img,
body.ms-blog-surface .ms-blog-content > .article-image:first-of-type {
  width: 100%; max-height: 280px; object-fit: cover; object-position: center;
}
body.ms-blog-surface .ms-blog-content nav[aria-label="Содержание статьи"] { padding: 16px 20px !important; margin: 24px 0 !important; background: #22222f !important; border: 1px solid var(--blog-line) !important; border-radius: 8px; }
.ms-blog-content :is(.ms-blog-table-scroll, [role="region"], .wp-block-table) { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
body.ms-blog-surface .ms-blog-content table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
body.ms-blog-surface .ms-blog-content :is(th, td) { padding: 12px !important; text-align: left; vertical-align: top; border: 1px solid var(--blog-line) !important; }
body.ms-blog-surface .ms-blog-content th { color: var(--blog-text); background: #22222f !important; }
.ms-article-toc { min-width: 0; margin-bottom: 24px; }
.ms-article-toc details { border-block: 1px solid var(--blog-line); padding: 4px 0; }
.ms-article-toc summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; color: var(--blog-text); font-weight: 600; font-size: 16px; }
.ms-article-toc summary::-webkit-details-marker { display: none; }
.ms-article-toc summary::after { content: '+'; font-size: 23px; font-weight: 400; color: var(--blog-link); }
.ms-article-toc details[open] summary::after { content: '−'; }
.ms-article-toc ol { list-style: decimal-leading-zero; padding: 0 0 8px 28px; margin: 0; }
.ms-article-toc li { margin: 0; padding-left: 3px; color: #a9a7bc; font-size: 13px; }
.ms-article-toc a { display: block; min-height: 44px; padding: 10px 0; color: var(--blog-muted); font-size: 15px; line-height: 1.4; text-decoration: none; transition: color .15s ease; }
.ms-article-toc a:hover { color: var(--blog-link); text-decoration: underline; text-underline-offset: 3px; }
.ms-blog-back { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--blog-line); }
.ms-blog-back a { display: inline-flex; gap: 16px; align-items: center; min-height: 44px; color: var(--blog-link); }
.ms-adjacent-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--blog-line); }
.ms-adjacent-card { min-width: 0; display: flex; flex-direction: column; color: var(--blog-text); text-decoration: none; border: 1px solid var(--blog-line); border-radius: 8px; overflow: hidden; transition: border-color .15s ease; }
.ms-adjacent-card--next { grid-column: 2; }
.ms-adjacent-card:hover { color: var(--blog-text); border-color: var(--blog-link); }
.ms-adjacent-card__image { display: block; aspect-ratio: 16 / 9; background: #22222f; overflow: hidden; }
.ms-adjacent-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ms-adjacent-card__image--placeholder { display: flex; align-items: center; justify-content: center; }
.ms-adjacent-card__image--placeholder img { width: 50%; height: auto; object-fit: contain; }
.ms-adjacent-card__body { display: block; padding: 20px 24px 24px; }
.ms-adjacent-card__label { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--blog-link); font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.ms-adjacent-card__label svg { flex: none; }
.ms-adjacent-card--prev .ms-adjacent-card__label svg { transform: rotate(180deg); }
.ms-adjacent-card__title { display: block; font-size: clamp(20px, 2vw, 26px); line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.ms-adjacent-card:hover .ms-adjacent-card__title { text-decoration: underline; text-underline-offset: 4px; }
/* Listing, category and tag archives share the blog width. */
body.ms-blog-surface :is(.uni-wrap, .site-main.wrap) { max-width: 1240px; padding-left: 20px; padding-right: 20px; }
body.ms-blog-surface .uni-main { padding: 28px 0 48px; }
body.ms-blog-surface .ms-blog { padding-top: 8px; }
body.ms-blog-surface .ms-blog-card__date { color: #b6b3c7; }
body.ms-blog-surface .ms-blog-fbtn { min-height: 44px; }
body.ms-blog-surface .site-main.wrap { padding-top: 28px; padding-bottom: 48px; }
body.ms-blog-surface .site-main .entry-header { height: auto; min-height: 0; padding: 0; margin-bottom: 20px; }
body.ms-blog-surface .site-main > article + article { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--blog-line); }
/* Header and footer inherit the shared theme styles. */
@media (min-width: 1100px) {
  .ms-article-layout.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 240px; column-gap: 40px; align-items: start; }
  .ms-article-layout.has-toc > .ms-blog-content { grid-row: 1; grid-column: 1; }
  .ms-article-toc { grid-row: 1; grid-column: 2; position: sticky; top: 123px; max-height: calc(100vh - 147px); overflow-y: auto; margin: 0; }
  .admin-bar .ms-article-toc { top: 155px; max-height: calc(100vh - 179px); }
}
@media (max-width: 1099px) {
  .ms-blog-content { max-width: none; }
}
@media (max-width: 767px) {
  .ms-adjacent-posts { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 32px; padding-top: 24px; }
  .ms-adjacent-card--next { grid-column: auto; }
  .ms-adjacent-card__body { padding: 16px 20px 20px; }
  .ms-blog-main { padding-top: 20px; padding-bottom: 32px; }
  .ms-blog-breadcrumbs { margin-bottom: 12px; }
  body.ms-blog-surface .ms-article-header { margin-bottom: 20px; }
  .ms-blog-content { font-size: 17px; line-height: 1.6; }
  body.ms-blog-surface .ms-blog-content h2 { margin-top: 28px !important; }
  body.ms-blog-surface .maybesmart-editorial > figure:first-of-type img { max-height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(body.ms-blog-surface) { scroll-behavior: auto; }
  body.ms-blog-surface main :is(a, button, summary) { transition: none !important; }
  body.ms-blog-surface .ms-blog-card:hover { transform: none; }
}

/* Keep the shared header even while an older site-style.css is cached. */
body.ms-blog-surface .ms-site-header {
  position: sticky;
  background: linear-gradient(180deg, rgba(10,11,15,.85), rgba(10,11,15,.62));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Article hero and contextual product, 2026-10-23. No category badges in hero. */
body.ms-blog-surface .ms-blog-main--hero { max-width:none; padding:0; }
body.ms-blog-surface header.ms-article-hero {
  position:relative; isolation:isolate; display:flex; align-items:stretch;
  width:100%; height:auto; min-height:440px; margin:0; padding:0;
  background:#181822; border:0; overflow:hidden;
}
.ms-article-hero__image { position:absolute; inset:0; z-index:-2; width:100%; height:100%; object-fit:cover; object-position:center 48%; }
.ms-article-hero::before { content:''; position:absolute; inset:0; z-index:-1; background:linear-gradient(90deg,rgba(15,16,25,.86),rgba(15,16,25,.66)); }
.ms-article-hero__inner { position:relative; display:flex; flex-direction:column; justify-content:center; width:100%; max-width:1240px; margin:0 auto; padding:56px 20px 64px; }
body.ms-blog-surface .ms-article-hero .ms-blog-breadcrumbs { flex-wrap:wrap; margin:0 0 32px; color:#eef0f6; }
.ms-article-hero .ms-blog-breadcrumbs a { color:inherit; text-underline-offset:4px; }
body.ms-blog-surface .ms-article-hero .ms-article-title { max-width:970px; font-size:clamp(32px,4.3vw,62px); line-height:1.1; text-wrap:balance; color:#f5f5fa; }
.ms-article-hero__credit { position:absolute; bottom:18px; right:20px; font-size:12px; color:#eef0f6; }
.ms-article-body { max-width:1240px; margin:0 auto; padding:40px 20px 48px; }
body.ms-blog-surface .ms-blog-content .ms-product-inline { display:flow-root; margin:24px 0; }
body.ms-blog-surface .ms-blog-content .ms-product-photo { float:right; width:240px; max-width:40%; margin:0 0 16px 28px!important; }
.ms-product-photo > a { display:block; background:#f3f5f7; border-radius:8px; }
body.ms-blog-surface .ms-blog-content .ms-product-photo img { display:block; width:100%; height:auto; max-height:none; object-fit:contain; }
.ms-product-photo figcaption { margin-top:8px; font-size:13px; line-height:1.45; }
@media(max-width:600px) {
  body.ms-blog-surface header.ms-article-hero { min-height:360px; }
  .ms-article-hero__inner { padding:36px 20px 52px; }
  body.ms-blog-surface .ms-article-hero .ms-blog-breadcrumbs { margin-bottom:24px; }
  .ms-article-body { padding-top:28px; }
  body.ms-blog-surface .ms-blog-content .ms-product-photo { float:none; width:180px; max-width:100%; margin:0 auto 20px!important; }
}
