@import url("fonts/lato.css");

:root {
	--color-logo-red: #ec131e;
	--color-logo-yellow: #ffd504;
	--color-logo-black: #000;

	interpolate-size: allow-keywords;
}

html {
	padding: 0;
	margin: 0;
	width: 100%;
	height: 100%;
}

@page {
	margin: 20mm 15mm 8mm;
	padding: 0;
	size: a4;
}

body {
	font-family: Lato, Arial, Helvetica, sans-serif;
	min-width: 320px;
	font-weight: 400;
	background-color: #eee;
	font-size: 14px;
	line-height: 1.6;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	color: #444;
}

body, div, dl, dt, dd, li,
h1, h2, h3, h4, h5, h6,
pre, form, fieldset,
input, textarea, p, blockquote,
th, td {
	margin: 0;
	padding: 0;
}

.group::after {
	content: "";
	display: table;
	clear: both;
}

p {
	font-family: Lato, arial, helvetica, sans-serif;
	line-height: inherit;
	margin-top: 0;
	font-size: inherit;
}

::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}

::-webkit-scrollbar-track {
	box-shadow: inset 2px 0 4px #0003;
	border-radius: 1px;
	background-color: #fff;
}

::-webkit-scrollbar-thumb {
	box-shadow: inset 2px 0 4px #0003;
	border-radius: 1px;
	background-color: #c0c0c0;
	color: #c0c0c04d;
}

.visuallyhidden {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard: h5bp.com/p
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
	clip-path: none;
	height: auto;
	margin: 0;
	overflow: visible;
	position: static;
	width: auto;
}

cs-bouncing-pane {
	position: fixed;
	top: 0;
	height: 100%;
	width: 230px;
	min-width: 200px;
	background-color: white;
	box-shadow: 0 7px 14px #0005;
	z-index: 30;
	overflow: hidden;
	left: calc(50% - 480px);
	transition: left 0.2s ease-in-out;
}

#main-menu a {
	text-transform: uppercase;
	text-decoration: none;
	color: #075c98;
	font-size: 12px;
	display: inline-block;
}

#mainmenu a:first-child img {
	margin: 30px auto 12px;
}

#main-menu {
	margin: 0 20px;
	box-shadow: 0 0 4px #ddd;
	margin-bottom: 30px;
}

#main-menu > ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	text-align: center;
}

#main-menu > ul > li {
	display: block;
	text-align: center;
	text-decoration: none;
	border-style: solid;
	border-width: 0 0 1px;
	border-color: #ccc;
	padding: 5px 9px;
	background: #fff;
	background: linear-gradient(to bottom, #fff 0%, #f7f7f7 100%);
}

#main-menu > ul > :last-child {
	border-width: 0;
	padding: 8px 0;
}

#main-menu > ul > li > cs-expand-button,
#main-menu > ul > li > a {
	cursor: pointer;
	line-height: 1.6;
	text-transform: uppercase;
	text-decoration: none;
	font-weight: 500;
	color: #075c98;
	font-size: 14px;
}

#main-menu > ul > li._active {
	border-style: solid;
	border-width: 0 0 1px 4px;
	border-left-color: var(--color-logo-red);
	border-right-color: transparent;
	padding: 5px 13px 5px 9px;
}

body > header {
	box-sizing: border-box;
	position: relative;
	display: flow-root;

	& > div:first-child {
		z-index: 20;
		width: 100%;
		height: 30px;
		position: fixed;
		background-color: #555;
		display: grid;
		grid-template-columns: 1fr max-content;
		padding: 0 calc(50% - 490px) 0 calc(50% - 490px + 280px);
		box-sizing: border-box;

		&::before {
			content: 'INTRANET';
			padding: 5px 20px 3px 0;
			font-weight: bold;
			letter-spacing: 2px;
			color: white;
		}
	}

	cs-open-login-dialog-button,
	cs-user-logout-button {
		display: inline-block;
		position: relative;
		box-sizing: border-box;
		background-color: var(--color-logo-red);
		background-repeat: no-repeat;
		background-position: calc(100% - 12px) 50%;
		place-items: center;
		font-family: Arial, helvetica, sans-serif;
		padding: 6px 42px 0 16px;
		vertical-align: middle;
		margin: auto 0 auto 8px;
		font-weight: bold;
		height: 100%;
		line-height: 100%;
		font-size: 16px;
		color: white;
		transition: all 0.3s ease-in-out;

		&:hover {
			cursor: pointer;
			background-color: hsl(from var(--color-logo-red) h calc(s * 1) calc(l * 0.7))
		}
	}

	cs-open-login-dialog-button::before {
		content: '👤';
		color: transparent;
		background-color: white;
		background-clip: text;
		display: inline-block;
		font-size: 20px;
		position: absolute;
		right: 10px;
		top: 1px;
		line-height: 1.4;
	}

	cs-user-logout-button {
		&::before {
			content: '↩';
			display: inline-block;
			font-size: 20px;
			position: absolute;
			right: 14px;
			top: 7px;
		}
	}

	cs-open-login-dialog-button:active:hover,
	cs-user-logout-button:active:hover {
		box-shadow: 2px 2px 10px #400 inset;
	}

	.links-menu {
		display: flow-root;
		max-width: 980px;
		margin: 0 auto;
		box-sizing: border-box;
		padding-top: 38px;

		& > ul {
			display: flex;
			gap: 1em;
			justify-content: flex-end;
			background-color: white;
			padding: 4px 1em 0 280px;
			margin: 0;
			line-height: 1.0;

			@media screen and (width <= 730px) {
				padding-left: 4px;
			}

			& > li {
				display: inline-block;

				& > a {
					text-decoration: none;
					text-transform: uppercase;
					color: #888;
					letter-spacing: 0.4px;
					font-weight: bold;
					transition: color 0.5s;

					&:hover {
						color: red
					}
				}
			}
		}
	}
}

html.print {
	body {
		background-color: white;
	}

	#mainmenu {
		display: none;
	}

	main {
		width: 730px;
		padding: 0 30px;
	}

	main h1 {
		margin-top: 30px;
	}

	header {
		display: none;
	}

	header.print {
		display: block;
		color: black;
		background-color: white;
		width: auto;
		margin: auto;
		position: relative;
		height: auto;
		overflow: auto;
		padding: 10px 30px 0;
		box-sizing: border-box;
	}

	#menu-togge {
		display: none;
	}
}

summary {
	font-weight: bold;
}

#login-pane {
	color: white;
	display: flex;
	line-height: 1.2;

	&  > span {
		color: #ddd;
		line-height:23px;
	}
}

.logged-in-pane {
	& > div:first-child {
		display: inline-block;
		vertical-align: middle;
		margin: auto 10px;
		color: transparent;
		background-color: white;
		background-clip: text;
	}

	& > a:nth-child(2) > img {
		display: block;
		padding-top: 2px;
	}
}

main {
	min-height: calc(100% + 1px);
	width: 980px;
	margin: auto;
	background-color: white;
	box-sizing: border-box;
	padding: 30px 30px 30px 280px;
}

article {
	text-align: justify;
	margin-top: 40px;
}

article * a {
	color: #444;
	transition: color 0.2s ease-in-out;
}

article * a:hover {
	color: #c44;
}

#skip-links {
	width: 230px;
}

#skip-links > ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
}

#skip-links > ul > li {
	text-align: center;
}

#skip-links > ul > li:nth-last-child(n+2) > a {
	z-index: 1000;
	position: absolute;
	width: 0;
	height: 0;
	top: 10px;
	left: -10000px;
	display: block;
}

html[data-whatintent=keyboard] #skip-links > ul > li:nth-last-child(n+2) > a:hover,
html[data-whatintent=keyboard] #skip-links > ul > li:nth-last-child(n+2) > a:focus,
html[data-whatintent=keyboard] #skip-links > ul > li:nth-last-child(n+2) > a:active {
	left: 10px;
	background-color: #ffd500;
	height: auto;
	width: auto;
	padding: 5px 10px;
	color: black;
}


.menu-toggle {
	cursor: pointer;
	border: 0;
	background-color: transparent;
	user-select: none;
}

.menu-toggle+ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: all 0.3s ease-in-out, visibility 0s 0.3s;
	visibility: hidden;
}

.menu-toggle[aria-expanded=true]+ul,
._active > .menu-toggle+ul {
	max-height: 600px;
	visibility: visible;
	transition: all 0.3s ease-in-out;
}

.menu-toggle+ul > li {
	padding: 6px 0 0;
}

#menu-toggle {
	display: none;
	background-color: var(--color-logo-red);
	position: fixed;
	text-align: center;
	top: 0;
	left: 0;
	width: 48px;
	height: 30px;
	color: white;
	font-size: 22px;
	line-height: 1.4em;
	z-index: 25;
	user-select: none;
	cursor: pointer;
	border-width: 0;
}

table.styled {
	width: 100%;
}

table.styled td {
	background-color: #eee;
	padding: 4px 6px;
}

table.styled th	 {
	padding: 4px 6px;
	background-color: #e8e8e8;
}

table.styled tr:first-child th {
	background-color: #ddd;
}

main > article > h1 {
	font-family: lato, arial, helvetica, sans-serif;
	margin-top: 1.8em;
	margin-bottom: 40px;
	line-height: 1.4em;
	text-align: left;
}

article h1 {
	font-size: 24px;
	font-weight: bold;
	margin: 8px 0 16px;
}

article h2 {
	margin: 0.5em 0;
	padding: 0;
	font-size: 150%;
	line-height: 1.6;
	color: #444;
	text-align: left;
	font-family: Lato, arial, helvetica, sans-serif;
	font-weight: 400;
	border-width: 0;
}

article h3 {
	margin: 0.5em 0;
	padding: 0;
	font-size: 150%;
	line-height: 1.6;
	color: var(--color-logo-red);
	text-align: left;
	font-family: Lato, arial, helvetica, sans-serif;
	font-weight: 400;
	border-width: 0;
}

.newslist {
	padding: 0;
	margin-bottom: 20px;

	> .date  {
		font-size: 18px;
	}

	> .title {
		font-size: 18px;
	}

	.shortinfo {
		margin-left: 96px;
	}

	.readmore {
		text-align: right;
	}
}

.newslist-date {
	color: var(--color-logo-red);
}

.newslist-title {
	font-size: 16px;
	margin: 0 0 10px;
	padding: 0;
}

.newslist-news+.newslist-news {
	position: relative;
	display: block;
	padding-top: 10px;
}

.newslist-link {
	top: 0;
	right: 0;
	width: 70px;
	height: 100%;
	position: absolute;
	background: linear-gradient(to right, #f9d00400 0%, #f9d004 30px);
	transition: all 0.3s ease-in-out;
}

.newslist-news:hover .newslist-link {
	width: 130px;
}

.gallery-list-item	a {
	text-decoration: none;
}

.gallery-list-item	a div {
	color: #555;
}

.c-gallery-default img {
	margin-bottom: 20px;
}

article img {
	max-width: 100%;
	height: auto;
}

.news-subtitle {
	background-color: #ffd504;
	padding: 12px 20px;
	width: 100%;
	margin-left: -20px;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 20px;
	color: white;
}

blockquote {
	display: block;
	margin: 0.5em;
	padding: 1em;
	font-size: 150%;
	line-height: 1.6;
	color: #444;
	text-align: left;
	font-family: Lato, arial, helvetica, sans-serif;
	font-weight: 400;
	font-style: italic;
	background-color: #f8f8f8;
	border-width: 0;
}


@scope (cs-reading-confirmation-box,
cs-user-application-box) {
	:scope {
		display: block;
		padding: 2px 6px 10px 20px;
		background-color: #f2f2f2;
		margin: 20px 0;
		transition: margin 0.2s ease-in-out;
	}

	.date-created, .date-modified,
	.date-applied, .date-availability {
		text-align: right;
		font-size: 12px;
	}

	label {
		color: #a00;
	}

	.date-applied,
	.message-no-applications {
		font-weight: bold;
	}

	.date-expired {
		margin: 10px auto;
		text-align: center;
	}

	._outdated {
		color: #a00;
	}

	table {
		background-color: #f2f2f2;
		width: 100%;

		tr td {
			padding: 4px 8px;
		}

		tr th {
			padding: 8px;
			font-weight: bold;
		}

		tr td:nth-child(n+2),
		tr th:nth-child(n+2) {
			text-align: center;
		}
	}

	html.print & {
		background-color: white;

		& > :first-child {
			background-color: white;
			margin: 0 0 1px -20px;
			box-sizing: border-box;
			padding-right: 3px;
			border-style: solid;
			border-width: 1px 0 0;
		}

		table {
			background-color: white;
		}
	}

	&:is(cs-user-application-box) {
		text-align: left;

		label:has(input[type=radio]:not(:checked)) {
			color: #444;
		}

		button {
			margin: 4px 8px 20px auto;
			padding: 10px 20px;
			border-style: solid;
			border-width: 0;
			border-radius: 4px;
			cursor: pointer;
			color: white;
			font-weight: bold;
			display: block;
			background-color: #a00;
			transition: background-color 0.3s ease-in-out;
		}

		input[name=custom_account] {
			width: 32ch;
			padding: 1px 4px;
			box-sizing: border-box;
		}

		button:disabled {
			background-color: #aaa;
		}

		.operation-in-progress-message {
			visibility: hidden;
			text-align: center;
			color: red;
			font-weight: bold;

			&._show {
				visibility: visible;
			}
		}

		form:has(:invalid) button {
			background-color: #aaa;
		}

		tr.custom_account {
			font-size: 12px;
			line-height: 12px;

			td {
				padding: 0 0 0 16px;
			}
		}

		tr:has(+ .custom_account) td {
			padding-bottom: 0;
		}
	}

	details {
		margin-top: 16px;
	}

	@media screen and (width <= 976px) {
		/* not problematic here, but disabling it globally may hide real issues elsewhere */
		/* stylelint-disable-next-line no-invalid-position-declaration */
		margin: 20px calc(10px - 5.5vw);

		& > details > table {
			td:nth-child(2),
			td:nth-child(3),
			td:nth-child(4) {
				text-align: left;
				padding-left: 2em;
			}

			tr {
				position: relative;
				display: flex;
				flex-wrap: wrap;
			}

			th {
				display: none;
			}

			td {
				flex: 1 0 60%;
				padding: 1px 8px;
			}

			td:first-child {
				margin-top: 10px;
				font-weight: bold;
			}
		}

		&:is(cs-reading-confirmation-box) > details > table {
			td:nth-child(2)::before {
				content: 'Powiadomienie: ';
			}

			td:nth-child(3)::before {
				content: 'Potwierdzenie: ';
			}

			td:nth-child(4)::before {
				content: 'Wymagane: ';
			}
		}

		&:is(cs-user-application-box) > details > table {
			td:nth-child(2)::before {
				content: 'Data: ';
			}
		}
	}
}

.pages-list {
	text-align: center;
	padding: 10px;
}

.pages-list > a {
	display: inline-block;
	color: var(--color-logo-red);
	font-weight: bold;
	padding: 0 10px;
}

.pages-list > span {
	display: inline-block;
	font-weight: bold;
	padding: 0 10px;
}


.middlemenu li,
.middlemenu a {
	color: #075c98;
}

@media (width <= 990px) {
	main {
		padding-left: calc(100% - 700px);
		width: 100%;
	}

	cs-user-logout-button > span {
		display: none;
	}

	body > header > div:first-child {
		padding: 0 0 0 calc(100% - 700px);
	}
}

@media (width <= 976px) {
	#mainmenu {
		left: -240px;
	}

	main {
		padding: 30px calc(5.5vw - 10px);
		min-width: 340px;
	}

	body > header > div:first-child {
		padding: 0 0 0 calc(5.5vw + 40px);
	}

	html:not(.print) #menu-toggle {
		display: block;
	}

	#menu-toggle[aria-expanded=true] {
		background-color: #0000;
		width: calc(100% - 230px);
		height: 100%;
		left: 230px;
		color: #0000;
		cursor: auto;
	}

	#menu-toggle[aria-expanded=true]+#mainmenu {
		left: 0;
	}

	header > div {
		padding-left: 40px;
	}

	header > div > :first-child {
		display: none;
	}

	.logged-in-form div > span:first-child {
		display: none;
	}

	#menu-toggle-btn {
		display: block;
	}

	#menu-toggle:checked+label {
		background-color: #0000;
		width: calc(100% - 230px);
		height: 100%;
		left: 230px;
		color: #0000;
		cursor: auto;
	}
}

@media screen and (width <= 360px) {
	main {
		padding: 30px 10px;
		width: 360px;
	}

	main > header {
		margin: 0 -10px;
		background-size: 40px 50px;
		padding-left: 80px;
		font-size: 18px;
	}
}
