/* =========================
   Theme tokens (your colors)
   ========================= */

/* =========================
   Scoped component (no conflicts)
   ========================= */
.ci-book {
  color: var(--text);
}

/* Header */
.ci-book__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}

.ci-book__title {
  margin: 0;
  font-weight: 800;
  font-size: 22px;
  color: var(--mainText);
}

.ci-book__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* Layout */
.ci-book__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}
@media (max-width: 992px) {
  .ci-book__grid {
    grid-template-columns: 1fr;
  }
}

/* Card */
.ci-book__card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ci-book__cardPad {
  padding: 14px;
}

/* Meta */
.ci-book__meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.ci-book__cover {
  max-width: 240px;
  height: 360px;
  width: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--panel2);
}

.ci-book__metaTitle {
  font-weight: 800;
  color: var(--text);
}

.ci-book__hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* Buttons */
.ci-book__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.ci-book__btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ci-book__btn:hover {
  transform: translateY(-1px);
  border-color: rgba(70, 211, 154, 0.45);
}

.ci-book__btn.is-disabled,
.ci-book__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Languages */
.ci-book__langsHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--text);
}

.ci-book__langsList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

/* Language button */
.ci-book__langBtn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.ci-book__langBtn:hover,
.ci-book__langBtn:focus {
  background-color: var(--panel2) !important;
}
.ci-book__langBtn:hover:not(.is-active) {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.ci-book__langBtn.is-active {
  border-color: rgba(70, 211, 154, 0.55);
  /* box-shadow: 0 0 0 3px rgba(70, 211, 154, 0.12); */
}

/* Title in that language */
.ci-book__langTitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.ci-book__langMeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* Check icon */
.ci-book__langBtn i {
  color: var(--brand);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ci-book__langBtn.is-active i {
  opacity: 1;
}

/* RTL support */
.ci-book__langBtn[data-book-lang="ar"] {
  direction: rtl;
}
.ci-book__langBtn[data-book-lang="ar"] div {
  text-align: right;
}

/* Preview */
.ci-book__previewTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.ci-book__badge {
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel2);
}

/* iframe */
.ci-book__frame {
  width: 100%;
  height: 72vh;
  border: 0;
  background: #fff;
}

/* Content section (kept readable) */
.ci-book__content {
  margin-top: 14px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
.ci-book__content p,
.ci-book__content li {
  color: var(--text);
}
.ci-book__content a {
  color: var(--brand);
}
