/* ── Row controls: the per-site design of the small controls beside the home row titles ────────────────────────────
   UI_CONTROLS in plugins/settings.php puts data-ui-controls="<n>" on <html> and links this sheet (design 1, the site as
   designed, links nothing). One markup everywhere — the designs only restyle it:

     × / ‹ / ›          .series-slider-controls > button (Featured), .poster-slider-ctl (Trending, Most Reviewed, Editor's
                        Choice row, Similar series …), .recent-updated-controls > button (Recently Updated), .ec-hide
     View all           .recent-updated-controls > a
     range menu         .poster-slider-range + button.poster-slider-range-opt (the active one carries the accent inline)
     list / grid        .ru-seg + .ru-seg button[aria-pressed] (home + /recently-updated)

   The Featured designs' header controls — × ‹ › of designs 2 and 4, the × of 5, 6 and 8 — carry .poster-slider-ctl too;
   design 3's glass buttons over the slide and the arrows inside the stages of 5, 6 and 8 keep their own look. The roundness level
   (ui-radius.css, linked before this sheet) still decides the corners; the joined design only squares the shared ones.
   Colours use the --c-white token so the light theme flips them with the rest of the page. ── */

/* ── 2 · joined: adjacent icon buttons fuse into one bar — the gap closes, the hairlines overlap, inner corners square ── */
html[data-ui-controls="2"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button)
  + :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button) {
    margin-left: calc(-.5rem - 1px); /* the row's gap-2 plus the shared 1px hairline */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
html[data-ui-controls="2"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button):has(+ button) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
/* a hovered / focused cell rises above its neighbours so its full hairline shows */
html[data-ui-controls="2"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button):is(:hover, :focus-visible) { position: relative; z-index: 1; }
/* the range menu and the list / grid switch: no inner padding, options flush to the frame, hairlines between them */
html[data-ui-controls="2"] .poster-slider-range, html[data-ui-controls="2"] .ru-seg { padding: 0; gap: 0; overflow: hidden; }
html[data-ui-controls="2"] button.poster-slider-range-opt { height: 100%; border-radius: 0; }
html[data-ui-controls="2"] .ru-seg button { width: 36px; height: 34px; border-radius: 0; }
html[data-ui-controls="2"] button.poster-slider-range-opt + button.poster-slider-range-opt,
html[data-ui-controls="2"] .ru-seg button + button { border-left: 1px solid rgb(var(--c-white) / .08); }

/* ── 3 · solid: filled tiles, no hairline ── */
html[data-ui-controls="3"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button, .recent-updated-controls > a, .ec-hide, .poster-slider-range, .ru-seg) {
    border-color: transparent;
    background: rgb(var(--c-white) / .1);
}
html[data-ui-controls="3"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button, .recent-updated-controls > a, .ec-hide):is(:hover, :focus-visible) {
    border-color: transparent;
    background: rgb(var(--c-white) / .17);
}

/* ── 4 · outline: transparent tiles with a hairline; the active option is outlined in the accent, not filled ── */
html[data-ui-controls="4"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button, .recent-updated-controls > a, .ec-hide, .poster-slider-range, .ru-seg) {
    border-color: rgb(var(--c-white) / .18);
    background: transparent;
}
html[data-ui-controls="4"] :is(.series-slider-controls > button, .poster-slider-ctl, .recent-updated-controls > button, .recent-updated-controls > a, .ec-hide):is(:hover, :focus-visible) {
    border-color: rgb(var(--c-white) / .45);
    background: transparent;
}
/* the active range option's accent is an inline style, hence the !important */
html[data-ui-controls="4"] button.poster-slider-range-opt[style*="background"],
html[data-ui-controls="4"] .ru-seg button[aria-pressed="true"], html[data-ui-controls="4"] .ru-seg button[aria-pressed="true"]:hover {
    background: transparent !important;
    box-shadow: inset 0 0 0 1px rgba(var(--zmio-accent-rgb, var(--scheme-rgb, 167,139,250)), .9);
    color: var(--zmio-accent-soft, #a78bfa);
}

/* ── 5 · accent: the arrows and View all in the site accent; × stays quiet ── */
html[data-ui-controls="5"] :is(.series-slider-controls > button[data-slider-prev], .series-slider-controls > button[data-slider-next], .poster-slider-ctl[data-slider-prev], .poster-slider-ctl[data-slider-next], .recent-updated-controls > button[hx-get], .recent-updated-controls > a) {
    border-color: transparent;
    background: var(--zmio-accent-pill-bg, var(--scheme-pill, linear-gradient(135deg, rgb(109, 40, 217), rgb(167, 139, 250))));
    color: #fff;
}
html[data-ui-controls="5"] :is(.series-slider-controls > button[data-slider-prev], .series-slider-controls > button[data-slider-next], .poster-slider-ctl[data-slider-prev], .poster-slider-ctl[data-slider-next], .recent-updated-controls > button[hx-get], .recent-updated-controls > a):is(:hover, :focus-visible) {
    border-color: transparent;
    background: var(--zmio-accent-pill-bg, var(--scheme-pill, linear-gradient(135deg, rgb(109, 40, 217), rgb(167, 139, 250))));
    color: #fff;
    filter: brightness(1.12);
}

/* ── The offline downloads page (/?downloads; assets/scripts/offline.js) ─────────────────────────────────────────────
   Its buttons — Select, Select all, Cancel (.mo-tb-btn) and the per-row delete (.mo-lib-del) — are drawn like the row
   controls above (hairline + faint fill), so they take the same five designs. Delete (.is-danger) keeps its red in
   every design; the accent design paints Select, the page's one primary action. ── */
html[data-ui-controls="2"] .mo-bar .mo-tb-btn + .mo-tb-btn { margin-left: calc(-8px - 1px); border-top-left-radius: 0; border-bottom-left-radius: 0; }
html[data-ui-controls="2"] .mo-bar .mo-tb-btn:has(+ .mo-tb-btn) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
html[data-ui-controls="2"] .mo-bar .mo-tb-btn:is(:hover, :focus-visible) { position: relative; z-index: 1; }
html[data-ui-controls="3"] :is(.mo-tb-btn:not(.is-danger), .mo-lib-del) { border-color: transparent; background: rgb(var(--c-white) / .1); }
html[data-ui-controls="3"] .mo-tb-btn:not(.is-danger):is(:hover, :focus-visible) { border-color: transparent; background: rgb(var(--c-white) / .17); }
html[data-ui-controls="4"] :is(.mo-tb-btn:not(.is-danger), .mo-lib-del) { border-color: rgb(var(--c-white) / .18); background: transparent; }
html[data-ui-controls="4"] .mo-tb-btn:not(.is-danger):is(:hover, :focus-visible) { border-color: rgb(var(--c-white) / .45); background: transparent; }
html[data-ui-controls="4"] .mo-tb-btn.is-danger { border-color: rgba(248, 113, 113, .5); background: transparent; }
html[data-ui-controls="4"] .mo-lib-del:hover { border-color: rgba(248, 113, 113, .5); background: transparent; }
html[data-ui-controls="5"] .mo-tb-btn[data-mo-act="select"], html[data-ui-controls="5"] .mo-tb-btn[data-mo-act="select"]:is(:hover, :focus-visible) {
    border-color: transparent;
    background: var(--zmio-accent-pill-bg, var(--scheme-pill, linear-gradient(135deg, rgb(109, 40, 217), rgb(167, 139, 250))));
    color: #fff;
}
html[data-ui-controls="5"] .mo-tb-btn[data-mo-act="select"]:is(:hover, :focus-visible) { filter: brightness(1.12); }
