/* The home page (series/serie_list.html) and the category pages (series/category_list.html), built on the shared
   ui-* pieces of static/site/site.css and the theme variables of layout/base.html. */

/* ================================================================ home: the phone slider */
.hm-mslider { position: relative; margin: 12px 12px 0; overflow: hidden; border-radius: 20px; background: var(--surface-2); user-select: none; -webkit-user-select: none; }
.hm-mslider-in { position: relative; aspect-ratio: 2 / 1; }
.hm-mslide { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; }
.hm-mslide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-mslide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, 0) 55%); }
.hm-mslide span { position: absolute; right: 14px; bottom: 12px; left: 70px; z-index: 1; overflow: hidden; font-size: 15px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.hm-mslide small { display: block; color: rgba(255, 255, 255, .75); font-size: 11px; font-weight: 700; }
.hm-dots { position: absolute; bottom: 14px; left: 14px; z-index: 20; display: flex; gap: 5px; direction: ltr; }
.hm-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .25s, background .25s; }
.hm-dots button[aria-current="true"] { width: 18px; background: #fff; }
.hm-ddots { bottom: 64px; left: 26px; }
.hm-ddots button { width: 9px; height: 9px; }
.hm-ddots button[aria-current="true"] { width: 24px; background: var(--accent); }

/* ================================================================ home: today's pick */
.hm-spot {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 22px; overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: var(--surface);
}
.hm-spot-art { position: absolute; inset: -40px; z-index: -2; background-position: center; background-size: cover; filter: blur(36px) saturate(1.3); opacity: .45; }
[data-theme="light"] .hm-spot-art { opacity: .28; }
.hm-spot::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(270deg, color-mix(in srgb, var(--surface) 35%, transparent), var(--surface) 85%); }
.hm-spot-cover { display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 16px; box-shadow: 0 24px 44px -24px rgba(0, 0, 0, .6), 0 0 0 1px var(--border); }
.hm-spot-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.hm-spot-cover:hover img { transform: scale(1.04); }
.hm-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); font-size: 12px; font-weight: 800; }
.hm-kicker svg { width: 15px; height: 15px; }
.hm-spot h3 { margin: 6px 0 0; font-size: 26px; font-weight: 900; line-height: 1.4; }
.hm-spot h3 a { color: var(--text); text-decoration: none; }
.hm-spot h3 a:hover { color: var(--accent); }
.hm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hm-tags a { padding: 3px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.hm-tags a:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.hm-spot p { display: -webkit-box; max-width: 640px; margin: 10px 0 0; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: var(--text-muted); font-size: 14px; line-height: 2; }
.hm-spot-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.hm-spot-act small { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.hm-spot-act small b { color: var(--text); }
.hm-picks-row { margin-top: 18px; }

/* ================================================================ home: new series */
.hm-banners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hm-banner {
  position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 190px; padding: 18px 20px; overflow: hidden;
  border-radius: 22px; background: #11151f; color: #fff; text-decoration: none; box-shadow: 0 0 0 1px var(--border);
}
.hm-banner-bg { position: absolute; inset: 0; z-index: -2; background-position: center; background-size: cover; transition: transform .5s; }
.hm-banner:hover .hm-banner-bg { transform: scale(1.04); }
.hm-banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(270deg, rgba(8, 10, 15, .9) 0%, rgba(8, 10, 15, .62) 50%, rgba(8, 10, 15, .15) 100%); }
.hm-banner-text { position: relative; max-width: 60%; }
.hm-banner-text em { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 800; font-style: normal; }
.hm-banner-text b { display: block; margin-top: 8px; font-size: 20px; font-weight: 900; line-height: 1.4; }
.hm-banner-text small { display: block; color: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 700; }
.hm-banner-text span { display: -webkit-box; margin-top: 6px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: rgba(255, 255, 255, .78); font-size: 13px; line-height: 1.9; }
.hm-banner-char { position: absolute; bottom: 0; left: 10px; width: auto; height: 92%; max-width: 42%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .5)); transition: transform .35s; }
.hm-banner:hover .hm-banner-char { transform: translateY(-4px); }

/* ================================================================ home: genres */
.hm-genres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hm-genre .ui-card-head h2 small { font-weight: 600; }
.hm-genre-row { display: flex; gap: 12px; margin: 0; padding: 14px 16px 16px; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.hm-genre-row a { display: block; width: 92px; color: var(--text); text-decoration: none; }
.hm-genre-row img, .hm-genre-row .ph { display: block; width: 92px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border); transition: transform .18s; }
.hm-genre-row a:hover img { transform: translateY(-3px); }
.hm-genre-row span { display: block; margin-top: 6px; overflow: hidden; font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.hm-genre-row a:hover span { color: var(--accent); }

/* ================================================================ home: join */
.hm-join {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-top: 36px; padding: 22px 24px;
  border-radius: 24px; color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--accent) 80%, #000) 0%, #11151f 55%, color-mix(in srgb, var(--accent-2) 55%, #000) 120%);
}
.hm-join h2 { margin: 0; font-size: 20px; font-weight: 900; }
.hm-join ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding: 0; list-style: none; color: rgba(255, 255, 255, .78); font-size: 13px; }
.hm-join li { display: flex; align-items: center; gap: 6px; }
.hm-join li svg { width: 16px; height: 16px; color: var(--accent); }
.hm-join-act { display: flex; gap: 10px; }
.hm-join .ui-btn:not(.is-primary) { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; }

.hm-ad { display: flex; justify-content: center; margin-top: 28px; }

/* ================================================================ categories */
.ct-hero { position: relative; overflow: hidden; padding: 22px 0 18px; border-bottom: 1px solid var(--border);
  background: radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 60%),
              radial-gradient(70% 120% at 0% 100%, color-mix(in srgb, var(--accent-2) 12%, transparent) 0%, transparent 60%), var(--bg-soft); }
.ct-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ct-title h1 { margin: 0; font-size: 28px; font-weight: 900; color: var(--text); }
.ct-count { padding: 3px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 800; }
.ct-intro { max-width: 720px; margin: 8px 0 0; color: var(--text-muted); font-size: 14px; line-height: 2; }
.ct-hero .ui-chips { margin-top: 16px; }
.ui-chips a small { margin-inline-start: 6px; font-size: 11px; opacity: .65; }
.ct-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 22px 0 18px; }
.ct-tools > span { color: var(--text-soft); font-size: 13px; font-weight: 700; }
.ct-tools .ui-seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.ct-empty { padding: 60px 16px; border: 1px dashed var(--border-strong); border-radius: 20px; text-align: center; color: var(--text-soft); font-size: 14px; line-height: 2; }
.ct-empty a { color: var(--accent); font-weight: 800; }

/* ================================================================ narrow screens */
@media (max-width: 899px) {
  .hm-banners, .hm-genres { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 679px) {
  .hm-spot { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 20px; align-items: start; }
  .hm-spot h3 { margin-top: 2px; font-size: 18px; }
  .hm-spot p { -webkit-line-clamp: 2; font-size: 13px; }
  .hm-spot-act { gap: 8px; margin-top: 10px; }
  .hm-spot-act small { display: none; }
  .hm-spot .ui-btn { height: 38px; padding: 0 14px; font-size: 12px; }
  .hm-banner { min-height: 160px; padding: 14px 16px; }
  .hm-banner-text b { font-size: 17px; }
  .hm-join { padding: 18px; }
  .hm-join-act { width: 100%; }
  .hm-join-act .ui-btn { flex: 1; }
  .ct-title h1 { font-size: 22px; }
  .ct-hero { padding: 16px 0 14px; }
  .ct-hero .ui-chips { margin: 14px -12px 0; padding: 2px 12px; }
  .ct-tools > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-spot-cover img, .hm-banner-bg, .hm-banner-char, .hm-genre-row img, .hm-dots button { transition: none !important; }
}
