/* ---------------------------------------------------------------------------
   blog-article.css -- presentation for long-form blog posts.

   Mezzanine sanitises rich text with bleach (RICHTEXT_FILTER_LEVEL = high), which
   strips <svg>, and keeps only a short whitelist of inline styles. So every visual
   element an article needs has to be reachable through a class name on a whitelisted
   tag. That is what this file provides: post bodies stay plain semantic HTML and
   survive a round-trip through the admin editor untouched.

   Scoped to .rs-blog-details .bs-desc so nothing here leaks into the rest of the site.
   Palette follows the site: #607d8b brand, #21aa50 green, #212121 ink, #666 body.
--------------------------------------------------------------------------- */

/* --- body text ---------------------------------------------------------- */

/* No max-width: fill the post column, like posts without the wrapper do. */
.rs-blog-details .bs-desc .qw-article {
  font-size: 16px;
  line-height: 1.75;
  color: #4a4a4a;
}

.rs-blog-details .bs-desc .qw-article p {
  margin: 0 0 22px;
}

/* The site stylesheet has a typo -- ".bs-desch2" -- so h2 in a post body is
   unstyled. Restore a real heading scale here. */
.rs-blog-details .bs-desc .qw-article h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: #212121;
  margin: 54px 0 6px;
  padding-top: 26px;
  border-top: 1px solid #ececec;
}

.rs-blog-details .bs-desc .qw-article h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.rs-blog-details .bs-desc .qw-article h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  color: #212121;
  margin: 34px 0 10px;
}

.rs-blog-details .bs-desc .qw-article h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #212121;
  margin: 26px 0 8px;
}

.rs-blog-details .bs-desc .qw-article ul,
.rs-blog-details .bs-desc .qw-article ol {
  padding-left: 24px;
  margin: 0 0 22px;
}

.rs-blog-details .bs-desc .qw-article li {
  margin-bottom: 9px;
}

.rs-blog-details .bs-desc .qw-article strong {
  color: #212121;
  font-weight: 600;
}

/* Inline code. Prism only themes <pre>, so standalone <code> needs its own look. */
.rs-blog-details .bs-desc .qw-article code {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 0.88em;
  background: #f2f4f5;
  color: #37474f;
  border: 1px solid #e4e8ea;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ...but not inside a highlighted block, where Prism owns the styling. */
.rs-blog-details .bs-desc .qw-article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

.rs-blog-details .bs-desc .qw-article pre {
  border-radius: 6px;
  border: 1px solid #e4e4de;
  font-size: 13.5px;
  margin: 0 0 24px;
}

/* --- lede --------------------------------------------------------------- */

.rs-blog-details .bs-desc .qw-lede {
  font-size: 19px;
  line-height: 1.6;
  color: #37474f;
  border-left: 4px solid #607d8b;
  padding: 2px 0 2px 22px;
  margin: 0 0 30px;
}

/* --- series banner ------------------------------------------------------ */

.rs-blog-details .bs-desc .qw-series {
  display: block;
  background: #f4f6f7;
  border: 1px solid #e0e6e8;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.6;
}

.rs-blog-details .bs-desc .qw-series .qw-series-label {
  display: block;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8d91a1;
  margin-bottom: 6px;
}

.rs-blog-details .bs-desc .qw-series ol {
  margin: 0;
  padding-left: 20px;
}

.rs-blog-details .bs-desc .qw-series li {
  margin-bottom: 3px;
}

.rs-blog-details .bs-desc .qw-series .qw-here {
  color: #212121;
  font-weight: 600;
}

/* --- figures ------------------------------------------------------------ */

.rs-blog-details .bs-desc .qw-fig {
  margin: 34px 0;
  padding: 0;
}

.rs-blog-details .bs-desc .qw-fig img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e6e6e0;
  border-radius: 8px;
  background: #ffffff;
}

.rs-blog-details .bs-desc .qw-fig figcaption,
.rs-blog-details .bs-desc .qw-figcap {
  display: block;
  font-size: 13.5px;
  line-height: 1.55;
  color: #8a8a8a;
  margin-top: 10px;
  padding-left: 2px;
  border-left: 3px solid #e0e6e8;
  padding: 2px 0 2px 12px;
}

/* --- callouts ----------------------------------------------------------- */

.rs-blog-details .bs-desc .qw-callout {
  position: relative;
  border: 1px solid #e0e6e8;
  border-left: 4px solid #607d8b;
  border-radius: 0 6px 6px 0;
  background: #fafbfb;
  padding: 18px 22px 4px;
  margin: 28px 0;
  font-size: 15.5px;
  line-height: 1.65;
}

.rs-blog-details .bs-desc .qw-callout .qw-callout-title {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #607d8b;
  margin-bottom: 8px;
}

.rs-blog-details .bs-desc .qw-callout p:last-child,
.rs-blog-details .bs-desc .qw-callout ul:last-child {
  margin-bottom: 14px;
}

.rs-blog-details .bs-desc .qw-callout-warn {
  border-left-color: #c98200;
  background: #fdfaf3;
}

.rs-blog-details .bs-desc .qw-callout-warn .qw-callout-title {
  color: #a86d00;
}

.rs-blog-details .bs-desc .qw-callout-key {
  border-left-color: #21aa50;
  background: #f6fbf7;
}

.rs-blog-details .bs-desc .qw-callout-key .qw-callout-title {
  color: #1a8c41;
}

.rs-blog-details .bs-desc .qw-callout-gotcha {
  border-left-color: #db4f36;
  background: #fdf7f5;
}

.rs-blog-details .bs-desc .qw-callout-gotcha .qw-callout-title {
  color: #c2402a;
}

/* --- tables ------------------------------------------------------------- */

.rs-blog-details .bs-desc .qw-table-wrap {
  overflow-x: auto;
  margin: 26px 0;
  -webkit-overflow-scrolling: touch;
}

.rs-blog-details .bs-desc .qw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
  background: #ffffff;
  border: 1px solid #e6e6e0;
  border-radius: 6px;
}

.rs-blog-details .bs-desc .qw-table th {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #55606b;
  background: #f4f6f7;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e6e8;
  vertical-align: middle;
}

.rs-blog-details .bs-desc .qw-table td {
  padding: 12px 16px;
  border-top: 1px solid #eeeeea;
  color: #4a4a4a;
  vertical-align: top;
}

.rs-blog-details .bs-desc .qw-table tbody tr:nth-child(even) td {
  background: #fbfbf9;
}

.rs-blog-details .bs-desc .qw-table td:first-child {
  color: #212121;
  font-weight: 600;
}

.rs-blog-details .bs-desc .qw-table code {
  white-space: nowrap;
}

/* numeric column, e.g. token counts */
.rs-blog-details .bs-desc .qw-num {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  text-align: right;
  white-space: nowrap;
  color: #37474f;
}

.rs-blog-details .bs-desc .qw-table .qw-total td {
  border-top: 2px solid #d8dde0;
  background: #f6f8f8;
  color: #212121;
  font-weight: 700;
}

/* support marks in comparison tables */
.rs-blog-details .bs-desc .qw-mark {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.rs-blog-details .bs-desc .qw-yes { color: #21aa50; }
.rs-blog-details .bs-desc .qw-no { color: #bfc4c7; }
.rs-blog-details .bs-desc .qw-partial { color: #c98200; }

.rs-blog-details .bs-desc .qw-center { text-align: center; }

/* --- numbered steps ----------------------------------------------------- */

.rs-blog-details .bs-desc .qw-steps {
  list-style: none;
  counter-reset: qwstep;
  padding-left: 0;
  margin: 26px 0;
}

.rs-blog-details .bs-desc .qw-steps > li {
  counter-increment: qwstep;
  position: relative;
  padding: 0 0 0 52px;
  margin-bottom: 20px;
  min-height: 36px;
}

.rs-blog-details .bs-desc .qw-steps > li:before {
  content: counter(qwstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #607d8b;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 34px;
  text-align: center;
}

.rs-blog-details .bs-desc .qw-steps > li strong {
  display: block;
  font-size: 16px;
  color: #212121;
  margin-bottom: 1px;
}

/* --- stat row ----------------------------------------------------------- */

.rs-blog-details .bs-desc .qw-stats {
  display: block;
  overflow: hidden;
  list-style: none;
  padding-left: 0;
  margin: 28px 0;
  border-top: 1px solid #e6e6e0;
  border-bottom: 1px solid #e6e6e0;
}

.rs-blog-details .bs-desc .qw-stats > li {
  float: left;
  width: 25%;
  padding: 18px 16px 18px 0;
  margin: 0;
  box-sizing: border-box;
}

.rs-blog-details .bs-desc .qw-stats .qw-stat-n {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  color: #607d8b;
}

.rs-blog-details .bs-desc .qw-stats .qw-stat-l {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  color: #8a8a8a;
  margin-top: 3px;
}

/* --- key/value definition rows ------------------------------------------ */

.rs-blog-details .bs-desc .qw-kv {
  margin: 24px 0;
  border-top: 1px solid #eeeeea;
}

.rs-blog-details .bs-desc .qw-kv dt {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #212121;
  font-size: 15px;
  padding-top: 14px;
}

.rs-blog-details .bs-desc .qw-kv dd {
  margin: 2px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eeeeea;
  color: #4a4a4a;
  font-size: 15px;
}

/* --- pills / tag row ---------------------------------------------------- */

.rs-blog-details .bs-desc .qw-pills {
  list-style: none;
  padding-left: 0;
  margin: 0 0 26px;
}

.rs-blog-details .bs-desc .qw-pills > li {
  display: inline-block;
  margin: 0 7px 8px 0;
  padding: 5px 13px;
  border: 1px solid #dde3e5;
  border-radius: 999px;
  background: #f6f8f8;
  color: #55606b;
  font-size: 13px;
  line-height: 1.4;
}

/* --- file tree ---------------------------------------------------------- */

.rs-blog-details .bs-desc .qw-tree {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 13.5px;
  line-height: 1.85;
  background: #fbfbf9;
  border: 1px solid #e6e6e0;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 0 0 24px;
  overflow-x: auto;
  color: #37474f;
  white-space: pre;
}

.rs-blog-details .bs-desc .qw-tree .qw-dim {
  color: #9aa2a7;
}

/* --- references --------------------------------------------------------- */

.rs-blog-details .bs-desc .qw-refs {
  list-style: none;
  padding-left: 0;
  font-size: 14px;
  line-height: 1.6;
}

.rs-blog-details .bs-desc .qw-refs > li {
  padding-left: 34px;
  position: relative;
  margin-bottom: 7px;
  word-break: break-word;
}

.rs-blog-details .bs-desc .qw-refs .qw-refn {
  position: absolute;
  left: 0;
  top: 0;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 12px;
  color: #8d91a1;
}

/* --- responsive --------------------------------------------------------- */

@media (max-width: 767px) {
  .rs-blog-details .bs-desc .qw-article {
    font-size: 15.5px;
  }
  .rs-blog-details .bs-desc .qw-article h2 {
    font-size: 22px;
    margin-top: 40px;
  }
  .rs-blog-details .bs-desc .qw-lede {
    font-size: 17px;
  }
  .rs-blog-details .bs-desc .qw-stats > li {
    width: 50%;
  }
  .rs-blog-details .bs-desc .qw-table {
    font-size: 14px;
  }
  .rs-blog-details .bs-desc .qw-table th,
  .rs-blog-details .bs-desc .qw-table td {
    padding: 10px 12px;
  }

  /* The diagrams are drawn on a 960px canvas. Scaled to fit a 400px phone their
     labels drop to about 5px, which is unreadable. Let them keep a legible size
     and pan horizontally instead -- the usual trade for a technical diagram. */
  .rs-blog-details .bs-desc .qw-fig {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .rs-blog-details .bs-desc .qw-fig img {
    min-width: 720px;
  }
  .rs-blog-details .bs-desc .qw-fig figcaption,
  .rs-blog-details .bs-desc .qw-figcap {
    position: sticky;
    left: 0;
  }
}
