:root {
	--color-text: #787878;
	--color-heading: #222;
	--color-dark: #000;
	--color-link: #2e9bdb;
	--color-accent: #00aeef;
	--color-muted: #9c9c9c;
	--color-border: #e8e8e8;
	--color-border-light: #e5e5e5;
	--color-border-input: #ddd;
	--color-error: #c70000;
	--color-bg-dark: #222;
	--color-bg-hover: #f5f5f5;
	--color-footer-text: #545454;
	--color-footer-highlight: #858585;
	--color-btn: #3e3e3e;
	--max-width: 960px;
	--side-padding: 15px;
}

html, body {
	height: 100%;
}

body {
	color: var(--color-text);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

#frame {
	min-height: 100%;
	display: flex;
	flex-direction: column;
}

a {
	color: var(--color-link);
}

/* Content */

.content-block {
	overflow: hidden;
}

.content-block h1,
#contacts form h1 {
	color: var(--color-heading);
	font-family: "Times New Roman", Times, serif;
	font-size: 32px;
	font-style: italic;
	font-weight: normal;
	line-height: 36px;
	border-bottom: 1px solid var(--color-border-light);
	margin-bottom: 22px;
	padding-bottom: 6px;
}

.content-block h2 {
	color: var(--color-dark);
	font-size: 16px;
	font-weight: bold;
}

.content-block ul {
	list-style-position: inside;
	margin-left: 2px;
}

.content-block p > strong {
	color: #333;
}

.content-block hr {
	margin: 25px 0;
	border-style: dashed;
}

.content-block a {
	text-decoration: none;
}

.content-block a:hover {
	text-decoration: underline;
}

.content-block a.file-link-doc,
.content-block a.file-link-pdf {
	padding-left: 20px;
	background: url("../img/disk.png") left center no-repeat;
}

/* Header (mobile-first) */

#header {
	padding-bottom: 8px;
	background: url("../img/header.gif") left bottom repeat-x;
}

#header-content {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	min-height: 70px;
	position: relative;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 var(--side-padding);
}

#logo {
	width: 200px;
	height: 37px;
	margin: 16.5px 0;
	font-size: 0;
	color: transparent;
	background: url("../img/logo2.png") no-repeat;
	background-size: contain;
}

nav {
	display: none;
	width: 100%;
}

#header.menu-open nav {
	display: flex;
	flex-direction: column;
}

#language {
	color: var(--color-dark);
	text-decoration: none;
	padding: 10px 12px;
}

#language:hover {
	text-decoration: underline;
}

/* Navigation (mobile-first) */

#navigation {
	display: flex;
	flex-direction: column;
}

#navigation > li > a {
	display: block;
	padding: 10px 12px;
	font-size: 15px;
	line-height: 18px;
	color: var(--color-muted);
	text-decoration: none;
	border-bottom: 1px solid var(--color-border);
}

#navigation a.active {
	color: var(--color-dark);
}

#navigation a:hover {
	color: var(--color-dark);
}

#navigation ul li {
	border-bottom: 1px solid var(--color-border);
}

#navigation ul li a {
	display: block;
	padding: 8px 12px 8px 30px;
	white-space: nowrap;
	text-decoration: none;
	color: var(--color-muted);
}

/* Hamburger */

#hamburger {
	display: block;
	position: absolute;
	right: 12px;
	top: 35px;
	transform: translateY(-50%);
	width: 30px;
	height: 24px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	z-index: 10;
}

#hamburger span {
	display: block;
	width: 100%;
	height: 3px;
	background: #333;
	border-radius: 2px;
	position: absolute;
	left: 0;
	transition: transform 0.3s, opacity 0.3s;
}

#hamburger span:nth-child(1) {
	top: 0;
}

#hamburger span:nth-child(2) {
	top: 10px;
}

#hamburger span:nth-child(3) {
	top: 20px;
}

#header.menu-open #hamburger span:nth-child(1) {
	top: 10px;
	transform: rotate(45deg);
}

#header.menu-open #hamburger span:nth-child(2) {
	opacity: 0;
}

#header.menu-open #hamburger span:nth-child(3) {
	top: 10px;
	transform: rotate(-45deg);
}

/* Header & Navigation: Desktop */

@media (min-width: 768px) {
	#header-content {
		justify-content: space-between;
		flex-wrap: nowrap;
		align-items: stretch;
		height: 160px;
	}

	#logo {
		width: 300px;
		height: 55px;
		margin: 60px 0 0;
		background-size: auto;
	}

	nav {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		padding: 12px 0 35px;
		width: auto;
	}

	#language {
		order: -1;
		padding: 0;
	}

	#hamburger {
		display: none;
	}

	#navigation {
		flex-direction: row;
		margin-top: auto;
	}

	#navigation > li {
		position: relative;
	}

	#navigation > li > a {
		padding: 0 12px 8px;
	}

	#navigation > li > a.active {
		border-bottom-color: var(--color-dark);
	}

	#navigation > li:hover > a {
		color: var(--color-dark);
	}

	#navigation ul a.active {
		color: var(--color-muted);
	}

	#navigation > li:hover ul {
		display: block;
	}

	#navigation ul {
		display: none;
		position: absolute;
		left: 0;
		top: 27px;
		background: #fff;
	}

	#navigation ul li {
		border-left: 1px solid var(--color-border);
		border-right: 1px solid var(--color-border);
	}

	#navigation ul li a {
		padding: 8px 12px;
	}

	#navigation ul li:hover a {
		background: var(--color-bg-hover);
		color: #333;
	}
}

/* Footer */

#footer {
	background: var(--color-bg-dark);
	margin-top: auto;
}

#footer-content {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 30px var(--side-padding);
	color: var(--color-footer-text);
	font-size: 11px;
	line-height: 2;
}

#footer-content p.copyright {
	white-space: nowrap;
}

#footer-content p.copyright strong {
	color: var(--color-footer-highlight);
	margin: 0 4px;
}

/* Layout */

#container {
	flex: 1;
}

#content-wrapper {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 25px var(--side-padding) 35px;
	overflow: hidden;
}

/* Contacts */

#contacts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}

#contacts form {
	min-width: 0;
}

#contacts form .form-field {
	margin-bottom: 20px;
}

#contacts form .form-field input,
#contacts form .form-field textarea {
	padding: 8px 7px;
	width: 100%;
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 12px;
	color: #333;
	border: 1px solid var(--color-border-input);
	border-radius: 3px;
}

#contacts form .form-field textarea {
	height: 120px;
}

#contacts form .form-submit {
	text-align: right;
}

#contacts form .form-submit button {
	border: none;
	border-radius: 4px;
	background: var(--color-btn);
	padding: 6px 12px;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
}

#contacts form .form-submit button:hover {
	background-color: var(--color-dark);
}

#contacts form.submitted .form-field input:invalid,
#contacts form.submitted .form-field textarea:invalid {
	border-color: var(--color-error);
}

#contacts .content-block {
	min-width: 0;
}

/* Gallery */

#gallery .photos {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
}

#gallery .photos a {
	border: 4px solid #ccc;
}

#gallery .photos a:hover {
	border-color: var(--color-accent);
}

#gallery .photos a img {
	width: 100%;
	height: auto;
	display: block;
}

/* Responsive: Tablet / Mobile */

@media (max-width: 767px) {
	#content-wrapper,
	#footer-content {
		width: auto;
	}

	#gallery .photos {
		grid-template-columns: repeat(2, 1fr);
	}

	#contacts {
		grid-template-columns: 1fr;
		gap: 25px;
	}

	#footer-content p.copyright {
		text-align: center;
	}

	.content-block h1,
	#contacts form h1 {
		font-size: 24px;
		line-height: 28px;
	}
}

/* Responsive: Small Mobile */

@media (max-width: 479px) {
	#gallery .photos {
		grid-template-columns: 1fr;
	}

	#logo {
		width: 160px;
		height: 29px;
	}
}
