/**
 * Single post — editorial readability (Gutenberg + classic markup).
 * Fixes white-on-white from global * { color: var(--white) } and tight line-height.
 * Scoped to blog single only.
 */

/* -------------------------------------------------------------------------
   Base column: comfortable measure (Forbes / NYT–style reading width)
   ------------------------------------------------------------------------- */
body.single-post .blog_item_blck .article_content,
body.single-post .blog_item_blck .article_content.wp-block-post-content {
  max-width: 42rem; /* ~672px — optimal line length */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  /* Тот же шрифт бренда, что и на сайте (Montserrat-Medium из style.css @font-face) */
  font-family: Montserrat-Medium, Montserrat, sans-serif;
  font-size: clamp(17px, 1.05rem + 0.35vw, 20px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: #1a1a1a !important;
  -webkit-font-smoothing: antialiased;
}

/* Таблицы в контенте — тот же Montserrat */
body.single-post .blog_item_blck .article_content .has-fixed-layout {
  font-family: Montserrat-Medium, Montserrat, sans-serif;
}

/* Every text node & block: dark on light (overrides theme * and WP preset white) */
body.single-post .blog_item_blck .article_content :where(
  p, li, span, div, td, th, figcaption, dt, dd, small, label
) {
  color: #1a1a1a !important;
}

body.single-post .blog_item_blck .article_content :where(strong, b) {
  color: #0d0d0d !important;
  font-weight: 700;
}

body.single-post .blog_item_blck .article_content :where(em, i) {
  color: #252525 !important;
}

/* Paragraph rhythm (direct + nested Gutenberg wrappers) */
body.single-post .blog_item_blck .article_content .wp-block-paragraph,
body.single-post .blog_item_blck .article_content > :where(p) {
  margin-top: 0;
  margin-bottom: 1.35em;
  line-height: 1.78;
  font-weight: 400;
}

body.single-post .blog_item_blck .article_content .wp-block-paragraph:last-child,
body.single-post .blog_item_blck .article_content > p:last-child {
  margin-bottom: 0;
}

/* Headings inside post */
body.single-post .blog_item_blck .article_content :where(h2, .wp-block-heading h2) {
  font-family: Montserrat-Bold, Montserrat-Medium, Montserrat, sans-serif;
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.85rem);
  line-height: 1.25;
  font-weight: 700;
  color: #111 !important;
  margin: 2.25em 0 0.75em;
  letter-spacing: -0.02em;
}

body.single-post .blog_item_blck .article_content :where(h3, .wp-block-heading h3) {
  font-family: Montserrat-Bold, Montserrat-Medium, Montserrat, sans-serif;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.3;
  font-weight: 700;
  color: #141414 !important;
  margin: 2em 0 0.65em;
}

body.single-post .blog_item_blck .article_content :where(h4, h5, h6, .wp-block-heading h4, .wp-block-heading h5, .wp-block-heading h6) {
  font-family: Montserrat-Bold, Montserrat-Medium, Montserrat, sans-serif;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.15rem);
  line-height: 1.35;
  font-weight: 700;
  color: #1a1a1a !important;
  margin: 1.75em 0 0.5em;
}

/* First heading after intro — less top gap */
body.single-post .blog_item_blck .article_content > :where(h2, h3, .wp-block-heading):first-child {
  margin-top: 0;
}

/* Lists */
body.single-post .blog_item_blck .article_content :where(ul, ol) {
  margin: 1.25em 0 1.5em;
  padding-left: 1.35em;
  color: #1a1a1a !important;
}

body.single-post .blog_item_blck .article_content :where(ul) {
  list-style: disc;
}

body.single-post .blog_item_blck .article_content :where(ol) {
  list-style: decimal;
}

body.single-post .blog_item_blck .article_content li {
  margin: 0.5em 0;
  line-height: 1.75;
  font-weight: 400;
  color: #1a1a1a !important;
}

body.single-post .blog_item_blck .article_content li::marker {
  color: #444;
}

/* Block group / columns — visible boundaries when editor adds bg */
body.single-post .blog_item_blck .article_content .wp-block-group {
  margin: 1.75em 0;
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  color: #1a1a1a !important;
}

body.single-post .blog_item_blck .article_content .wp-block-group:not(.has-background) {
  background: #f7f7f8;
  border: 1px solid #e8e8ea;
}

/* If group already has a light preset background, keep text dark */
body.single-post .blog_item_blck .article_content .wp-block-group.has-background,
body.single-post .blog_item_blck .article_content .wp-block-columns.has-background,
body.single-post .blog_item_blck .article_content .wp-block-column.has-background {
  color: #1a1a1a !important;
}

body.single-post .blog_item_blck .article_content .wp-block-group.has-background *,
body.single-post .blog_item_blck .article_content .wp-block-columns.has-background *,
body.single-post .blog_item_blck .article_content .wp-block-column.has-background * {
  color: #1a1a1a !important;
}

body.single-post .blog_item_blck .article_content .wp-block-columns {
  margin: 1.75em 0;
  gap: 1.25rem;
}

body.single-post .blog_item_blck .article_content .wp-block-column {
  min-width: 0;
  color: #1a1a1a !important;
}

/* Images & captions */
body.single-post .blog_item_blck .article_content .wp-block-image,
body.single-post .blog_item_blck .article_content figure {
  margin: 2em auto;
}

body.single-post .blog_item_blck .article_content figcaption {
  margin-top: 0.65em;
  font-size: 0.9em;
  line-height: 1.5;
  color: #5a5a5a !important;
  text-align: center;
  font-family: Montserrat-Medium, Montserrat, sans-serif;
}

/* Quotes */
body.single-post .blog_item_blck .article_content blockquote,
body.single-post .blog_item_blck .article_content .wp-block-quote {
  margin: 1.75em 0;
  padding: 1rem 1.25rem 1rem 1.35rem;
  border-left: 4px solid var(--pink, #e91e8c);
  background: #fafafa;
  color: #222 !important;
  font-size: 1.05em;
  line-height: 1.7;
}

body.single-post .blog_item_blck .article_content blockquote cite {
  display: block;
  margin-top: 0.75em;
  font-size: 0.85em;
  font-style: normal;
  color: #666 !important;
}

/* Separator */
body.single-post .blog_item_blck .article_content hr,
body.single-post .blog_item_blck .article_content .wp-block-separator {
  margin: 2.5em auto;
  border: none;
  border-top: 1px solid #ddd;
  max-width: 12rem;
}

/* Code / pre */
body.single-post .blog_item_blck .article_content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  background: #f0f0f2;
  color: #1a1a1a !important;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

body.single-post .blog_item_blck .article_content pre,
body.single-post .blog_item_blck .article_content .wp-block-code {
  margin: 1.5em 0;
  padding: 1.15rem 1.25rem;
  background: #1e1e1e;
  color: #f5f5f5 !important;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.6;
}

body.single-post .blog_item_blck .article_content pre code,
body.single-post .blog_item_blck .article_content .wp-block-code code {
  background: transparent;
  color: inherit !important;
  padding: 0;
}

/* Tables (existing .has-fixed-layout + generic) */
body.single-post .blog_item_blck .article_content table {
  font-size: 0.95em;
  color: #333 !important;
}

/* Links: keep theme pink, underline on hover */
body.single-post .blog_item_blck .article_content a {
  color: var(--pink) !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.single-post .blog_item_blck .article_content a:hover {
  opacity: 0.85;
}

/* WP “has white color” on default light canvas — force readable */
body.single-post .blog_item_blck .article_content .has-white-color:not(.has-black-background):not(.has-dark-background) {
  color: #1a1a1a !important;
}

/* Spacer block */
body.single-post .blog_item_blck .article_content .wp-block-spacer {
  margin: 0 !important;
}

/* Embeds / video */
body.single-post .blog_item_blck .article_content .wp-block-embed {
  margin: 2em 0;
}

/* Pullquote */
body.single-post .blog_item_blck .article_content .wp-block-pullquote {
  border-top: 3px solid #111;
  border-bottom: 3px solid #111;
  padding: 1.5em 1em;
  margin: 2em 0;
  color: #111 !important;
}

body.single-post .blog_item_blck .article_content .wp-block-pullquote p {
  font-size: 1.2em;
  line-height: 1.55;
  color: #111 !important;
}

/* -------------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------------- */
@media screen and (max-width: 600px) {
  body.single-post .blog_item_blck .article_content,
  body.single-post .blog_item_blck .article_content.wp-block-post-content {
    max-width: 100%;
    font-size: 17px;
    line-height: 1.72;
  }

  body.single-post .blog_item_blck {
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 36px;
  }

  body.single-post .blogitem_general .article_title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    letter-spacing: -0.05em;
    margin-bottom: 28px;
  }

  body.single-post .blog_item_blck .article_content :where(ul, ol) {
    padding-left: 1.15em;
  }

  body.single-post .blog_item_blck .article_content .wp-block-columns {
    flex-direction: column !important;
  }
}
