/*
Theme Name: RetroTube
Theme URI: https://example.com/retrotube
Author: Your Name
Author URI: https://example.com
Description: A nostalgic theme that recreates the look of a video-sharing homepage circa 2016 — reimagined as a blog. Thumbnails link to posts, the sidebar links to pages about you and your site, the search bar searches your content, and comments are fully disabled so there is nothing for bots to spam.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: retrotube
*/

/* -------------------------------------------------------------------------
   0. Custom properties + reset
------------------------------------------------------------------------- */
:root {
	--rt-accent: #e52d27;
	--rt-accent-dark: #cc181e;
	--rt-bg: #ffffff;
	--rt-bg-alt: #f9f9f9;
	--rt-border: #e5e5e5;
	--rt-text: #0f0f0f;
	--rt-text-secondary: #606060;
	--rt-text-tertiary: #909090;
	--rt-link: #1a56c4;
	--rt-blue: #065fd4;
	--rt-blue-dark: #0356c4;
	--rt-sidebar-width: 240px;
	--rt-sidebar-collapsed-width: 72px;
	--rt-header-height: 56px;
	--rt-tabs-height: 44px;
	--rt-radius: 3px;
	--rt-font: 'Roboto', Arial, Helvetica, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: var(--rt-font);
	color: var(--rt-text);
	background: var(--rt-bg-alt);
	font-size: 14px;
	line-height: 1.5;
}

img {
	max-width: 100%;
	display: block;
}

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

button {
	font-family: inherit;
	cursor: pointer;
	background: none;
	border: none;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

h1, h2, h3, p {
	margin: 0;
}

svg {
	display: block;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.rt-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: #fff;
	color: #000;
	padding: 10px 16px;
	z-index: 1000;
	border-radius: 0 0 4px 0;
}
.rt-skip-link:focus {
	left: 0;
}

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

/* -------------------------------------------------------------------------
   1. Shell / header
------------------------------------------------------------------------- */
.rt-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.rt-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--rt-bg);
	border-bottom: 1px solid var(--rt-border);
}

.rt-header__row,
.rt-tabs,
.rt-body {
	max-width: 1800px;
	margin-left: auto;
	margin-right: auto;
}

.rt-header__row {
	height: var(--rt-header-height);
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 0 16px;
}

.rt-header__left {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: 0 0 auto;
}

.rt-hamburger {
	padding: 8px;
	color: var(--rt-text);
	display: flex;
	border-radius: 50%;
}
.rt-hamburger:hover {
	background: var(--rt-bg-alt);
}
.rt-hamburger svg {
	width: 20px;
	height: 20px;
}

.rt-logo {
	display: flex;
	align-items: center;
	min-width: 0;
}
.rt-logo__text {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.5px;
	color: var(--rt-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rt-logo img {
	max-height: 32px;
	width: auto;
}

.rt-header__center {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 560px;
	margin: 0 auto;
}
.rt-search-form {
	display: flex;
	height: 38px;
}
.rt-search-input {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--rt-border);
	border-right: none;
	border-radius: var(--rt-radius) 0 0 var(--rt-radius);
	padding: 0 14px;
	font-size: 15px;
	outline: none;
}
.rt-search-input:focus {
	border-color: #8fb8f6;
}
.rt-search-btn {
	width: 62px;
	flex: 0 0 auto;
	background: #f8f8f8;
	border: 1px solid var(--rt-border);
	border-radius: 0 var(--rt-radius) var(--rt-radius) 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rt-text-secondary);
}
.rt-search-btn:hover {
	background: #eee;
}
.rt-search-btn svg {
	width: 18px;
	height: 18px;
}

.rt-header__right {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.rt-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: var(--rt-radius);
	font-size: 13px;
	font-weight: 500;
	border: 1px solid transparent;
	white-space: nowrap;
}
.rt-btn svg {
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
}
.rt-btn--outline {
	border-color: var(--rt-border);
	color: var(--rt-text-secondary);
}
.rt-btn--outline:hover {
	background: var(--rt-bg-alt);
}
.rt-btn--filled {
	background: var(--rt-blue);
	color: #fff;
}
.rt-btn--filled:hover {
	background: var(--rt-blue-dark);
}
.rt-btn--text {
	color: var(--rt-text-secondary);
}
.rt-btn--text:hover {
	text-decoration: underline;
}
.rt-user-chip img {
	border-radius: 50%;
	display: block;
}

.rt-tabs {
	display: flex;
	gap: 24px;
	padding: 0 24px;
	height: var(--rt-tabs-height);
}
.rt-tab {
	display: flex;
	align-items: center;
	font-size: 14px;
	font-weight: 500;
	color: var(--rt-text-secondary);
	border-bottom: 2px solid transparent;
}
.rt-tab.is-active {
	color: var(--rt-text);
	border-bottom-color: var(--rt-accent);
}

/* -------------------------------------------------------------------------
   2. Body layout: sidebar / main / aside
------------------------------------------------------------------------- */
.rt-body {
	display: flex;
	align-items: flex-start;
	flex: 1;
	width: 100%;
}

.rt-sidebar {
	width: var(--rt-sidebar-width);
	flex: 0 0 var(--rt-sidebar-width);
	position: sticky;
	top: calc(var(--rt-header-height) + var(--rt-tabs-height));
	height: calc(100vh - var(--rt-header-height) - var(--rt-tabs-height));
	overflow-y: auto;
	padding: 12px 0 24px;
	border-right: 1px solid var(--rt-border);
	background: var(--rt-bg);
	transition: width 0.2s ease;
}

.rt-sidebar-overlay {
	display: none;
}

.rt-nav-item {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 10px 24px;
	font-size: 14px;
	color: var(--rt-text);
}
.rt-nav-item:hover {
	background: var(--rt-bg-alt);
}
.rt-nav-item.is-active {
	background: #fdeceb;
	color: var(--rt-accent);
	font-weight: 500;
}
.rt-nav-item.is-active .rt-nav-item__icon {
	color: var(--rt-accent);
}
.rt-nav-item__icon {
	display: flex;
	width: 20px;
	height: 20px;
	color: var(--rt-text-secondary);
	flex: 0 0 auto;
}
.rt-nav-item__icon svg {
	width: 100%;
	height: 100%;
}
.rt-nav-item--muted {
	color: var(--rt-text-secondary);
	font-size: 13px;
}

.rt-sidebar__section {
	border-top: 1px solid var(--rt-border);
	margin-top: 12px;
	padding-top: 12px;
}
.rt-sidebar__heading {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--rt-text-secondary);
	padding: 4px 24px 8px;
}
.rt-subscribe-box {
	padding: 12px 24px;
}
.rt-subscribe-box__text {
	font-size: 13px;
	color: var(--rt-text-secondary);
	margin: 0 0 12px;
}
.rt-subscribe-box__btn {
	width: 100%;
	justify-content: center;
}

.rt-main {
	flex: 1 1 auto;
	min-width: 0;
	padding: 20px 24px 60px;
}
.rt-aside {
	width: 340px;
	flex: 0 0 340px;
	padding: 20px 24px 60px 0;
}

/* -------------------------------------------------------------------------
   3. Homepage sections (horizontally scrollable rows)
------------------------------------------------------------------------- */
.rt-section {
	margin-bottom: 32px;
}
.rt-section__header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}
.rt-section__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	flex: 0 0 auto;
}
.rt-section__avatar svg {
	width: 18px;
	height: 18px;
	color: #fff;
}
.rt-section__titles {
	display: flex;
	flex-direction: column;
	margin-right: auto;
	min-width: 0;
}
.rt-section__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--rt-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rt-section__subtitle {
	font-size: 12px;
	color: var(--rt-text-secondary);
}
.rt-section__viewall {
	background: var(--rt-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: var(--rt-radius);
	flex: 0 0 auto;
}
.rt-section__viewall:hover {
	background: var(--rt-accent-dark);
}
.rt-section__count {
	font-size: 12px;
	color: var(--rt-text-secondary);
	min-width: 60px;
	text-align: right;
	flex: 0 0 auto;
}

.rt-section__row-wrap {
	position: relative;
}
.rt-section__row {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	padding-bottom: 4px;
	scrollbar-width: none;
}
.rt-section__row::-webkit-scrollbar {
	display: none;
}
.rt-section__item {
	flex: 0 0 240px;
	scroll-snap-align: start;
}
.rt-section__arrow {
	position: absolute;
	top: 0;
	right: -4px;
	height: 135px;
	width: 44px;
	background: linear-gradient(to left, rgba(249, 249, 249, 0.97), rgba(249, 249, 249, 0));
	display: flex;
	align-items: center;
	justify-content: flex-end;
	color: var(--rt-text);
}
.rt-section__arrow svg {
	width: 22px;
	height: 22px;
}

/* -------------------------------------------------------------------------
   4. Cards
------------------------------------------------------------------------- */
.rt-card {
	display: block;
}
.rt-card__thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: #ddd;
}
.rt-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.rt-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 40px;
	font-weight: 700;
}
.rt-card__badge {
	position: absolute;
	bottom: 6px;
	right: 6px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 5px;
	border-radius: 2px;
}
.rt-card__body {
	padding-top: 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.rt-card__title {
	font-size: 14px;
	font-weight: 500;
	color: var(--rt-link);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rt-card:hover .rt-card__title {
	text-decoration: underline;
}
.rt-card__channel {
	font-size: 12px;
	color: var(--rt-text-secondary);
}
.rt-card__stats {
	font-size: 12px;
	color: var(--rt-text-tertiary);
}
.rt-card__dot {
	margin: 0 4px;
}

/* -------------------------------------------------------------------------
   5. Grid pages: archive / search / trending / categories list
------------------------------------------------------------------------- */
.rt-archive__heading {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 4px;
}
.rt-archive__heading span {
	color: var(--rt-accent);
}
.rt-archive__subheading {
	color: var(--rt-text-secondary);
	font-size: 13px;
	margin-bottom: 20px;
}
.rt-archive__desc {
	margin-bottom: 20px;
	color: var(--rt-text-secondary);
	font-size: 14px;
}

.rt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 24px 16px;
}

.rt-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}
.rt-load-more {
	background: #fff;
	border: 1px solid var(--rt-border);
	color: var(--rt-text);
	padding: 10px 28px;
	border-radius: var(--rt-radius);
	font-size: 13px;
	font-weight: 600;
}
.rt-load-more:hover {
	background: var(--rt-bg-alt);
}
.rt-load-more.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.rt-empty {
	color: var(--rt-text-secondary);
	padding: 40px 0;
	text-align: center;
}

.rt-cat-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}
.rt-cat-list__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--rt-border);
	border-radius: 4px;
}
.rt-cat-list__link:hover {
	background: #fff;
}
.rt-cat-list__icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	flex: 0 0 auto;
}
.rt-cat-list__name {
	flex: 1;
	font-weight: 500;
	font-size: 14px;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.rt-cat-list__count {
	font-size: 12px;
	color: var(--rt-text-secondary);
	flex: 0 0 auto;
}

/* -------------------------------------------------------------------------
   6. Single post ("watch page") / video embed
------------------------------------------------------------------------- */
.rt-main--single {
	max-width: 900px;
}
.rt-single__player {
	margin-bottom: 16px;
}
.rt-single__hero {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 8px;
}

.rt-video-embed {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
}
.rt-video-embed iframe,
.rt-video-embed__native {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.rt-video-embed__native {
	object-fit: contain;
	background: #000;
}
.rt-video-embed__fallback,
.rt-video-embed--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #fff;
	font-size: 14px;
}
.rt-video-embed__fallback a {
	color: #fff;
	text-decoration: underline;
}
.rt-video-embed--empty span {
	color: var(--rt-text-tertiary);
	padding: 0 20px;
	text-align: center;
}

.rt-card__badge--video {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 3px;
}
.rt-card__badge--video svg {
	width: 100%;
	height: 100%;
}

.rt-share-btn.is-copied {
	background: #e6f4ea;
	border-color: #34a853;
	color: #1e7e34;
}
.rt-single__title {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 10px;
	line-height: 1.3;
}
.rt-single__meta {
	font-size: 13px;
	color: var(--rt-text-secondary);
	margin-bottom: 16px;
}
.rt-single__meta .rt-dot {
	margin: 0 6px;
}
.rt-single__author-box {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	border-top: 1px solid var(--rt-border);
	border-bottom: 1px solid var(--rt-border);
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.rt-single__author-box img {
	border-radius: 50%;
}
.rt-single__author-info {
	display: flex;
	flex-direction: column;
	margin-right: auto;
	min-width: 0;
}
.rt-single__author-name {
	font-weight: 600;
	font-size: 14px;
}
.rt-single__author-bio {
	font-size: 12px;
	color: var(--rt-text-secondary);
	max-width: 460px;
}
.rt-single__content {
	font-size: 16px;
	line-height: 1.75;
	color: var(--rt-text);
}
.rt-single__content p {
	margin: 0 0 1.2em;
}
.rt-single__content img {
	border-radius: 8px;
	height: auto;
}
.rt-single__content h2,
.rt-single__content h3 {
	margin: 1.5em 0 0.6em;
}
.rt-single__content a {
	color: var(--rt-link);
	text-decoration: underline;
}
.rt-single__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 28px;
}
.rt-tag-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #fff;
	border: 1px solid var(--rt-border);
	border-radius: 14px;
	padding: 5px 12px;
	font-size: 12px;
	color: var(--rt-text-secondary);
}
.rt-tag-pill svg {
	width: 12px;
	height: 12px;
}
.rt-tag-pill:hover {
	background: var(--rt-bg-alt);
}

/* Related posts rail */
.rt-related__heading {
	font-size: 15px;
	font-weight: 700;
	margin-bottom: 12px;
}
.rt-related__item {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}
.rt-related__thumb-wrap {
	position: relative;
	width: 140px;
	flex: 0 0 140px;
	aspect-ratio: 16 / 9;
	border-radius: 4px;
	overflow: hidden;
	background: #ddd;
}
.rt-related__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.rt-related__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 22px;
	font-weight: 700;
}
.rt-related__badge {
	position: absolute;
	bottom: 4px;
	right: 4px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 10px;
	padding: 1px 4px;
	border-radius: 2px;
}
.rt-related__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.rt-related__title {
	font-size: 13px;
	font-weight: 500;
	color: var(--rt-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rt-related__channel,
.rt-related__stats {
	font-size: 11px;
	color: var(--rt-text-tertiary);
}

/* -------------------------------------------------------------------------
   7. Static pages / categories page / 404
------------------------------------------------------------------------- */
.rt-main--page {
	max-width: 760px;
}
.rt-page__title {
	font-size: 26px;
	font-weight: 700;
	margin-bottom: 20px;
}
.rt-page__content {
	font-size: 16px;
	line-height: 1.75;
}
.rt-page__content a {
	color: var(--rt-link);
	text-decoration: underline;
}
.rt-page__content img {
	border-radius: 8px;
	height: auto;
}

.rt-404 {
	max-width: 480px;
	margin: 60px auto;
	text-align: center;
}
.rt-404__code {
	font-size: 56px;
	font-weight: 700;
	color: var(--rt-border);
	margin-bottom: 8px;
}
.rt-404__text {
	font-size: 18px;
	font-weight: 500;
	margin-bottom: 4px;
}
.rt-404__subtext {
	color: var(--rt-text-secondary);
	margin-bottom: 24px;
}
.rt-search-form--404 {
	margin: 0 auto 24px;
	max-width: 400px;
}

/* -------------------------------------------------------------------------
   8. Footer
------------------------------------------------------------------------- */
.rt-footer {
	border-top: 1px solid var(--rt-border);
	background: #fff;
	padding: 24px;
	margin-top: auto;
}
.rt-footer__top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 12px;
	max-width: 1800px;
	margin-left: auto;
	margin-right: auto;
}
.rt-footer__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-right: auto;
}
.rt-footer__menu a {
	font-size: 13px;
	color: var(--rt-text-secondary);
}
.rt-footer__menu a:hover {
	text-decoration: underline;
}
.rt-footer__rss {
	color: var(--rt-text-secondary);
	display: flex;
}
.rt-footer__rss svg {
	width: 18px;
	height: 18px;
}
.rt-footer__bottom {
	font-size: 12px;
	color: var(--rt-text-tertiary);
	max-width: 1800px;
	margin-left: auto;
	margin-right: auto;
}

/* -------------------------------------------------------------------------
   9. Responsive behaviour
------------------------------------------------------------------------- */

/* Desktop: hamburger collapses the sidebar to icons-only. */
@media (min-width: 901px) {
	body.rt-sidebar-collapsed .rt-sidebar {
		width: var(--rt-sidebar-collapsed-width);
		flex-basis: var(--rt-sidebar-collapsed-width);
	}
	body.rt-sidebar-collapsed .rt-nav-item {
		justify-content: center;
		padding: 10px 0;
	}
	body.rt-sidebar-collapsed .rt-nav-item__label,
	body.rt-sidebar-collapsed .rt-sidebar__heading,
	body.rt-sidebar-collapsed .rt-subscribe-box {
		display: none;
	}
}

/* Tablet/mobile: sidebar becomes an off-canvas drawer; aside stacks below main. */
@media (max-width: 900px) {
	.rt-sidebar {
		position: fixed;
		top: 0;
		left: -280px;
		height: 100vh;
		width: 260px;
		z-index: 200;
		transition: left 0.25s ease;
		box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
	}
	body.rt-sidebar-open .rt-sidebar {
		left: 0;
	}
	body.rt-sidebar-open .rt-sidebar-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 150;
	}

	.rt-body {
		flex-wrap: wrap;
	}
	.rt-aside {
		flex: 1 1 100%;
		width: 100%;
		order: 3;
		border-top: 1px solid var(--rt-border);
	}
	.rt-related {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
		gap: 16px;
	}
	.rt-related__item {
		flex-direction: column;
		margin-bottom: 0;
	}
	.rt-related__thumb-wrap {
		width: 100%;
		flex-basis: auto;
	}
}

@media (max-width: 640px) {
	.rt-btn--outline span {
		display: none;
	}
	.rt-logo__text {
		font-size: 16px;
	}
	.rt-header__row {
		gap: 8px;
		padding: 0 8px;
	}
	.rt-tabs {
		padding: 0 12px;
		gap: 16px;
	}
	.rt-main {
		padding: 16px 14px 40px;
	}
	.rt-section__item {
		flex-basis: 200px;
	}
}
