/* =========================================
   ROOT + COLOR SYSTEM
========================================= */

:root {
	/* Light/dark automatic theme */
	color-scheme: light dark;

	--light-bg: #fffbf7;
	--light-color: #222;
	--light-code: tomato;
	--light-link: darkblue;
	--light-emphasis: darkslateblue;

	--dark-bg: #222;
	--dark-color: #fff;
	--dark-code: gold;
	--dark-link: yellow;
	--dark-emphasis: darkorange;

	/* Layout + spacing tokens */
	--page-max-width: 95vw;
	--content-width: 800px;

	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 12px;

	--shadow-soft-light: 0 2px 4px #0002;
	--shadow-soft-dark: 0 2px 4px #0004;
}

/* =========================================
   RESETS / BASE
========================================= */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	padding: 0;
	margin: 0;
	height: 100%;
	min-height: 100vh;
	font-family: Transcend, Arial, sans-serif;
	font-size: 12px;
	line-height: 1.2em;
	background-color: light-dark(var(--light-bg), var(--dark-bg));
	color: light-dark(var(--light-color), var(--dark-color));
	line-height: 1.5em;
}

/* Custom tags used as layout primitives */
site-container,
wrap-narrow,
access-layout,
reg-button,
enter-button,
work-view,
eval-tabs,
contribute-work {
	display: block;
}

access-layout {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: space-evenly;
}

/* Code + font */
code {
	color: light-dark(var(--light-code), var(--dark-code));
}

.light {
	color-scheme: light;
}

.dark {
	color-scheme: dark;
}

@font-face {
	font-family: 'Transcend';
	src: url('/assets/Transcend Regular.otf') format('opentype');
	font-weight: 400;
	font-style: normal;
}

.t- {
	font-family: 'Transcend', serif;
}

/* Links */
a {
	text-decoration: none;
	color: light-dark(var(--light-link), var(--dark-link));
}
a.work-link {
	color: inherit;
	text-decoration: inherit;
}
a.work-link:hover .work-card {
	border-color: #ff7f01;
}

/* Errors */
.error {
	color: red !important;
}

/* =========================================
   GLOBAL LAYOUT
========================================= */

site-container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	max-width: var(--page-max-width);
	margin: 0 auto;
	width: 98vw;
	max-width: content-width;
}

/* Universal centered narrow wrapper */
wrap-narrow {
	width: var(--content-width);
	max-width: var(--page-max-width);
	margin: 0 auto;
}

/* Generic sections */
.section {
	margin-bottom: 1.5rem;
}
.section h2 {
	font-size: 1rem;
	margin: 0 0 0.4rem 0;
	color: light-dark(var(--light-emphasis), var(--dark-emphasis));
}
.section small {
	display: block;
	font-size: 0.8rem;
	color: #aaa;
}


/***** CONTRIBUTE WORK ERROR *****/
error-box {
	display: block;
	flex-basis: 100%;
	text-align: left;
	margin: 0 2em;
	color: red;
	font-size: 16px;
	font-family: calibri;
}

p {
	font-size: 12px;
	line-height: 1.5em;
	font-family: Arial;
}

/* =========================================
   HEADER / FOOTER
========================================= */

#header {
	padding: 6px 0;
	border-bottom: 1px solid light-dark(var(--light-color), var(--dark-color));
	margin-bottom: 1em;
}

#header wrap-narrow {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
}

#header #logo {
	position: relative;
	width: 100px;
	margin-right: 2em;
}

#header #wisdom {
	font-family: 'Transcend', serif;
	font-size: 16px;
}

#header #menu {
	cursor: pointer;
	position: fixed;
	top: 116px;
	background: #000;
	padding: 1em;
	border: 1px solid #ff7f01;
	border-top: none;
	border-radius: 0 0 1em 1em;
	display: none;
	z-index: 999999999;
}

#header #menu a {
	display: block;
	font-family: sans-serif;
	font-size: 14px;
	color: #fff;
	line-height: 2em;
}

#header #menu a:hover {
	color: #ff7f01;
}

#footer {
	display: block;
	background: #000;
	line-height: 25px;
	font-size: 10px;
	text-align: center;
	padding: 0.25em 0;
	color: #fff;
}

/* =========================================
   TYPOGRAPHY / MISC
========================================= */

h1 {
	color: light-dark(var(--light-emphasis), var(--dark-emphasis));
	text-align: center;
	font-weight: normal;
	font-size: 2.5em;
	margin-bottom: 12px;
}

small {
	font-family: Calibri, sans-serif;
	color: light-dark(var(--light-emphasis), var(--dark-emphasis));
}

/* =========================================
   LANDING / ACCESS PAGE
========================================= */

access-layout {
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;
	padding-top: 1em;
	gap: 2em;
	flex: 1;
}

access-layout wrap-narrow {
	padding-top: 1em;
}

/* Container blocks */
.landing {
	display: block;
	width: 100%;
}

/* Labels + status span */
.landing label {
	font-size: 16px;
	margin-bottom: 1em;
	margin-left: 0.25em;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5em;
}

/* Inputs */
.landing input {
	display: block;
	width: 100%;
	font-size: 14px;
	line-height: 28px;
	font-family: Arial, sans-serif;
	border: 1px solid light-dark(var(--light-color), var(--dark-color));
	padding: 0.25em 1em;
	margin-top: 0.25em;
	margin-bottom: 2em;
	color: #fff;
}

/* ENTER gradient */
.landing#enter input,
.landing#enter enter-button {
	background: linear-gradient(
		98deg,
		rgba(1, 97, 129, 1) 0%,
		rgba(0, 0, 0, 1) 100%
	);
}

/* REGISTER gradient */
.landing#reg input,
.landing#reg reg-button {
	background: linear-gradient(
		98deg,
		rgba(128, 69, 0, 1) 0%,
		rgba(0, 0, 0, 1) 100%
	);
}

/* Action buttons */
.landing reg-button,
.landing enter-button {
	color: #fff;
	font-size: 3em;
	display: block;
	width: fit-content;
	padding: 0.75em 0.5em;
	border: 1px solid;
	border-radius: 10px;
	margin: 1.5em auto;
	transform: scaleY(1.5);
	cursor: default;
}

/* Accepted / hover / denied */
.landing reg-button.accepted,
.landing enter-button:hover {
	color: yellow;
	cursor: pointer;
}

.landing reg-button.denied,
.landing enter-button.denied {
	color: red;
	cursor: not-allowed;
}

/* Inline status spans in access-layout */
access-layout span.rejected {
	float: right;
	color: crimson;
	font-family: sans-serif;
	font-size: 18px;
	text-transform: uppercase;
}

access-layout span.accepted {
	float: right;
	color: yellow;
	font-family: sans-serif;
	font-size: 18px;
	text-transform: uppercase;
}

reg-button.waiting,
enter-button.waiting {
	opacity: 0.6;
	pointer-events: none;
	cursor: wait;
}

reg-button.waiting::after,
enter-button.waiting::after {
	content: '…';
	margin-left: 6px;
}


/***** INPUTS *****/
input[type='text'] {
	flex: 1;
}

input, textarea {
	padding: 0.5em;
	font-family: Arial, sans-serif;
	border-radius: 8px;
	border: 1px solid light-dark(#ccc, #444);
	line-height: 1.5em;
}

textarea {
	height: 6em;
}


/***** BUTTONS *****/

button {
	margin: 1.5rem 0;
	padding: 1rem;
	border-radius: 5px;
	border: 0px;
	cursor: pointer;
	font-family: 'Transcend';
	color: light-dark(var(--light-color), var(--dark-color));
}

button:hover {
	border: 1px solid light-dark(var(--light-color), var(--dark-color));
	padding: calc(1rem - 1px);
	box-shadow:
		0 6px 15px rgba(0,0,0,0.45),
		inset 0 0 0 1px rgba(255,255,255,0.2);	
}


/***** TABLES *****/
table.global {
	width: 100%;
}

table.global th {
	color: light-dark(var(--light-emphasis), var(--dark-emphasis));
}

table.global tbody tr:hover {
	background-color: light-dark(rgba(0,0,0,.1), rgba(255,255,255,.1));
	cursor: pointer;
}

table.global tbody tr td {
	border-top: 1px solid light-dark(var(--light-color), var(--dark-color));
	padding: 1em;
	margin: .5em 0;
	text-align: center;
}

table.global tbody tr td:first-child {
	text-align: left;
}

table.global th.sortable {
	cursor: pointer;
	user-select: none;
}

table.global th.sortable:hover {
	font-style: italic;
}

table.global th.sortable.active {
	font-weight: bold;
}

table.global .sort-indicator {
	margin-left: .4em;
	font-size: .8em;
}