/* TOC-001-C — Styles (arzcredit_toc v2, ArzCredit adaptation)
 *
 * Mission:     arzcredit-toc-001   Folder: TOC-001
 * Depends on:  the markup from TOC-001-A. Portability: PORTABLE TO PRODUCTION.
 *
 * Scoped entirely to .arzcredit-toc; RTL; sticky right-rail on desktop,
 * collapsible drawer on mobile. No horizontal overflow.
 *
 * DEVIATIONS FROM THE REFERENCE (presentation only, as §1.4 allows):
 *
 *  1. z-index 90000 -> 900.
 *     MEASURED on a lab blog post: the highest z-index on the page is 1010
 *     (Element Pack's modal), the Astra scroll-to-top button is 99, and every
 *     Elementor container is 50. 90000 would put the TOC above the modal, so a
 *     modal would open BEHIND it. 900 sits above all content and above the
 *     scroll-to-top button, and below the modal — which is the correct order.
 *
 *  2. Colours: campino purple (#6a3df5 / #9767f7) -> ArzCredit's own palette.
 *     Structure, spacing and sizing are unchanged.
 *
 *  3. Mobile drawer button stays bottom-RIGHT. Measured: Astra's
 *     scroll-to-top renders at bottom-LEFT on this RTL site (its class says
 *     "right" but RTL flips it), so there is no collision. Verified at 390px
 *     and 1440px.
 *
 *  4. `position: sticky` + a `top` offset is set on desktop. The reference
 *     relies on the host template for stickiness; ArzCredit's sidebar column
 *     does not provide it, so the rail is made sticky here.
 */
.arzcredit-toc{font-family:inherit;direction:rtl;text-align:right;z-index:900;
  max-height:calc(100vh - 40px);box-sizing:border-box}
.arzcredit-toc *,.arzcredit-toc *::before,.arzcredit-toc *::after{box-sizing:border-box}

/* Desktop: a sticky right rail inside whatever column hosts it. */
@media (min-width:1025px){
  .arzcredit-toc{position:sticky;top:20px}
}

.arzcredit-toc__panel{background:#fff;border:1px solid #e6e8ec;border-radius:14px;
  box-shadow:0 10px 30px rgba(16,24,40,.12);padding:16px 14px;overflow-y:auto;
  max-height:calc(100vh - 80px)}
.arzcredit-toc__title{margin:0 0 10px;font-size:15px;font-weight:700;color:#0f172a;
  padding-bottom:8px;border-bottom:2px solid #1ea8a0}
.arzcredit-toc__list{list-style:none;margin:0;padding:0}
.arzcredit-toc__item{margin:0}
.arzcredit-toc__link{display:block;padding:6px 8px;color:#475569;text-decoration:none;
  font-size:13.5px;line-height:1.7;border-radius:8px;border-right:3px solid transparent;
  transition:background .15s,color .15s,border-color .15s;word-break:break-word}
.arzcredit-toc__link:hover{background:#f5f7fa;color:#0f172a}
.arzcredit-toc__item--h1>.arzcredit-toc__link{font-weight:700}
.arzcredit-toc__item--h2>.arzcredit-toc__link{padding-right:16px}
.arzcredit-toc__item--h3>.arzcredit-toc__link{padding-right:28px;font-size:12.5px;color:#64748b}
.arzcredit-toc__link.is-active{background:#1ea8a01f;color:#12756f;
  border-right-color:#1ea8a0;font-weight:700}

/* toggle button: hidden on desktop, floating on mobile */
.arzcredit-toc__toggle{display:none;align-items:center;gap:8px;cursor:pointer;border:none;
  background:#1ea8a0;color:#fff;font-family:inherit;font-size:14px;font-weight:700;
  padding:12px 16px;border-radius:999px;box-shadow:0 8px 22px rgba(30,168,160,.40)}
.arzcredit-toc__toggle-icon{width:18px;height:12px;position:relative;display:inline-block}
.arzcredit-toc__toggle-icon::before,.arzcredit-toc__toggle-icon::after,
.arzcredit-toc__toggle-icon{background:#fff}
.arzcredit-toc__toggle-icon{height:2px;top:5px;box-shadow:0 5px 0 #fff,0 -5px 0 #fff}

/* Tablet / mobile: collapsible drawer, no horizontal overflow */
@media (max-width:1024px){
  .arzcredit-toc{top:auto;position:fixed;bottom:20px;right:16px;left:auto;width:auto;max-height:none}
  .arzcredit-toc__toggle{display:inline-flex}
  .arzcredit-toc__panel{display:none;position:fixed;left:16px;right:16px;bottom:80px;
    width:auto;max-width:calc(100vw - 32px);max-height:60vh}
  .arzcredit-toc.is-open .arzcredit-toc__panel{display:block;animation:arztoc-in .18s ease}
}
@keyframes arztoc-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media print{.arzcredit-toc{display:none}}
