/* =========================================================
   Sticky / fixed sayfa içi menü (TOC) — ortalı pill
   Kullanım: php/page-toc.php + assets/js/page-toc.js
   ========================================================= */

.jt-toc {
    position: sticky;
    top: 12px;
    /* Header (#masthead z-index:1000) altında kalmalı — mega menü / blur üstte */
    z-index: 90;
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 4px auto 20px;
    background: #ffffff;
    border: 1px solid rgba(18, 25, 28, 0.08);
    border-radius: 999px;
    box-shadow:
        0 4px 6px rgba(18, 25, 28, 0.04),
        0 12px 28px rgba(18, 25, 28, 0.10);
}

/* JS fallback — sticky bozulursa fixed'e geçer (aynı genişlik, ortalı) */
.jt-toc.is-fixed {
    position: fixed;
    top: 12px;
    left: 50%;
    right: auto;
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 0;
    transform: translateX(-50%);
}

.jt-toc-spacer {
    display: none;
    height: 76px;
    pointer-events: none;
}

.jt-toc-spacer.is-on {
    display: block;
}

.jt-toc-inner {
    padding: 6px 10px 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
}

.jt-toc-label {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #12191c;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
    padding-right: 10px;
    margin-right: 2px;
    border-right: 1px solid #e8eef0;
    cursor: pointer;
    transition: color .15s ease;
}

.jt-toc-label:hover {
    color: #087b86;
}

.jt-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
}

.jt-toc-list::-webkit-scrollbar {
    display: none;
}

.jt-toc-list li {
    flex: 0 0 auto;
}

.jt-toc-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: #3d474c;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.jt-toc-link:hover {
    color: #12191c;
    background: #f1f3f4;
}

.jt-toc-link.is-active {
    color: #ffffff;
    background: #12191c;
}

/* Hedef bölümler — floating TOC altında kalsın */
.jt-page [id].jt-section,
.jt-page .jt-section[id] {
    scroll-margin-top: 80px;
}

@media (max-width: 768px) {
    .jt-toc {
        top: 10px;
        max-width: calc(100% - 20px);
        margin: 2px auto 16px;
    }

    .jt-toc.is-fixed {
        top: 10px;
        max-width: calc(100% - 20px);
    }

    .jt-toc-label {
        display: none;
    }

    .jt-toc-inner {
        padding: 5px 8px;
        min-height: 44px;
    }

    .jt-toc-spacer {
        height: 64px;
    }

    .jt-toc-link {
        padding: 7px 11px;
        font-size: 12.5px;
    }

    .jt-page [id].jt-section,
    .jt-page .jt-section[id] {
        scroll-margin-top: 68px;
    }
}


/* ------------------------------------------------------------------
   MOBIL: seridin kaydirilabildigini belli et
   .jt-toc-list zaten overflow-x:auto ile kayiyordu ama kullanici
   bunu anlamiyordu. Sag kenarda solma + tek seferlik ipucu oku.
   Markup/JS: php/page-toc.php + php/footer.php ([data-swipe-hint])
   ------------------------------------------------------------------ */
@media screen and (max-width: 767.98px) {

    .jt-toc-inner {
        position: relative;
    }

    .jt-toc-inner::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 38px;
        pointer-events: none;
        background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.94) 72%);
        opacity: 0;
        transition: opacity .25s ease;
        z-index: 2;
        border-radius: 0 999px 999px 0;
    }
    .jt-toc-inner.has-more-right::after { opacity: 1; }

    .jt-toc-inner .jt-swipe-hint {
        position: absolute;
        top: 50%;
        right: 6px;
        transform: translateY(-50%);
        z-index: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: #12191c;
        color: #fff;
        font-size: 11px;
        box-shadow: 0 3px 10px rgba(18,25,28,.3);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
    }
    .jt-toc-inner .jt-swipe-hint.is-on {
        opacity: 1;
        animation: jtSwipeNudge 1.1s ease-in-out 2;
    }

    @media (prefers-reduced-motion: reduce) {
        .jt-toc-inner .jt-swipe-hint.is-on { animation: none; }
    }

    /* 2026-11-16: oklar kalıcı. Başta yalnız sağ ok; kaydırınca sol ok da gelir,
       uca varınca sağ ok kaybolur. Dokununca şerit kayar. */
    .jt-toc-inner.has-more-right .jt-swipe-sag { opacity: 1; pointer-events: auto; cursor: pointer; }
    .jt-toc-inner .jt-swipe-sol {
        right: auto;
        left: 6px;
        pointer-events: none;
    }
    .jt-toc-inner.has-more-left .jt-swipe-sol { opacity: 1; pointer-events: auto; cursor: pointer; }
    .jt-toc-inner::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 38px;
        pointer-events: none;
        background: linear-gradient(270deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.94) 72%);
        opacity: 0;
        transition: opacity .25s ease;
        z-index: 2;
        border-radius: 999px 0 0 999px;
    }
    .jt-toc-inner.has-more-left::before { opacity: 1; }
}
@keyframes jtSwipeNudgeSol {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%      { transform: translateY(-50%) translateX(7px); }
}

/* Ok animasyonu modul-sekmeleri.css icinde de kullaniliyor;
   iki dosyadan biri yuklenmese de calissin diye burada da tanimli. */
@keyframes jtSwipeNudge {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%      { transform: translateY(-50%) translateX(-7px); }
}
