/*!
 * Adeeb Al-Silwy — code block chrome (language badge + copy button)
 * Works on top of the Prism "tomorrow" theme. RTL friendly.
 */

.adeeb-code {
  position: relative;
  margin: 20px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #1d1f21;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.10);
  direction: ltr; /* code stays LTR even inside RTL pages */
}

.adeeb-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #23262a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.adeeb-code__lang {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa4b2;
}

.adeeb-code__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: #d7dce5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.adeeb-code__copy:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.adeeb-code__copy.is-copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.adeeb-code pre[class*="language-"],
.adeeb-code pre {
  margin: 0 !important;
  padding: 16px 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #1d1f21 !important;
  font-size: 13.5px;
  line-height: 1.7;
  overflow: auto;
  max-height: 620px;
}

.adeeb-code pre code {
  background: transparent !important;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Liberation Mono", monospace;
  direction: ltr;
  text-align: left;
  white-space: pre;
}

.adeeb-code pre::-webkit-scrollbar {
  height: 9px;
}
.adeeb-code pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}

/* Standalone code blocks that were not wrapped (fallback) */
.text-lesson-contents pre,
.blog-contents pre {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: #1d1f21;
  color: #e6e9ef;
  overflow: auto;
  direction: ltr;
}

.text-lesson-contents pre code,
.blog-contents pre code {
  background: transparent;
  color: inherit;
}

/* Inline code */
.text-lesson-contents :not(pre) > code,
.blog-contents :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2f7;
  color: #b5295b;
  font-size: 0.92em;
  direction: ltr;
  display: inline-block;
}

@media (max-width: 575px) {
  .adeeb-code pre {
    font-size: 12.5px;
    padding: 14px !important;
  }
}
