/*
 * FE-4 bridge: runs after the 0017 template CSS (assets/t17/css/*).
 * The template draws images as lazy background-images; we render real <img>/<picture> for SEO
 * and LCP, and keep a single plain <h1> per page. This file only adapts those differences.
 * Colors come from the template's own variables.
 */
.skip { position: absolute; left: 8px; top: -48px; z-index: 200; padding: 8px 12px; background: var(--bg-color-2); color: var(--text-color-1); }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* one plain <h1> per page, styled by its template container */
.logo-box h1, .box-head-title h1, .detail-title h1, .player-title h1 { font: inherit; color: inherit; margin: 0; padding: 0; line-height: inherit; display: inline; letter-spacing: inherit; }
.box-head-title h1 { display: inline-block; }
.detail-title { color: inherit; }

/* logo: image when configured, otherwise the site name as text */
.logo { display: flex; align-items: center; height: 88px; }
.logo-pic { display: block; max-height: 56px; width: auto; max-width: 200px; object-fit: contain; }
.logo-word { display: block; font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: 2px; color: var(--theme-color); white-space: nowrap; }
@media (min-width: 992px) { .ewave-headroom-top .logo-word { color: var(--theme-text-color); } }
@media (max-width: 991px) {
  .logo { height: 60px; }
  .logo-word { font-size: 22px; }
  .logo-pic { max-height: 40px; }
}

/* image boxes: keep the template ratio, fill with the real picture */
.ewave-img-wrapper { position: relative; overflow: hidden; background-size: cover; background-position: center; }
.ewave-img-wrapper > picture, .ewave-img-wrapper > img, .ewave-img-wrapper > picture > img, .ewave-img-wrapper > .poster-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-fallback { display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-color-3); background: var(--bg-color-3); }

/* home hero: the template uses Swiper fade; we stack slides and fade with site.js */
.index-slide .swiper-wrapper { display: block; position: relative; list-style: none; margin: 0; padding: 0; }
.index-slide .swiper-slide { position: absolute; inset: 0; width: 100%; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.index-slide .swiper-slide.is-active { position: relative; opacity: 1; visibility: visible; z-index: 1; }
.slide-item { display: block; }
.slide-item-pic { overflow: hidden; background: var(--bg-color-3); }
.slide-item-pic > .slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-item-pic.is-poster > .slide-bg { filter: blur(28px) saturate(1.2); transform: scale(1.25); }
.slide-item-pic.is-poster > .slide-poster { position: absolute; z-index: 0; right: 26%; top: 50%; translate: 0 -50%; height: 78%; aspect-ratio: 3 / 4.2; width: auto; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 60px oklch(0 0 0 / .45); }
.slide-item-pic.is-poster > picture.slide-poster > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-thumb-item .ewave-img-wrapper { aspect-ratio: 16 / 9; }
@media (max-width: 991px) { .slide-item-pic.is-poster > .slide-poster { right: 6%; height: 72%; } }

/* detail / play: blurred poster background as an <img> */
.detail-box > img.detail-box-bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
.detail-cover picture { display: contents; }
.detail-cover img { height: auto; aspect-ratio: 1 / 1.3; object-fit: cover; border-radius: var(--radius); }
.detail-crumbs { padding: 0 4px; position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: oklch(100% 0 0 / .72); }
.detail-crumbs a { color: oklch(100% 0 0 / .85); }
.detail-crumbs a:hover { color: #fff; }
.play-btn.is-disabled { opacity: .55; cursor: not-allowed; }
.playlist-tab-item a small { margin-left: 4px; font-size: 12px; opacity: .75; }

/* nav rows: the template scrolls them with Swiper; without it they scroll natively */
.ewave-swiper-nav { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ewave-swiper-nav::-webkit-scrollbar { display: none; }
.ewave-swiper-nav > .swiper-wrapper { display: flex; flex-wrap: nowrap; }
.ewave-swiper-nav .swiper-slide { flex-shrink: 0; width: auto; }
@media (min-width: 1200px) { .filter-list .swiper-wrapper { flex-wrap: wrap; } }

/* play page: our player shell lives inside the template's 16:9 box */
.play-stage { background: #000; }
.play-stage > .stage-poster { position: absolute; left: 50%; top: 50%; translate: -50% -50%; height: 76%; aspect-ratio: 3 / 4.2; border-radius: var(--radius); overflow: hidden; opacity: .9; }
.play-stage > .stage-poster picture, .play-stage > .stage-poster img { width: 100%; height: 100%; object-fit: cover; }
.play-stage:has(.player-stage) > .stage-poster, .play-stage:has(iframe[src]:not([hidden])) > .stage-poster { display: none; }
.play-stage .player-shell { position: absolute; inset: 0; display: flex; flex-direction: column; color: #fff; }
.play-stage .player-shell:not(:has(.player-stage)) { align-items: center; justify-content: center; }
.play-stage .player-shell > iframe:not([src]) { display: none; }
.play-stage .player-shell > iframe[src] { position: relative; flex: 1; width: 100%; height: auto; border: 0; }
.player-start { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--theme-color); color: var(--theme-text-color); font-size: 13px; font-weight: 700; box-shadow: 0 0 0 6px var(--glow-color), 0 0 40px var(--glow-color); cursor: pointer; z-index: 2; }
.player-start .fa { font-size: 28px; margin-left: 4px; }
.player-start:hover { filter: brightness(1.1); }
.player-shell .player-stage { position: relative; flex: 1; min-height: 0; background: #000; }
.player-shell .player-stage video { width: 100%; height: 100%; display: block; background: #000; }
.player-shell .player-ui { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; background: oklch(12% 0.02 280 / .92); font-size: 13px; }
.player-shell .player-ui button, .player-shell .player-danmaku-bar button, .player-shell .player-danmaku-bar select { height: 26px; padding: 0 10px; border-radius: var(--radius); border: 1px solid oklch(100% 0 0 / .18); background: oklch(100% 0 0 / .08); color: #fff; font-size: 12px; cursor: pointer; }
.player-shell .player-ui button[aria-current="true"] { background: var(--theme-color); border-color: var(--theme-color); }
.player-shell .player-eps { display: none; }
.player-shell .player-danmaku-bar { padding: 6px 10px; margin: 0; background: oklch(12% 0.02 280 / .92); }
.player-shell .player-danmaku-form input { height: 26px; border-radius: var(--radius); border: 1px solid oklch(100% 0 0 / .18); background: transparent; color: #fff; padding: 0 10px; font: inherit; font-size: 12px; }
.player-shell .player-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 10px; background: oklch(12% 0.02 280 / .92); color: oklch(100% 0 0 / .8); font-size: 12px; }
.player-shell .player-banner:empty { display: none; }
.player-shell .player-share-open { display: inline-flex; align-items: center; margin: 0; height: 26px; padding: 0 12px; border-radius: var(--radius); background: var(--theme-color); font-size: 12px; }
.player-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.player-ep { font-size: .7em; font-weight: 700; opacity: .85; }
.player-line-note { margin: 8px 0 0; font-size: 13px; color: oklch(100% 0 0 / .7); }
.ad-labels { margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.ad-label { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: oklch(100% 0 0 / .12); color: oklch(100% 0 0 / .8); }
.ewave-player-footer-btns a.disabled { opacity: .45; pointer-events: none; }

/* misc slots */
.ad-slot { display: block; max-width: 100%; margin: 15px auto; }
.related-links { margin: 10px 0 20px; }
.related-links h2 { font-size: 16px; margin: 0 0 8px; }
.related-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.related-links a { font-size: 14px; color: var(--text-color-3); }
.fixture-banner { background: var(--theme-color-3); color: #fff; padding: 8px 12px; font-weight: 700; text-align: center; }
.landing-slug { color: var(--text-color-3); }
.ewave-empty { padding: 40px 10px; text-align: center; }
