/* sektorCMS: layout for the public pages and the admin forms.
   Colours and fonts come from /theme.css (Data/Style); the values after the commas are fallbacks. */

:root {
	color-scheme: dark;

	--ink: var(--colour-ink, #09090b);
	--panel: var(--colour-panel, #111114);
	--panel-hover: var(--colour-panelhover, #1a1a1f);
	--line: var(--colour-line, #25252b);
	--text: var(--colour-text, #f4f4f5);
	--muted: var(--colour-muted, #a1a1aa);
	--subtle: var(--colour-subtle, #71717a);
	--accent: var(--colour-accent, #8b7cf6);
	--accent-light: var(--colour-accentlight, #b4a9ff);
	--radius: 16px;
	--mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;

	/* Bootstrap (used by the login pages) follows the same colours */
	--bs-body-color: #f4f4f5;
	--bs-body-color-rgb: 244, 244, 245;
	--bs-body-bg: #09090b;
	--bs-border-color: #25252b;
	--bs-secondary-color: rgba(244, 244, 245, 0.6);
}

body {
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: rgba(139, 124, 246, 0.35);
}

/* ---------- Page frame ---------- */

.page {
	overflow-x: clip;
}

header {
	top: 0;
}

main > article {
	max-width: 56rem;
	margin: 0 auto;
	padding-top: 2.25rem;
	padding-bottom: 4.5rem;
}

main > article > h1:first-child {
	margin: 0 0 1.5rem;
	font-size: 2.1rem;
	letter-spacing: -0.015em;
}

h1, h2, h3 {
	line-height: 1.2;
	letter-spacing: -0.01em;
}

h1 small {
	margin-left: 0.35rem;
	color: var(--subtle);
	font-weight: 500;
	font-size: 0.45em;
	letter-spacing: 0;
}

h2 {
	margin: 2.5rem 0 1rem;
	padding: 0 0 0.6rem;
	border-bottom: 1px solid var(--line);
	font-size: 1.3rem;
}

a {
	text-underline-offset: 3px;
}

.lead {
	max-width: 40rem;
	color: var(--muted);
	font-size: 1.12rem;
}

.prose {
	max-width: 44rem;
	color: #d4d4d8;
}

.prose a {
	text-decoration: underline;
	text-decoration-color: rgba(180, 169, 255, 0.4);
}

.prose a:hover {
	text-decoration-color: currentColor;
}

.prose img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.prose h2, .prose h3 {
	color: var(--text);
}

.prose li::marker {
	color: var(--subtle);
}

footer.site-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
	max-width: 56rem;
	width: 100%;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 2rem;
	border-top: 1px solid var(--line);
	background-color: transparent;
	color: var(--subtle);
	font-size: 0.88rem;
}

footer.site-footer a {
	color: var(--muted);
	text-decoration: none;
}

footer.site-footer a:hover {
	color: var(--text);
}

/* ---------- Home hero ---------- */

.hero {
	position: relative;
	padding: 3.5rem 0 1.5rem;
}

.hero::before {
	content: "";
	position: absolute;
	inset: -9rem -30vw auto;
	height: 30rem;
	background: radial-gradient(ellipse 45% 55% at 38% 20%, rgba(139, 124, 246, 0.17), transparent 70%);
	pointer-events: none;
	z-index: -1;
}

.eyebrow {
	margin: 0 0 1rem;
	color: var(--subtle);
	font-family: var(--mono);
	font-size: 0.8rem;
	letter-spacing: 0.06em;
}

.hero h1 {
	margin: 0 0 1.1rem;
	font-size: clamp(1.9rem, 5.6vw, 2.8rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.08;
}

.hero .lead {
	margin: 0 0 1.75rem;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin: 0;
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 3.5rem 0 1.5rem;
	padding-bottom: 0.8rem;
	border-bottom: 1px solid var(--line);
}

.section-head h2 {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 1.45rem;
}

.section-head a {
	color: var(--muted);
	font-size: 0.92rem;
	text-decoration: none;
}

.section-head a:hover {
	color: var(--text);
}

/* ---------- Project and post cards ---------- */

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
	gap: 1.5rem;
	margin: 0 0 1.5rem;
}

.project-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
	transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
	border-color: #3b3b45;
	transform: translateY(-3px);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.card-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: radial-gradient(ellipse at 50% 0%, #1b1b24, #0d0d10 70%);
}

.card-media::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 42%;
	background: linear-gradient(transparent, var(--panel));
	pointer-events: none;
}

.card-media img {
	max-width: 36%;
	max-height: 62%;
	object-fit: contain;
	filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.card-media.cover img {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	object-position: top left;
	filter: none;
	transition: transform 0.5s ease;
}

.project-card:hover .card-media.cover img {
	transform: scale(1.035);
}

.monogram {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 18px;
	background: linear-gradient(135deg, var(--accent), #5a49d6);
	color: #fff;
	font-size: 2rem;
	font-weight: 700;
	text-transform: uppercase;
}

.card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 0.35rem 1.35rem 1.35rem;
}

.card-body h3 {
	margin: 0;
	font-size: 1.25rem;
}

.card-body h3 a {
	color: var(--text);
	text-decoration: none;
}

.card-body .category {
	margin: 0.3rem 0 0;
	color: var(--subtle);
	font-family: var(--mono);
	font-size: 0.78rem;
	letter-spacing: 0.05em;
}

.card-body .summary {
	margin: 0.65rem 0 0.2rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.card-body .project-links {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: auto 0 0;
	padding-top: 1rem;
}

.card-body .more {
	color: var(--muted);
	font-size: 0.9rem;
	text-decoration: none;
}

.card-body .more:hover {
	color: var(--text);
}

/* Text-only blocks (blog list, products) */
section.project-card {
	padding: 1.1rem 1.35rem;
	margin: 0 0 1rem;
}

section.project-card h3 {
	margin: 0 0 0.25rem;
}

section.project-card h3 a {
	color: var(--text);
	text-decoration: none;
}

section.project-card p {
	margin: 0.35rem 0 0;
	color: var(--muted);
}

/* ---------- Badges ---------- */

.badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.8rem 0 0.2rem;
}

.badge {
	display: inline-block;
	padding: 0.12rem 0.6rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.7rem;
	letter-spacing: 0.03em;
}

.badge.good {
	border-color: rgba(61, 214, 140, 0.35);
	background: rgba(61, 214, 140, 0.08);
	color: #4fe0a0;
}

.badge.private {
	border-color: rgba(245, 196, 81, 0.35);
	background: rgba(245, 196, 81, 0.08);
	color: #f5c451;
}

/* ---------- Buttons ---------- */

/* "main" in front keeps buttons from being recoloured by the theme's link colour */
main a.button, main a.button:visited, .admin-form button, table.list button {
	display: inline-block;
	padding: 0.6rem 1.15rem;
	border: 1px solid var(--text);
	border-radius: 10px;
	background-color: var(--text);
	color: var(--ink);
	font: inherit;
	font-size: 0.95rem;
	font-style: normal;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

main a.button:hover, .admin-form button:hover {
	background-color: #fff;
	border-color: #fff;
	color: var(--ink);
	transform: translateY(-1px);
}

main a.button.secondary, main a.button.secondary:visited, table.list button {
	border-color: var(--line);
	background-color: var(--panel);
	color: var(--text);
	font-weight: 500;
}

main a.button.secondary:hover, table.list button:hover {
	border-color: #3b3b45;
	background-color: var(--panel-hover);
	color: var(--text);
}

main a.button.small {
	padding: 0.4rem 0.9rem;
	font-size: 0.88rem;
}

/* ---------- Project page ---------- */

.project-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.75rem;
	margin-bottom: 1.75rem;
	padding-bottom: 1.75rem;
	border-bottom: 1px solid var(--line);
}

.project-logo {
	width: 6.5rem;
	height: 6.5rem;
	object-fit: contain;
	border-radius: 22px;
	background: var(--panel);
	border: 1px solid var(--line);
	padding: 0.6rem;
}

.project-header h1 {
	margin: 0;
	font-size: 2.2rem;
}

.project-header .lead {
	margin: 0.35rem 0 0.4rem;
}

.project-header .badges {
	margin: 0.7rem 0 1rem;
}

.project-header p {
	margin: 0;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.1rem;
	margin: 0 0 2.25rem;
}

.gallery figure {
	margin: 0;
}

.gallery img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
	transition: border-color 0.15s ease;
}

.gallery a:hover img {
	border-color: #3b3b45;
}

.gallery figcaption {
	margin-top: 0.5rem;
	color: var(--subtle);
	font-size: 0.84rem;
}

/* ---------- Tables ---------- */

table.info, table.list {
	border-collapse: collapse;
	margin: 0.5rem 0 1.5rem;
	max-width: 100%;
}

table.info th, table.info td, table.list th, table.list td {
	padding: 0.5rem 1.25rem 0.5rem 0;
	text-align: left;
	vertical-align: top;
}

table.info th {
	color: var(--subtle);
	font-weight: 500;
	white-space: nowrap;
}

table.list th {
	border-bottom: 1px solid var(--line);
	color: var(--subtle);
	font-family: var(--mono);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

table.list td {
	border-bottom: 1px solid var(--line);
	color: var(--muted);
}

@media (max-width: 40rem) {
	table.list {
		display: block;
		overflow-x: auto;
	}
}

/* Tables written in Markdown (docs, posts) */
.prose table {
	width: 100%;
	margin: 1rem 0 1.5rem;
	border-collapse: collapse;
}

.prose th, .prose td {
	padding: 0.55rem 1rem 0.55rem 0;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.prose th {
	color: var(--subtle);
	font-family: var(--mono);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ---------- Admin and login forms ---------- */

.inline-form {
	display: inline;
}

.admin-form {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
	max-width: 40rem;
}

.admin-form label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.admin-form label.check {
	flex-direction: row;
	align-items: center;
	gap: 0.55rem;
}

.admin-form input[type="text"], .admin-form input[type="number"], .admin-form input[type="date"], .admin-form textarea, .admin-form select, .admin-form input:not([type]),
.form-control, .form-select {
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 10px;
	background-color: var(--panel);
	color: var(--text);
	font: inherit;
}

.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus, .form-control:focus, .form-select:focus {
	outline: none;
	border-color: var(--accent);
	background-color: var(--panel);
	color: var(--text);
	box-shadow: 0 0 0 3px rgba(139, 124, 246, 0.25);
}

.form-floating > label {
	color: var(--subtle);
}

.text-danger, .error {
	color: var(--colour-danger, #ff6b6b) !important;
}

.btn {
	border-radius: 10px;
}

/* ---------- Code ---------- */

pre {
	padding: 1rem 1.15rem;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
	background-color: #0c0c0f;
	color: #e4e4e7;
	font-size: 0.88rem;
}

code {
	font-family: var(--mono);
}

p code, li code, td code {
	padding: 0.1rem 0.4rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background-color: var(--panel-hover);
	color: #d4d4d8;
	font-size: 0.86em;
}

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

@media (max-width: 40rem) {
	/* the extra element names make these rules win over the menu's own scoped styles */
	nav.main-nav ul.menu {
		padding: 0 0.75rem;
	}

	nav.main-nav ul.menu li.menu-brand {
		flex-basis: 100%;
	}

	.hero {
		padding-top: 2rem;
	}

	.card-grid {
		grid-template-columns: 1fr;
	}

	main > article {
		padding-top: 1.5rem;
		padding-bottom: 3rem;
	}
}
