/* theme.css — Agent H (SPEC3). Global polish for the EVOLOAD dark theme, loaded LAST (from partials/footer.ejs).
   Scope: tokens, typography, focus rings, scrollbars, buttons, pager, header on scroll, mobile side panel,
   footer, loading bar, toasts, back-to-top, keyboard / TV navigation, reduced motion, print.
   Component files (card.css, nav.css, home.css, serie.css, detail.css, extra.css) keep their own intent:
   nothing here restyles their internals — only cross-cutting states (focus, motion, mobile spacing). */

:root {
  --fs-bg: #222;
  --fs-panel: #1e1e1e;
  --fs-panel-2: #2a2a2a;
  --fs-line: #3a3a3a;
  --fs-text: #ccc;
  --fs-text-strong: #fff;
  --fs-muted: #8f8f8f;
  --fs-accent: #f48625;
  --fs-accent-2: #f8aa0c;
  --fs-accent-soft: rgba(244, 134, 37, .35);
  --fs-radius: 4px;
  --fs-shadow: 0 8px 24px rgba(0, 0, 0, .55);
  --fs-ease: cubic-bezier(.2, .8, .2, 1);
  --fs-header-h: 70px;
}

/* ------------------------------------------------------------------ 1. base, typography, scrollbars */
html { scrollbar-width: thin; scrollbar-color: #4b4b4b #1a1a1a; scroll-padding-top: calc(var(--fs-header-h) + 20px); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
a { transition: color .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease; }
h1, h2, h3 { color: var(--fs-text-strong); line-height: 1.3; }
.full-text, .fdesc, .fs-text, .listing-intro, .ft-text { line-height: 1.6; }
/* .pages radius: left to home.css (Agent E) */
::selection { background: rgba(244, 134, 37, .9); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #4b4b4b; border-radius: 8px; border: 2px solid #1a1a1a; }
::-webkit-scrollbar-thumb:hover { background: var(--fs-accent); }
::-webkit-scrollbar-corner { background: #1a1a1a; }

/* ------------------------------------------------------------------ 2. focus (keyboard only) */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--fs-accent); outline-offset: 2px; border-radius: 3px; }
#pjax-root:focus, .cont.center:focus { outline: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; box-shadow: 0 0 0 2px var(--fs-accent-soft); }
.short a.short-poster:focus-visible, .fssts-card > a:focus-visible { outline-offset: 0; }

/* ------------------------------------------------------------------ 3. buttons + form controls */
.button, button:not([class]), input[type="submit"], input[type="button"], input[type="reset"], .fs-btn {
  border-radius: var(--fs-radius);
  font-weight: 700;
  letter-spacing: .2px;
  transition: background-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.button:hover, button:not([class]):hover, input[type="submit"]:hover, input[type="button"]:hover, .fs-btn:hover { box-shadow: 0 4px 14px rgba(244, 134, 37, .28); }
.button:active, button:not([class]):active, input[type="submit"]:active, input[type="button"]:active, .fs-btn:active { transform: translateY(1px); box-shadow: none; }
input[type="text"], input[type="search"], input[type="email"], select, textarea { border-radius: var(--fs-radius); transition: box-shadow .15s ease, background-color .15s ease; }

/* ------------------------------------------------------------------ 4. pager (moved here from local.css) */
.bottom-nav { margin: 30px 0 10px; }
.pagi-nav .navigation { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagi-nav .navigation a, .pagi-nav .navigation span {
  display: inline-block; min-width: 46px; height: 44px; line-height: 44px; padding: 0 12px; text-align: center;
  background: #333; color: #fff; font-size: 22px; border-radius: 3px;
  transition: background-color .15s ease, color .15s ease, transform .15s var(--fs-ease), box-shadow .15s ease;
}
.pagi-nav .navigation a:hover { background: #444; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .4); }
.pagi-nav .navigation a:focus-visible { outline-offset: 0; }
.pagi-nav .navigation .pg-current { background: var(--fs-accent); color: #fff; box-shadow: 0 4px 14px rgba(244, 134, 37, .35); }
.pagi-nav .navigation .nav_ext { background: #2a2a2a; color: #999; }
.pagi-nav .navigation .pg-off { background: #2a2a2a; color: #666; }
@media (max-width: 760px) {
  .pagi-nav .navigation a, .pagi-nav .navigation span { min-width: 36px; height: 36px; line-height: 36px; font-size: 16px; padding: 0 8px; }
}

/* ------------------------------------------------------------------ 5. header on scroll (libs3.js toggles .sticky / .sticky-hide) */
.header { transition: top .3s ease, box-shadow .3s ease, background-color .3s ease; }
html.is-scrolled .header { background-color: rgba(30, 30, 30, .97); box-shadow: 0 4px 20px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html.is-scrolled .header.sticky-hide { box-shadow: none; }
/* keyboard users can open a mega-menu with the arrows (inline display:none is set by head.ejs) */
html.fs-knav #nav-menu > li.submenu:focus-within > .hidden-menu { display: block !important; }
.bookmark-tip { z-index: 9990; }

/* ------------------------------------------------------------------ 6. mobile side panel (built by libs3.js: #side-panel + #close-overlay) */
.side-panel {
  width: 300px; left: -300px; padding: 14px 16px 60px;
  background: rgba(26, 26, 26, .98);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 6px 0 30px rgba(0, 0, 0, .6);
  transition: left .35s var(--fs-ease);
  overscroll-behavior: contain;
}
.side-panel.active { left: 0; }
.side-panel::before { content: "Menu"; display: block; margin: 0 0 10px; padding: 6px 8px 10px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--fs-accent); border-bottom: 2px solid var(--fs-accent); }
.side-panel .nav-menu > li { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.side-panel .nav-menu > li > a { height: 46px; line-height: 46px; font-size: 15px; padding: 0 8px; }
.side-panel .nav-menu > li > a.active, .side-panel .nav-menu > li.menuactive > a { color: var(--fs-accent); }
.side-panel .nav-menu > li.submenu > a::after { content: "\f107"; font-family: FontAwesome; float: right; opacity: .6; transition: transform .2s ease; }
.side-panel .nav-menu > li.submenu.menuactive > a::after { transform: rotate(180deg); }
.side-panel .hidden-menu { background: rgba(255, 255, 255, .04); border-radius: var(--fs-radius); padding: 6px 4px; margin: 0 0 10px; }
.side-panel .hm-col { width: 50%; }
.side-panel .hm-col a { padding: 8px 10px; font-size: 13px; border-radius: 3px; }
.side-panel .hm-col a:hover, .side-panel .hm-col a:focus-visible { background: rgba(244, 134, 37, .15); color: #fff; }
.side-panel .hd-right { padding: 0 0 14px; }
.side-panel .search-wrap { width: 100%; margin-bottom: 8px; }
.side-panel .search-box input { height: 40px; }
.close-overlay { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.btn-menu { border-radius: var(--fs-radius); }
@media (max-width: 760px) {
  .cont { padding: 12px 8px; }
  .pages { padding: 12px; }
  .sect-t { margin-bottom: 12px; }
}
@media (max-width: 360px) { .side-panel { width: 280px; left: -280px; } }

/* ------------------------------------------------------------------ 7. footer (partials/footer.ejs) */
.footer.ft { margin: 24px auto 40px; }
.ft-in { padding: 28px 30px 20px; }
.ft-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 24px 30px; }
.ft-grid > .ft-col { width: auto; min-width: 0; margin: 0; float: none; } /* EVOLOAD styles.css sets .ft-col { width: 16% } */
.ft-title { display: inline-block; margin: 0 0 12px; padding-bottom: 8px; font-size: 13px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .6px; border-bottom: 2px solid var(--fs-accent); }
.ft-brand { font-size: 20px; color: var(--fs-accent); text-transform: none; letter-spacing: 0; }
.ft-brand:hover { color: var(--fs-accent-2); }
.ft-text { margin-bottom: 12px; font-size: 13px; color: #b5b5b5; }
.ft-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ft-stat { padding: 3px 10px; border-radius: 3px; background: #2c2c2c; color: #ddd; font-size: 12px; }
.ft-stat b { color: var(--fs-accent); }
.ft-links { margin: 0; padding: 0; list-style: none; }
.ft-links.ft-two { columns: 2; column-gap: 16px; }
.ft-links li { break-inside: avoid; min-width: 0; overflow: hidden; }
.ft-links a { display: block; padding: 4px 8px 4px 0; font-size: 13px; color: #c3c3c3; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s ease, padding-left .15s ease, background-color .15s ease; }
.ft-links a::before { content: "\f105"; font-family: FontAwesome; margin-right: 8px; color: var(--fs-accent); opacity: .8; }
.ft-links a:hover, .ft-links a:focus-visible { color: #fff; padding-left: 4px; background: rgba(255, 255, 255, .04); }
.ft-btm { display: flex; flex-wrap: wrap; gap: 10px 30px; justify-content: space-between; align-items: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--fs-line); font-size: 12px; line-height: 1.6; color: #9a9a9a; }
.ft-legal { flex: 1 1 520px; }
.ft-legal p { margin: 0 0 6px; }
.ft-legal b { color: #ddd; }
.ft-legal a, .ft-copyr a { color: var(--fs-accent); }
.ft-legal a:hover, .ft-copyr a:hover { color: var(--fs-accent-2); text-decoration: underline; }
.ft-copyr { flex: 0 0 auto; color: #777; }
.ft-copyr kbd { display: inline-block; padding: 0 5px; border: 1px solid #555; border-bottom-width: 2px; border-radius: 3px; background: #2a2a2a; color: #ddd; font: 11px/16px Verdana, Geneva, sans-serif; }
@media (max-width: 950px) { .ft-grid { grid-template-columns: 1fr 1fr; } .ft-about { grid-column: 1 / -1; } }
@media (max-width: 590px) { .ft-grid { grid-template-columns: 1fr; gap: 18px; } .ft-in { padding: 20px 14px; } .ft-links.ft-two { columns: 2; } .footer.ft { margin-bottom: 70px; } }

/* ------------------------------------------------------------------ 8. loading bar (pjax.js: window.fsLoadBar) */
#fs-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100000; pointer-events: none; opacity: 0; transition: opacity .25s ease .15s; }
#fs-loadbar.is-active { opacity: 1; transition-delay: 0s; }
.fs-loadbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ff6a00, var(--fs-accent) 60%, #ffb84d); box-shadow: 0 0 10px rgba(244, 134, 37, .8), 0 0 2px #fff; transition: width .25s ease; }
#fs-loadbar:not(.is-active) .fs-loadbar-fill { transition: none; }
#fs-loadbar.is-error .fs-loadbar-fill { background: #e53935; box-shadow: 0 0 10px rgba(229, 57, 53, .8); }
#pjax-root, .cont.center { transition: opacity .2s ease; }
#pjax-root.pjax-loading, .cont.center.pjax-loading { opacity: .55; pointer-events: none; }
html.pjax-busy { cursor: progress; }

/* ------------------------------------------------------------------ 9. toasts (ui.js: window.fsToast) */
.fs-notifs { position: fixed; right: 16px; bottom: 74px; z-index: 100001; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.fs-notif {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 14px;
  background: rgba(28, 28, 28, .97); color: #eee; border: 1px solid var(--fs-line); border-left: 4px solid var(--fs-accent); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6); font-size: 13.5px; line-height: 1.45; pointer-events: auto; cursor: default;
  opacity: 0; transform: translateY(12px); transition: transform .25s var(--fs-ease), opacity .25s ease;
}
.fs-notif.is-in { opacity: 1; transform: none; }
.fs-notif.is-out { opacity: 0; transform: translateX(24px); }
.fs-notif > .fa { flex: 0 0 auto; margin-top: 1px; font-size: 16px; color: var(--fs-accent); }
.fs-notif-success { border-left-color: #43a047; } .fs-notif-success > .fa { color: #43a047; }
.fs-notif-error { border-left-color: #e53935; } .fs-notif-error > .fa { color: #e53935; }
.fs-notif-warn { border-left-color: #fbc02d; } .fs-notif-warn > .fa { color: #fbc02d; }
.fs-notif-msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.fs-notif-msg b { color: #fff; }
.fs-notif-msg a { color: var(--fs-accent); text-decoration: underline; }
.fs-notif-msg kbd { display: inline-block; padding: 0 5px; border: 1px solid #555; border-bottom-width: 2px; border-radius: 3px; background: #2a2a2a; color: #fff; font: 11px/16px Verdana, Geneva, sans-serif; }
.fs-notif-x { flex: 0 0 auto; height: auto; padding: 0 4px; border: 0; background: none !important; box-shadow: none !important; color: #888; font-size: 18px; line-height: 1; cursor: pointer; }
.fs-notif-x:hover, .fs-notif-x:focus-visible { color: #fff; }
@media (max-width: 590px) { .fs-notifs { left: 12px; right: 12px; bottom: 70px; width: auto; max-width: none; } }

/* ------------------------------------------------------------------ 10. back to top (#fs-totop in footer.ejs) */
.fs-totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 9000; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff;
  background: rgba(244, 134, 37, .92); box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s var(--fs-ease), visibility 0s linear .25s, background-color .15s ease;
}
.fs-totop.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.fs-totop:hover, .fs-totop:focus-visible { background: var(--fs-accent-2); color: #fff; }
.fs-totop:active { transform: scale(.94); }

/* ------------------------------------------------------------------ 11. keyboard / TV navigation (ui.js: html.fs-knav, html.fs-tv) */
html.fs-knav .fs-knav-focus, html.fs-knav :focus-visible { outline: 2px solid #ffab55; outline-offset: 2px; box-shadow: 0 0 0 5px var(--fs-accent-soft), 0 0 18px rgba(244, 134, 37, .5); border-radius: 4px; }
html.fs-knav .short a.short-poster.fs-knav-focus, html.fs-knav .short a.short-poster:focus-visible,
html.fs-knav .fssts-card > a.fs-knav-focus, html.fs-knav .fssts-card > a:focus-visible {
  outline: none; position: relative; z-index: 120;
  box-shadow: 0 0 0 3px #ffab55, 0 0 0 7px rgba(244, 134, 37, .4), 0 12px 30px rgba(0, 0, 0, .65);
  transform: scale(1.06); transition: transform .18s var(--fs-ease), box-shadow .2s ease;
}
html.fs-knav .short:has(a.fs-knav-focus), html.fs-knav .short:has(a:focus-visible) { z-index: 120; }
html.fs-knav .fssts-card:has(a.fs-knav-focus) { z-index: 120; overflow: visible; }
html.fs-knav #nav-menu > li > a.fs-knav-focus, html.fs-knav #nav-menu > li > a:focus-visible,
html.fs-knav #header .logotype.fs-knav-focus, html.fs-knav #header .btn-menu.fs-knav-focus {
  outline: none; box-shadow: none; color: #fff; transform: scale(1.08); text-shadow: 0 0 12px rgba(244, 134, 37, .9); transition: transform .18s ease;
}
html.fs-knav #header .search-box:focus-within { box-shadow: 0 0 0 2px var(--fs-accent-soft); border-radius: var(--fs-radius); }
html.fs-knav .short-mask { opacity: 0; }
html.fs-knav .short a.short-poster.fs-knav-focus .short-mask { opacity: 1; }
html.fs-tv body { font-size: 15px; }
html.fs-tv .short a.short-poster.fs-knav-focus { transform: scale(1.1); }
html.fs-tv .fs-notifs { font-size: 16px; }
html.fs-tv .fs-totop { display: none; }

/* ------------------------------------------------------------------ 12. motion + print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
@media print {
  .header-outer, .footer, .fs-totop, .fs-notifs, #fs-loadbar, .side-panel, .close-overlay, .btn-menu, .bottom-nav,
  .fssts-nav, .short-mask, .fav-btn, .info-btn, .bookmark-tip, iframe { display: none !important; }
  body, .wrap, .wrap-in, .pages { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  a { color: #000 !important; text-decoration: none; }
  .cont { min-height: 0; padding: 0; }
}
