/*
Theme Name: ReelVault
Theme URI: https://example.com
Author: Jamal
Description: A custom dark cinematic movie catalog theme, synced from TMDB.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: reelvault
*/

/* ---------------------------------------------------------------------
   Design tokens
--------------------------------------------------------------------- */
:root {
	--rv-bg:        #1C1614; /* dark warm charcoal, theater-curtain undertone */
	--rv-surface:   #241C19; /* card / raised surface */
	--rv-border:    rgba(242, 234, 225, 0.12);
	--rv-text:      #F2EAE1; /* warm off-white */
	--rv-text-dim:  #B8ACA1;
	--rv-gold:      #E8A33D; /* marquee light accent */
	--rv-red:       #8B2635; /* cinema-seat red, used sparingly */

	--rv-font-display: 'Fraunces', Georgia, serif;
	--rv-font-body: 'Work Sans', -apple-system, sans-serif;

	--rv-radius: 3px;
	--rv-max-width: 1240px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--rv-bg);
	color: var(--rv-text);
	font-family: var(--rv-font-body);
	font-size: 16px;
	line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.rv-container {
	max-width: var(--rv-max-width);
	margin: 0 auto;
	padding: 0 32px;
}

/* ---------------------------------------------------------------------
   Header
--------------------------------------------------------------------- */
.rv-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 28px 32px;
	max-width: var(--rv-max-width);
	margin: 0 auto;
}

.rv-logo {
	font-family: var(--rv-font-display);
	font-size: 24px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.rv-logo span { color: var(--rv-gold); }

.rv-nav ul {
	list-style: none;
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
}

.rv-nav a {
	font-size: 14px;
	color: var(--rv-text-dim);
	border-bottom: 1px solid transparent;
	padding-bottom: 4px;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.rv-nav a:hover { color: var(--rv-gold); border-color: var(--rv-gold); }

/* ---------------------------------------------------------------------
   Hero (front page featured title)
--------------------------------------------------------------------- */
.rv-hero {
	position: relative;
	min-height: 62vh;
	display: flex;
	align-items: flex-end;
	background-size: cover;
	background-position: center;
	margin-bottom: 56px;
}

.rv-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(28,22,20,0.15) 0%, rgba(28,22,20,0.55) 55%, var(--rv-bg) 100%);
}

.rv-hero-content {
	position: relative;
	z-index: 1;
	padding: 0 32px 48px;
	max-width: 640px;
}

.rv-hero-title {
	font-family: var(--rv-font-display);
	font-size: clamp(36px, 5vw, 56px);
	font-weight: 600;
	line-height: 1.05;
	margin: 0 0 14px;
}

.rv-hero-meta {
	display: flex;
	gap: 16px;
	font-size: 14px;
	color: var(--rv-text-dim);
	margin-bottom: 16px;
}

.rv-hero-rating { color: var(--rv-gold); }

.rv-hero-overview {
	font-size: 16px;
	color: var(--rv-text-dim);
	margin-bottom: 24px;
	max-width: 60ch;
}

.rv-btn {
	display: inline-block;
	padding: 12px 22px;
	border-radius: var(--rv-radius);
	font-size: 14px;
	font-weight: 500;
	border: 1px solid var(--rv-border);
}

.rv-btn-primary {
	background: var(--rv-gold);
	color: #1C1614;
	border-color: var(--rv-gold);
}

/* ---------------------------------------------------------------------
   Sections / poster grid
--------------------------------------------------------------------- */
.rv-section { margin-bottom: 56px; }

.rv-section-title {
	font-family: var(--rv-font-display);
	font-size: 24px;
	font-weight: 500;
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--rv-border);
}

/* ---------------------------------------------------------------------
   Filter bar (genre / year / live search)
--------------------------------------------------------------------- */
.rv-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
}

.rv-filter-bar select {
	background: var(--rv-surface);
	color: var(--rv-text);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	padding: 9px 12px;
	font-family: var(--rv-font-body);
	font-size: 14px;
}

.rv-filter-clear {
	font-size: 13px;
	color: var(--rv-gold);
	text-decoration: underline;
}

.rv-filter-search {
	position: relative;
	flex: 1 1 240px;
	max-width: 320px;
}

.rv-filter-search input {
	width: 100%;
	background: var(--rv-surface);
	color: var(--rv-text);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	padding: 9px 12px;
	font-family: var(--rv-font-body);
	font-size: 14px;
}

.rv-filter-search input:focus { outline: none; border-color: var(--rv-gold); }

#rv-live-search-results {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 20;
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	max-height: 320px;
	overflow-y: auto;
	box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

#rv-live-search-results.is-open { display: block; }

.rv-search-result {
	display: block;
	padding: 10px 14px;
	font-size: 14px;
	border-bottom: 1px solid var(--rv-border);
}

.rv-search-result:last-child { border-bottom: none; }
.rv-search-result:hover { background: rgba(232, 163, 61, 0.1); color: var(--rv-gold); }

.rv-search-empty {
	padding: 10px 14px;
	font-size: 13px;
	color: var(--rv-text-dim);
}

/* ---------------------------------------------------------------------
   Poster grid
--------------------------------------------------------------------- */
.rv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 20px;
}

.rv-card {
	position: relative;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	overflow: hidden;
	background: var(--rv-surface);
}

.rv-card-poster { aspect-ratio: 2 / 3; background: var(--rv-surface); object-fit: cover; }

.rv-card-body { padding: 12px 14px; }

.rv-card-title {
	font-size: 14.5px;
	font-weight: 500;
	margin: 0 0 4px;
	line-height: 1.3;
}

.rv-card-meta {
	font-size: 12.5px;
	color: var(--rv-text-dim);
	display: flex;
	justify-content: space-between;
}

.rv-card-rating { color: var(--rv-gold); }

/* Hover overlay: title/rating/blurb slide in over the poster on hover */
.rv-card-hover { transition: transform 0.18s ease, box-shadow 0.18s ease; }

.rv-card-hover:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}

.rv-card-overlay {
	position: absolute;
	inset: 0;
	bottom: auto;
	aspect-ratio: 2 / 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 14px;
	background: linear-gradient(180deg, rgba(28,22,20,0) 40%, rgba(28,22,20,0.95) 100%);
	opacity: 0;
	transition: opacity 0.18s ease;
	pointer-events: none;
}

.rv-card-hover:hover .rv-card-overlay { opacity: 1; }
.rv-card-hover:hover .rv-card-body { visibility: hidden; }

.rv-card-overlay-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 4px;
	line-height: 1.25;
}

.rv-card-overlay-excerpt {
	font-size: 12px;
	color: var(--rv-text-dim);
	margin: 8px 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (hover: none) {
	/* Touch devices: skip the hover overlay, keep the always-visible body */
	.rv-card-overlay { display: none; }
}

/* ---------------------------------------------------------------------
   Single movie page
--------------------------------------------------------------------- */
.rv-movie-hero {
	position: relative;
	min-height: 50vh;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: flex-end;
	margin-bottom: 40px;
}

.rv-movie-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(28,22,20,0.2) 0%, var(--rv-bg) 100%);
}

.rv-movie-header {
	position: relative;
	z-index: 1;
	display: flex;
	gap: 28px;
	padding: 0 32px 32px;
	max-width: var(--rv-max-width);
	margin: 0 auto;
	align-items: flex-end;
}

.rv-movie-poster {
	width: 180px;
	border-radius: var(--rv-radius);
	border: 1px solid var(--rv-border);
	flex-shrink: 0;
}

.rv-movie-title {
	font-family: var(--rv-font-display);
	font-size: clamp(28px, 4vw, 42px);
	margin: 0 0 8px;
}

.rv-movie-tagline {
	font-style: italic;
	color: var(--rv-text-dim);
	margin: 0 0 12px;
}

.rv-movie-body {
	max-width: var(--rv-max-width);
	margin: 0 auto;
	padding: 0 32px 64px;
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 48px;
}

.rv-movie-overview { font-size: 16px; max-width: 68ch; margin-bottom: 32px; }

.rv-cast-list { list-style: none; padding: 0; margin: 0; }
.rv-cast-list li { padding: 8px 0; border-bottom: 1px solid var(--rv-border); font-size: 14px; }
.rv-cast-list .rv-character { color: var(--rv-text-dim); }

.rv-facts { list-style: none; padding: 0; margin: 0; }
.rv-facts li {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--rv-border);
	font-size: 14px;
}
.rv-facts .rv-fact-label { color: var(--rv-text-dim); }

.rv-trailer {
	position: relative;
	aspect-ratio: 16 / 9;
	margin-bottom: 32px;
	border-radius: var(--rv-radius);
	overflow: hidden;
	border: 1px solid var(--rv-border);
}
.rv-trailer iframe { width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */
.rv-footer {
	border-top: 1px solid var(--rv-border);
	padding: 32px;
	text-align: center;
	color: var(--rv-text-dim);
	font-size: 13px;
}

/* ---------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------- */
@media (max-width: 720px) {
	.rv-header { flex-direction: column; gap: 16px; padding: 20px; }
	.rv-movie-header { flex-direction: column; align-items: flex-start; }
	.rv-movie-body { grid-template-columns: 1fr; }
	.rv-container, .rv-hero-content, .rv-movie-header, .rv-movie-body { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.rv-nav a { transition: none; }
}

:focus-visible {
	outline: 2px solid var(--rv-gold);
	outline-offset: 2px;
}
