/*
 * nineanime-home.css — owned by the home area.
 * Scope: /home — the slider, Recently Updated, the sidebar blocks, and the
 * CMS home features 9anime never drew (continue watching, comments widget,
 * trending posts).
 *
 * Rules here extend public/assets/nineanime/css/styles.css (9anime's own
 * stylesheet, vendored verbatim — never edit it). Loaded on every page after
 * nineanime-bridge.css, so any page may reuse another area's component.
 * Everything 9anime drew on its home (slider, cards, Quick filter, Top Anime,
 * Recently Added, the schedule widget) is styles.css alone; this file only
 * holds the CMS additions. Comment each block with why it exists.
 */

/* ── Loaders (see the Loaders block in nineanime-bridge.css) ────────────────
   Recently Updated: main.js RecentUpdate sets an inline opacity .5 on .body
   while a tab or page is out; 9anime's grid had no pager, so the dim is
   cancelled (it can only happen if the hidden tabs are ever shown). */
#recent-update .body[style*="opacity"] { opacity: 1 !important; }

/* ── Continue Watching (members: partials/continue-watching-widget; guests:
   app.js renderGuestContinue) ─────────────────────────────────────────────
   A ✕ at the poster's top right (over 9anime's HD corner, which these cards
   do not carry) and "12:34 / 23:40" over a 3px purple rule under the title. */
.na-cw .flw-item .na-cw-x {
    position: absolute; top: 5px; right: 5px; z-index: 5; width: 26px; height: 26px; line-height: 26px;
    border-radius: 50%; text-align: center; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; cursor: pointer;
}
.na-cw .flw-item .na-cw-x:hover { background: #5a2e98; }
.film_list .film_list-wrap .flw-item .na-cw-bar { margin-top: 4px; font-size: 12px; color: #666; }
.na-cw-bar .na-cw-rule { height: 3px; margin-top: 4px; border-radius: 2px; background: #343434; overflow: hidden; }
.na-cw-bar .na-cw-rule span { display: block; height: 100%; background: #5a2e98; }
#na-continue-guest .flw-item .na-cw-line { margin-top: 4px; }
#na-continue-guest .flw-item .na-cw-remove { color: #666; font-size: 12px; }
#na-continue-guest .flw-item .na-cw-remove:hover { color: #fff; }
/* One row only on the home page (owner's choice): as many cards as 9anime's
   grid fits per row at that width (styles.css: 5 / 4 ≤768 / 3 ≤639 / 2 ≤479);
   the rest stay in the DOM, so removing a card lets the next one move up.
   The full list is on /member/continue-watching. */
#widget-continue-watching .film_list-wrap > .flw-item:nth-child(n+6) { display: none; }
@media screen and (max-width: 768px) {
    #widget-continue-watching .film_list-wrap > .flw-item:nth-child(n+5) { display: none; }
}
@media screen and (max-width: 639px) {
    #widget-continue-watching .film_list-wrap > .flw-item:nth-child(n+4) { display: none; }
}
@media screen and (max-width: 479px) {
    #widget-continue-watching .film_list-wrap > .flw-item:nth-child(n+3) { display: none; }
}

/* ── Comments widget (#home-discussion — CMS; notifications-bell.js owns
   loading, the Newest / Top sort and the on/off switch) ───────────────────
   Drawn as one of 9anime's #1c1c1c sidebar panels in the main column:
   heading, 9anime's `.anw-tabs` for the sort, its small `.toggle-onoff`
   switch, then a free-mode row of #212121 comment cards (app.js swiper). */
.na-home-discussion .block_area-header .na-hd-toggle { margin: 9px 15px 0 0; }
.na-home-discussion .block_area-content { padding: 15px 15px 20px; }
#home-discussion.is-off .hd-body { display: none; }
#home-discussion.is-off .bah-tab-min { visibility: hidden; }
#home-discussion .na-hd-loading { display: none; }
#home-discussion:not(.na-hd-ready) .na-hd-loading,
#home-discussion.is-loading .na-hd-loading { display: block; }
#home-discussion:not(.na-hd-ready) .dwl-ul,
#home-discussion.is-loading .dwl-ul { display: none; }
#home-discussion .dwl-ul .swiper-container { padding-bottom: 14px; }
#home-discussion .dwl-ul .swiper-slide { width: 260px; height: auto; }
#home-discussion .dwl-ul .swiper-slide.na-empty { width: 100%; }
#home-discussion .swiper-container-horizontal > .swiper-scrollbar { height: 4px; bottom: 0; background: #262626; }
#home-discussion .swiper-scrollbar-drag { background: #5a2e98; }
#home-discussion .dwl-item { position: relative; height: 100%; padding: 12px 12px 12px 58px; border-radius: 6px; background: #212121; font-size: 13px; line-height: 1.4em; }
#home-discussion .dwl-item .comment-avatar { position: absolute; top: 12px; left: 12px; }
#home-discussion .dwl-item .user-avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #343434; }
#home-discussion .dwl-item .user-avatar-img { width: 100%; height: 100%; object-fit: cover; }
#home-discussion .dwl-item .about { display: flex; align-items: baseline; min-width: 0; margin-bottom: 4px; white-space: nowrap; }
#home-discussion .dwl-item .user-name { color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
#home-discussion .dwl-item .user-name.is-staff { color: #b082e6; }
#home-discussion .dwl-item .time { color: #666; font-size: 12px; margin-left: 4px; flex-shrink: 0; }
#home-discussion .dwl-item .text-cut { color: #aaa; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; margin-bottom: 6px; }
#home-discussion .dwl-item .on-chapt { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#home-discussion .dwl-item .on-chapt a { color: #b082e6; }
#home-discussion .dwl-item .on-chapt a:hover { color: #fff; }

/* ── Trending Posts (community — CMS) ─────────────────────────────────────
   The last sidebar block: rows in the Recently Added rhythm (15px apart,
   alternate rows #181818 as `.anime-block-ul`), a meta line, the title in
   9anime's list-title colours and the author. */
.na-trending-posts .na-post-list { margin: 0 -15px; }
.na-trending-posts .na-post-list li { padding: 12px 15px; font-size: 12px; color: #666; }
.na-trending-posts .na-post-list li:nth-of-type(2n+1) { background: #181818; }
.na-trending-posts .na-post-top { margin-bottom: 4px; }
.na-trending-posts .na-post-top .dot { display: inline-block; width: 4px; height: 4px; margin: 0 6px 2px; border-radius: 50%; background: #444; }
.na-trending-posts .na-post-tag { color: #b082e6; }
.na-trending-posts .film-name { font-size: 14px; font-weight: 400; line-height: 1.4em; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.na-trending-posts .film-name a { color: #ababab; }
.na-trending-posts .film-name a:hover { color: #fff; }
.na-trending-posts .na-post-by img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; margin-right: 6px; vertical-align: middle; }
.na-trending-posts .na-post-by a { color: #666; }
.na-trending-posts .na-post-by a:hover { color: #fff; }
