/*
Theme Name: Original Video
Author: Original Video Theme
Description: A lightweight, responsive theme for hosting and watching original videos.
Version: 1.2.6
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: original-video
*/

:root {
	color-scheme: dark;
	--ov-bg: #0f0f0f;
	--ov-surface: #181818;
	--ov-text: #f1f1f1;
	--ov-muted: #aaa;
	--ov-border: #303030;
	--ov-accent: #f1f1f1;
	--ov-radius: 12px;
	--ov-content-width: 1440px;
}

@font-face {
	font-family: Ubuntu;
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/Ubuntu-Regular.ttf") format("truetype");
}

@font-face {
	font-family: Ubuntu;
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/Ubuntu-Bold.ttf") format("truetype");
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--ov-bg);
	color: var(--ov-text);
	font-family: Ubuntu, "Noto Sans", sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--ov-accent);
}

button,
input,
textarea {
	font: inherit;
}

.site-header {
	position: sticky;
	z-index: 10;
	top: 0;
	display: grid;
	grid-template-columns: 1fr minmax(200px, 600px) 1fr;
	grid-template-rows: auto auto;
	align-items: center;
	gap: 8px;
	padding: 12px clamp(16px, 4vw, 56px);
	border-bottom: 1px solid var(--ov-border);
	background: rgba(15, 15, 15, .96);
}

.site-branding {
	display: inline-flex;
	grid-column: 2;
	justify-self: center;
	align-items: center;
	gap: 10px;
	font-size: 1.2rem;
	font-weight: 750;
	letter-spacing: -.04em;
}

.site-search {
	display: flex;
	grid-column: 2;
	grid-row: 2;
	width: 100%;
}

.site-search__input {
	min-width: 0;
	flex: 1;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--ov-border);
	border-right: 0;
	border-radius: 999px 0 0 999px;
	outline-offset: 2px;
	background: #121212;
	color: var(--ov-text);
}

.site-search__input::placeholder {
	color: var(--ov-muted);
}

.site-search__button {
	min-width: 82px;
	padding: 0 16px;
	border: 1px solid var(--ov-border);
	border-radius: 0 999px 999px 0;
	background: #282828;
	color: var(--ov-text);
	cursor: pointer;
}

.site-search__button:hover {
	background: #383838;
}

.site-layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 28px;
	width: min(100%, 1720px);
	margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 56px);
}

.site-sidebar {
	position: sticky;
	top: 84px;
	align-self: start;
	max-height: calc(100vh - 100px);
	padding-top: 28px;
	overflow-y: auto;
}

.category-sidebar__heading {
	margin: 0 0 14px;
	color: var(--ov-muted);
	font-size: .82rem;
	font-weight: 650;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.category-sidebar__toggle {
	display: none;
}

.category-sidebar__details:not([open]) > .category-sidebar__list {
	display: grid !important;
}

.category-sidebar__list {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.category-sidebar__link {
	display: block;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--ov-text);
	font-weight: 550;
}

.category-sidebar__link:hover,
.category-sidebar__link.is-current {
	background: #242424;
	color: var(--ov-text);
}

.category-sidebar__link.is-current {
	box-shadow: inset 3px 0 var(--ov-accent);
}

.site-main {
	width: 100%;
	max-width: var(--ov-content-width);
	min-width: 0;
	min-height: calc(100vh - 128px);
	margin: 0;
	padding: clamp(24px, 4vw, 48px) 0 64px;
}

.page-heading {
	margin: 0 0 24px;
	font-size: clamp(1.5rem, 3vw, 2rem);
	letter-spacing: -.045em;
}

.video-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px 20px;
}

.video-card {
	min-width: 0;
}

.video-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--ov-radius);
	background: #202020;
}

.video-card__thumbnail-link {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.video-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .2s ease;
}

.video-card__thumbnail-link:hover .video-card__image {
	transform: scale(1.035);
}

.video-card__placeholder {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	color: #777;
}

.video-card__duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 2px 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .8);
	color: #fff;
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
}

.video-card__hover-preview {
	position: absolute;
	z-index: 1;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	background: #000;
	object-fit: cover;
	pointer-events: none;
}

.video-card__media.is-previewing .video-card__duration {
	display: none;
}

.video-card__title {
	display: -webkit-box;
	overflow: hidden;
	margin: 11px 0 0;
	font-size: .98rem;
	font-weight: 650;
	line-height: 1.4;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.video-card__link:hover,
.video-card__link:focus-visible {
	color: var(--ov-accent);
}

.video-grid-empty,
.video-player-empty {
	display: grid;
	min-height: 220px;
	place-items: center;
	border: 1px solid var(--ov-border);
	border-radius: var(--ov-radius);
	background: #111;
	color: #fff;
	text-align: center;
}

.video-grid-empty {
	min-height: 180px;
	border-color: var(--ov-border);
	background: var(--ov-surface);
	color: var(--ov-muted);
}

.browse-all {
	margin-top: 32px;
	text-align: center;
}

.button-link {
	display: inline-flex;
	min-height: 42px;
	align-items: center;
	justify-content: center;
	padding: 0 20px;
	border-radius: 999px;
	font-weight: 650;
}

.button-link,
.button-link:hover {
	border: 1px solid var(--ov-border);
	background: #282828;
	color: #fff;
}

.button-link:hover {
	background: #383838;
}

.video-entry {
	max-width: 1080px;
	margin: 0 auto;
}

.video-player {
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--ov-radius);
	background: #000;
}

.video-player video {
	display: block;
	width: 100%;
	height: 100%;
}

.video-player-empty {
	height: 100%;
	padding: 24px;
	background: #151515;
}

.video-entry__title {
	margin: 20px 0 16px;
	font-size: clamp(1.35rem, 3vw, 1.9rem);
	letter-spacing: -.04em;
	line-height: 1.25;
}

.video-entry__description {
	margin: 0 0 18px;
	padding: 16px 18px;
	border: 1px solid var(--ov-border);
	border-radius: var(--ov-radius);
	background: var(--ov-surface);
	color: var(--ov-muted);
	line-height: 1.7;
}

.video-entry__description > :first-child {
	margin-top: 0;
}

.video-entry__description > :last-child {
	margin-bottom: 0;
}

.video-categories {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: -4px 0 18px;
	color: var(--ov-muted);
	font-size: .9rem;
}

.video-categories a {
	padding: 4px 10px;
	border: 1px solid var(--ov-border);
	border-radius: 999px;
	background: var(--ov-surface);
	color: var(--ov-text);
}

.video-categories a:hover {
	border-color: var(--ov-accent);
	color: var(--ov-accent);
}

.video-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--ov-border);
}

.more-videos {
	margin-top: 36px;
}

.more-videos__title {
	margin: 0 0 18px;
	font-size: 1.25rem;
}

.video-vote {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--ov-border);
	border-radius: 999px;
	background: var(--ov-surface);
	color: var(--ov-text);
	cursor: pointer;
}

.video-vote[aria-pressed="true"] {
	border-color: var(--ov-accent);
	background: var(--ov-accent);
	color: var(--ov-bg);
}

.video-vote:disabled {
	cursor: wait;
	opacity: .65;
}

.video-vote__count {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.video-download {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	margin-left: auto;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--ov-accent);
	color: var(--ov-bg);
	font-weight: 650;
}

.video-download:hover {
	background: #d8d8d8;
	color: var(--ov-bg);
}

.video-download[aria-disabled="true"] {
	cursor: wait;
	opacity: .75;
}

.video-vote-status {
	flex-basis: 100%;
	min-height: 1.4em;
	color: var(--ov-muted);
	font-size: .875rem;
}

.comments-area {
	margin-top: 36px;
}

.comments-title,
.comment-reply-title {
	margin: 0 0 20px;
	font-size: 1.25rem;
}

.comment-list {
	display: grid;
	gap: 16px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}

.comment-list .comment {
	padding: 16px;
	border: 1px solid var(--ov-border);
	border-radius: var(--ov-radius);
	background: var(--ov-surface);
}

.comment-list .children {
	display: grid;
	gap: 12px;
	margin: 16px 0 0;
	padding-left: 24px;
	list-style: none;
}

.comment-meta,
.comment-notes,
.logged-in-as {
	color: var(--ov-muted);
	font-size: .875rem;
}

.comment-content {
	overflow-wrap: anywhere;
}

.comment-content p:last-child {
	margin-bottom: 0;
}

.comment-respond {
	margin-top: 24px;
}

.comment-form {
	display: grid;
	gap: 14px;
}

.comment-form label {
	display: block;
	margin-bottom: 5px;
}

.comment-form input:not([type="submit"]),
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ov-border);
	border-radius: 8px;
	background: #121212;
	color: var(--ov-text);
}

.comment-form textarea {
	min-height: 120px;
	resize: vertical;
}

.comment-form .submit {
	min-height: 42px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--ov-accent);
	color: var(--ov-bg);
	cursor: pointer;
}

.site-footer {
	padding: 22px 16px;
	border-top: 1px solid var(--ov-border);
	background: var(--ov-surface);
	color: var(--ov-muted);
	font-size: .875rem;
	text-align: center;
}

.site-footer p {
	margin: 0;
}

.screen-reader-text {
	position: absolute;
	overflow: hidden;
	width: 1px;
	height: 1px;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	clip-path: inset(50%);
}

.navigation.pagination {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.navigation.pagination .nav-links {
	display: flex;
	gap: 8px;
}

.navigation.pagination .page-numbers {
	display: grid;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	place-items: center;
	border: 1px solid var(--ov-border);
	border-radius: 8px;
	background: var(--ov-surface);
}

.pagination .current {
	border-color: var(--ov-accent);
	background: var(--ov-accent);
	color: var(--ov-bg);
}

@media (max-width: 620px) {
	.site-header {
		grid-template-columns: 1fr;
		gap: 12px;
		padding-top: 12px;
		padding-bottom: 12px;
	}

	.site-branding {
		grid-column: 1;
		grid-row: 1;
	}

	.site-search {
		grid-column: 1;
		grid-row: 2;
	}
}

@media (max-width: 1100px) {
	.video-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.site-layout {
		display: flex;
		flex-direction: column;
		padding: 0 12px;
	}

	.site-sidebar {
		order: 2;
		position: static;
		max-height: none;
		padding-top: 0;
		padding-bottom: 18px;
		overflow: visible;
	}

	.category-sidebar__heading {
		display: none;
	}

	.category-sidebar__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px 12px;
		border: 1px solid var(--ov-border);
		border-radius: 8px;
		background: var(--ov-surface);
		color: var(--ov-text);
		font-weight: 650;
		cursor: pointer;
		list-style: none;
	}

	.category-sidebar__toggle::-webkit-details-marker {
		display: none;
	}

	.category-sidebar__toggle::after {
		content: "+";
		font-size: 1.2rem;
	}

	.category-sidebar__details[open] > .category-sidebar__toggle::after {
		content: "−";
	}

	.category-sidebar__details:not([open]) > .category-sidebar__list {
		display: none !important;
	}

	.category-sidebar__list {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 0 6px;
		overflow: visible;
	}

	.category-sidebar__link {
		padding: 8px 12px;
		border: 1px solid var(--ov-border);
		border-radius: 999px;
		background: var(--ov-surface);
	}

	.category-sidebar__link.is-current {
		border-color: var(--ov-accent);
		box-shadow: none;
	}

	.site-main {
		order: 1;
		padding-top: 20px;
	}

	.video-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px 14px;
	}

	.video-card__media {
		border-radius: 9px;
	}

	.video-card__title {
		margin-top: 8px;
		font-size: .9rem;
	}
}

@media (max-width: 440px) {
	.video-grid {
		gap: 20px 10px;
	}

	.video-actions {
		gap: 8px;
	}

	.video-vote {
		padding: 0 11px;
		font-size: .9rem;
	}

	.video-download {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		transition-duration: .01ms !important;
	}
}
