/*
Theme Name: Vidora
Theme URI: https://example.com/vidora
Author: Vidora
Description: A dark, fast video-site theme with video pages, categories, tags and actors, member video submission, likes and views, an age gate and configurable ad zones. No license server and no required plugins.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: vidora
Tags: video, dark, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--bg: #15111c;
	--surface: #1e1829;
	--raised: #2a2038;
	--line: #3a2e4d;
	--text: #ece7f4;
	--muted: #a79bb8;
	--amber: #ffb454;
	--ok: #4fd18b;
	--danger: #ff6b6b;
	--radius: 8px;
	--rail-w: 244px;
	--header-h: 60px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
body.gate-open, body.rail-open { overflow: hidden; }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed !important; z-index: 10000; top: 8px; left: 8px; width: auto; height: auto; margin: 0;
	clip: auto; padding: 10px 14px; background: var(--accent); color: #fff; border-radius: var(--radius);
}

/* ==========================================================================
   Buttons and inputs
   ========================================================================== */
.btn, .vidora-form button, .comment-form input[type="submit"], .login-submit input[type="submit"], .search-form .search-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	min-height: 38px; padding: 0 16px;
	border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--raised); color: var(--text);
	font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none;
}
.btn:hover, .vidora-form button:hover { background: var(--line); text-decoration: none; }
.btn--accent, .vidora-form button.btn--accent, .comment-form input[type="submit"], .login-submit input[type="submit"] {
	background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn--accent:hover, .comment-form input[type="submit"]:hover, .login-submit input[type="submit"]:hover { filter: brightness(1.1); background: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"],
textarea, select {
	width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}
.site-header__bar {
	display: flex; align-items: center; gap: 16px;
	min-height: var(--header-h); padding: 8px 20px; max-width: 1760px; margin: 0 auto;
}
.rail-toggle {
	display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; border-radius: var(--radius);
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { display: block; max-height: 40px; width: auto; }
.brand__name {
	font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em;
	padding: 2px 10px; background: var(--accent); color: #fff; border-radius: 6px;
}
.brand__slogan { font-size: .8rem; color: var(--muted); }

.header-search { position: relative; flex: 1 1 320px; max-width: 560px; margin-left: auto; }
.header-search input { padding-right: 44px; border-radius: 999px; background: var(--surface); }
.header-search button {
	position: absolute; right: 4px; top: 4px; width: 34px; height: 34px;
	border: 0; border-radius: 50%; background: var(--raised); color: var(--text); cursor: pointer;
	display: grid; place-items: center;
}
.header-search button:hover { background: var(--accent); }

.header-nav .menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.header-nav a { display: block; padding: 8px 12px; color: var(--muted); border-radius: var(--radius); font-weight: 600; font-size: .94rem; }
.header-nav a:hover, .header-nav .current-menu-item > a { color: var(--text); background: var(--surface); text-decoration: none; }
.member-links { display: flex; gap: 8px; flex-shrink: 0; }

/* ==========================================================================
   Layout
   ========================================================================== */
.site-body {
	display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr);
	max-width: 1760px; margin: 0 auto; align-items: start;
}
.no-rail .site-body { grid-template-columns: minmax(0, 1fr); }
.site-main { min-width: 0; padding: 20px; min-height: 60vh; }

/* Left rail */
.site-rail {
	position: sticky; top: var(--header-h); align-self: start;
	max-height: calc(100vh - var(--header-h)); overflow-y: auto;
	padding: 20px 8px 24px 20px; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.rail-group { margin-bottom: 22px; }
.rail-group__title { font-size: .85rem; color: var(--muted); font-weight: 600; margin: 0 0 6px 10px; }
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list a {
	display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: var(--radius);
	color: var(--text); font-size: .94rem;
}
.rail-list a:hover { background: var(--surface); text-decoration: none; }
.rail-list__count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.rail-group__all { display: inline-block; margin: 4px 0 0 10px; font-size: .86rem; }

/* ==========================================================================
   Listings
   ========================================================================== */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.page-head__title { font-size: clamp(1.4rem, 2.2vw, 1.9rem); margin: 0; font-weight: 800; }
.page-head__desc { color: var(--muted); max-width: 70ch; margin-top: 4px; }
.page-head__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }

.sort-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.sort-tabs a {
	padding: 6px 14px; border-radius: 999px; color: var(--muted); background: var(--surface);
	font-weight: 600; font-size: .9rem; border: 1px solid transparent;
}
.sort-tabs a:hover { color: var(--text); text-decoration: none; border-color: var(--line); }
.sort-tabs a.is-active { background: var(--accent); color: #fff; }

.video-grid { display: grid; gap: 22px 14px; grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, 1fr)); }
.video-grid__ad { grid-column: 1 / -1; display: flex; justify-content: center; }
.home-widgets { margin-bottom: 28px; }
.widget-title, .section-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 12px; }

/* Card */
.video-card { min-width: 0; }
.video-card__thumb {
	position: relative; display: block; overflow: hidden; border-radius: var(--radius);
	aspect-ratio: var(--thumb-ratio, 16/9); background: var(--raised);
}
.video-card__thumb img, .video-card__preview {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
/* The one signature detail: a scrubber line that sweeps across the thumbnail on hover. */
.video-card__thumb::after {
	content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent);
	transition: width .6s ease;
}
.video-card:hover .video-card__thumb::after, .video-card:focus-within .video-card__thumb::after { width: 100%; }
.badge {
	position: absolute; padding: 1px 6px; border-radius: 4px; font-size: .74rem; font-weight: 700; line-height: 1.5;
	background: rgba(12, 8, 18, .82); color: #fff; font-variant-numeric: tabular-nums;
}
.badge--time { right: 6px; bottom: 8px; }
.badge--hd { left: 6px; top: 6px; background: var(--amber); color: #20140a; }
.video-card__title { font-size: .95rem; font-weight: 600; line-height: 1.35; margin: 8px 0 2px; }
.video-card__title a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card__title a:hover { color: var(--accent); text-decoration: none; }
.video-card__meta { display: flex; gap: 10px; margin: 0; color: var(--muted); font-size: .82rem; }
.meta-rating::before { content: "\1F44D\FE0E "; }

/* Pagination */
.pagination { margin: 28px 0 8px; }
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; justify-content: center; }
.pagination a, .pagination span {
	display: block; min-width: 38px; padding: 7px 12px; text-align: center; border-radius: var(--radius);
	background: var(--surface); color: var(--text); font-weight: 600; font-size: .92rem;
}
.pagination a:hover { background: var(--raised); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; }
.pagination .dots { background: none; color: var(--muted); }

.empty-state { padding: 48px 8px; text-align: center; max-width: 520px; margin: 0 auto; color: var(--muted); }
.empty-state h1, .empty-state h2 { color: var(--text); }
.search-form { display: flex; gap: 8px; margin-top: 16px; }
.search-form label { flex: 1; }

/* Terms grid */
.term-grid { display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.term-card { display: block; color: var(--text); }
.term-card:hover { text-decoration: none; }
.term-card__img { display: block; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius); background: var(--raised); }
.term-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.term-card:hover .term-card__img img { transform: scale(1.04); }
.term-card__name { display: block; font-weight: 700; margin-top: 8px; }
.term-card__count { color: var(--muted); font-size: .84rem; }

/* ==========================================================================
   Single video
   ========================================================================== */
.video-single, .related, .comments { max-width: 1100px; }
.player-frame { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-frame > img { width: 100%; height: 100%; object-fit: cover; }
.vidora-embed, .vidora-video { position: absolute; inset: 0; }
.vidora-embed iframe, .vidora-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vidora-video video { width: 100%; height: 100%; background: #000; display: block; }
.vidora-quality {
	position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; z-index: 3;
	opacity: 0; transition: opacity .2s; padding: 4px; background: rgba(12, 8, 18, .75); border-radius: var(--radius);
}
.vidora-video:hover .vidora-quality, .vidora-quality:focus-within { opacity: 1; }
.vidora-quality__btn { background: none; border: 0; color: #fff; padding: 4px 8px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; }
.vidora-quality__btn.is-active { background: var(--accent); }

.vidora-preroll {
	position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center;
	background: rgba(10, 7, 14, .97); overflow: hidden;
}
.vidora-preroll__ads { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; overflow: auto; padding: 12px; }
.vidora-preroll__skip { position: absolute; right: 10px; bottom: 10px; }
.vidora-preroll__skip { min-height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.vidora-preroll__skip:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }

.video-title { font-size: clamp(1.25rem, 2vw, 1.7rem); font-weight: 800; margin: 16px 0 10px; }
.video-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.video-actions__views { color: var(--muted); font-weight: 600; }
.vote { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.vote__btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
	background: var(--surface); color: var(--text); border: 1px solid var(--line); font: inherit; font-weight: 600; cursor: pointer;
}
.vote__btn:hover:not(:disabled) { border-color: var(--accent); }
.vote__btn.is-voted { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote__bar { width: 90px; height: 5px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.vote__fill { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.vote__pct { min-width: 3ch; color: var(--muted); font-size: .86rem; font-weight: 600; }
.vote-note { min-height: 1.4em; margin: 6px 0 0; color: var(--muted); font-size: .86rem; }
.share-panel { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.share-panel[hidden] { display: none; }

.video-about { margin-top: 10px; padding: 16px; background: var(--surface); border-radius: var(--radius); }
.video-about__text { color: var(--text); margin-bottom: 12px; }
.video-about__terms { margin: 0; }
.chips { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.chips dt { color: var(--muted); font-size: .86rem; min-width: 5.5em; }
.chips dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips dd a {
	display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--raised); color: var(--text); font-size: .86rem; font-weight: 600;
}
.chips dd a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.video-about__date { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
.under-video-widgets, .related { margin-top: 28px; }

/* ==========================================================================
   Pages, prose, forms, comments
   ========================================================================== */
.prose { max-width: 78ch; }
.prose--wide { max-width: none; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content img { border-radius: var(--radius); }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }

.form-page { max-width: 980px; }
.form-cols { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form-card--wide { max-width: 720px; }
.form-card h2 { font-size: 1.15rem; }
.vidora-form p, .login-username, .login-password { margin: 0 0 14px; }
.vidora-form label, .login-username label, .login-password label { display: block; margin-bottom: 4px; font-size: .9rem; font-weight: 600; }
.vidora-form small { display: block; margin-top: 4px; color: var(--muted); }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.login-remember label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.login-remember input { width: auto; }
.hp { position: absolute !important; left: -9999px; height: 0; overflow: hidden; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--line); background: var(--surface); }
.notice--ok { border-color: var(--ok); }
.notice--error { border-color: var(--danger); }
.my-videos { list-style: none; margin: 0 0 16px; padding: 0; }
.my-videos li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.status-pill { font-style: normal; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--raised); color: var(--amber); white-space: nowrap; }

.comments { margin-top: 32px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); }
.comment-meta .avatar { border-radius: 50%; }
.comment-meta a { color: var(--muted); }
.comment-content { margin-top: 6px; }
.comment-reply-link { font-size: .86rem; font-weight: 600; }
.comment-form p { margin-bottom: 12px; }
.comment-form label { display: block; margin-bottom: 4px; font-weight: 600; font-size: .9rem; }

/* ==========================================================================
   Ads
   ========================================================================== */
.vidora-ad { max-width: 100%; margin: 14px auto; text-align: center; overflow: hidden; }
.vidora-ad--header, .vidora-ad--footer { padding: 0 20px; }
.site-rail .vidora-ad { margin: 14px 0; }
.vidora-sticky {
	display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
	padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(12, 8, 18, .94); text-align: center;
}
.vidora-sticky .vidora-ad { margin: 0 auto; }
.vidora-sticky__close {
	position: absolute; top: -26px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 6px 6px 0 0;
	background: rgba(12, 8, 18, .94); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: 24px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__widgets { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 1760px; margin: 0 auto; padding: 24px 20px 0; }
.site-footer__bar { max-width: 1760px; margin: 0 auto; padding: 20px; text-align: center; color: var(--muted); font-size: .88rem; }
.footer-nav .menu, .social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; list-style: none; margin: 0 0 12px; padding: 0; }
.footer-nav a, .social-links a { color: var(--muted); font-weight: 600; }
.footer-nav a:hover, .social-links a:hover { color: var(--text); }
.footer-note { max-width: 80ch; margin: 8px auto 0; font-size: .8rem; }
.widget { margin-bottom: 20px; }
.widget ul { padding-left: 18px; }

/* ==========================================================================
   Age gate
   ========================================================================== */
.age-gate {
	position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px;
	background: rgba(12, 8, 18, .97); backdrop-filter: blur(14px);
}
.age-gate[hidden] { display: none; }
.age-gate__box { max-width: 460px; text-align: center; }
.age-gate__box h2 { font-size: 1.6rem; font-weight: 800; }
.age-gate__box p { color: var(--muted); }
.age-gate__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.age-gate__actions .btn { min-height: 44px; padding: 0 22px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
	.video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
	.header-nav { display: none; }
	.site-body { grid-template-columns: minmax(0, 1fr); }
	.rail-toggle { display: inline-flex; }
	.site-rail {
		position: fixed; z-index: 40; top: var(--header-h); left: 0; bottom: 0; width: min(86vw, 320px);
		max-height: none; background: var(--bg); border-right: 1px solid var(--line);
		transform: translateX(-100%); transition: transform .22s ease; padding-top: 16px;
	}
	.site-rail.is-open { transform: none; }
	.form-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
	.site-main { padding: 14px 12px; }
	.site-header__bar { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
	.header-search { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
	.member-links { margin-left: auto; }
	.member-links .btn:not(.btn--accent) { display: none; }
	.vidora-ad--desktop { display: none; }
	.vidora-sticky { display: block; }
	body:has(.vidora-sticky) .site-footer { padding-bottom: 70px; }
	.vote { margin-left: 0; width: 100%; }
	.form-row { grid-template-columns: 1fr; }
	.site-rail { top: 0; padding-top: 128px; }
}
@media (min-width: 769px) {
	.vidora-ad--mobile { display: none; }
}
@media (max-width: 860px) {
	.video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
}
@media (max-width: 340px) {
	.video-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
