/*
Theme Name: Video Links
Description: A single-screen link page with your own looping video as the background, a picture, a name and a stack of links in white rounded buttons. Set everything under Appearance > Customize > Video Links.
Version: 2.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: video-links
*/

/* Pixel fonts, bundled in the theme (assets/fonts, SIL Open Font License).
   Pick one under Customize > Video Links > Font. */
@font-face { font-family: "VL Press Start"; src: url("assets/fonts/press-start-2p-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "VL Pixelify"; src: url("assets/fonts/pixelify-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "VL Pixelify"; src: url("assets/fonts/pixelify-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "VL Silkscreen"; src: url("assets/fonts/silkscreen-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "VL Silkscreen"; src: url("assets/fonts/silkscreen-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
	--ink: #ffffff;
	--muted: #d2d2d2;
	--card: #ffffff;
	--card-ink: #111111;
	--radius: 16px;
}

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

html {
	background: #050505;
}
button,
input,
select,
textarea {
	font: inherit;
}

body {
	margin: 0;
	min-height: 100vh;
	background: #050505;
	color: var(--ink);
	font-family: var(--vl-font, "VL Press Start"), ui-monospace, Menlo, Consolas, monospace;
	font-size: calc(1rem * var(--vl-fs, 0.75));
	font-synthesis: none; /* never smear a pixel font with fake bold */
	line-height: 1.6;
}

/* Fade to black between pages */
.vl-fade {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: #000;
	opacity: 0;
	pointer-events: none;
	animation: vl-fade-in 0.6s ease both; /* page opens: black fades away */
}
.vl-fade.is-leaving {
	pointer-events: all;
	animation: vl-fade-out 0.4s ease forwards; /* page closes: fades to black */
}
@keyframes vl-fade-in  { from { opacity: 1; } to { opacity: 0; } }
@keyframes vl-fade-out { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.vl-fade,
	.vl-fade.is-leaving { animation: none; opacity: 0; }
}

/* Video background */
.vl-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: #050505 center / cover no-repeat;
	pointer-events: none;
}
.vl-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.vl-video--contain { object-fit: contain; } /* Customize > Background video > Video fit */
.vl-dim {
	position: absolute;
	inset: 0;
	background: #000;
}

/* Page layout */
.stage {
	position: relative;
	z-index: 2;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	padding: 3rem 1.5rem;
	text-align: center;
}
body.admin-bar .stage { min-height: calc(100svh - 32px); }
@media (max-width: 782px) {
	body.admin-bar .stage { min-height: calc(100svh - 46px); }
}

/* Picture: no frame by default, so transparent images stay transparent */
.avatar {
	width: min(176px, 46vw);
	aspect-ratio: 1;
}
.avatar img,
.avatar-empty {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}
.avatar-empty {
	background: rgba(255, 255, 255, 0.12);
	border-radius: var(--radius);
	filter: none;
}
/* Optional white rounded square behind the picture (best with a dark picture) */
.avatar.has-frame {
	padding: 8px;
	background: var(--card);
	border-radius: calc(var(--radius) + 6px);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.avatar.has-frame img,
.avatar.has-frame .avatar-empty {
	border-radius: var(--radius);
	object-fit: cover;
	filter: none;
}

/* Name and tagline */
.name {
	margin: 0;
	font-size: clamp(1.4em, 5vw, 1.9em);
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.tagline {
	margin: -0.75rem 0 0;
	color: var(--muted);
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

/* Links: white rounded buttons, stacked */
.links {
	list-style: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	margin: 0;
	padding: 0;
}
.links a {
	display: block;
	min-width: min(260px, 80vw);
	padding: 0.8rem 1.75rem;
	background: var(--card);
	color: var(--card-ink);
	border-radius: var(--radius);
	text-decoration: none;
	text-align: center;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease;
}
.links a:hover,
.links a:focus-visible {
	text-shadow: 1px 0 0 currentColor;
	transform: translateY(-2px);
}
a:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

/* Alternative: plain white text links (Customize > Link style) */
.links--plain a {
	min-width: 0;
	padding: 0.3rem 0.6rem;
	background: transparent;
	color: var(--ink);
	box-shadow: none;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
	border-radius: 6px;
}
.links--plain a:hover,
.links--plain a:focus-visible {
	transform: none;
}

.hint {
	max-width: 34ch;
	margin: 0;
	padding: 0.75rem 1rem;
	background: rgba(0, 0, 0, 0.55);
	border-radius: var(--radius);
	color: var(--muted);
	font-size: 0.9em;
}
.hint a { color: var(--ink); }

/* Menu: a bar across the top, items side by side */
:root { --bar-h: 3rem; }
.vl-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
	min-height: var(--bar-h);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1rem;
	background: var(--menu-bg, rgba(0, 0, 0, 0.55));
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
body.admin-bar .vl-nav { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar .vl-nav { top: 46px; }
}
.vl-nav__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.4rem 0;
	margin: 0;
	padding: 0;
}
.vl-nav__list li { display: flex; align-items: center; }
.vl-nav__sep {
	padding: 0 1em;
	color: var(--menu-ink, #fff);
	opacity: 0.85;
}
.vl-nav__list a,
.vl-nav__item {
	color: var(--menu-ink, #fff);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}
.vl-nav__item { text-decoration: none; opacity: 0.7; }
.vl-nav__list a:hover,
.vl-nav__list a:focus-visible,
.vl-nav__list a[aria-current="page"] {
	text-shadow: 1px 0 0 currentColor;
}
.vl-nav__list a[aria-current="page"] { text-decoration: none; }
.vl-nav a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* Click to enter: full black screen, first visit only (per browser tab) */
.vl-enter { display: none; }
html.vl-enter-pending .vl-enter {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 1.5rem;
	border: 0;
	background: #000;
	color: #fff;
	cursor: pointer;
	transition: opacity 0.6s ease;
}
html.vl-enter-pending .vl-enter.is-done { opacity: 0; pointer-events: none; }
html.vl-enter-pending body { overflow: hidden; }
.vl-enter__text {
	font-size: clamp(1.25rem, 5vw, 2.25rem);
	line-height: 1.3;
	letter-spacing: 0.02em;
	animation: vl-blink 1.4s steps(1, end) infinite;
}
.vl-enter:hover .vl-enter__text { animation: none; }
.vl-enter:focus { outline: none; } /* the whole screen is the button and has focus on load */
@keyframes vl-blink { 0% { opacity: 1; } 70% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
	.vl-enter__text { animation: none; }
	html.vl-enter-pending .vl-enter { transition: none; }
}

/* Rain on the click to enter screen */
.vl-enter__rain {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	pointer-events: none;
}
.vl-enter__text { position: relative; z-index: 1; }

/* Music on/off switch: last item in the top bar */
.vl-music-toggle {
	padding: 0;
	border: 0;
	background: none;
	color: var(--menu-ink, #fff);
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
	opacity: 0.75;
}
.vl-music-toggle[aria-pressed="true"] { opacity: 1; }
.vl-music-toggle:hover,
.vl-music-toggle:focus-visible { text-shadow: 1px 0 0 currentColor; opacity: 1; }
.vl-music-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
/* Used when the menu bar is switched off */
.vl-music-toggle--corner {
	position: fixed;
	top: 1rem;
	right: 1.25rem;
	z-index: 20;
	padding: 0.35rem 0.7rem;
	background: var(--menu-bg, rgba(0, 0, 0, 0.55));
	border-radius: 10px;
	text-decoration: none;
}
body.admin-bar .vl-music-toggle--corner { top: calc(32px + 1rem); }

/* Bottom left corner text (email) */
.vl-corner {
	position: fixed;
	left: 1.25rem;
	bottom: 1.25rem;
	z-index: 10;
	font-size: 0.9em;
}
.vl-corner a {
	display: inline-block;
	padding: 0.35rem 0.7rem;
	color: var(--menu-ink, #fff);
	background: var(--menu-bg, rgba(0, 0, 0, 0.55));
	border-radius: 10px;
	text-decoration: none;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.vl-corner a:hover,
.vl-corner a:focus-visible { text-shadow: 1px 0 0 currentColor; }

/* Extra text blocks (Customize > Video Links > Extra text blocks) */
.vl-extra {
	position: fixed;
	z-index: 10;
	max-width: min(22rem, 70vw);
	padding: 0.45rem 0.8rem;
	font-size: 0.9em;
	line-height: 1.5;
	color: var(--menu-ink, #fff);
	background: var(--menu-bg, rgba(0, 0, 0, 0.55));
	border-radius: 10px;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.vl-extra a { color: inherit; }
.vl-extra a:hover { text-shadow: 1px 0 0 currentColor; }
.vl-extra--top-right { top: calc(var(--bar-h) + 1rem); right: 1.25rem; }
body.admin-bar .vl-extra--top-right { top: calc(32px + var(--bar-h) + 1rem); }
.vl-extra--bottom-left { left: 1.25rem; bottom: 1.25rem; }
.vl-extra--bottom-right { right: 1.25rem; bottom: 1.25rem; text-align: right; }
.vl-extra--bottom-center { left: 50%; bottom: 1.25rem; transform: translateX(-50%); text-align: center; }

/* Built-in pages: Gallery, Setup, Others */
.stage--page {
	justify-content: flex-start;
	padding-top: 5.5rem;
}
.page-panel {
	width: 100%;
	max-width: 40rem;
	padding: 1.5rem;
	background: rgba(0, 0, 0, 0.6);
	border-radius: calc(var(--radius) + 6px);
	text-align: left;
}
.page-panel--setup { max-width: 32rem; }
.page-panel a { color: var(--ink); }
.page-title { margin: 0.75rem 0 1.25rem; font-size: 1.6em; line-height: 1.2; }
.vl-grid,
.vl-friends {
	list-style: none;
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
}
.vl-grid--3 { grid-template-columns: repeat(3, 1fr); }
.vl-grid--2 { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.vl-friends { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 1.25rem 0.75rem; }
.vl-tile {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.08);
	border-radius: var(--radius);
}
.vl-tile a { display: block; width: 100%; height: 100%; }
.vl-tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}
.vl-tile a:hover img,
.vl-tile a:focus-visible img { transform: scale(1.05); }
.vl-tile--empty {
	display: grid;
	place-items: center;
	border: 2px dashed rgba(255, 255, 255, 0.3);
	background: transparent;
}
.vl-tile--empty a {
	display: grid;
	place-items: center;
	color: rgba(255, 255, 255, 0.6);
	font-size: 2em;
	text-decoration: none;
}
.vl-item { display: flex; flex-direction: column; gap: 0.5rem; }
.vl-caption { display: block; text-align: center; overflow-wrap: anywhere; }
.vl-friend {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	color: var(--ink);
	text-decoration: none;
}
a.vl-friend:hover .vl-caption,
a.vl-friend:focus-visible .vl-caption { text-shadow: 1px 0 0 currentColor; }
a.vl-friend:hover .vl-tile img,
a.vl-friend:focus-visible .vl-tile img { transform: scale(1.05); }
.vl-empty { margin: 0; color: var(--muted); }

/* Regular pages and posts (index.php) */
.stage--text {
	justify-content: flex-start;
	align-items: stretch;
	text-align: left;
}
.entry-wrap {
	width: 100%;
	max-width: 42rem;
	margin: 0 auto;
	padding: 1.5rem;
	background: rgba(0, 0, 0, 0.6);
	border-radius: var(--radius);
}
.entry-wrap a { color: var(--ink); text-underline-offset: 3px; }
.entry-title { margin: 1.5rem 0 1rem; font-size: 1.6em; line-height: 1.25; }
.entry-content img { max-width: 100%; height: auto; }
.back { margin: 0; }

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