/*
 * v2-listing.css — listing area of the animeunity-v2 theme
 * (frontend/listing.blade.php + frontend/partials/listing/*: /filter, /genre,
 * /type, /status, /studio, /producer, /az-list, /latest-updated, /new-release,
 * /most-viewed and the Top Anime ranking on /filter?top=1).
 *
 * The page is animeunity.cx's Archive markup with its own Tailwind classes
 * (css/app.css, vendored); this file only adds what those classes cannot say:
 * the three-views switch, the card colours per theme, the engine's add-to-list
 * widget in the card's "+" look, the phone option sheet, the A-Z strip and the
 * no-JS pager. Everything is scoped to #app.v2-listing / .v2-archive.
 * Pushed by the listing view only (@push('styles')).
 */

/* ---------- 1. the bridge's fallback rules do not apply here ---------- */

/* v2-bridge.css §7 colours every link and auto-sizes every image of a page
   that is not the home (for the first skin's views rendered in this shell).
   This page is rebuilt: links take their Tailwind colour again, posters fill
   their box. */
#app.v2-listing #content .v2-archive a { color: inherit; }
#app.v2-listing #content .v2-archive a.text-white { color: #fff; }
#app.v2-listing #content .v2-archive a.text-text-100 { color: rgba(var(--tw-text-100)); }
#app.v2-listing #content .v2-archive a.text-text-200 { color: rgba(var(--tw-text-200)); }
#app.v2-listing #content .v2-archive a[data-v2-genre] { color: var(--media-bg-text); }
#app.v2-listing #content .v2-archive .v2-item a.d-title:hover { color: var(--media-overlay-text); }
#app.v2-listing #content .v2-archive .v2-as-card:hover a.d-title { color: var(--media-text); }
#app.v2-listing #content .v2-archive .v2-item img { max-width: none; height: 100%; }

/* ---------- 2. one title, three looks ---------- */

/* Each .v2-item prints the three looks; the list's data-v2-view keeps one and
   the item itself leaves no box (the look is the grid child). */
.v2-archive [data-v2-list] > .v2-item { display: contents; }
.v2-archive [data-v2-list] > script { display: none; }
.v2-archive [data-v2-view="card"] > .v2-item > :not(.v2-as-card),
.v2-archive [data-v2-view="compact"] > .v2-item > :not(.v2-as-compact),
.v2-archive [data-v2-view="table"] > .v2-item > :not(.v2-as-table) { display: none; }

/* animeunity.cx's --media-text is the light tone on dark and the dark tone on light. */
.v2-media { --media-text: var(--v2-mt-d); }
html.light .v2-media { --media-text: var(--v2-mt-l); }

/* The compact card's plot scrolls on hover (as the reference); a tap pins it open. */
.v2-archive .v2-plot.is-open { display: block; -webkit-line-clamp: unset; max-height: 100%; overflow-y: auto; color: rgba(var(--tw-text-200)); }
.v2-archive .v2-plot { scrollbar-width: thin; }

/* The poster card's hover panel: desktop pointers only (as animeunity.cx), and
   it opens to the left when the card sits near the right edge. */
.v2-archive .v2-hover-panel { backface-visibility: hidden; }
.v2-archive .v2-as-card.is-flip .v2-hover-panel { left: auto; right: 100%; margin-left: 0; margin-right: .625rem; transform-origin: top right; }
.v2-archive .v2-as-card.is-flip .v2-hover-arrow { right: auto; left: 100%; }
.v2-archive .v2-as-card.is-flip .v2-hover-arrow > div { border-right-width: 0; border-left: .6rem solid rgba(var(--tw-fore-800)); }
@media (max-width: 499px), (pointer: coarse), (hover: none) {
    .v2-archive .v2-hover-info { display: none; }
}
/* No hover on touch: the "+" of a poster card is always there. */
@media (hover: none) {
    .v2-archive .v2-card-list { opacity: 1; transform: none; }
}
.v2-archive .v2-card-list:focus-within, .v2-archive .v2-card-list:has(.show) { opacity: 1; transform: none; }

/* ---------- 3. the engine's add-to-list widget as the card's "+" ---------- */

/* animeunity.cx: a 24px square, bg-fore-700 (bg-back-900/90 over a poster),
   text-xs plus. The shared partial's round variant is 20px on bg-back-900. */
.v2-archive .v2-list-btn > a { width: 1.5rem; height: 1.5rem; color: rgba(var(--tw-text-200)); background-color: rgba(var(--tw-fore-700)); }
.v2-archive .v2-list-btn--dark > a { background-color: rgba(var(--tw-back-900), .9); }
.v2-archive .v2-list-btn > a:hover { color: var(--media-text); }
#app.v2-listing #content .v2-archive .v2-list-btn > a { color: rgba(var(--tw-text-200)); }
#app.v2-listing #content .v2-archive .v2-list-btn > a:hover { color: var(--media-text); }
.v2-archive .v2-list-btn > a svg { opacity: .9; }
.v2-archive .v2-list-btn .v2-folders { z-index: 60; text-align: left; white-space: nowrap; }
#app.v2-listing #content .v2-archive .v2-folders a { color: rgba(var(--tw-text-200)); }
#app.v2-listing #content .v2-archive .v2-folders a:hover { color: rgba(var(--tw-blue-100)); }
#app.v2-listing #content .v2-archive .v2-folders a.active { color: #fff; }
/* The compact card clips its content: its folder menu is laid out against the
   viewport (v2-listing.js writes the two custom properties when it opens). */
.v2-archive .v2-as-compact .v2-folders { position: fixed; top: var(--v2-menu-y, 0); left: var(--v2-menu-x, 0); right: auto; margin: 0; }
/* The table row's "+" is a block-level 24px square (the reference's div), not an
   inline box sitting on a text line (that added 1.2px to its cell). */
.v2-archive .v2-as-table .v2-list-btn { display: flex; }
/* The open widget's row sits above the rows after it. */
.v2-archive .v2-as-table:has(.favourite.show) { position: relative; z-index: 30; }
.v2-archive .v2-as-card:has(.favourite.show) { z-index: 30; }

/* ---------- 4. the selects ---------- */

.v2-archive [data-v2-filters][hidden] { display: none; }
.v2-archive .dropdown-trigger { outline: 0; }
.v2-archive .dropdown-trigger:focus-visible > div { box-shadow: 0 0 0 2px rgba(var(--tw-blue-100), .6); }
.v2-archive [data-v2-year] { width: 100%; }
.v2-archive .v2-opt { user-select: none; }
.v2-archive .v2-dd-wrap { min-width: 100%; }
/* A panel (Genere, Studio) never leaves the viewport: v2-listing.js shifts it by --v2-dd-shift. */
.v2-archive .v2-dd-wrap > div { margin-left: var(--v2-dd-shift, 0px); }

/* The tags' "Reimposta" chip shows while the pointer is over the tags (always on touch), as animeunity.cx. */
.v2-archive .v2-tags-reset { opacity: 0; transform: scale(.95); pointer-events: none; transition: opacity .2s ease-out, transform .2s ease-out; }
.v2-archive [data-v2-tags]:hover .v2-tags-reset, .v2-archive .v2-tags-reset:focus-visible { opacity: 1; transform: none; pointer-events: auto; }
@media (pointer: coarse) {
    .v2-archive .v2-tags-reset { opacity: 1; transform: none; pointer-events: auto; }
}

/* The phone sheet (animeunity.cx's ArchiveOptionsModal: a dark veil, the
   select's name over a rounded list at a quarter of the screen). */
.v2-sheet { position: fixed; inset: 0; z-index: 75; font-family: Overpass, sans-serif; }
.v2-sheet-veil { position: absolute; inset: 0; background-color: #000000d9; }
.v2-sheet .v2-opt { user-select: none; }
body.v2-sheet-open { overflow: hidden; }

/* ---------- 5. the A-Z strip (CMS-only: animeunity.cx has no letter list) ---------- */

.v2-az { display: flex; flex-wrap: wrap; gap: .5rem; }
.v2-az-link { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 .6rem; font-size: 12px; font-weight: 700; letter-spacing: .03rem; background-color: rgba(var(--tw-fore-800)); border-radius: .375rem; box-shadow: 0 1px 2px rgba(var(--color-shadow-blue), .03); transition: color .2s; }
#app.v2-listing #content .v2-archive .v2-az-link { color: rgba(var(--tw-text-300)); }
#app.v2-listing #content .v2-archive .v2-az-link:hover { color: rgba(var(--tw-text-100)); }
#app.v2-listing #content .v2-archive .v2-az-link.is-active { color: #fff; background-color: rgba(var(--tw-blue-300)); }

/* ---------- 6. loading, the end of the list, the no-JS pager ---------- */

.v2-archive [data-v2-list].is-loading > .v2-item { opacity: .45; transition: opacity .2s; }
.v2-archive .v2-list-wrap { min-height: 120px; }
.v2-archive .v2-sentinel { height: 1px; }
.v2-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .375rem; margin: 2.5rem 0 1rem; font-family: Overpass, sans-serif; }
.v2-pager[hidden] { display: none; }
.v2-pager-num, .v2-pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 .5rem; font-size: 13px; font-weight: 700; background-color: rgba(var(--tw-fore-800)); border-radius: .375rem; transition: color .2s; }
.v2-pager-btn { font-size: 18px; }
#app.v2-listing #content .v2-archive .v2-pager-num, #app.v2-listing #content .v2-archive .v2-pager-btn { color: rgba(var(--tw-text-300)); }
#app.v2-listing #content .v2-archive a.v2-pager-num:hover, #app.v2-listing #content .v2-archive a.v2-pager-btn:hover { color: rgba(var(--tw-text-100)); }
#app.v2-listing #content .v2-archive .v2-pager-num.is-active { color: #fff; background-color: rgba(var(--tw-blue-300)); }
.v2-archive .au-ad { margin-top: 1.5rem; }
