/* ==========================================================================
	 Truluck Engineering
	 All styling lives here; the HTML uses classes only (no inline styles).
	 Sizes and colours reproduce the original Materialize based design.
============================================================================= */

	/* ---------- 1. Fonts ---------- */
	@font-face {
		font-family: "title";
		src: url("/fonts/fontasia.ttf") format("truetype");
		font-display: swap;
	}

	@font-face {
		font-family: "body";
		src: url("/fonts/crimson-roman.otf") format("opentype");
		font-display: swap;
	}

	@font-face {
		font-family: "motto";
		src: url("/fonts/library_3_am.otf") format("opentype");
		font-display: swap;
	}

	/* ---------- 2. Design tokens ---------- */
	:root {
		--color-text: rgba(0, 0, 0, 0.87);
		--color-indigo-dark: #1a237e;
		--color-indigo-dark-hover: #283593;
		--color-indigo: #3f51b5;
		--color-grey-line: #9e9e9e;
		--color-grey-border: #bdbdbd;
		--color-grey-motto: #808080;
		--color-grey-sidenav: #e0e0e0;
		--color-footer: #212121;
		--color-link: #039be5;
		--color-error: #f44336;
		--color-success: #4caf50;
		--font-body: "body", Georgia, "Times New Roman", serif;
		--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
		--shadow-nav: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
		--shadow-modal: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.2);
		--shadow-sidenav: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
	}

	/* ---------- 3. Base ---------- */
	*, *::before, *::after {
		box-sizing: border-box;
	}

	/* Root size steps as before: rem based sizes grow a little on wide screens */
	html {
		font-size: 14px;
		line-height: 1.5;
		font-family: var(--font-ui);
		color: var(--color-text);
		scroll-behavior: smooth;
		-webkit-text-size-adjust: 100%;
	}

	@media (min-width: 993px) {
		html {
			font-size: 14.5px;
		}
	}

	@media (min-width: 1201px) {
		html {
			font-size: 15px;
		}
	}

	body {
		margin: 0;
		font-family: var(--font-body);
		font-size: 17px;
		background-color: #ffffff;
		overflow-y: scroll;
	}

	a {
		color: var(--color-link);
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
	}

	h1, h2, h3, h4, h5, h6 {
		font-weight: 400;
		line-height: 110%;
	}

	img {
		border-style: none;
	}

	ul {
		margin: 0;
		padding: 0;
	}

	::placeholder {
		color: grey;
		opacity: 0.6;
	}

	:focus-visible {
		outline: 2px solid var(--color-indigo);
		outline-offset: 2px;
	}

	/* ---------- 4. Layout helpers ---------- */
	.container {
		margin: 0 auto;
		max-width: 1280px;
		width: 90%;
	}

	@media (min-width: 601px) {
		.container {
			width: 85%;
		}
	}

	@media (min-width: 993px) {
		.container {
			width: 70%;
		}
	}

	.section {
		padding-top: 4vw;
		padding-bottom: 4vw;
	}

	/* flow-root keeps the margins of the first and last paragraphs inside each row and column, as the old floated grid did */
	.row {
		display: flow-root;
		margin-bottom: 20px;
	}

	.col {
		display: flow-root;
		padding: 0 0.75rem;
		min-height: 1px;
	}

	/* Twelve column grid on large screens; the columns stack on smaller screens */
	@media (min-width: 993px) {
		.row {
			display: grid;
			grid-template-columns: repeat(12, minmax(0, 1fr));
			align-items: start;
		}

		.row .col-image {
			grid-column: 1 / span 4;
			grid-row: 1;
		}

		.row .col-text {
			grid-column: 6 / span 6;
			grid-row: 1;
		}

		/* Image on the right, text on the left (the image stays first on small screens) */
		.row-reversed .col-image {
			grid-column: 9 / span 4;
		}

		.row-reversed .col-text {
			grid-column: 2 / span 6;
		}

		.row .col-about-text {
			grid-column: 1 / span 4;
		}

		.row .col-about-tabs {
			grid-column: 6 / span 7;
		}

		.row .col-contact-text {
			grid-column: 1 / span 5;
		}

		.row .col-contact-form {
			grid-column: 8 / span 5;
		}
	}

	.right-align {
		text-align: right;
	}

	.center {
		text-align: center;
	}

	.responsive-img {
		display: block;
		max-width: 100%;
		height: auto;
	}

	.border {
		border: 1px solid var(--color-grey-border);
	}

	.visually-hidden, .nav-toggle, .tab-radio {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
		opacity: 0;
	}

	/* ---------- 5. Typography ---------- */
	.truengLogo {
		font-family: "title", var(--font-body);
	}

	/* Section headings (the size of the original h4) */
	.title-text {
		color: var(--color-indigo-dark);
	}

	h2.title-text, h3.title-text, h1.title-text {
		font-size: 2.28rem;
		margin: 1.52rem 0 0.912rem 0;
	}

	/* Text that grows with the screen width */
	.flow-text {
		font-weight: 300;
		font-size: clamp(17px, calc(12.75px + 1.12vw), 25.2px);
		line-height: 1.5;
		margin: 1em 0;
	}

	/* ---------- 6. Header and navigation ---------- */
	.site-header {
		position: relative;
		background: url("/img/background.jpg") center / cover no-repeat;
		min-height: 100vh;
	}

	@media (max-width: 670px) {
		.site-header {
			min-height: 500px;
		}
	}

	.site-nav {
		color: #ffffff;
		background-color: transparent;
		height: 56px;
		line-height: 56px;
		box-shadow: var(--shadow-nav);
	}

	@media (min-width: 601px) {
		.site-nav {
			height: 64px;
			line-height: 64px;
		}
	}

	.site-nav-logo {
		color: #ffffff;
		font-size: 55px;
		white-space: nowrap;
	}

	.site-nav-list {
		float: right;
		list-style: none;
	}

	.site-nav-list li {
		float: left;
	}

	.site-nav-list a {
		display: block;
		padding: 0 15px;
		color: #ffffff;
		font-size: 1rem;
		transition: background-color 0.3s;
	}

	.site-nav-list a:hover {
		background-color: rgba(0, 0, 0, 0.1);
	}

	.sidenav-trigger {
		display: none;
		float: right;
		height: 56px;
		margin: 0 0 0 12px;
		color: #ffffff;
		cursor: pointer;
	}

	.sidenav-trigger-icon {
		width: 32px;
		height: 32px;
		vertical-align: middle;
	}

	.nav-toggle:focus-visible ~ .site-header .sidenav-trigger {
		outline: 2px solid #ffffff;
		outline-offset: 2px;
	}

	@media (max-width: 992px) {
		.site-nav-list {
			display: none;
		}

		.sidenav-trigger {
			display: block;
		}
	}

	@media (min-width: 601px) {
		.sidenav-trigger {
			height: 64px;
		}
	}

	/* Tagline and motto over the header image */
	.header-text {
		padding-top: 51px;
	}

	.header-tagline {
		float: right;
		color: #ffffff;
		font-size: 1.64rem;
		margin: 1.0933rem 0 0.656rem 0;
	}

	.header-motto {
		position: absolute;
		right: 25px;
		bottom: 25px;
		margin: 0;
		font-family: "motto", var(--font-body);
		font-size: 2.92rem;
		font-weight: bold;
		line-height: 110%;
		color: var(--color-grey-motto);
	}

	/* ---------- 7. Slide out menu (narrow screens) ---------- */
	.sidenav {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
		width: 300px;
		max-width: 85vw;
		height: 100%;
		padding-bottom: 60px;
		overflow-y: auto;
		background-color: var(--color-grey-sidenav);
		box-shadow: var(--shadow-sidenav);
		transform: translateX(-105%);
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}

	.sidenav ul {
		list-style: none;
	}

	.sidenav a {
		display: block;
		height: 48px;
		line-height: 48px;
		padding: 0 32px;
		font-size: 14px;
		font-weight: 500;
		color: var(--color-text);
	}

	.sidenav a:hover {
		background-color: rgba(0, 0, 0, 0.05);
	}

	.sidenav-overlay {
		position: fixed;
		inset: 0;
		z-index: 997;
		background-color: rgba(0, 0, 0, 0.5);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0s linear 0.25s;
	}

	.nav-toggle:checked ~ .sidenav {
		transform: translateX(0);
		visibility: visible;
		transition: transform 0.25s ease, visibility 0s;
	}

	.nav-toggle:checked ~ .sidenav-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.25s ease, visibility 0s;
	}

	body:has(.nav-toggle:checked) {
		overflow: hidden;
	}

	@media (min-width: 993px) {
		.nav-toggle, .sidenav, .sidenav-overlay {
			display: none;
		}
	}

	/* ---------- 8. Parallax images (js/parallax.js moves the image as the page scrolls) ---------- */
	.parallax-container {
		position: relative;
		overflow: hidden;
		height: 500px;
	}

	.parallax {
		position: absolute;
		inset: 0;
	}

	.parallax img {
		position: absolute;
		left: 50%;
		bottom: 0;
		display: block;
		width: 100%;
		height: auto;
		min-height: 100%;
		max-width: none;
		object-fit: cover;
		transform: translate3d(-50%, 0, 0);
		will-change: transform;
	}

	/* ---------- 9. Project tabs (CSS only, driven by the radio buttons) ---------- */
	.tabs {
		position: relative;
		display: flex;
		height: 48px;
		background-color: #ffffff;
		overflow: hidden;
		white-space: nowrap;
	}

	.tab {
		flex: 1 1 0;
		min-width: 0;
		height: 48px;
		line-height: 48px;
		padding: 0 24px;
		text-align: center;
		font-size: 20px;
		color: var(--color-indigo-dark);
		overflow: hidden;
		text-overflow: ellipsis;
		cursor: pointer;
		user-select: none;
		transition: color 0.28s ease;
	}

	.tab-indicator {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 50%;
		height: 2px;
		background-color: var(--color-indigo-dark);
		transition: transform 0.3s ease;
	}

	#tab-europe:checked ~ .tabs .tab-indicator {
		transform: translateX(100%);
	}

	/* Keyboard focus on a radio button shows on its tab */
	#tab-worldwide:focus-visible ~ .tabs label[for="tab-worldwide"],
	#tab-europe:focus-visible ~ .tabs label[for="tab-europe"] {
		outline: 2px solid var(--color-indigo);
		outline-offset: -2px;
	}

	/* Both panels share one grid cell, so the section keeps the height of the taller one */
	.tab-panels {
		display: grid;
	}

	.tab-panel {
		grid-area: 1 / 1;
		padding: 0 0.75rem;
		visibility: hidden;
	}

	#tab-worldwide:checked ~ .tab-panels .panel-worldwide,
	#tab-europe:checked ~ .tab-panels .panel-europe {
		visibility: visible;
	}

	.project-list {
		list-style: disc outside;
	}

	@media (max-width: 992px) {
		.tab {
			padding: 0 12px;
		}
	}

	@media (max-width: 600px) {
		.tab {
			padding: 0 6px;
			font-size: 17px;
		}
	}

	/* ---------- 10. Contact form ---------- */
	.form-hp {
		position: absolute;
		left: -10000px;
		top: auto;
		width: 1px;
		height: 1px;
		overflow: hidden;
	}

	.input-field {
		display: flow-root;
		position: relative;
		margin: 1rem 0;
	}

	/* Icon to the left of each field */
	.input-field .prefix {
		position: absolute;
		left: 0;
		top: 1rem;
		width: 30px;
		height: 30px;
		color: var(--color-indigo);
	}

	.input-field input, .input-field textarea {
		display: block;
		width: calc(100% - 3rem);
		margin: 0 0 8px 3rem;
		padding: 0;
		font-family: var(--font-ui);
		font-size: 16px;
		color: #000000;
		background-color: transparent;
		border: none;
		border-bottom: 1px solid var(--color-grey-line);
		border-radius: 0;
		outline: none;
		box-shadow: none;
		transition: box-shadow 0.3s, border 0.3s;
	}

	.input-field input {
		box-sizing: content-box;
		height: 3rem;
	}

	.input-field textarea {
		min-height: 3rem;
		height: 3rem;
		padding: 0.8rem 0;
		line-height: normal;
		resize: none;
		overflow-y: hidden;
	}

	.input-field input:focus, .input-field textarea:focus {
		border-bottom: 1px solid var(--color-indigo);
		box-shadow: 0 1px 0 0 var(--color-indigo);
	}

	/* A field left empty or wrongly filled, once the visitor has used it */
	.input-field input:user-invalid, .input-field textarea:user-invalid {
		border-bottom: 1px solid var(--color-error);
		box-shadow: 0 1px 0 0 var(--color-error);
	}

	.captcha-row {
		display: flex;
		align-items: center;
		gap: 0.75rem;
	}

	.captcha-row .captcha-font {
		flex-shrink: 0;
		white-space: nowrap;
		font-family: var(--font-body);
		font-size: 20px;
		color: var(--color-indigo);
	}

	.captcha-row input {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
		margin-left: 0;
	}

	/* Result of a form sent without JavaScript */
	.form-notice {
		margin: 1rem 0;
		padding: 0.75rem 1rem;
		border-left: 4px solid var(--color-error);
		background-color: rgba(244, 67, 54, 0.08);
	}

	.form-notice-success {
		border-left-color: var(--color-success);
		background-color: rgba(76, 175, 80, 0.08);
	}

	.form-notice p {
		margin: 0;
	}

	.form-notice ul {
		margin: 0.5rem 0 0 1.25rem;
		list-style: disc;
	}

	/* ---------- 11. Buttons ---------- */
	.btn {
		display: inline-block;
		height: 36px;
		line-height: 36px;
		padding: 0 16px;
		font-family: var(--font-body);
		font-size: 17px;
		letter-spacing: 0.5px;
		color: #ffffff;
		background-color: var(--color-indigo-dark);
		border: none;
		border-radius: 5px;
		text-decoration: none;
		vertical-align: middle;
		cursor: pointer;
		transition: background-color 0.2s ease-out;
	}

	.btn:hover {
		color: #ffffff;
		background-color: var(--color-indigo-dark-hover);
	}

	.btn:disabled {
		opacity: 0.6;
		cursor: wait;
	}

	/* ---------- 12. Modals (js/ui-modal.js) ---------- */
	body.ui-modal-lock {
		overflow: hidden;
	}

	html:has(body.ui-modal-lock) {
		scrollbar-gutter: stable;
	}

	.ui-modal-backdrop {
		position: fixed;
		inset: 0;
		z-index: 4000;
		background: rgba(0, 0, 0, 0.6);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease, visibility 0.2s ease;
	}

	.ui-modal-backdrop.open {
		opacity: 1;
		visibility: visible;
	}

	/* The enlarged image sits on a darker backdrop */
	body:has(#imageModal.open) .ui-modal-backdrop {
		background: rgba(41, 41, 41, 0.92);
	}

	.ui-modal {
		position: fixed;
		top: 50%;
		left: 50%;
		z-index: 4001;
		transform: translate(-50%, -50%) scale(0.96);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	}

	.ui-modal.open {
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, -50%) scale(1);
	}

	.ui-modal-content {
		padding: 24px;
		border-radius: 15px;
	}

	.ui-modal-light {
		background-color: #ffffff;
		color: var(--color-text);
		box-shadow: var(--shadow-modal);
	}

	/* Contact form result dialogs */
	.contact-dialog {
		width: 55vw;
		max-height: 80vh;
		max-height: 80svh;
		overflow-y: auto;
	}

	@media (max-width: 992px) {
		.contact-dialog {
			width: 80vw;
		}
	}

	.contact-dialog h3.title-text {
		margin-top: 0;
	}

	.contact-dialog .error-list {
		margin: 0 0 1em 25px;
		list-style: disc;
		font-size: 120%;
	}

	.contact-dialog .error-list:empty {
		display: none;
	}

	.modal-footer {
		padding-top: 4px;
		text-align: right;
	}

	/* ---------- 13. Footer ---------- */
	.page-footer {
		padding-top: 20px;
		background-color: #ffffff;
	}

	.footer-copyright {
		display: flex;
		align-items: center;
		min-height: 50px;
		padding: 10px 0;
		color: rgba(255, 255, 255, 0.8);
		background-color: var(--color-footer);
	}

	.footer-copyright .container {
		text-align: center;
	}

	.footer-logo {
		font-size: 30px;
	}

	#site-total {
		display: inline-block;
	}

	.counter-bump {
		animation: counterBump 0.7s ease;
	}

	@keyframes counterBump {
		30% {
			transform: scale(1.2);
		}
	}

	/* ---------- 14. Page not found ---------- */
	.notfound {
		max-width: 600px;
		margin: 15vh auto;
		padding: 0 1rem;
		text-align: center;
	}

	.notfound-logo {
		font-size: 55px;
		color: var(--color-indigo-dark);
	}

	/* ---------- 15. Reduced motion ---------- */
	@media (prefers-reduced-motion: reduce) {
		html {
			scroll-behavior: auto;
		}

		*, *::before, *::after {
			transition-duration: 0.01ms !important;
			animation-duration: 0.01ms !important;
		}
	}

	/* ---------- 16. Print ---------- */
	@media print {
		.site-nav, .parallax-container, .sidenav, .sidenav-overlay, form, .page-footer {
			display: none;
		}

		.site-header {
			min-height: 0;
			background: none;
		}

		.header-tagline, .header-motto {
			position: static;
			float: none;
			color: #000000;
		}

		.tab-panel {
			visibility: visible;
			grid-area: auto;
		}
	}