/* ========================================================================
   Simple Post Series - Frontend
   ======================================================================== */

/* ---------- Wrapper ---------- */
.sps-single-series-nav {
    overflow: visible;
    margin: 0 0 30px;
}

/* Card container */
.sps-single-series-nav details {
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: #ffffff;
}

/* ---------- Summary (header) ---------- */
.sps-series-summary {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    padding: 15px 18px;
    background: #f6f8f8;
    font-size: 15px;
    line-height: 1.45;
    color: #111111;
    transition: background .25s ease;
}

.sps-series-summary:hover {
    background: #eef2f3;
}

.sps-series-summary::-webkit-details-marker {
    display: none;
}

.sps-series-summary::marker {
    content: "";
}

.sps-series-count {
    font-weight: 600;
    white-space: nowrap;
}

.sps-series-name {
    font-weight: 400;
    opacity: .85;
}

/* Arrow indicator */
.sps-series-summary::before {
    content: "\25B6";
    display: inline-block;
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
    color: #7bb5c0;
    transform: rotate(0deg);
    transition: transform .48s cubic-bezier(.16, 1, .3, 1);
}

.sps-single-series-nav details.is-open .sps-series-summary::before {
    transform: rotate(90deg);
}

/* Header state when open */
.sps-single-series-nav details.is-open .sps-series-summary {
    background: #f0f4f5;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

/* ---------- List ---------- */
.sps-series-list {
    overflow: hidden;
    height: 0;
    opacity: 0;
    transform: translateY(-12px);
    transform-origin: top center;
    transition:
        height .42s cubic-bezier(.16, 1, .3, 1),
        opacity .24s ease,
        transform .36s cubic-bezier(.16, 1, .3, 1);
    will-change: height, opacity, transform;
    margin: 0;
    padding: 0;
    background: #ffffff;
}

.sps-single-series-nav details.is-open .sps-series-list {
    opacity: 1;
    transform: translateY(0);
}

.sps-series-list .sps-series-item:first-child {
    margin-top: 0;
}

/* ---------- Item ---------- */
.sps-series-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    text-decoration: none;
    color: #111111;
    opacity: 0;
    transform: translateY(-10px);
    transition:
        opacity .36s ease,
        transform .46s cubic-bezier(.16, 1, .3, 1),
        background .25s ease;
}

.sps-series-item:last-child {
    border-bottom: none;
}

/* Link item (artikel yang belum/tidak sedang dibuka) — teks hitam, tanpa underline */
.sps-single-series-nav a.sps-series-item,
.sps-single-series-nav a.sps-series-item .sps-series-title,
.sps-single-series-nav .sps-series-title {
    color: #111111;
    text-decoration: none;
}

/* Ruang untuk panah di kanan */
.sps-single-series-nav a.sps-series-item {
    position: relative;
    padding-right: 44px;
}

/* Accent bar di kiri (muncul saat hover) */
.sps-single-series-nav a.sps-series-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #7bb5c0;
    transform: scaleY(0);
    transform-origin: center;
    transition: transform .3s ease;
}

.sps-single-series-nav a.sps-series-item:hover::before {
    transform: scaleY(1);
}

/* Panah masuk dari kanan saat hover */
.sps-single-series-nav a.sps-series-item::after {
    content: "\2192";
    position: absolute;
    right: 18px;
    top: 50%;
    font-size: 16px;
    line-height: 1;
    color: #7bb5c0;
    opacity: 0;
    transform: translate(8px, -50%);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}

.sps-single-series-nav a.sps-series-item:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
}

/* Hover: geser halus + highlight background (specificity tinggi agar menang atas state is-open) */
.sps-single-series-nav details.is-open a.sps-series-item:hover {
    background: #f6f8f8;
    transform: translateX(4px);
    transition-delay: 0s;
}

/* Judul berubah warna aksen saat hover + underline beranimasi (tumbuh kiri → menyusut kanan) */
.sps-single-series-nav details.is-open a.sps-series-item:hover .sps-series-title {
    color: #7bb5c0;
    animation: sps-underline-hover 1.5s ease;
}

@keyframes sps-underline-hover {
    0% {
        background-size: 0% 3px;
    }

    50% {
        background-size: 100% 3px;
        background-position: bottom left;
    }

    51% {
        background-size: 100% 3px;
        background-position: bottom right;
    }

    100% {
        background-size: 0% 3px;
        background-position: bottom right;
    }
}

/* Thumbnail zoom saat hover */
.sps-single-series-nav details.is-open a.sps-series-item:hover .sps-series-thumb-img {
    transform: scale(1.08);
}

.sps-series-item.is-current {
    background: rgba(123, 181, 192, 0.08);
    cursor: default;
}

.sps-single-series-nav details.is-open .sps-series-item {
    opacity: 1;
    transform: translateY(0);
}

/* Item stagger animation — hanya saat animasi buka, agar tidak menunda hover */
.sps-single-series-nav details.is-animating.is-open .sps-series-item:nth-child(1) {
    transition-delay: .04s;
}

.sps-single-series-nav details.is-animating.is-open .sps-series-item:nth-child(2) {
    transition-delay: .08s;
}

.sps-single-series-nav details.is-animating.is-open .sps-series-item:nth-child(3) {
    transition-delay: .12s;
}

.sps-single-series-nav details.is-animating.is-open .sps-series-item:nth-child(4) {
    transition-delay: .16s;
}

.sps-single-series-nav details.is-animating.is-open .sps-series-item:nth-child(5) {
    transition-delay: .20s;
}

.sps-single-series-nav details.is-animating.is-open .sps-series-item:nth-child(n+6) {
    transition-delay: .23s;
}

.sps-single-series-nav details:not(.is-open) .sps-series-item {
    transition-delay: 0s;
}

/* ---------- Thumbnail ---------- */
.sps-series-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #eceff0;
}

.sps-series-thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}

.sps-series-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #eceff0;
}

/* ---------- Info ---------- */
.sps-series-info {
    flex: 1 1 auto;
    min-width: 0;
}

.sps-series-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: inherit;
    overflow-wrap: anywhere;
    transition: color .25s ease;
    /* Underline animasi (gaya hover-ani-7 tema Foxiz): default 0% = tidak terlihat */
    width: fit-content;
    max-width: 100%;
    background-image: linear-gradient(#7bb5c0, #7bb5c0);
    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: 0% 3px;
}

.sps-series-current {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: 999px;
    background: #7bb5c0;
    color: #ffffff;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .sps-series-summary::before,
    .sps-series-list,
    .sps-series-item {
        transition: none !important;
        transform: none !important;
    }

    .sps-single-series-nav details.is-open a.sps-series-item:hover .sps-series-title {
        animation: none;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .sps-series-summary {
        padding: 13px 14px;
        font-size: 14px;
    }

    .sps-series-item {
        padding: 12px 14px;
        gap: 12px;
    }

    .sps-series-thumb {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
    }

    .sps-series-title {
        font-size: 14px;
    }
}
