/* ════════════════════════════════════════
   TLL Chapter Navigation — أزرار التنقل بين الفصول
   متوافقة مع ألوان قالب The Last Line
   ════════════════════════════════════════ */

.tll-chnav {
  display: flex;
  align-items: stretch;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, #2a2a38);
  direction: rtl;
  max-width: 100%;
  box-sizing: border-box;
}

.tll-chnav-btn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--card, #1c1c26);
  border: 1px solid var(--border, #2a2a38);
  border-radius: 10px;
  padding: .8rem 1rem;
  text-decoration: none;
  color: var(--text, #e8e6f0);
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.tll-chnav-btn:hover {
  border-color: var(--purple, #7c5cbf);
  background: rgba(124, 92, 191, .08);
  transform: translateY(-1px);
}

.tll-chnav-btn:active {
  transform: translateY(0);
}

.tll-chnav-next {
  justify-content: flex-start;
}

.tll-chnav-prev {
  justify-content: flex-start;
}

.tll-chnav-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(124, 92, 191, .15);
  color: var(--purple2, #9b7de0);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .2s ease, color .2s ease;
}

.tll-chnav-btn:hover .tll-chnav-icon {
  background: var(--purple, #7c5cbf);
  color: #fff;
}

.tll-chnav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.tll-chnav-prev .tll-chnav-text {
  text-align: left;
}

.tll-chnav-next .tll-chnav-text {
  text-align: right;
}

.tll-chnav-label {
  font-size: .72rem;
  color: var(--muted, #7a7890);
  font-weight: 500;
  margin-bottom: .12rem;
}

.tll-chnav-title {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text, #e8e6f0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* حالة الزر المعطل (مفيش فصل سابق/تالي) */
.tll-chnav-disabled {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--border, #2a2a38);
  border-radius: 10px;
  padding: .8rem 1rem;
  color: var(--muted, #7a7890);
  opacity: .55;
  cursor: not-allowed;
}

.tll-chnav-disabled .tll-chnav-label {
  margin-bottom: 0;
  font-size: .8rem;
  text-align: center;
  white-space: normal;
}

/* ════════ موبايل ════════ */
@media (max-width: 600px) {
  .tll-chnav {
    flex-direction: column;
    gap: .6rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    width: 100%;
    box-sizing: border-box;
  }

  .tll-chnav-btn,
  .tll-chnav-disabled {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: .75rem .9rem;
  }

  .tll-chnav-text {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .tll-chnav-title {
    font-size: .85rem;
    max-width: 100%;
  }

  .tll-chnav-icon {
    width: 27px;
    height: 27px;
    font-size: 1.15rem;
  }
}

@media (max-width: 360px) {
  .tll-chnav-title {
    max-width: 100%;
  }
}
