@font-face {
	font-family: Montserrat;
	src: url(/fonts/Montserrat/Montserrat-Regular.ttf);
	font-display: swap;
}

@font-face {
	font-family: OpenSans;
	src: url(/fonts/OpenSans/OpenSans-Light.ttf);
	font-display: swap;
}

:root {
	/*
	--background: #a8d5a2;
	--foreground: #2d6a2f;
	--text: #1a5a1a;*/
	--background: #bfe2bc; 
	--foreground: #428a62;
	--text:  #294257;
	--accent: #1a5a1a;

}

html {
	font-size: medium;
	overflow-x: hidden;
}

body {
	background-color: var(--background);
	color: var(--text);
	font-family: OpenSans, sans-serif;
	margin: 0;
	padding: 0;
	font-size: 1rem;
	line-height: 1.4;
	min-height: 100vh;
	overflow-x: hidden;
	position: relative;
}

main {
	margin: 2rem auto 8rem 48px;
	max-width: 90%;
	padding: 0 2em;
}

/* Canvas texture overlay */
.bg-texture {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: var(--background);
}

.bg-texture::before {
	content: "";
	position: absolute;
	inset: 0;
	background: url('../images/home-texture.png') repeat-y top center;
	background-size: 100% auto;
	mix-blend-mode: overlay;
}

/* Left sidebar */
.sidebar-left {
	position: fixed;
	top: 0;
	left: 8px;
	width: 28px;
	height: 100vh;
	height: 100dvh; /* Use dynamic viewport height for better mobile support */
	background-color: rgba(0, 60, 0, 0.06);
	border-right: 1px solid rgba(0, 60, 0, 0.1);
	z-index: 100;
	will-change: transform;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

@supports (-webkit-touch-callout: none) {
	/* iOS-specific fix for position: fixed */
	.sidebar-left {
		position: -webkit-sticky;
		position: sticky;
		height: 100vh;
	}
}

.sidebar-left .label {
	position: absolute;
	left: 50%;
	font: 10px Montserrat;
	color: var(--foreground);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	transform: translateX(-50%) rotate(-90deg);
}

.sidebar-left .label-top { top: 80px; }
.sidebar-left .label-middle { top: 50%; }
.sidebar-left .label-bottom { bottom: 80px; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
	color: var(--text);
	font-weight: bold;
	line-height: 1.2;
	margin: 2em 0 1em;
}

h1 {
	font: 300 2.2em Montserrat, sans-serif;
	margin-bottom: 10px;
	text-align: center;
}

h2 { font-size: 1.8em; border-bottom: solid 0.1rem var(--foreground); }
h3 { font-size: 1.5em; }
h4 { font-size: 1.3em; text-decoration: underline; }
h5 { font-size: 1.2em; font-style: italic; }
h6 { font-size: 1.1em; margin-bottom: 0.5rem; }

hr {
	border: none;
	height: 1px;
	background: var(--foreground);
}

a {
	text-decoration: none;
	color: var(--text);
	transition: color 0.3s, background-color 0.3s;
}

a:hover {
	background: var(--foreground);
	text-decoration: underline;
}

a:active {
	background-color: var(--foreground);
	color: var(--background);
}

ul, ol {
	margin: 1em 0;
	padding-left: 1.5em;
}

li {
	line-height: 1.6;
	font-size: 1rem;
	font-weight: normal;
	margin-bottom: 0.5em;
}

pre, code, xmp {
	font-family: courier, monospace;
	font-size: 1.1rem;
	line-height: 1.4;
	white-space: pre-wrap;
}

img {
	margin: 2em auto;
	padding: 1em;
	max-width: 90%;
}

/* Posts list on landing page */
.posts-list ul {
	list-style: none;
}

.posts-list li {
	font-size: 1rem;
	font-weight: normal;
	line-height: 1.4;
	margin-bottom: 1em;
}

.posts-list a {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.75em 0;
	border-bottom: 1px solid rgba(0, 60, 0, 0.1);
}

.posts-list a:hover {
	background: transparent;
	text-decoration: none;
	border-bottom-color: var(--foreground);
}

.posts-list .post-title {
	font-weight: bold;
}

.posts-list .post-desc {
	font-size: 0.9em;
	opacity: 0.7;
	text-align: right;
}

/* Navigation */
.breadcrumb {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.9em;
	margin-bottom: 2em;
	opacity: 0.8;
}

.breadcrumb a:hover {
	background: transparent;
	text-decoration: underline;
}

.post-nav {
	margin-top: 4em;
	padding-top: 2em;
	border-top: 1px solid rgba(0, 60, 0, 0.1);
}

/* Article styling */
article .post-meta {
	font-size: 0.9em;
	opacity: 0.7;
	text-align: center;
	margin-bottom: 2em;
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin: 1em 0 2em;
}

th, td {
	padding: 0.5em 0.75em;
	text-align: left;
	border-bottom: 1px solid rgba(0, 60, 0, 0.1);
}

th {
	font-weight: bold;
	border-bottom-color: var(--foreground);
}

tr:hover {
	background: rgba(0, 60, 0, 0.03);
}

/* Utility classes */
.centered {
	display: block;
	margin: 0 auto;
}

/* Language switcher */
.lang-switcher {
	display: flex;
	gap: 0.5em;
	font-size: 0.85em;
}

.lang-switcher a {
	padding: 0.2em 0.5em;
	border: 1px solid rgba(0, 60, 0, 0.2);
	border-radius: 3px;
}

.lang-switcher a.active {
	background: var(--foreground);
	color: var(--background);
	border-color: var(--foreground);
}

.lang-switcher a:hover:not(.active) {
	background: rgba(0, 60, 0, 0.1);
	text-decoration: none;
}

/* ID card table */
.id-card {
	width: auto;
	margin: 1.5em auto 2em;
	border: 1px solid rgba(0, 60, 0, 0.35);
	background-color: rgba(0, 60, 0, 0.03);
	border-radius: 12px;
	font-size: 0.85em;
	border-collapse: separate;
	border-spacing: 0;
}

.id-card th,
.id-card td {
	border-bottom: 1px solid rgba(0, 60, 0, 0.15);
	padding: 0.4em 0.75em;
}

.id-card tr:last-child th,
.id-card tr:last-child td {
	border-bottom: none;
}

.id-card th {
	text-align: right;
	font-weight: bold;
	padding-right: 1em;
	white-space: nowrap;
	border-right: 1px solid rgba(0, 60, 0, 0.15);
}

/* Mobile: Show ID card photo above table */
@media (max-width: 500px) {
	.id-card {
		display: block;
	}

	.id-card tbody {
		display: block;
	}

	.id-card tr {
		display: table;
		width: 100%;
		border-collapse: collapse;
	}

	.id-card tr:first-child {
		display: block;
		text-align: center;
	}

	.id-card tr:first-child td:first-child {
		display: block;
		padding: 1em;
		border: none;
		border-bottom: 1px solid rgba(0, 60, 0, 0.15);
	}

	.id-card tr:first-child td:first-child img {
		width: 150px;
		height: 150px;
		margin: 0 auto;
	}

	.id-card tr:first-child th,
	.id-card tr:first-child td:not(:first-child) {
		display: table-cell;
	}
}
