/*
 * (C) 2019 by Christoph Grenz <christophg@grenz-bonn.de>
 *
 * This software is distributed under GNU GPL v3
 */

/* BASIC LAYOUT */

* {
	box-sizing: inherit;
}

html {
	font-family: "Verdana", "Vera Sans", "Bitstream Vera Sans", sans-serif;
	min-height: 100%;
	background-color: #fff;
	color: black;
	font-size: 10pt;
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

header {
	display: flex;
	height: 4.3rem;
	padding: 0 0.8rem;
	border-bottom: 1px solid #ddd;
	justify-content: space-between;
}

#main-container {
	display: flex;
	position: relative;
	height: calc( 100vh - 4.3rem );
	overflow-y: hidden;
}

#sidebar {
	position: absolute;
	width: 28rem;
	max-width: 93vw;
	max-width: calc(100vw - 2rem);
	height: 100%;
	overflow: visible;
	background-color: white;
	border-right: 1px solid #CCC;
	z-index: 4;
	flex-shrink: 0;
}

#sidebar .datasets {
	width: 100%;
	height: 100%;
	position: relative;
	padding: 0.8rem 1rem 0.8rem 0.7rem;
	overflow-y: auto;
	z-index: 1;
}

#main-container main {
	position: relative;
	margin: 0;
	flex-grow: 1;
	flex-shrink: 1;
	height: 100%;
}

#details-pane {
	position: absolute;
	background: white;
	display: none;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: white;
	padding: 0.5rem 1rem;
	transition: left 0.2s;
	overflow-y: auto;
	z-index: 2;
}

#main-container main.special-page {
	padding: 2rem;
	max-width: 80rem;
	margin: auto;
	text-align: center;
}

/* HELPER CLASSES */

@media screen {

	.hidden {
		display: none;
	}
}

/* MOBILE NAVIGATION */

#nav-toggle {
	display: none;
}
#nav-toggle+label {
	border: none;
	background: transparent;
	font-size: 3.1rem;
	padding: 0 0.5rem;
	color: #333;
	cursor: pointer;
}

#nav-toggle+label::before {
	content: '≡';
	color: inherit;
}

#top-navigation {
	display: none;
	position: absolute;
	top: 4.3rem;
	left: 0;
	right: 0;
	background: white;
	transition: opacity 0.2s;
	padding: 0.3rem;
	z-index: 5;
}

#nav-toggle:active ~ #top-navigation,
#nav-toggle:checked ~ #top-navigation {
	display: block;
	opacity: 1;
}

#nav-toggle:active ~ #top-navigation {
	opacity: 0.05;
}

/* NAVIGATION BUTTONS */

.tab-buttons {
	display: block;
	list-style: none;
	margin: auto;
	padding: 0;
}

.tab-buttons li {
	display: block;
}
.tab-button, .compact {
	display: block;
	text-align: center;
	width: 100%;
	background: transparent;
	color: inherit;
	border: 1px none black;
	border-bottom-style: solid;
	padding: 0.4rem 0.7rem;
	line-height: 2.35rem;
	font-family: inherit;
	font-size: 0.95rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}
.tab-buttons .tab-button:disabled, .tab-buttons .tab-button.disabled {
	color: #BBB;
	cursor: not-allowed;
	opacity: 0.8;
}
.tab-button:focus {
	outline: 0 none transparent;
}
.tab-button::-moz-focus-inner {
	border: 0 none transparent;
}

.tab-button img {
	vertical-align: -0.6em;
}

.dropdown-button::after {
	content: ' \25be';
	color: #BBB;
}

.dropdown {
	position: relative;
}

.dropdown .submenu {
	margin: 0;
	padding: 0;
}

/* SIDEBAR CONTROL */
#sidebar {
	left: -28rem;
	transition: left 0.3s;
}

#sidebar-toggle {
	display: none;
}
#sidebar-toggle+label {
	position: fixed;
	text-align: right;
	left: -26.3rem;
	top: 49%;
	width: 28rem;
	border: 1px solid #ddd;
	border-radius: 0.5rem;
	background: rgba(255,255,255,0.9);
	font-size: 2.5rem;
	padding: 0.5rem 0.3rem 0.8rem;
	color: #888;
	cursor: pointer;
	z-index: 3;
	transition: left 0.3s, width 0.3s;
}

#sidebar-toggle+label::before {
	content: '›';
	color: inherit;
}
#sidebar-toggle:checked+label::before {
	content: '‹';
	color: inherit;
}

#sidebar-toggle:checked+label {
	left: 1.7rem;
	max-width: 93vw;
	max-width: calc(100vw - 2rem);
}

#sidebar-toggle:checked ~ #sidebar {
	left: 0;
}

/* EXTREMELY NARROW SCREENS */
@media (max-width: 30rem)
{
	/* Header-Bild graduell verkleinern */
	h1 #header-image {
		height: auto;
		width: 55vw;
		width: calc(90vw - 7.5rem);
	}
}

/* DESKTOPS */
@media (min-width: 80rem)
{
	#top-navigation {
		display: flex;
		position: static;
		flex-grow: 1;
	}
	#nav-toggle:active ~ #top-navigation,
	#nav-toggle:checked ~ #top-navigation {
		display: flex;
	}

	#main-container #sidebar {
		left: 0;
		position: relative;
		transition: unset;
	}

	#nav-toggle+label {
		display: none;
	}
	
	#sidebar-toggle+label {
		display: none;
	}
	
	.tab-buttons {
		display: inline-block;
		list-style: none;
		margin: auto;
		padding: 0;
		height: 2.5rem;
	}

	.tab-buttons li {
		display: inline-block;
		float: left;
		height: 100%;
	}
	.tab-button {
		display: block;
		vertical-align: top;
		background: transparent;
		color: inherit;
		border: 1px solid black;
		border-right-style: none;
		padding: 0 0.7rem;
		height: 100%;
		line-height: 2.35rem;
		font-family: inherit;
		font-size: 0.95rem;
		text-decoration: none;
		cursor: pointer;
	}

	.compact {
		display: block;
		vertical-align: top;
		background: transparent;
		color: inherit;
		border: none;
		padding: 0 0.7rem;
		height: 100%;
		line-height: 2.40rem;
		font-family: inherit;
		font-size: 0.95rem;
		text-decoration: none;
		cursor: pointer;
	}

	.tab-button:disabled, .tab-button.disabled {
		cursor: not-allowed;
	}

	.tab-buttons > li:first-child .tab-button,
	.tab-buttons > li.first-button .tab-button {
		border-top-left-radius: 0.2rem;
		border-bottom-left-radius: 0.2rem;
	}
	.tab-buttons > li:last-child .tab-button {
		border-top-right-radius: 0.2rem;
		border-bottom-right-radius: 0.2rem;
		border-right-style: solid;
	}

	.tab-buttons.primary {
		flex-grow: 1;
		margin-left: 1.5rem;
	}

	.dropdown .submenu {
		display: none;
		min-width: 23rem;
		padding: 0.4rem 0rem;
		border: 1px solid: #ccc;
		border-radius: 0.3rem;
		box-shadow: 0px 4px 8px 0px rgba(40,40,40,0.3);
		background: white;
		color: #333;
	}

	.dropdown input:checked ~ .submenu {
		display: block;
		position: absolute;
		right: 0;
	}

	.secondary .submenu li {
		display: block;
		width: 100%;
	}
	.secondary .submenu .tab-button {
		display: block;
		border: 0 none transparent;
		border-radius: 0;
		color: inherit;
		text-align: left;
	}
	.secondary .submenu .tab-button:hover {
		color: white;
		background-color: #7ebc6f;
	}
}
/* LANGUAGE SPECIFIC */

:lang(en) q {
	quotes: "“" "”" "‘" "’" "«" "»" "‹" "›";
}


:lang(de) q {
	quotes: "„" "“" "‚" "‘" "»" "«" "›" "‹";
}

/* PRINT STYLESHEET */
@media print {
	#top-navigation {
		display: none;
	}
	
	#main-container {
		display: block;
		height: auto;
	}

	#main-container #sidebar {
		left: 0;
		position: static;
		transition: unset;
	}

	#nav-toggle+label {
		display: block;
	}
	
	#sidebar-toggle+label {
		display: none;
	}
	
	#sidebar {
		display: block;
		height: auto;
		width: 100%;
		border-right: none;
	}
	
	#sidebar .datasets {
		display: block;
		position: static;
		height: auto;
		width: 100%;
		overflow: visible;
	}
	
	.dataset {
		display: none;
		page-break-inside: avoid;
	}
	
	.dataset[itemprop] {
		display: block;
	}

	#main-container main {
		width: 100vw;
		page-break-after: always;
	}

	#map {
		page-break-inside: avoid;
		page-break-after: always;
		min-height: 50vh;
		max-height: 100vh;
	}
	
	#details-pane {
		position: static;
		background: transparent;
		width: 100%;
		height: auto;
	}

	.close-btn { display: none; }
}

/* HEADER */

header h1 {
	margin: 0;
	overflow: hidden;
	white-space: nowrap;
}

#logo {
	height: 3.4rem;
	margin: 0.45rem 0.5rem 0.45rem 0rem;
	vertical-align: middle;
}

#header-image {
	height: 2.5rem;
	vertical-align: middle;
}

.primary .tab-button {
	border-color: #7ebc6f;
	color: #7ebc6f;
}
.primary .tab-button:not(:disabled):hover,
.primary .tab-button:not(:disabled):active,
.primary .tab-button:not(:disabled):focus
{
	background-color: #dcedd7;
}

.secondary .compact {
	color: #888;
}

.secondary .compact:not(:disabled):hover,
.secondary .compact:not(:disabled):active,
.secondary .compact:not(:disabled):focus
{
	color: #484848;
}

.secondary .tab-button,
.secondary .compact{
	border-color: #ccc;
	color: #888;
}
.secondary > .tab-button:not(:disabled):hover,
.secondary > .tab-button:not(:disabled):active,
.secondary > .tab-button:not(:disabled):focus
{
	color: #484848;
	background-color: #d5d5d5;
}

/* DATENSATZ-LISTE */

.datasets .callout {
	border: 1px solid #eee;
	border-left: 0.4em solid #1b809e;
	border-radius: 3px;
	margin: 0.4em 1.2em 1rem;
	padding: 0.5em 1em 0.5em 1.5rem;
}

.datasets .callout p {
	margin: 0.75em 0;
}

.datasets p {
	hyphens: auto;
}

.dataset p a {
	word-wrap: break-word;
}

.datasets {
	list-style: none;
	margin: 0;
	padding: 0;
	color: #4D4D4D;
}

.dataset + .dataset {
	border-top: 1px solid #DDD;
}

.dataset {
	border: 1px solid transparent;
	padding: 0.5em 1.2em;
}

.dataset.current {
	color: #1D1D1D;
	border: 1px solid black;
}

.dataset::after {
	display: block;
	content: ' ';
	clear: both;
}

#sidebar .datasets::after {
	display: block;
	content: ' ';
	clear: both;
	height: 0.5rem;
}

#sidebar h2 {
	margin: -0.6rem 0 0.3rem;
	padding-top: 0.9rem;
	font-size: 12pt;
	font-family: inherit;
	color: black;
}

.dataset h2 a {
	display: block;
	color: inherit;
	text-decoration: none;
	margin: -0.7rem 0;
	padding: 0.7rem 0;
}

.dataset h2 a:visited {
	color: #252025;
}

.dataset h2 a:hover {
	text-decoration: underline;
}

.dataset p {
	margin: 0.7rem 0;
}

.dataset .license {
	margin-top: -0rem;
	float: right;
}

.dataset .author {
	margin-top: 1.5rem;
}


.resources {
	margin-bottom: 0.3rem;
}

.resources p:first-child {
	margin-top: 1rem;
}

.resources ul {
	margin-top: 0;
}


#map {
	width: 100%;
	height: 100%;
	cursor: grab;
}
#map:active {
	cursor: grabbing;
}

.ol-control button {
	cursor: pointer;
}
.ol-attribution li+li+li::before {
	content: ' | '
}

.close-btn {
	float: right;
	border: none;
	background: transparent;
	font-family: inherit;
	padding: 0.4rem 0.6rem;
	font-size: 1.3rem;
	color: #CCC;
	cursor: pointer;
	transition: color 0.1s;
}

.close-btn:hover {
	color: #888;
}

#details-pane h2 {
	margin: 0 0 1rem;
}

#details-pane p {
	margin-bottom: 0.5em;
	margin-top: 0;
}

#details-pane table {
	width: 100%;
	border-collapse: collapse;
	overflow-wrap: break-word;
	table-layout: fixed;
	font-size: 0.9rem;
	margin-top: 2em;
	margin-bottom: 2em;
}
#details-pane th {
	padding: 6px 10px;
	background-color: #F6F6F6;
	border: 1px solid #DDD;
	text-align: left;
	vertical-align: top;
	font-weight: normal;
	hyphens: auto;
}
#details-pane td {
	padding: 6px 10px;
	border: 1px solid #DDD;
	text-align: left;
	vertical-align: top;
	hyphens: auto;
}

dialog {
  position: fixed;
  top: 50%;
  transform: translate(0, -50%);
  left: 0; right: 0;
  width: -moz-fit-content;
  width: -webkit-fit-content;
  width: fit-content;
  max-width: 100%;
  height: -moz-fit-content;
  height: -webkit-fit-content;
  height: fit-content;
  margin: auto;
  border: 2px solid #aaa;
  border-radius: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: white;
  color: black;
  display: none;
}

dialog[open] {
  display: block;
}

dialog + .backdrop, dialog::backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.2);
}

._dialog_overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
}

#dialog--mapcss-edit {
	width: 85%;
	height: 85%;
}

dialog h2 {
	margin: 0.3rem 0 0.6rem;
	padding-bottom: 0.2rem;
	font-size: 1.4rem;
	font-weight: normal;
	border-bottom:1px solid #ddd
}

dialog p {
	font-size: 0.9rem;
	margin: 0 0 0.3rem;
}

.vbox {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.vbox textarea {
	width: 100%;
	height: auto;
	flex-grow: 1;
}

dialog > .close-btn {
	position: absolute;
	right: 0.5rem;
	top: 0;
	background: transparent;
}
dialog > .close-btn:hover,
dialog > .close-btn:focus,
dialog > .close-btn:active {
	background: transparent;
}

dialog .error {
	color: red;
	font-weight: bold;
}

@keyframes oscillate {
	0% {
		padding-right: 1ex;
		padding-left: 0;
	}
	50% {
		padding-left: 1ex;
		padding-right: 0;
	}
	100% {
		padding-right: 1ex;
		padding-left: 0;
	}
}

.progress {
	cursor: progress;
}
.tab-button.progress::before {
	content: '⚫';
	color: inherit;
	animation-name: oscillate;
	animation-duration: 1s;
	animation-iteration-count: infinite;
	animation-timing-function: ease-in-out;

	margin-right: 0.15rem;
	margin-left: -0.55rem;

	display: inline-block;
}
#map.progress {
	cursor: progress;
}

.datalink {
	display: inline-block;
	border: 1px solid #555;
	font-size: 0.65em;
	letter-spacing: -0.05em;
	color:inherit;
	text-decoration: none;
	padding: 0.02em 0.02em 0.05em;
	
}

main button, dialog button, .btn {
	background-color: #7092FF;
	color: #fff;
	border: 0 none transparent;
	border-radius: 0.2rem;
	padding: 0.6em 1.2em;
	text-decoration: none;
	cursor: pointer;
}
main button:hover, dialog button:hover, .btn:hover,
main button:focus, dialog button:focus, .btn:focus {
	background-color: #6482E3;
}
main button:active, dialog button:active, .btn:active {
	background-color: #5D7EDC;
}
main button:disabled, dialog button:disabled, .btn.disabled {
	cursor: not-allowed;
	background-color: #96B0FF;
}

.error-code {
	font-size: 30vh;
	font-weight: normal;
	line-height: 1em;
	margin: 0;
	padding: 0;
	z-index: 0;
	opacity: 0.2;
	overflow: hidden;
	cursor: default;
}

.error-message {
	font-size: 1.2rem;
	margin-bottom: 2.5rem;
}

.messages {
	position: absolute;
	width: max-content;
	display: table;
	z-index: 3;
	left: 0;
	right: 0;
	margin: auto;
	padding: 0;
	list-style: none;
	text-align: center;
}
.messages li {
	margin-top: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: rgba(150,150,150,0.8);
	border-radius: 0.3rem;
}
.messages .close-btn {
	padding: 0 0 0 0.75ex;
	line-height: 0.95em;

}

main::before {
	z-index: 1;
	display: block;
	position: absolute;
	content: '';
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	background-color: black;
	opacity: 0;
	pointer-events: none;
	user-select: none;
	transition: opacity 0.3s ease-in-out;
}

main.loading::before {
	opacity: 0.25;
}

main.loading::after {
	content: url(data:image/gif;base64,R0lGODlhKwALAPEAADw8PP///5qamv///yH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAKwALAAACMoSOCMuW2diD88UKG95W88uF4DaGWFmhZid93pq+pwxnLUnXh8ou+sSz+T64oCAyTBUAACH5BAkKAAAALAAAAAArAAsAAAI9xI4IyyAPYWOxmoTHrHzzmGHe94xkmJifyqFKQ0pwLLgHa82xrekkDrIBZRQab1jyfY7KTtPimixiUsevAAAh+QQJCgAAACwAAAAAKwALAAACPYSOCMswD2FjqZpqW9xv4g8KE7d54XmMpNSgqLoOpgvC60xjNonnyc7p+VKamKw1zDCMR8rp8pksYlKorgAAIfkECQoAAAAsAAAAACsACwAAAkCEjgjLltnYmJS6Bxt+sfq5ZUyoNJ9HHlEqdCfFrqn7DrE2m7Wdj/2y45FkQ13t5itKdshFExC8YCLOEBX6AhQAADsAAAAAAAAAAAA=);
	position: absolute;
	z-index: 2;
	display: block;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	width: 43px;
	height: 11px;
	margin: auto;
	pointer-events: none;
	user-select: none;
}
