/**
 * Discord-like rich text (admin content)
 */

.joyple-md {
  word-break: break-word;
}

.ticket-msg__body--rich,
.ticket-msg__body--rich.joyple-md,
.ticket-msg__body .joyple-md {
  white-space: normal;
}

.joyple-md-list {
  margin: 0.35rem 0 0.6rem 1.15rem;
  padding: 0;
}

.joyple-md-list > li {
  margin: 0.15rem 0;
}

.joyple-md-quote {
  margin: 0.5rem 0;
  padding: 0.35rem 0.85rem;
  border-left: 4px solid #30eee2;
  background: rgba(48, 238, 226, 0.08);
  color: #495057;
}

.joyple-md-heading {
  margin: 0.75rem 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.joyple-md-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.08);
}

.joyple-md-pre {
  display: block;
  margin: 0.55rem 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border-radius: 0.35rem;
  background: #2b2d31;
  color: #dbdee1;
  white-space: pre;
}

.joyple-md-pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: transparent;
  color: inherit;
  padding: 0;
}

.joyple-md-spoiler {
  position: relative;
  display: inline;
  cursor: pointer;
  margin: 0;
}

.joyple-md-spoiler__check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.joyple-md-spoiler__text {
  border-radius: 0.25rem;
  padding: 0 0.2em;
  background: #202225;
  color: #202225;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.joyple-md-spoiler__check:checked + .joyple-md-spoiler__text,
.joyple-md-spoiler:focus-within .joyple-md-spoiler__text {
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.joyple-md a {
  word-break: break-all;
}

.joyple-md-youtube {
  position: relative;
  display: block;
  width: 100%;
  min-width: 50%;
  max-width: 100%;
  margin: 0.75rem auto;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.news-article-body .joyple-md-youtube,
.faq-answer-panel .joyple-md-youtube,
.docs-content .joyple-md-youtube {
  width: max(50%, min(100%, 960px));
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  margin-left: auto;
  margin-right: auto;
}

/* Conteúdo legado: wrapper externo vazio com aspect-ratio duplicado. */
.joyple-md-youtube > .joyple-md-youtube:only-child {
  margin-top: 0;
  margin-bottom: 0;
}

.joyple-md-youtube:has(> .joyple-md-youtube:only-child) {
  aspect-ratio: auto;
  min-height: 0;
  height: auto;
  background: transparent;
  width: auto;
  max-width: none;
}

.joyple-md-youtube iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.joyple-html-tooltip .tooltip-inner,
.custom-tooltip .tooltip-inner {
  background-color: rgba(20, 22, 26, 0.94);
  color: #f3f4f6;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  border-radius: 0.5rem;
  max-width: 320px;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.joyple-html-tooltip .tooltip-inner b,
.joyple-html-tooltip .tooltip-inner strong,
.custom-tooltip .tooltip-inner b,
.custom-tooltip .tooltip-inner strong {
  color: #fff;
}

.joyple-html-tooltip .tooltip-arrow::before,
.custom-tooltip .tooltip-arrow::before {
  border-top-color: rgba(20, 22, 26, 0.94);
  border-bottom-color: rgba(20, 22, 26, 0.94);
  border-left-color: rgba(20, 22, 26, 0.94);
  border-right-color: rgba(20, 22, 26, 0.94);
}

.joyple-item-chip,
[data-joyple-html-title="1"] {
  cursor: help;
}

.news-article-body.joyple-md .joyple-md-quote,
.faq-answer-panel .joyple-md-quote,
.docs-content .joyple-md-quote {
  border-left-color: #ff5200;
  background: rgba(255, 82, 0, 0.06);
}
