:root {
	--main-border: hsl(197, 91%, 63%);
}

/* container */
#container {
  padding: 60px 0;
}

/* image container */
.image-container {
	padding: 1em;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}
.image-checkbox {
	position: relative;
  border: 1px solid var(--main-border);
  float: left;
  margin: 0.5em;
	padding: 0.5em;
	text-align: center;
	background: transparent;
	-moz-user-select: none;
	-webkit-user-select: none;
}
.image-checkbox.checked {
	background: var(--main-border);
}
.image-checkbox.disabled {
	opacity: 0.2;
}
.image-checkbox.error {
  background: red;
  border-color: red;
}
.image-checkbox input {
	position: absolute;
	height: 100%;
	left: -99999px;
}
.image-checkbox input:focus + img {
	outline: 2px dotted rgba(0, 0, 0, 0.4);
}
.image-checkbox-image {
	display: block;
	max-height: calc(var(--previewMaxHeight, 200) * 1px);
	margin: 0 auto;
	position: relative;
}
.image-checkbox-image-container {
	position: relative;
}
.image-checkbox-cover {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.image-checkbox-info {
	display: block;
	font-size: 70%;
	color: white;
	background: black;
	line-height: 1;
	padding: 0.25em 0;
}

/* toolbar */
.toolbar {
  padding: 0 1.5em;
  position: fixed;
  width: 100%;
  background: white;
  z-index: 1;
}
.toolbar-top {
  top: 0;
  border-bottom: 2px solid whitesmoke;
}
.toolbar-bottom {
  bottom: 0;
  border-top: 2px solid whitesmoke;
}
.toolbar-control {
  margin: 0.7em 0;
  display: none;
}
.toolbar-expand-button {
  width: 100%;
  display: block;
  border: 0;
  background: none;
}
.toolbar-top .toolbar-expand-button::after {
  content: "▽";
}
.toolbar-bottom .toolbar-expand-button::after {
  content: "△";
}
.toolbar.expanded .toolbar-control {
  display: block;
}
.toolbar-top.expanded .toolbar-expand-button::after {
  content: "△";
}
.toolbar-bottom.expanded .toolbar-expand-button::after {
  content: "▽";
}
.toolbar.expanded {
  z-index: 2;
  max-height: 100vh;
  overflow: auto;
}
@media (min-width: 768px) {
  .toolbar {
    display: flex;
  }
  .toolbar input[type=number] {
    width: 5em;
  }
  .toolbar input[type=range] {
    width: 7em;
  }
  .toolbar-control + .toolbar-control {
    margin-left: 1em;
  }
  .toolbar-control,
  .toolbar.expanded .toolbar-control {
    display: flex;
    align-items: center;
  }
  .toolbar-control > :not(:first-child) {
    margin-left: 0.5em;
  }
  .flex-stretch {
    width: auto;
    flex: 1;
  }
  .match-url {
    margin-left: 0.5em;
  }
  .toolbar-expand-button {
    display: none;
  }
  .mobile-only {
    display: none;
  }
}

/* images counter */
.main-container {
	counter-reset: images-selected images-total;
}
.tab-container .image-container {
	counter-reset: images-tab-selected images-tab-total;
}
.image-checkbox {
	counter-increment: images-total images-tab-total;
}
.image-checkbox.checked:not(.disabled) {
	counter-increment: images-total images-selected images-tab-total images-tab-selected;
}
.save::after {
	content: " (" counter(images-selected) "/" counter(images-total) ")";
}
.tab-image-counter {
	position: absolute;
	top: -2.5px;
	left: 1em;
	background: white;
	border: 1px solid var(--main-border);
	padding: 0.1em 0.6em;
	font-family: monospace;
	transform: translateY(-50%);
}
.tab-image-counter::before {
	content: counter(images-tab-selected) "/" counter(images-tab-total);
}

/* tab container */
.tab-container {
	margin: 0;
	padding: 0;
}
.tab-container .image-container {
	margin: 1.4em 1em;
	padding: 0.5em;
	border: 5px dashed var(--main-border);
	position: relative;
}

/* dark mode */
@media (prefers-color-scheme: dark) {
  .toolbar {
    background: var(--c-bg);
    border-color: var(--c-text-d2);
  }
}
