/* Shared rich-content surface: published articles, TinyMCE edit iframe, and preview. */
:where(.news-content, .mce-content-body) {
  position: relative;
  min-height: 5px;
  max-width: 100%;
  color: #333;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: normal;
  display: flow-root;
  overflow-x: auto;
}

:where(.news-content, .mce-content-body) > :first-child {
  margin-top: 0;
}

:where(.news-content, .mce-content-body) h1,
:where(.news-content, .mce-content-body) h2,
:where(.news-content, .mce-content-body) h3,
:where(.news-content, .mce-content-body) h4,
:where(.news-content, .mce-content-body) h5,
:where(.news-content, .mce-content-body) h6 {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  color: #1f2937;
  clear: both;
}

:where(.news-content, .mce-content-body) :is(h1, h2, h3, h4, h5, h6) + :is(p, div, figure) {
  margin-top: 0;
}

:where(.news-content, .mce-content-body) p,
:where(.news-content, .mce-content-body) ul,
:where(.news-content, .mce-content-body) ol,
:where(.news-content, .mce-content-body) blockquote,
:where(.news-content, .mce-content-body) pre {
  margin-bottom: 1rem;
}

:where(.news-content, .mce-content-body) ul,
:where(.news-content, .mce-content-body) ol {
  padding-left: 1.25rem;
}

:where(.news-content, .mce-content-body) img,
:where(.news-content, .mce-content-body) video,
:where(.news-content, .mce-content-body) iframe,
:where(.news-content, .mce-content-body) table {
  max-width: 100%;
}

:where(.news-content, .mce-content-body) img,
:where(.news-content, .mce-content-body) video {
  height: auto;
}

:where(.news-content, .mce-content-body) p > img:only-child:not([style*="float"]):not([style]),
:where(.news-content, .mce-content-body) > p > img:only-child:not([style*="float"]):not([style]) {
  display: block;
  margin: 1rem auto;
  border-radius: 0.5rem;
}

:where(.news-content, .mce-content-body) p > img:only-child:not([style*="float"])[style],
:where(.news-content, .mce-content-body) > p > img:only-child:not([style*="float"])[style] {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(.news-content, .mce-content-body) img[style*="float: left"],
:where(.news-content, .mce-content-body) img[style*="float:left"],
:where(.news-content, .mce-content-body) figure[style*="float: left"],
:where(.news-content, .mce-content-body) figure[style*="float:left"] {
  float: left;
  height: auto;
  display: block;
}

:where(.news-content, .mce-content-body) img[style*="float: right"],
:where(.news-content, .mce-content-body) img[style*="float:right"],
:where(.news-content, .mce-content-body) figure[style*="float: right"],
:where(.news-content, .mce-content-body) figure[style*="float:right"] {
  float: right;
  height: auto;
  display: block;
}

:where(.news-content, .mce-content-body) .news-media-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

:where(.news-content, .mce-content-body) .news-media-layout__media,
:where(.news-content, .mce-content-body) .news-media-layout__body {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
}

:where(.news-content, .mce-content-body) .news-media-layout__media img {
  width: 100%;
  display: block;
  border-radius: 0.75rem;
  height: auto;
}

:where(.news-content, .mce-content-body) .news-media-layout__body > :first-child {
  margin-top: 0;
}

:where(.news-content, .mce-content-body) .news-media-layout__body > :last-child {
  margin-bottom: 0;
}

:where(.news-content, .mce-content-body) .news-media-layout__body > p + p {
  margin-top: 0.75rem;
}

:where(.news-content, .mce-content-body) .news-float-layout {
  display: flow-root;
  margin-bottom: 1rem;
}

:where(.news-content, .mce-content-body) .news-float-layout > img[style*="float"],
:where(.news-content, .mce-content-body) .news-float-layout > p > img[style*="float"] {
  vertical-align: top;
}

:where(.news-content, .mce-content-body) .news-float-layout > p {
  margin-top: 0;
  margin-bottom: 0;
}

:where(.news-content, .mce-content-body) .news-float-layout > p + p {
  margin-top: 0.75rem;
}

:where(.news-content, .mce-content-body) p:has(> img[style*="float"]) {
  margin-top: 0;
}

:where(.news-content, .mce-content-body) p:has(> img[style*="float"]) + p {
  margin-top: 0;
}

:where(.news-content, .mce-content-body) iframe {
  width: 100%;
  min-height: 320px;
  border-radius: 0.5rem;
  border: 0;
}

:where(.news-content, .mce-content-body) pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  font-size: 0.925rem;
  line-height: 1.55;
  overflow-x: auto;
}

:where(.news-content, .mce-content-body) code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: #eef2ff;
  color: #1d4ed8;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
}

:where(.news-content, .mce-content-body) pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

:where(.news-content, .mce-content-body) figure {
  margin: 1rem auto;
  max-width: 100%;
  text-align: center;
}

:where(.news-content, .mce-content-body) figure.image:not([style*="float"]):not(:has(> img[style*="float"])) {
  display: table;
}

:where(.news-content, .mce-content-body) figure.image:has(> img[style*="float"]) {
  display: block;
  margin: 0;
  max-width: none;
  text-align: inherit;
}

:where(.news-content, .mce-content-body) figure.image:not(:has(> img[style*="float"])) img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

:where(.news-content, .mce-content-body) figure.image:has(> img[style*="float"]) img {
  display: block;
  margin-left: 0;
  margin-right: 0;
}

:where(.news-content, .mce-content-body) figcaption {
  caption-side: bottom;
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

:where(.news-content, .mce-content-body) pre[class*="language-"],
:where(.news-content, .mce-content-body) code[class*="language-"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

:where(.news-content, .mce-content-body) th,
:where(.news-content, .mce-content-body) td {
  border: 1px solid #dee2e6;
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

:where(.news-content, .mce-content-body) table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
}

:where(.news-content, .mce-content-body) blockquote {
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  color: #334155;
}

:where(.news-content, .mce-content-body) blockquote > :first-child {
  margin-top: 0;
}

:where(.news-content, .mce-content-body) blockquote > :last-child {
  margin-bottom: 0;
}

:where(.news-content, .mce-content-body) blockquote h1,
:where(.news-content, .mce-content-body) blockquote h2,
:where(.news-content, .mce-content-body) blockquote h3,
:where(.news-content, .mce-content-body) blockquote h4,
:where(.news-content, .mce-content-body) blockquote h5,
:where(.news-content, .mce-content-body) blockquote h6,
:where(.news-content, .mce-content-body) blockquote p {
  margin-left: 0;
}

:where(.news-content, .mce-content-body) blockquote ul,
:where(.news-content, .mce-content-body) blockquote ol {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
}

@media (max-width: 768px) {
  :where(.news-content, .mce-content-body) {
    font-size: 0.98rem;
  }

  :where(.news-content, .mce-content-body) iframe {
    min-height: 220px;
  }

  :where(.news-content, .mce-content-body) .news-media-layout__media,
  :where(.news-content, .mce-content-body) .news-media-layout__body {
    flex-basis: 100%;
  }

  :where(.news-content, .mce-content-body) img[style*="float"],
  :where(.news-content, .mce-content-body) figure[style*="float"] {
    float: none;
    display: block;
    margin: 1rem auto;
    max-width: 100%;
  }
}
