/**
 * SAT blog article body (#blog-content) only — linked from sat/blog-single.
 * Does not load on NEET/JEE/AP/IB blog singles.
 *
 * 1) WP rewrite wraps text in <span style="font-size:16px">, flattening headings.
 * 2) WP paste sometimes opens an empty <h3> then dumps .table-responsive inside it,
 *    so tables inherit heading word-break (mid-word wraps like "Sectio/n").
 * 3) Theme html { font-size:10px } collapses Bootstrap rem .btn-lg.
 */

/* Let wide images / cards breathe; theme wrapper clips with overflow:hidden */
.rbt-blog-details-area .rbt-article-content-wrapper {
  overflow: visible;
}

.rbt-blog-details-area .post-thumbnail figcaption {
  display: none; /* title already shown as page H1; graphic often includes it */
}

#blog-content {
  color: #111827;
  font-size: 18px;
  line-height: 1.67;
}

#blog-content p {
  font-size: 18px;
  line-height: 1.67;
  margin-bottom: 1.25em;
}

/* Undo WP span font locks in prose/lists only — not tables (handled below) */
#blog-content p span[style*="font-size"],
#blog-content li span[style*="font-size"] {
  font-size: inherit !important;
}

#blog-content h2,
#blog-content h2.wp-block-heading {
  font-size: 28px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  margin: 1.4em 0 0.65em !important;
  color: #1e1b4b;
}

#blog-content h3,
#blog-content h3.wp-block-heading {
  font-size: 22px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  margin: 1.25em 0 0.55em !important;
  color: #1e1b4b;
}

#blog-content h4,
#blog-content h4.wp-block-heading {
  font-size: 20px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
  margin: 1.1em 0 0.5em !important;
}

#blog-content h2 > span[style*="font-size"],
#blog-content h3 > span[style*="font-size"],
#blog-content h4 > span[style*="font-size"],
#blog-content h2 > span,
#blog-content h3 > span,
#blog-content h4 > span {
  font-size: inherit !important;
  line-height: inherit !important;
}

#blog-content img {
  max-width: 100%;
  height: auto;
}

#blog-content figure {
  max-width: 100%;
  margin: 1.25em 0;
}

#blog-content figure.wp-block-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Restore readable CTA buttons (html root is 10px → rem .btn-lg collapses) */
#blog-content a.btn,
#blog-content a.btn.btn-lg,
#blog-content a.btn.btn-primary,
#blog-content p a.btn,
#blog-content p a.btn.btn-lg {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  padding: 15px 24px !important;
  min-height: 52px !important;
  border-radius: 8px !important;
  text-decoration: none;
}

#blog-content ul,
#blog-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.35em;
}

#blog-content li {
  margin-bottom: 0.4em;
  font-size: 18px;
  line-height: 1.6;
}

/*
 * Tables — including those wrongly nested under h2/h3 by WP paste.
 * Theme headings use word-break:break-word; that must not apply inside cells.
 */
#blog-content .table-responsive,
#blog-content .wp-block-table,
#blog-content h2 .table-responsive,
#blog-content h3 .table-responsive,
#blog-content h4 .table-responsive {
  display: block !important;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25em 0;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

#blog-content table,
#blog-content h2 table,
#blog-content h3 table,
#blog-content h4 table,
#blog-content .table-responsive table,
#blog-content .wp-block-table table {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  table-layout: auto !important;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: 15px !important;
  font-weight: 400 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  line-height: 1.45 !important;
  color: #111827 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  height: auto !important;
}

#blog-content table th,
#blog-content table td,
#blog-content h2 table th,
#blog-content h2 table td,
#blog-content h3 table th,
#blog-content h3 table td,
#blog-content h4 table th,
#blog-content h4 table td {
  word-break: normal !important;
  overflow-wrap: break-word !important; /* wrap at spaces only when possible */
  white-space: normal !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  padding: 10px 12px !important;
  vertical-align: top;
  height: auto !important;
  color: #111827 !important;
}

#blog-content table th,
#blog-content table tr:first-child td {
  font-weight: 700 !important;
}

/* Section labels (first column) stay readable; still wrap if needed on narrow screens */
#blog-content table td:first-child {
  font-weight: 700 !important;
  white-space: nowrap !important;
  width: 1%;
}

#blog-content table th span,
#blog-content table td span,
#blog-content h3 table th span,
#blog-content h3 table td span {
  font-size: inherit !important;
  font-weight: inherit !important;
  word-break: normal !important;
  overflow-wrap: inherit !important;
}

#blog-content table[style*="height"],
#blog-content table tr[style*="height"],
#blog-content table td[style*="height"],
#blog-content table th[style*="height"] {
  height: auto !important;
}

@media only screen and (max-width: 767px) {
  #blog-content,
  #blog-content p,
  #blog-content li {
    font-size: 16px;
  }

  #blog-content h2,
  #blog-content h2.wp-block-heading {
    font-size: 24px !important;
  }

  #blog-content h3,
  #blog-content h3.wp-block-heading {
    font-size: 20px !important;
  }

  #blog-content a.btn,
  #blog-content a.btn.btn-lg,
  #blog-content p a.btn {
    width: 100%;
    max-width: 100%;
  }

  #blog-content table th,
  #blog-content table tr:first-child td,
  #blog-content table td:first-child {
    white-space: normal !important; /* allow wrap on small screens once scroll exists */
  }
}
