/* AnimeSuge — custom styles on top of style.css.
   Colours use the --primary / --animesuge-primary variables so the
   Customizer colour picker actually changes buttons, badges, links
   and the play button. */

/* Logo text fallback (when no custom logo image is uploaded).
   One horizontal lockup: "AnimeSuge!" on a single line, never stacked. */
.logo-text { display: inline-flex; align-items: baseline; white-space: nowrap; line-height: 1; color: #fff; font-family: "Pathway Extreme", sans-serif; }
.logo-suge { font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: .02em; }
.logo-anime { font-size: 2rem; font-weight: 900; color: #fff; }
.logo-bang { font-size: 2rem; font-weight: 900; color: var(--primary, #e50914); }
.footer-logo .logo-anime, .footer-logo .logo-suge, .footer-logo .logo-bang { font-size: 1.6rem; }
/* The logo image (custom logo) is sized by style.css (.logo a img). */

/* Breadcrumbs */
.animesuge-breadcrumb { font-size: .9rem; color: #9a9a9a; margin: 1rem 0; }
.animesuge-breadcrumb a { color: #d3d3d3; }
.animesuge-breadcrumb a:hover { color: var(--primary, #e50914); }

/* Buttons use the Customizer button colour */
.btn-primary, .filter-btn { background-color: var(--animesuge-button, #e50914) !important; border-color: var(--animesuge-button, #e50914) !important; color: #fff !important; }
.btn-primary:hover, .filter-btn:hover { filter: brightness(1.15); }

/* Anime cards — the grid itself is sized by style.css
   (.anime.main-card .item { width: 14.2857% } = 7 per row desktop).
   Cards MUST be direct .item children of .anime.main-card. These rules
   only add the play button, the alt-text safeguard and small tweaks. */
/* Never show alt text inside the poster box (double-name fix). */
.anime.main-card .item .poster { font-size: 0; color: transparent; }
.anime.main-card .item .poster img { color: transparent; }
.anime.main-card .item .poster div { position: relative; }
.poster-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; font-weight: 800; color: #464646; background: linear-gradient(135deg, #1b1b1b, #2d2d2d); }
/* The stylesheet's own .poster:before play glyph needs the Line Awesome
   font, which the theme does not load, so the visible play button is
   this real element (red circle, white triangle). */
.anime.main-card .item .inner .item-top .playnow-btn { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--primary, #e50914); display: flex; align-items: center; justify-content: center; z-index: 5; opacity: 0; transform: scale(3); transition: transform .3s ease, opacity .3s ease; pointer-events: none; box-shadow: 0 4px 18px rgba(0,0,0,.55); }
.playnow-btn .play-triangle { width: 0; height: 0; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }
.anime.main-card .item .inner .item-top::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .3s ease; z-index: 4; pointer-events: none; }
.anime.main-card .item .inner:hover .item-top::after, .anime.main-card .item.playshow .item-top::after { opacity: 1; }
.anime.main-card .item .inner:hover .playnow-btn, .anime.main-card .item:focus-within .playnow-btn, .anime.main-card .item.playshow .playnow-btn { opacity: 1; transform: scale(1); }
/* Hide the stylesheet's empty .poster:before glyph (no Line Awesome font). */
.anime.main-card .item .poster::before { content: none !important; }
@media (prefers-reduced-motion: reduce) {
  .anime.main-card .item .inner .item-top .playnow-btn { transition: none; transform: scale(1); }
}

/* Most Viewed ranked list */
.most-list { list-style: none; padding: 0; margin: 0; }
.most-item { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid #2d2d2d; }
.most-item .rank { font-size: 1.4rem; font-weight: 800; color: var(--primary, #e50914); min-width: 2rem; }
.most-item img { width: 48px; height: 68px; object-fit: cover; border-radius: .2rem; }
.most-link { display: flex; align-items: center; gap: .7rem; color: #ededed; flex: 1; }
.most-title { font-weight: 600; }

/* Detail / watch pages */
.detail-top { display: flex; gap: 1.5rem; margin: 1rem 0 2rem; flex-wrap: wrap; }
.detail-poster { position: relative; flex: 0 0 220px; }
.detail-poster img { width: 100%; height: auto; border-radius: .2rem; }
.detail-info { flex: 1; min-width: 260px; }
.anime-title, .episode-title, .page-title { font-size: 1.6rem; color: #fff; margin: .5rem 0 1rem; }
.detail-badges .badge { display: inline-block; background: #2d2d2d; color: #ededed; padding: .2rem .6rem; border-radius: .2rem; margin-right: .4rem; font-size: .85rem; }
.details-list { display: grid; grid-template-columns: 140px 1fr; gap: .3rem .8rem; }
.details-list dt { font-weight: 700; color: #d3d3d3; }
.details-list dd { margin: 0; color: #ededed; }
.episode-list { list-style: none; padding: 0; columns: 2; }
@media (max-width: 768px) { .episode-list { columns: 1; } }
.episode-list li { margin-bottom: .4rem; break-inside: avoid; }
.episode-list li a { display: flex; justify-content: space-between; background: #1b1b1b; color: #ededed; padding: .55rem .8rem; border-radius: .2rem; }
.episode-list li a:hover, .episode-list li.current a { background: var(--primary, #e50914); color: #fff; }

/* Video player */
.video-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: .2rem; overflow: hidden; margin: 1rem 0; }
.video-player iframe, .video-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #9a9a9a; text-align: center; padding: 1rem; }
.player-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.player-toggle, .server-btn { background: #2d2d2d; color: #ededed; border: 1px solid #464646; padding: .4rem .9rem; border-radius: .2rem; cursor: pointer; }
.player-toggle.active, .player-toggle[aria-pressed="true"], .server-btn.active { background: var(--primary, #e50914); border-color: var(--primary, #e50914); color: #fff; }
.server-btn:disabled { opacity: .45; cursor: not-allowed; }
a.server-btn { display: inline-block; text-decoration: none; }
.episode-nav { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1rem 0 2rem; }

/* Filter form */
.filter-form { background: #1b1b1b; padding: 1rem; border-radius: .2rem; margin-bottom: 1.5rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.filter-row label { flex: 1; min-width: 160px; color: #d3d3d3; font-size: .9rem; }
.filter-row input, .filter-row select { width: 100%; margin-top: .3rem; background: #2d2d2d; color: #ededed; border: 1px solid #464646; padding: .5rem; border-radius: .2rem; }
.filter-count { color: #9a9a9a; }

/* Hero */
.hero-search { text-align: center; padding: 2rem 0; }
.hero-title { font-size: 2rem; color: #fff; }
.hero-tagline { color: #9a9a9a; }
.hero-search-form { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.hero-search-form input[type="search"] { min-width: 260px; padding: .6rem .9rem; background: #2d2d2d; color: #ededed; border: 1px solid #464646; border-radius: .2rem; }

/* v1.0.5: the .or.at stylesheet makes every .unix-head-btn a fixed
   2rem-wide icon button. The theme's text links (Surprise Me, Bookmarks,
   Profile) overflowed that 2rem box and painted over each other at
   1280px. Text buttons get their natural width instead. */
.unix-head-wrap a.unix-head-btn { width: auto; padding: 0 .45rem; }

/* Header fit: at 1280px the 9-item menu + logo + language + search +
   Sign In overflowed the container by ~15px, clipping "Sign In".
   Tighten spacing below 1400px (the mobile menu takes over below 1200px). */
@media (max-width: 1400px) {
  #unix-head-menu > ul > li { margin-left: 1.1rem; }
  #unix-head-menu > ul > li > a { font-size: 1rem; }
  .logo-anime, .logo-suge, .logo-bang { font-size: 1.7rem; }
  .unix-head-btn { margin-left: .8rem; white-space: nowrap; }
  #language-switch { margin-left: .5rem; }
  /* v1.0.5: v1.0.4 added Surprise Me + Bookmarks buttons after the search
     icon, so at 1280px (logged in) the three buttons overlapped. Below
     1400px keep only the Surprise Me dice icon — the label hides. */
  .surprise-btn .surprise-label { display: none; }
}

/* Anime detail poster: the type badge is absolutely positioned, so the
   poster wrapper must be the positioning context (otherwise the badge
   lands below the poster). */
.detail-poster { position: relative; display: inline-block; }
.menu-toggler { display: none; background: none; border: 0; color: #fff; font-size: 1.8rem; cursor: pointer; }
@media (max-width: 1199.98px) {
  .menu-toggler { display: inline-flex; align-items: center; }
  #unix-head-menu.open > ul { display: block; }
  #unix-head-menu > ul > li.have-sub > ul, #unix-head-menu > ul > li.menu-item-has-children > ul { display: none; }
  #unix-head-menu > ul > li.have-sub.open-sub > ul, #unix-head-menu > ul > li.menu-item-has-children.open-sub > ul { display: block; }
}
.show-search { background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; }
.site-footer { padding: 2rem 0; text-align: center; }
.site-footer .footer-nav a { margin: 0 .8rem; color: #d3d3d3; }
/* Footer menu: horizontal, no bullets (the assigned menu renders a <ul>,
   which otherwise shows default disc bullets stacked at the left). */
.site-footer .footer-nav ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.site-footer .footer-nav ul li a { margin: 0 .8rem; color: #d3d3d3; }
.go-to-top { margin-bottom: 1rem; }
/* Synopsis more / less (single anime page) */
.synopsis { position: relative; }
.synopsis.clamped { max-height: 7.5em; overflow: hidden; }
.synopsis.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5em; background: linear-gradient(transparent, #101010); pointer-events: none; }
.synopsis-toggle { background: none; border: 0; color: var(--primary, #e50914); cursor: pointer; font-weight: 700; padding: .3rem 0; font-size: .95rem; }

#go-top { background: #2d2d2d; color: #ededed; border: 0; padding: .5rem 1rem; border-radius: .2rem; cursor: pointer; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ---- v1.0.4: AnimeStream-style additions ---- */

/* Homepage layout with sidebar */
.home-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.home-main { flex: 1; min-width: 0; }
.home-sidebar { flex: 0 0 300px; }
@media (max-width: 900px) {
  .home-layout { flex-direction: column; }
  .home-sidebar { flex: 1 1 auto; width: 100%; }
}
.sidebar-block { background: #1b1b1b; border-radius: .2rem; padding: 1rem; margin-bottom: 1.5rem; }
.sidebar-block h3 { color: #fff; font-size: 1.1rem; margin: 0 0 .8rem; }
.sidebar-block label { display: block; color: #d3d3d3; font-size: .9rem; margin-bottom: .6rem; }
.sidebar-block select { width: 100%; margin-top: .3rem; background: #2d2d2d; color: #ededed; border: 1px solid #464646; padding: .5rem; border-radius: .2rem; }
.sidebar-block .tabs { display: flex; gap: .8rem; margin-bottom: .6rem; }
.sidebar-block .tabs .tab { cursor: pointer; color: #9a9a9a; }
.sidebar-block .tabs .tab.active { color: var(--primary, #e50914); font-weight: 700; }
.latest-eps-list { list-style: none; padding: 0; margin: 0; }
.latest-eps-list li { padding: .4rem 0; border-bottom: 1px solid #2d2d2d; }
.latest-eps-list a { color: #ededed; }

/* Hero slider */
.hero-slider { position: relative; margin: 1.5rem 0; border-radius: .3rem; overflow: hidden; background: #000; }
.hero-slider .slide { position: relative; min-height: 320px; display: flex; align-items: flex-end; }
.hero-slider .slide-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.hero-slider .slide-info { position: relative; padding: 2rem; max-width: 640px; }
.hero-slider .slide-title { color: #fff; font-size: 1.8rem; margin: 0 0 .5rem; }
.hero-slider .slide-score { color: #ffd700; font-weight: 700; }
.hero-slider .slide-synopsis { color: #d3d3d3; }
.slider-prev, .slider-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.6); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; }
.slider-prev { left: .8rem; }
.slider-next { right: .8rem; }

/* Announcements */
.animesuge-announcement { background: var(--primary, #e50914); color: #fff; text-align: center; padding: .5rem 1rem; font-size: .95rem; }
.animesuge-announcement a { color: #fff; text-decoration: underline; }
.announcement-top-player, .announcement-bottom-player { background: #2d2d2d; color: #ededed; padding: .6rem 1rem; border-radius: .2rem; margin: .8rem 0; text-align: center; }

/* Ads */
.animesuge-ad { margin: 1rem 0; text-align: center; overflow: hidden; }
.animesuge-ad:empty { display: none; }
.overlay-player-ad { margin: .5rem 0; text-align: center; }
.animesuge-float-ad { position: fixed; z-index: 999; background: #1b1b1b; padding: .5rem; border: 1px solid #464646; }
.ad-float-left { left: 0; top: 50%; transform: translateY(-50%); }
.ad-float-right { right: 0; top: 50%; transform: translateY(-50%); }
.ad-float-top { top: 0; left: 50%; transform: translateX(-50%); }
.ad-float-bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.ad-float-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Autocomplete suggestions */
.animesuge-suggest { display: none; position: absolute; z-index: 100; background: #1b1b1b; border: 1px solid #464646; border-radius: .2rem; min-width: 260px; max-height: 320px; overflow-y: auto; }
.animesuge-suggest a { display: block; padding: .5rem .8rem; color: #ededed; }
.animesuge-suggest a:hover { background: var(--primary, #e50914); color: #fff; }
.unix-site-search { position: relative; }

/* Bookmark / actions */
.anime-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.bookmark-btn { background: #2d2d2d; color: #ededed; border: 1px solid #464646; }
.bookmark-btn[aria-pressed="true"] { background: var(--primary, #e50914); border-color: var(--primary, #e50914); color: #fff; }
.surprise-btn { white-space: nowrap; }
.share-links a { margin-right: .8rem; color: #d3d3d3; }
.share-links a:hover { color: var(--primary, #e50914); }
.censor-notice { background: #3a1b1b; color: #ffb3b3; padding: .6rem 1rem; border-radius: .2rem; }
.download-box { display: flex; gap: 1rem; align-items: center; background: #1b1b1b; padding: 1rem; border-radius: .2rem; margin: 1rem 0; }
.download-box img { width: 64px; height: 90px; object-fit: cover; }

/* Characters & gallery */
.characters-list { list-style: none; padding: 0; columns: 2; }
@media (max-width: 768px) { .characters-list { columns: 1; } }
.characters-list li { padding: .4rem 0; border-bottom: 1px solid #2d2d2d; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.gallery-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: .2rem; }

/* A-Z list */
.az-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.az-nav a { background: #2d2d2d; color: #ededed; padding: .3rem .7rem; border-radius: .2rem; }
.az-nav a:hover { background: var(--primary, #e50914); color: #fff; }
.az-heading { color: var(--primary, #e50914); border-bottom: 1px solid #2d2d2d; padding-bottom: .3rem; }

/* Home blog */
.home-blog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.home-blog-item { background: #1b1b1b; border-radius: .2rem; padding: 1rem; }
.home-blog-item img { width: 100%; height: auto; border-radius: .2rem; }
.home-blog-item h3 { font-size: 1.05rem; margin: .6rem 0 .3rem; }
.home-blog-item h3 a { color: #ededed; }

/* RTL */
body.animesuge-rtl { direction: rtl; }
body.animesuge-rtl .home-layout { flex-direction: row-reverse; }

/* Logo dark/light images */
.logo-dark-img, .custom-logo { max-height: 48px; width: auto; }

/* Options page colour fields */
.animesuge-color-field { font-family: monospace; }

/* Characters with images (Generate Cast Images) */
.characters-list .char-img { width: 48px; height: 68px; object-fit: cover; border-radius: .2rem; vertical-align: middle; margin-right: .6rem; }
