/* "Recently Updated" home section — grouped +N chapter cards, hover/tap popup. */

#recent-updated-section .recent-updated-skeleton {
    display: none;
}

#recent-updated-section.is-loading .recent-updated-content {
    display: none;
}

#recent-updated-section.is-loading .recent-updated-skeleton {
    display: block;
}

/* ── grouped "+N" chapter cards ─────────────────────────────── */
#recent-updated-section .rc-group {
    position: relative;
}

#recent-updated-section .rc-group:hover,
#recent-updated-section .rc-group.is-open {
    z-index: 50;
}

#recent-updated-section .rc-card {
    position: relative;
    z-index: 1;
}

/* a sheet of "paper" peeking out behind a multi-chapter card */
#recent-updated-section .rc-group.has-more::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: -4px;
    height: 12px;
    border-radius: 0 0 12px 12px;
    background: rgb(var(--c-peek));
    border: 1px solid rgb(var(--c-white) / .06);
    border-top: 0;
    z-index: 0;
}

#recent-updated-section .rc-more {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    /* follows the viewer's accent (--zmio-accent* are set in index.php's <head>); fallbacks = default violet */
    background: linear-gradient(135deg, var(--zmio-accent-soft, #a78bfa), var(--zmio-accent, #7c3aed));
    box-shadow: 0 1px 4px rgba(var(--zmio-accent-rgb, 124, 58, 237), .4);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

#recent-updated-section .rc-more:hover {
    filter: brightness(1.1);
}

/* no count pill (lone new chapter) but earlier chapters exist —
   a plain chevron that still opens the popup */
#recent-updated-section .rc-more.rc-more-plain {
    padding: 0 3px;
    background: rgb(var(--c-white) / .08);
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .5));
    box-shadow: none;
}

#recent-updated-section .rc-more.rc-more-plain:hover {
    filter: none;
    background: rgb(var(--c-white) / .14);
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .85));
}

#recent-updated-section .rc-more.rc-more-plain svg {
    width: 10px;
    height: 10px;
    transition: transform .15s ease;
}

#recent-updated-section .rc-group.is-open .rc-more-plain svg,
#recent-updated-section .rc-group:hover .rc-more-plain svg {
    transform: rotate(180deg);
}

#recent-updated-section .rc-pop {
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    right: 0;
    z-index: 40;
    padding: 8px;
    border-radius: 12px;
    background: rgb(var(--c-pop));
    border: 1px solid rgb(var(--c-white) / .1);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

#recent-updated-section .rc-group:hover .rc-pop,
#recent-updated-section .rc-group.is-open .rc-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#recent-updated-section .rc-pop-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 240px;
    overflow-y: auto;
}

#recent-updated-section .rc-pop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .72));
    transition: background .12s, color .12s;
}

#recent-updated-section .rc-pop-row:hover {
    background: rgb(var(--c-white) / .06);
    color: rgb(var(--c-white));
}

#recent-updated-section .rc-pop-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#recent-updated-section .rc-pop-ch {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#recent-updated-section .rc-pop-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    white-space: nowrap;
}

#recent-updated-section .rc-pop-clock {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .25));
}

#recent-updated-section .rc-pop-rel {
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .4));
}

#recent-updated-section .rc-pop-sep {
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .15));
}

#recent-updated-section .rc-pop-date {
    color: rgb(var(--c-white) / calc(var(--ta-b,0) + var(--ta-m,1) * .28));
}

#recent-updated-section .rc-pop-ic {
    width: 13px;
    height: 13px;
    display: block;
    flex-shrink: 0;
}

#recent-updated-section .rc-pop-coins {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: rgb(var(--c-violet-soft));
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

#recent-updated-section .rc-pop-more {
    display: block;
    margin-top: 4px;
    padding: 7px 8px;
    border-top: 1px solid rgb(var(--c-white) / .06);
    font-size: 12px;
    font-weight: 600;
    color: var(--zmio-accent-soft, #a78bfa);
    text-align: center;
}

#recent-updated-section .rc-pop-more:hover {
    color: var(--zmio-accent-light, #c4b5fd);
}

/* touch: :hover sticks after a tap, so let only .is-open drive the popup */
@media (hover: none) {

    #recent-updated-section .rc-group:hover .rc-pop {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
    }

    #recent-updated-section .rc-group.is-open .rc-pop {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}
