/**
 * Episode page parts — classic AnimeStream structure in AnimeKai colours.
 * Episode list (sidebar), series info box and recommended grid (main).
 * Built on the .ak-bix primitives from inner.css; all classes ak-cl-*.
 */

/* ---------- Episodes list (sidebar) ---------- */
.ak-cl-eplist .ak-bix-head {
    flex-wrap: wrap;
}

.ak-cl-epfind {
    width: 9.5rem;
    max-width: 100%;
    height: 2rem;
    padding: 0 .7rem;
    font-size: .85rem;
    color: #fff;
    background: var(--ak-panel-2);
    border: 1px solid var(--ak-line);
    border-radius: .35rem;
    outline: 0;
}

.ak-cl-epfind:focus {
    border-color: var(--ak-primary);
}

.ak-cl-epfind::placeholder {
    color: var(--ak-muted);
}

.ak-cl-eprange {
    padding: .6rem 1.2rem 0;
}

.ak-cl-eprange select {
    width: 100%;
    height: 2.1rem;
    padding: 0 .6rem;
    color: #fff;
    font-size: .85rem;
    background: var(--ak-panel-2);
    border: 1px solid var(--ak-line);
    border-radius: .35rem;
}

.ak-cl-eps {
    list-style: none;
    margin: 0;
    padding: .4rem 0;
    position: relative;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.ak-cl-eps li {
    margin: 0;
    border-left: 3px solid transparent;
}

.ak-cl-eps li + li {
    border-top: 1px solid var(--ak-line);
}

.ak-cl-eps a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .55rem 1rem .55rem calc(1.2rem - 3px);
    color: #fff;
    text-decoration: none;
    transition: background .15s;
}

.ak-cl-eps a:hover {
    background: rgba(255, 255, 255, .04);
}

.ak-cl-eps li.active {
    border-left-color: var(--ak-primary);
    background: rgba(228, 95, 58, .12);
}

.ak-cl-eps .thumb {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    aspect-ratio: 16 / 9;
    border-radius: .3rem;
    overflow: hidden;
    background: var(--ak-panel-2);
}

.ak-cl-eps .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ak-cl-eps .thumb i {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .9rem;
    background: rgba(0, 0, 0, .45);
}

.ak-cl-eps .meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.ak-cl-eps .num {
    font-weight: 700;
    font-size: .9rem;
}

.ak-cl-eps li.active .num {
    color: var(--ak-primary);
}

.ak-cl-eps .ttl {
    color: var(--ak-muted);
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ak-cl-eps .date {
    color: rgba(255, 255, 255, .35);
    font-size: .75rem;
}

.ak-cl-epnone {
    margin: 0;
    padding: 1rem 1.2rem;
    color: var(--ak-muted);
    font-size: .9rem;
}

/* ---------- Series info (main) ---------- */
.ak-cl-info-in {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.ak-cl-poster {
    position: relative;
    flex: 0 0 140px;
    width: 140px;
    aspect-ratio: 2 / 3;
    border-radius: .4rem;
    overflow: hidden;
    background: var(--ak-panel-2);
}

.ak-cl-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ak-cl-type {
    position: absolute;
    top: .4rem;
    left: .4rem;
    padding: .1rem .45rem;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: var(--ak-primary);
    border-radius: .25rem;
}

.ak-cl-infox {
    flex: 1;
    min-width: 0;
}

.ak-cl-title {
    margin: 0 0 .15rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.ak-cl-title a {
    color: #fff;
    text-decoration: none;
}

.ak-cl-title a:hover {
    color: var(--ak-primary);
}

.ak-cl-alt {
    color: var(--ak-muted);
    font-size: .85rem;
    margin-bottom: .4rem;
}

.ak-cl-rating {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .3rem 0 .6rem;
    font-size: .9rem;
}

.ak-cl-rating .stars {
    position: relative;
    display: inline-block;
    font-size: .8rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.ak-cl-rating .base {
    color: rgba(255, 255, 255, .15);
}

.ak-cl-rating .fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    color: #ffc107;
}

.ak-cl-spe {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .3rem 1.2rem;
    max-width: 640px;
    margin: .5rem 0 .7rem;
    font-size: .85rem;
    color: rgba(255, 255, 255, .8);
}

.ak-cl-spe span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ak-cl-spe span.wide {
    grid-column: 1 / -1;
    white-space: normal;
}

.ak-cl-spe b {
    font-weight: 600;
    color: #fff;
}

.ak-cl-spe a {
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
}

.ak-cl-spe a:hover {
    color: var(--ak-primary);
}

.ak-cl-genres {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .7rem;
}

.ak-cl-genres a {
    padding: .15rem .6rem;
    font-size: .78rem;
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
    background: var(--ak-panel-2);
    border: 1px solid var(--ak-line);
    border-radius: .3rem;
    transition: background .15s, color .15s;
}

.ak-cl-genres a:hover {
    color: #fff;
    background: var(--ak-primary);
    border-color: var(--ak-primary);
}

.ak-cl-desc {
    font-size: .88rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .7);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.ak-cl-desc p {
    margin: 0 0 .5rem;
}

.ak-cl-desc.open {
    display: block;
    -webkit-line-clamp: unset;
}

.ak-cl-more {
    margin-top: .3rem;
    padding: 0;
    font-size: .8rem;
    color: var(--ak-primary);
    background: none;
    border: 0;
}

/* ---------- Recommended series (main) ---------- */
.ak-cl-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem .9rem;
}

.ak-cl-card a {
    display: block;
    color: #fff;
    text-decoration: none;
}

.ak-cl-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    border-radius: .4rem;
    overflow: hidden;
    background: var(--ak-panel-2);
}

.ak-cl-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.ak-cl-card a:hover .ak-cl-cover img {
    transform: scale(1.05);
}

.ak-cl-lang {
    position: absolute;
    left: 4px;
    bottom: 4px;
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .85));
}

.ak-cl-lang::before {
    content: "";
    display: inline-block;
    width: .45rem;
    height: .45rem;
    margin-right: .35rem;
    border-radius: 50%;
    background: var(--ak-secondary);
    vertical-align: .05em;
}

.ak-cl-lang.dub::before {
    background: #e5a93a;
}

.ak-cl-lang.raw::before {
    background: #9aa4ad;
}

.ak-cl-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin-top: .45rem;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.35;
    min-height: 2.7em;
}

.ak-cl-card a:hover .ak-cl-name {
    color: var(--ak-primary);
}

@media (max-width: 1400px) {
    .ak-cl-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .ak-cl-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .ak-cl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .9rem .7rem;
    }

    .ak-cl-poster {
        flex-basis: 100px;
        width: 100px;
    }

    .ak-cl-info-in {
        gap: .9rem;
    }

    .ak-cl-title {
        font-size: 1.1rem;
    }

    .ak-cl-spe {
        grid-template-columns: minmax(0, 1fr);
    }

    .ak-cl-epfind {
        width: 8rem;
    }
}

/* ---------- Episodes list: list / number view toggle ---------- */
.ak-cl-eptools {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.ak-cl-epview {
    display: inline-flex;
    padding: 2px;
    background: var(--ak-panel-2);
    border: 1px solid var(--ak-line);
    border-radius: .35rem;
}

.ak-cl-epview button {
    width: 1.8rem;
    height: calc(2rem - 6px);
    padding: 0;
    font-size: .8rem;
    color: var(--ak-muted);
    background: transparent;
    border: 0;
    border-radius: .25rem;
    cursor: pointer;
    transition: color .15s, background .15s;
}

.ak-cl-epview button:hover {
    color: #fff;
}

.ak-cl-epview button.active {
    color: #fff;
    background: var(--ak-primary);
}

/* The number tile only shows in grid view. */
.ak-cl-eps .gnum {
    display: none;
}

.ak-cl-eps.is-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: start;
    gap: .45rem;
    padding: .8rem 1.2rem 1rem;
}

.ak-cl-eps.is-grid li,
.ak-cl-eps.is-grid li + li,
.ak-cl-eps.is-grid li.active {
    border: 0;
    background: none;
}

.ak-cl-eps.is-grid .thumb,
.ak-cl-eps.is-grid .meta {
    display: none;
}

.ak-cl-eps.is-grid a {
    display: block;
    padding: 0;
}

.ak-cl-eps.is-grid a:hover {
    background: none;
}

.ak-cl-eps.is-grid .gnum {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.3rem;
    font-size: .88rem;
    font-weight: 500;
    color: #fff;
    background: var(--ak-panel-2);
    border: 1px solid var(--ak-line);
    border-radius: .35rem;
    transition: background .15s, border-color .15s;
}

.ak-cl-eps.is-grid a:hover .gnum {
    border-color: var(--ak-primary);
}

.ak-cl-eps.is-grid li.active .gnum {
    color: #fff;
    background: var(--ak-primary);
    border-color: var(--ak-primary);
    font-weight: 600;
}

@media (max-width: 1199.98px) {
    .ak-cl-eps.is-grid {
        grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr));
    }
}
