/*
Theme Name: Reelhouse
Description: A video site theme (Top Zeed edition). Each video gets its own link and a thumbnail you choose, and players load only when pressed so pages stay fast.
Version: 1.1.0
Requires at least: 6.3
Requires PHP: 7.4
Author: Seal Desk
Text Domain: reelhouse
License: GPLv2 or later
*/

:root {
	--bg: #fff7fa;
	--band: #fce4ed;
	--panel: #fbe9f0;
	--line: #f2c8d7;
	--text: #3b1f2b;
	--muted: #85606f;
	--accent: #c93368;
	--accent-hi: #a8264f;
	--on-accent: #ffffff;

	--font-head: "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
	--font-body: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;

	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius: 4px;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1rem/1.7 var(--font-body);
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

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

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

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

.skip-link {
	position: absolute;
	left: 12px; top: -60px;
	z-index: 10;
	padding: 8px 14px;
	background: var(--accent);
	color: var(--on-accent);
	border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header { background: #fff; border-bottom: 1px solid var(--line); }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 68px;
}

.brand__name {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font: 600 1.35rem/1 var(--font-head);
	text-decoration: none;
	letter-spacing: -0.01em;
}
.brand__mark { width: 34px; height: 34px; flex: none; }
.custom-logo { max-height: 44px; width: auto; }

.nav { flex: 1; min-width: 0; }

.nav__list {
	display: flex;
	gap: 22px;
	margin: 0; padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}
.nav__list::-webkit-scrollbar { display: none; }

.nav__list a {
	display: block;
	padding: 6px 0;
	color: var(--muted);
	text-decoration: none;
	white-space: nowrap;
}
.nav__list a:hover,
.nav__list .current-menu-item > a { color: var(--text); }
.nav__list .current-menu-item > a { box-shadow: inset 0 -2px var(--accent); }

.search { position: relative; }

.search__input {
	width: 220px;
	padding: 8px 40px 8px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--panel);
	color: var(--text);
	font: inherit;
	font-size: 0.9375rem;
}
.search__input::placeholder { color: var(--muted); }

.search__submit {
	position: absolute;
	top: 50%; right: 6px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 30px; height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--muted);
	cursor: pointer;
}
.search__submit:hover { color: var(--accent); }
.search__submit svg { width: 18px; height: 18px; }

.empty .search { display: inline-block; margin-top: 8px; }
.empty .search__input { width: min(320px, 80vw); }

/* ---------- Curtain bands (feature + watch stage) ---------- */

.feature,
.stage {
	background-color: var(--band);
	background-image: repeating-linear-gradient(
		90deg,
		rgba(255, 255, 255, 0) 0,
		rgba(255, 255, 255, 0.3) 18px,
		rgba(201, 51, 104, 0.035) 40px,
		rgba(255, 255, 255, 0) 56px
	);
	border-bottom: 1px solid var(--line);
}

.feature__inner {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: clamp(24px, 4vw, 48px);
	align-items: center;
	padding-block: clamp(24px, 5vw, 56px);
}

.feature__title {
	margin: 6px 0 12px;
	font: 600 clamp(1.6rem, 3vw, 2.4rem)/1.25 var(--font-head);
	letter-spacing: -0.01em;
}
.feature__title a { text-decoration: none; }
.feature__title a:hover { text-decoration: underline; }

.feature__excerpt { margin: 0 0 22px; color: var(--muted); max-width: 36em; }

.stage__inner {
	max-width: 1120px;
	margin-inline: auto;
	padding: clamp(0px, 3vw, 36px) clamp(0px, 3vw, 32px);
}

/* ---------- Player ---------- */

.player {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
	border-radius: var(--radius);
}
.stage .player { border-radius: 0; }
@media (min-width: 700px) { .stage .player { border-radius: var(--radius); } }

.player img,
.player iframe,
.player video,
.player .thumb__empty {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.player--file video { object-fit: contain; } /* Never crop real video (vertical clips etc.). */

.player--embed { aspect-ratio: auto; background: none; }
.player--embed iframe,
.player--embed blockquote { position: static; height: auto; aspect-ratio: 16 / 9; }

.player__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 76px; height: 76px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--accent);
	color: var(--on-accent);
	cursor: pointer;
	box-shadow: 0 0 0 10px rgba(255, 247, 250, 0.55);
	transition: background-color 0.15s ease;
}
.player__play svg { width: 32px; height: 32px; margin-left: 4px; fill: currentColor; }
.player__play:hover { background: var(--accent-hi); }

/* ---------- Grid + cards ---------- */

.section-title {
	margin: 48px 0 20px;
	font: 600 1.5rem/1.3 var(--font-head);
}
.section-desc { margin: -8px 0 24px; color: var(--muted); max-width: 42em; }

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 32px 20px;
}

.card { min-width: 0; }

.thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--panel);
}
.thumb__img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.15s ease; }
.card:hover .thumb__img { filter: brightness(1.12); }
.thumb__empty { display: block; width: 100%; height: 100%; background: var(--panel); }

.thumb__time {
	position: absolute;
	right: 8px; bottom: 8px;
	padding: 1px 7px;
	border-radius: 3px;
	background: rgba(59, 31, 43, 0.86);
	color: #fff;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.card__title {
	margin: 12px 0 4px;
	font: 500 1.0625rem/1.45 var(--font-head);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }

.card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 0;
	color: var(--muted);
	font-size: 0.875rem;
}
.card__meta a { color: var(--accent); text-decoration: none; }
.card__meta a:hover { text-decoration: underline; }

/* ---------- Watch page ---------- */

.watch__head { padding-top: 28px; }
.watch__title {
	margin: 0 0 8px;
	max-width: 32em;
	font: 600 clamp(1.5rem, 2.6vw, 2rem)/1.3 var(--font-head);
}

.prose { margin-top: 24px; max-width: 42em; }
.prose a { color: var(--accent); }
.prose img { height: auto; border-radius: var(--radius); }

.more { padding-bottom: 16px; }

/* ---------- Comments ---------- */

.comments { max-width: 42em; margin-top: 16px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: clamp(16px, 4vw, 40px); }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata, .comment-metadata a { color: var(--muted); font-size: 0.8125rem; text-decoration: none; }
.comment-content p { margin: 8px 0; }
.reply a { color: var(--accent); font-size: 0.875rem; text-decoration: none; }
.comments__closed { color: var(--muted); }

.comment-form label { display: block; margin-bottom: 4px; font-size: 0.875rem; color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
	color: var(--text);
	font: inherit;
}
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: baseline; }
.comment-form .comment-form-cookies-consent label { display: inline; }
.comment-form .button { border: 0; cursor: pointer; font: inherit; font-weight: 500; }
.comment-reply-title small { margin-left: 12px; font-size: 0.875rem; }

/* ---------- Misc ---------- */

.button {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 500;
	text-decoration: none;
}
.button:hover { background: var(--accent-hi); }

.pagination { margin: 48px 0 16px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers {
	min-width: 40px;
	padding: 6px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-align: center;
	text-decoration: none;
	color: var(--muted);
}
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
a.page-numbers:hover { color: var(--text); border-color: var(--muted); }

.empty { padding-block: 64px; color: var(--muted); }

.site-footer {
	margin-top: 72px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.875rem;
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-block: 28px; }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
	.feature__inner { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
	.site-header__inner { flex-wrap: wrap; gap: 4px 20px; padding-block: 12px; }
	.nav { order: 3; flex-basis: 100%; }
	.search { margin-left: auto; }
	.search__input { width: 150px; }
	.feature .wrap { padding-inline: 0; }
	.feature__inner { padding-top: 0; }
	.feature .player { border-radius: 0; }
	.feature__text { padding-inline: var(--gutter); }
	.grid { grid-template-columns: 1fr; gap: 28px; }
}

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