/*
 * `animeworld` theme — the listing pages' additions (frontend/listing.blade.php + partials/listing/*). animeworld.ac's
 * own rules for the filter bar, the poster grid, the A-Z list and the pager are in the vendored css/all.css,
 * css/dark.css and css/pages/filter-filter.css; this file holds only what its pages carried inline or the CMS adds:
 *
 *   1. Sidebar genres   CMS genre names can be longer than animeworld's: one line each, cut with an ellipsis
 *   2. A-Z              `span.az-total` (animeworld prints this rule inline on /az-list), the title's wrapping
 *   3. Filter bar       the studio / producer tag (CMS facet), the members' "Nascondi i miei anime" box
 *   4. Empty result     the A-Z rows' alert line; the owner's mascot under every not-found line
 *   5. Pager            the page number field without the browser's spin buttons
 *   6. Banner boxes     the sidebar's two `div.widget.crop.text-center` around the CMS's `sidebar` ad slot
 *
 * Every rule is scoped to `#app.aw-listing` (the listing view's layout class) or to a class of its own.
 */

/* 1. Sidebar genres */
#app.aw-listing .widget.genres ul li a { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 2. A-Z */
.widget.az-list .widget-title .az-total { float: right; margin-top: 7px; padding: 2px 8px; border-radius: 3px; background: #367dc3; color: #fff; font-family: Nunito Sans, sans-serif; font-size: .8rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
@media screen and (max-width: 450px) { .widget.az-list .widget-title .az-total { float: none; display: inline-block; margin: 0 0 8px; } }
#app.aw-listing .widget.az-list .items .item .info .name, #app.aw-listing .widget.az-list .items .item .info p { overflow-wrap: anywhere; }
/* 3. Filter bar */
#app.aw-listing .aw-filter-tags { clear: both; padding: 2px 5px 6px; }
#app.aw-listing .aw-filter-tag { display: inline-block; max-width: 100%; margin: 0 6px 4px 0; padding: 2px 8px; overflow: hidden; border-radius: 3px; background: #367dc3; color: #fff; font-family: "Nunito Sans", sans-serif; font-size: .85rem; font-weight: 600; line-height: 1.6; white-space: nowrap; text-overflow: ellipsis; vertical-align: top; transition: background-color .2s ease-in-out; }
#app.aw-listing .aw-filter-tag:hover, #app.aw-listing .aw-filter-tag:focus { background: #165fa7; color: #fff; text-decoration: none; }
#app.aw-listing .aw-filter-tag .fas { margin-left: 4px; font-size: .75rem; opacity: .85; }
#app.aw-listing form.filters .aw-filter-mine { margin-top: 5px; padding-top: 5px; border-top: 1px solid #eee; }
#app.aw-listing form.filters .filter-dropdown-menu li.aw-filter-mine label { white-space: normal; }
body.dark #app.aw-listing form.filters .aw-filter-mine { border-top-color: #333; }
/* A CMS genre / source name can be one long word ("Anthropomorphic"): one line per option, cut with an ellipsis,
   so the floated columns stay in rows. */
form.filters .filter .filter-dropdown-menu li label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Touch screens: main.js lays a full-page `.dropdown-backdrop` (z-index 990) under an open menu so a tap outside
   closes it. animeworld has none — the other filter buttons, the keyword field and "Cerca" stay one tap away. */
@media (hover: none), (pointer: coarse) {
    form.filters .filter .dropdown-toggle, form.filters .filter.search, form.filters .filter.submit { position: relative; z-index: 991; }
}
/* Phones: the genre menu is 98vw wide and its `bounceIn` overshoots the screen edge for a few frames — enough for
   a phone browser to widen the layout viewport and keep it widened. The page root clips it instead. */
@media (max-width: 500px) { #app.aw-listing { overflow-x: clip; } }

/* 4. Empty result */
#app.aw-listing .aw-listing-empty { clear: both; margin: 10px 5px; font-family: "Nunito Sans", sans-serif; }
/* The owner's mascot under the not-found line: animeworld's search not-found picture box (centred, 35% of the
   column, 45% ≤ 400px — all.css `.search-not-found-wrapper img`). */
#app.aw-listing .aw-listing-art { clear: both; margin: 0; padding: 0 4% 15px; text-align: center; }
#app.aw-listing .aw-listing-art img { display: inline-block; width: 35%; max-width: 240px; height: auto; }
@media screen and (max-width: 400px) { #app.aw-listing .aw-listing-art img { width: 45%; } }

/* 5. Pager */
#app.aw-listing .paging-wrapper form input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
#app.aw-listing .paging-wrapper form input[type="number"]::-webkit-outer-spin-button,
#app.aw-listing .paging-wrapper form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 6. Banner boxes — the sidebar's two `div.widget.crop.text-center` (all.css draws the box: white, 3px radius,
      shadow, overflow hidden, 15px under it). The CMS prints the `sidebar` slot's code straight inside the box
      (animeworld wraps its own in <center>): a block-level unit is centred like the target's `margin:auto` frame
      and can never be wider than a phone's column. */
#app.aw-listing #sidebar > .ak-ad.widget.crop > * { margin-left: auto; margin-right: auto; max-width: 100%; }
#app.aw-listing #sidebar > .ak-ad.widget.crop iframe, #app.aw-listing #sidebar > .ak-ad.widget.crop img { display: block; margin-left: auto; margin-right: auto; max-width: 100%; }
