/*
 * The one stylesheet for article bodies. The sanitizer keeps no inline styles, so
 * everything an article looks like is decided here, and a change here restyles every
 * post. Loaded on the article and preview pages, and inside the admin editor (TinyMCE
 * content_css), where the body carries the same .ot-blog-body class.
 *
 * ongtho.css loads first and styles the landing page's own .ot-price-table, .ot-note and
 * button classes, so rules here that reuse those names reset what would break an article.
 */

.ot-blog-body h2 { font-size: 26px; margin: 30px 0 10px; }
.ot-blog-body h3 { font-size: 21px; margin: 24px 0 8px; }
.ot-blog-body p { margin-bottom: 15px; }
.ot-blog-body ul, .ot-blog-body ol { margin: 0 0 15px 20px; }
.ot-blog-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 14px 0; }
/* A link inside the article has to be visibly a link: the underline carries it for a
   reader who cannot tell the colour apart, and the colour reinforces it. */
.ot-blog-body a { color: var(--ot-blue); text-decoration: underline; }
.ot-blog-body a:hover { color: var(--ot-blue-d); }
/* Block buttons are buttons, not body links. */
.ot-blog-body a.ot-btn { text-decoration: none; }
.ot-blog-body a.ot-btn-primary, .ot-blog-body a.ot-btn-primary:hover { color: #fff; }
.ot-blog-body a.ot-btn-ghost { color: var(--ot-ink); }
.ot-blog-body a.ot-btn-ghost:hover { color: var(--ot-blue); }

/* The caption the editor writes under an image: centred, italic, grey. */
.ot-blog-body figure { margin: 18px 0; }
.ot-blog-body figure img { margin: 0; }
.ot-blog-body figcaption {
  text-align: center;
  font-style: italic;
  color: var(--ot-muted);
  font-size: 14.5px;
  margin-top: 8px;
}
.ot-blog-body figure.align-left { float: left; margin: 6px 18px 12px 0; max-width: 50%; }
.ot-blog-body figure.align-right { float: right; margin: 6px 0 12px 18px; max-width: 50%; }
/* display:table shrink-wraps the figure to the picture, which is what makes the auto
   margins centre it. A block figure already spans the column, so they did nothing. */
.ot-blog-body figure.align-center {
  display: table;
  margin-left: auto;
  margin-right: auto;
}

/* An image with no caption is aligned with a class on the img itself. */
.ot-blog-body img.ot-align-left { float: left; margin: 6px 18px 12px 0; max-width: 50%; }
.ot-blog-body img.ot-align-right { float: right; margin: 6px 0 12px 18px; max-width: 50%; }
.ot-blog-body img.ot-align-center { display: block; margin-left: auto; margin-right: auto; }

.ot-blog-body .ot-text-left { text-align: left; }
.ot-blog-body .ot-text-center { text-align: center; }
.ot-blog-body .ot-text-right { text-align: right; }

/* An uncleared float from the last figure would push into the FAQ and related blocks. */
.ot-blog-body::after { content: ''; display: table; clear: both; }
/* clear: full-width boxes start below a floated image; paragraphs still wrap around it. */
.ot-blog-body table { width: 100%; border-collapse: collapse; margin: 16px 0; clear: both; }
.ot-blog-body th, .ot-blog-body td { border: 1px solid var(--ot-line); padding: 9px 11px; text-align: left; }
.ot-blog-body blockquote { border-left: 3px solid var(--ot-blue); padding-left: 14px; margin: 16px 0; color: var(--ot-ink-soft); }
/* Anchored headings must clear the sticky header. */
.ot-blog-body h2[id], .ot-blog-body h3[id] { scroll-margin-top: 90px; }

/* ---- price tables ---- */
.ot-blog-body table.ot-price-table th { background: var(--ot-bg2); font-weight: 700; }
.ot-blog-body table.ot-price-table td:last-child,
.ot-blog-body table.ot-price-table th:last-child { white-space: nowrap; }
/* The landing page makes the first price cell a flex box, which pulls it out of the table. */
.ot-blog-body table.ot-price-table td:first-child { display: table-cell; }
/* The landing .ot-note is a flex row with an icon; here it is a plain paragraph. */
.ot-blog-body .ot-note { display: block; margin: 0 0 15px; font-size: 15px; color: var(--ot-muted); }

/* ---- blocks ---- */
.ot-blog-body .ot-block { margin: 24px 0; clear: both; }
.ot-blog-body .ot-block__title { font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.ot-blog-body .ot-block__text { color: var(--ot-muted); margin: 0 0 14px; }
.ot-blog-body .ot-block__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ot-blog-body .ot-block--app-cta,
.ot-blog-body .ot-block--contact { background: var(--ot-bg2); border-radius: 14px; padding: 18px 20px; }
.ot-blog-body .ot-block--disclaimer { font-size: 14.5px; color: var(--ot-muted); font-style: italic; }
.ot-blog-body .ot-block--sources h2 { font-size: 20px; }
.ot-blog-body .ot-block--sources ol { font-size: 14.5px; }

.ot-blog-body .ot-callout { border-left: 4px solid; border-radius: 12px; padding: 14px 16px; margin: 18px 0; clear: both; }
.ot-blog-body .ot-callout--tip { background: #eef6ff; border-color: var(--ot-blue); }
.ot-blog-body .ot-callout--warning { background: #fff4d6; border-color: #e0a100; }
.ot-blog-body .ot-callout > :last-child { margin-bottom: 0; }
.ot-blog-body .ot-callout a { color: var(--ot-blue-d); }

.ot-blog-body .ot-block--steps > ol { counter-reset: ot-step; list-style: none; margin: 0 0 15px; padding: 0; }
.ot-blog-body .ot-block--steps > ol > li { counter-increment: ot-step; position: relative; padding-left: 40px; margin-bottom: 12px; }
.ot-blog-body .ot-block--steps > ol > li::before {
  content: counter(ot-step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ot-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}

@media (max-width: 991.98px) {
  #blog-article-grid { grid-template-columns: 1fr !important; }
  #blog-toc { position: static !important; }
  .ot-blog-grid { grid-template-columns: 1fr !important; }
  /* Half a phone screen is not a picture. Text wrapping around one is worse. */
  .ot-blog-body figure.align-left,
  .ot-blog-body figure.align-right { float: none; max-width: 100%; margin: 18px 0; }
  .ot-blog-body img.ot-align-left,
  .ot-blog-body img.ot-align-right { float: none; max-width: 100%; margin: 14px 0; }
}

/* A wide table scrolls inside its own box so the page never scrolls sideways. */
@media (max-width: 575.98px) {
  .ot-blog-body table { display: block; overflow-x: auto; }
  .ot-blog-body table.ot-price-table td:last-child,
  .ot-blog-body table.ot-price-table th:last-child { white-space: normal; }
}
