/*
Theme Name: SeriesHub
Theme URI: https://example.com/serieshub
Author: Site Owner
Description: A fast, SEO-first WordPress theme for publishing original web series and episodes. Includes an Episode post type, Series/Platform/Genre taxonomies, video schema, an optional age gate, and a lightweight streaming-style UI with zero external dependencies.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: serieshub
Tags: blog, video, custom-logo, custom-menu, featured-images, grid-layout, translation-ready, full-width-template
*/

/* ---------------------------------------------------------------
   1. Tokens
--------------------------------------------------------------- */
:root {
	--bg: #0a0a0f;
	--bg-soft: #101018;
	--surface: #15151f;
	--surface-2: #1c1c28;
	--line: #2a2a3a;
	--text: #f2f3f7;
	--muted: #9ba1b0;
	--brand: #e11d48;
	--brand-soft: #ff4d6d;
	--accent: #f59e0b;
	--ok: #22c55e;
	--radius: 12px;
	--radius-lg: 18px;
	--shadow: 0 14px 40px rgba(0, 0, 0, .45);
	--container: 1240px;
	--header-h: 62px;
}

/* ---------------------------------------------------------------
   2. Base
--------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

body.is-locked { overflow: hidden; }

a { color: var(--brand-soft); text-decoration: none; }
a:hover { color: #ff8098; }

img, video, iframe { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: min(var(--container), calc(100% - 28px)); margin-inline: auto; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto; margin: 8px; padding: 10px 16px;
	background: #fff; color: #000; z-index: 9999; border-radius: 8px;
}

/* ---------------------------------------------------------------
   3. Header
--------------------------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 90;
	background: rgba(10, 10, 15, .92);
	border-bottom: 1px solid var(--line);
	backdrop-filter: blur(14px);
}

.header-inner {
	display: flex; align-items: center; gap: 14px;
	min-height: var(--header-h);
}

.brand {
	display: inline-flex; align-items: center; gap: 9px;
	color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em;
	white-space: nowrap;
}
.brand-mark {
	display: grid; place-items: center; width: 32px; height: 32px;
	border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--accent));
	color: #fff; font-size: .85rem; font-weight: 900;
}
.custom-logo { max-height: 40px; width: auto; }

.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.primary-nav a {
	display: block; padding: 8px 12px; border-radius: 9px;
	color: #d7dbe4; font-size: .9rem; font-weight: 600;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a { background: var(--surface-2); color: #fff; }

.header-search { position: relative; flex: 0 1 300px; margin-left: auto; }
.header-search input {
	width: 100%; padding: 9px 38px 9px 14px;
	background: var(--surface); border: 1px solid var(--line);
	border-radius: 999px; font-size: .88rem;
}
.header-search input::placeholder { color: #6f7686; }
.header-search button {
	position: absolute; right: 4px; top: 4px; width: 30px; height: 30px;
	border: 0; border-radius: 50%; background: var(--brand); color: #fff; line-height: 1;
}

.live-results {
	position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow); overflow: hidden; display: none;
}
.live-results.is-open { display: block; }
.live-results a {
	display: flex; gap: 10px; align-items: center; padding: 9px 12px;
	color: var(--text); font-size: .86rem; border-bottom: 1px solid var(--line);
}
.live-results a:last-child { border-bottom: 0; }
.live-results a:hover { background: var(--surface-2); }
.live-results img { width: 54px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; }
.live-results .empty { padding: 12px; color: var(--muted); font-size: .85rem; }

.menu-toggle {
	display: none; width: 38px; height: 38px; padding: 0;
	background: var(--surface-2); border: 1px solid var(--line);
	border-radius: 9px; color: #fff;
}

/* ---------------------------------------------------------------
   4. Buttons + chips
--------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 10px 18px; border: 1px solid transparent; border-radius: 10px;
	background: var(--brand); color: #fff; font-weight: 700; font-size: .92rem;
}
.btn:hover { background: var(--brand-soft); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: #fff; }
.btn-block { width: 100%; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
	background: var(--surface); color: #c9cfdb; font-size: .78rem; font-weight: 600;
}
.chip:hover { border-color: var(--brand); color: #fff; }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.badge {
	display: inline-block; padding: 3px 8px; border-radius: 6px;
	background: var(--brand); color: #fff; font-size: .68rem; font-weight: 800;
	letter-spacing: .04em; text-transform: uppercase;
}
.badge-muted { background: rgba(255, 255, 255, .12); color: #dfe3ea; }
.badge-new { background: var(--ok); }

/* ---------------------------------------------------------------
   5. Sections
--------------------------------------------------------------- */
.section { padding: 30px 0; }
.section-head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 16px; margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: clamp(1.15rem, 2.6vw, 1.5rem); }
.section-head h2::before {
	content: ""; display: inline-block; width: 4px; height: 1em;
	margin-right: 10px; border-radius: 3px; background: var(--brand);
	vertical-align: -.12em;
}
.section-head .more { font-size: .85rem; font-weight: 700; white-space: nowrap; }

.page-intro { padding: 26px 0 6px; }
.page-intro p { color: var(--muted); max-width: 70ch; margin: 0; }

/* ---------------------------------------------------------------
   6. Episode grid + cards
--------------------------------------------------------------- */
.grid {
	display: grid; gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card { position: relative; min-width: 0; }
.card-thumb {
	position: relative; display: block; overflow: hidden;
	border-radius: var(--radius); background: var(--surface-2);
	aspect-ratio: 16 / 9;
}
.card-thumb img {
	width: 100%; height: 100%; object-fit: cover;
	transition: transform .35s ease;
}
.card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb .placeholder {
	display: grid; place-items: center; width: 100%; height: 100%;
	color: #4c5364; font-size: .78rem; font-weight: 700;
}
.card-thumb::after {
	content: ""; position: absolute; inset: auto 0 0 0; height: 55%;
	background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
	pointer-events: none;
}
.card-play {
	position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
	opacity: 0; transition: opacity .25s ease;
}
.card:hover .card-play { opacity: 1; }
.card-play span {
	display: grid; place-items: center; width: 44px; height: 44px;
	border-radius: 50%; background: rgba(225, 29, 72, .92); color: #fff;
	font-size: .9rem; padding-left: 3px;
}
.card-tags {
	position: absolute; top: 8px; left: 8px; z-index: 3;
	display: flex; flex-wrap: wrap; gap: 5px;
}
.card-duration {
	position: absolute; right: 8px; bottom: 8px; z-index: 3;
	padding: 2px 7px; border-radius: 5px;
	background: rgba(0, 0, 0, .78); color: #fff;
	font-size: .72rem; font-weight: 700;
}
.card-body { padding: 9px 2px 0; }
.card-title {
	margin: 0 0 4px; font-size: .92rem; font-weight: 700; line-height: 1.35;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--brand-soft); }
.card-meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
	color: var(--muted); font-size: .76rem;
}
.card-meta .dot { opacity: .5; }

/* Horizontal scroller for "continue / trending" rows */
.rail {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 1fr);
	gap: 14px; overflow-x: auto; padding-bottom: 8px;
	scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------------------------------------------------------------
   7. Hero
--------------------------------------------------------------- */
.hero {
	position: relative; overflow: hidden;
	border-bottom: 1px solid var(--line);
	background:
		radial-gradient(1000px 400px at 80% -10%, rgba(225, 29, 72, .22), transparent 60%),
		radial-gradient(800px 400px at 10% 0%, rgba(245, 158, 11, .12), transparent 60%);
}
.hero-inner { padding: 42px 0 34px; max-width: 720px; }
.hero h1 { margin: 10px 0 12px; font-size: clamp(1.9rem, 5.4vw, 3.1rem); }
.hero p { color: var(--muted); font-size: 1.02rem; margin-bottom: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow {
	display: inline-block; color: var(--accent);
	font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}

/* ---------------------------------------------------------------
   8. Single episode
--------------------------------------------------------------- */
.single-layout { display: grid; gap: 28px; padding: 22px 0 40px; }

.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; opacity: .45; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand-soft); }

.player {
	position: relative; aspect-ratio: 16 / 9; width: 100%;
	background: #000; border: 1px solid var(--line); border-radius: var(--radius-lg);
	overflow: hidden;
}
.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; }
.player-facade {
	position: absolute; inset: 0; border: 0; padding: 0; width: 100%;
	background-size: cover; background-position: center; background-color: #000;
}
.player-facade::before {
	content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .35);
}
.player-facade .play-icon {
	position: relative; display: grid; place-items: center; margin: 0 auto;
	width: 68px; height: 68px; border-radius: 50%;
	background: var(--brand); color: #fff; font-size: 1.3rem; padding-left: 5px;
	box-shadow: 0 10px 30px rgba(225, 29, 72, .5);
}
.player-fallback {
	display: grid; place-items: center; height: 100%; padding: 24px;
	color: var(--muted); text-align: center; font-size: .9rem;
}

.entry-head { margin: 18px 0 14px; }
.entry-head h1 { margin-bottom: 8px; }
.entry-facts {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
	color: var(--muted); font-size: .85rem;
}

.watch-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

.entry-content { color: #d8dce4; }
.entry-content > * { max-width: 74ch; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; color: #fff; }
.entry-content ul, .entry-content ol { padding-left: 1.2em; }
.entry-content blockquote {
	margin: 1.4em 0; padding: 4px 0 4px 18px;
	border-left: 3px solid var(--brand); color: var(--muted);
}
.entry-content img { border-radius: var(--radius); }

.panel {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius-lg); padding: 18px;
}
.panel h2, .panel h3 { margin-top: 0; font-size: 1.05rem; }

.download-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.download-list a {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .9rem;
}
.download-list a:hover { border-color: var(--brand); color: #fff; }

.episode-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; }
.episode-list a {
	display: flex; align-items: center; gap: 10px; padding: 8px;
	border-radius: 9px; color: #cfd4de; font-size: .86rem;
}
.episode-list a:hover { background: var(--surface-2); color: #fff; }
.episode-list .is-current a { background: var(--surface-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.episode-list img { width: 62px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; }
.episode-list .num { color: var(--muted); font-variant-numeric: tabular-nums; }

.post-nav { display: grid; gap: 10px; margin: 26px 0; }
.post-nav a {
	display: block; padding: 14px 16px; border: 1px solid var(--line);
	border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.post-nav a:hover { border-color: var(--brand); }
.post-nav small { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; }

/* ---------------------------------------------------------------
   9. Sidebar / widgets / ads
--------------------------------------------------------------- */
.widget { margin-bottom: 22px; }
.widget-title { font-size: .95rem; margin-bottom: 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.widget li:last-child { border-bottom: 0; }

.widget-area { display: block; }

.ad-slot { margin: 22px 0; text-align: center; min-height: 1px; }
.ad-slot > * { max-width: 100%; }

.archive-description { color: var(--muted); max-width: 74ch; }
.archive-description p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------
   10. Filters / pagination / empty
--------------------------------------------------------------- */
.filter-bar {
	display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
	padding: 12px; margin-bottom: 18px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filter-bar select, .filter-bar input {
	padding: 8px 12px; background: var(--bg-soft);
	border: 1px solid var(--line); border-radius: 9px; font-size: .86rem;
}

.pagination { margin: 32px 0 8px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.page-numbers {
	display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px;
	border: 1px solid var(--line); border-radius: 9px;
	color: var(--text); font-size: .88rem; font-weight: 600;
}
.page-numbers:hover { border-color: var(--brand); color: #fff; }
.page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-numbers.dots { border-color: transparent; }

.empty-state {
	padding: 50px 24px; text-align: center; color: var(--muted);
	border: 1px dashed var(--line); border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------
   11. Footer
--------------------------------------------------------------- */
.site-footer {
	margin-top: 40px; padding: 34px 0 22px;
	background: var(--bg-soft); border-top: 1px solid var(--line);
}
.footer-grid { display: grid; gap: 24px; }
.footer-about p { color: var(--muted); font-size: .88rem; max-width: 46ch; }
.footer-col h3 { font-size: .9rem; margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-col a { color: var(--muted); font-size: .87rem; }
.footer-col a:hover { color: #fff; }
.site-info {
	margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line);
	color: #767d8c; font-size: .8rem; display: flex; flex-wrap: wrap; gap: 10px;
	align-items: center; justify-content: space-between;
}
.legal-note { color: #6b7280; font-size: .78rem; margin-top: 10px; line-height: 1.55; }

/* ---------------------------------------------------------------
   12. Age gate
--------------------------------------------------------------- */
/* Hidden by default; an inline head script adds .sh-age-pending before paint
   so verified visitors never see a flash of the overlay. */
.age-gate { display: none; }
.sh-age-pending body { overflow: hidden; }
.sh-age-pending .age-gate {
	position: fixed; inset: 0; z-index: 9999;
	display: grid; place-items: center; padding: 20px;
	background: rgba(6, 6, 10, .97); backdrop-filter: blur(6px);
}
.age-gate-box {
	width: min(440px, 100%); padding: 30px 26px; text-align: center;
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.age-gate-box h2 { margin-bottom: 10px; }
.age-gate-box p { color: var(--muted); font-size: .9rem; }
.age-gate-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }

/* ---------------------------------------------------------------
   13. Comments
--------------------------------------------------------------- */
.comments-area { margin-top: 36px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%; padding: 10px 12px; margin-top: 4px;
	background: var(--surface); border: 1px solid var(--line);
	border-radius: 9px;
}
.comment-form .submit { padding: 10px 20px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; }

/* ---------------------------------------------------------------
   14. Responsive
--------------------------------------------------------------- */
@media (min-width: 640px) {
	.grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
	.post-nav { grid-template-columns: 1fr 1fr; }
	.footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

@media (min-width: 1024px) {
	.single-layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
	.single-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }
	.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
}

@media (max-width: 899px) {
	.menu-toggle { display: grid; place-items: center; order: 3; }
	.header-search { order: 4; flex-basis: 100%; margin: 0 0 10px; }
	.header-inner { flex-wrap: wrap; padding-top: 10px; }
	.primary-nav {
		display: none; order: 5; flex-basis: 100%;
		padding: 6px 0 12px; border-top: 1px solid var(--line);
	}
	.primary-nav.is-open { display: block; }
	.primary-nav ul { display: grid; gap: 2px; }
	.primary-nav a { padding: 11px 10px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
