/*
Theme Name: VNReels
Theme URI: https://vnreels.in
Author: vnreels.in
Description: A fast, mobile-first theme for VN template galleries. Built around a 9:16 template grid, a prominent QR block, and article pages for tutorials.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
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: vnreels
Tags: blog, two-columns, custom-menu, featured-images
*/

:root {
	/* Light canvas. Media wells stay dark so 9:16 thumbnails pop. */
	--ink: #ffffff;
	--panel: #f5f4f8;
	--panel-2: #ecebf1;
	--line: #e4e2ea;
	--line-soft: #efeef3;
	--text: #16151c;
	--muted: #6e6b7b;
	--accent: #ff2d6f;
	--accent-dark: #b3004a;
	--accent-haze: #ffe8f0;
	--gold: #f2b441;
	--well: #141318;

	--font-display: "Bricolage Grotesque", system-ui, sans-serif;
	--font-body: "Inter Tight", system-ui, sans-serif;
	--font-mono: "DM Mono", ui-monospace, monospace;

	--wrap: 1120px;
	--radius: 12px;
}

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

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

body {
	margin: 0;
	background: var(--ink);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 12px;
}

h1 { font-size: clamp(26px, 5vw, 40px); }
h2 { font-size: clamp(21px, 3.4vw, 28px); }
h3 { font-size: 18px; }

p { margin: 0 0 16px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }

.skip-link {
	position: absolute;
	left: -9999px;
	background: var(--accent);
	color: #fff;
	padding: 10px 16px;
	z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ---------- beat-tick rule: the signature divider ---------- */

.beat-rule {
	height: 9px;
	margin: 30px 0;
	border-top: 1px solid var(--line);
	background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
	background-size: 14px 5px;
	background-repeat: repeat-x;
	background-position: 0 0;
}

/* ---------- header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--line-soft);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 58px;
}

.brand {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 18px;
	letter-spacing: -0.03em;
	text-decoration: none;
	white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand img { max-height: 32px; width: auto; }

.nav-toggle {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: none;
	border: 1px solid var(--line);
	color: var(--text);
	border-radius: 8px;
	padding: 7px 11px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 20px;
}
.main-nav a {
	text-decoration: none;
	font-size: 14px;
	color: var(--muted);
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--text); }

@media (max-width: 860px) {
	.main-nav {
		display: none;
		width: 100%;
		padding: 6px 0 14px;
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 2px; }
	.main-nav a { display: block; padding: 9px 0; font-size: 15px; }
	.header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 4px; }
}
@media (min-width: 861px) {
	.nav-toggle { display: none; }
	.main-nav { margin-left: auto; }
}

/* ---------- search ---------- */

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	color: var(--text);
	font: inherit;
	font-size: 15px;
	padding: 11px 14px;
}
.search-form input[type="search"]::placeholder { color: var(--muted); }
.search-form button {
	background: var(--panel-2);
	border: 1px solid var(--line);
	color: var(--text);
	border-radius: 10px;
	padding: 0 16px;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.search-form button:hover { border-color: var(--accent); }

/* ---------- home intro ---------- */

.home-intro { padding: 26px 0 6px; }
.home-intro h1 { margin-bottom: 6px; }
.home-intro p { color: var(--muted); margin-bottom: 18px; max-width: 52ch; }

.chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 16px 0 4px;
	scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
	flex: 0 0 auto;
	text-decoration: none;
	font-size: 13px;
	padding: 6px 13px;
	border-radius: 999px;
	border: 1px solid var(--line);
	color: var(--muted);
	white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--gold); }
.chip.is-active { background: var(--text); border-color: var(--text); color: #ffffff; font-weight: 500; }

/* ---------- template grid ---------- */

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 26px 0 14px;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 13px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--accent); }

.tpl-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
@media (min-width: 620px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .tpl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tpl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.tpl-card { text-decoration: none; display: block; }

.tpl-card-media {
	position: relative;
	aspect-ratio: 9 / 16;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--well);
	border: 1px solid var(--line);
}
.tpl-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}
.tpl-card:hover .tpl-card-media img { transform: scale(1.04); }

.tpl-card-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #8c8a96;
	font-size: 12px;
}

.timecode {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: -0.02em;
	padding: 2px 6px;
	border-radius: 5px;
	background: rgba(10, 12, 16, 0.82);
	color: #ffffff;
}
.tpl-card-media .timecode { position: absolute; right: 7px; bottom: 7px; }

.tpl-card h3 {
	font-size: 14px;
	font-weight: 500;
	margin: 9px 0 2px;
	line-height: 1.3;
}
.tpl-card .song { font-size: 12px; color: var(--muted); margin: 0; }
.tpl-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin: 3px 0 0; }

/* ---------- single template ---------- */

.tpl-single { padding: 22px 0 8px; }

.tpl-layout { display: grid; gap: 22px; }
@media (min-width: 900px) {
	.tpl-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; }
	.tpl-media-col { position: sticky; top: 78px; }
}

.tpl-player {
	width: 100%;
	aspect-ratio: 9 / 16;
	object-fit: cover;
	border-radius: var(--radius);
	background: var(--well);
	border: 1px solid var(--line);
}

.tpl-embed {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--well);
	border: 1px solid var(--line);
}
.tpl-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.tpl-eyebrow {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--gold);
	text-transform: uppercase;
	letter-spacing: .08em;
	margin: 0 0 6px;
	text-decoration: none;
	display: inline-block;
}

.tpl-badges { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.tpl-badges li {
	font-family: var(--font-mono);
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 6px;
	background: var(--panel);
	border: 1px solid var(--line);
	color: var(--muted);
}

.qr-card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
	margin: 20px 0;
	display: grid;
	gap: 14px;
	align-items: center;
}
@media (min-width: 520px) { .qr-card { grid-template-columns: 148px minmax(0, 1fr); } }

.qr-card img {
	width: 148px;
	height: 148px;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
	padding: 7px;
}
.qr-card h2 { font-size: 17px; margin: 0 0 4px; }
.qr-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	padding: 13px 20px;
	border-radius: 10px;
	border: 0;
	width: 100%;
	cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }

.btn-ghost {
	background: transparent;
	border: 1px solid var(--line);
	color: var(--text);
	font-weight: 500;
	margin-top: 9px;
}
.btn-ghost:hover { background: var(--panel-2); border-color: var(--muted); }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
	counter-increment: step;
	position: relative;
	padding-left: 34px;
	margin-bottom: 11px;
	color: var(--muted);
	font-size: 14.5px;
}
.steps li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 1px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--panel-2);
	border: 1px solid var(--line);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 11px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.entry-content { font-size: 16.5px; }
.entry-content a { color: var(--accent); }
.entry-content h2 { margin-top: 28px; }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content li { margin-bottom: 7px; }
.entry-content blockquote {
	margin: 22px 0;
	padding: 2px 0 2px 16px;
	border-left: 3px solid var(--gold);
	color: var(--muted);
}
.entry-content img { border-radius: 10px; }

/* ---------- articles ---------- */

.post-list { display: grid; gap: 18px; }
@media (min-width: 700px) { .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }

.post-card {
	background: var(--panel);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	overflow: hidden;
	text-decoration: none;
	display: block;
}
.post-card:hover { border-color: var(--line); }
.post-card-media { aspect-ratio: 16 / 9; background: var(--panel-2); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 15px 17px 18px; }
.post-card h3 { font-size: 17px; margin: 0 0 6px; }
.post-card p { font-size: 14px; color: var(--muted); margin: 0; }
.post-card time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.entry-header { padding: 26px 0 4px; max-width: 68ch; }
.entry-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.entry-narrow { max-width: 68ch; }

/* ---------- pagination ---------- */

.pagination { margin: 34px 0 8px; display: flex; gap: 7px; flex-wrap: wrap; }
.pagination .page-numbers {
	padding: 8px 13px;
	border: 1px solid var(--line);
	border-radius: 8px;
	text-decoration: none;
	font-size: 14px;
	color: var(--muted);
}
.pagination .page-numbers.current { background: var(--panel-2); color: var(--text); border-color: var(--muted); }
.pagination a.page-numbers:hover { color: var(--text); border-color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
	margin-top: 46px;
	border-top: 1px solid var(--line-soft);
	background: var(--panel);
	padding: 32px 0 26px;
}
.footer-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; } }
.footer-grid h4 { font-size: 14px; margin: 0 0 10px; }
.footer-grid p { font-size: 14px; color: var(--muted); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { font-size: 14px; color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }

.footer-legal {
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid var(--line-soft);
	font-size: 12.5px;
	color: var(--muted);
}
.footer-legal p { margin: 0 0 6px; }

/* ---------- misc ---------- */

.notice {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
	color: var(--muted);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

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

/* ---------- click-to-play preview ---------- */

.tpl-facade {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--well);
	cursor: pointer;
}

.tpl-facade img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tpl-facade iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.tpl-facade.is-live {
	aspect-ratio: auto;
	background: transparent;
	cursor: default;
}

.tpl-play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	cursor: pointer;
	padding: 0;
}

.tpl-play::before {
	content: "";
	position: absolute;
	left: 54%;
	top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent var(--text);
}

.tpl-facade:hover .tpl-play { background: #ffffff; }
.tpl-facade.is-live .tpl-play { display: none; }
