@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/*===============================================================================*/
/* Fixed Header */
/*-------------------------------------------------------------------------------*/

:root {
	--table-row-height: 100px;
	--table-image-height: 100px;
	--table-row-padding: 0.45rem;
	--table-notes-height: 60px;
	--table-people-height: 35px;
	--table-heading-width: 25%;

	--grid-image-min-width: 18%;
	--grid-image-max-width: 30.5;
	--grid-image-height: 42hv;
}

.table-hand-cursor {
	cursor: url(png/OpenImage.png) 7 2, auto;
	/*cursor: url(png/Hand.png) 11 3, auto;*/
}

.table-hand-cursor:hover img {
	width: 100%;
	height: 100%;
	-webkit-transform: scale(3); /* Safari, Chrome and Edge */
	-moz-transform: scale(3); /* Firefox */
	-ms-transform: scale(3); /* IE 9 */
	-o-transform: scale(3); /* Opera */
	transform: scale(3);
	z-index: 2;
}

thead th.db {
	position: sticky;
	top: 0;
	/*background-color: RGB(27, 110, 194);*/
	color: #fff;
	padding: 6px;
	z-index: 2;
	min-height: 40px;
	height: 40px;
}

th.db {
	outline: 1px solid #ccc;
}

td.db {
	border: 1px solid #ddd;		/* The outline creates a double line so use border instead. */
	padding: var(--table-row-padding);
}

tr.db {
	min-height: 25px;
	height: 25px;
}

/*.table-striped.table-hover > tbody > tr.db:hover > td.db {
	background-color: #ecf3f8;
}
*/
.col-id-no {
	position: sticky;
	left: 0;
}

.col-first-name {
	position: sticky;
	left: 80px;
}

.fixed-header {
	z-index: 11;
}

tr.db:nth-child(even) {
}

tr.db:nth-child(even) td.db[scope=row] {
}

tr.db:nth-child(odd) td.db[scope=row] {
}

tr.db:current {
}

/*-------------------------------------------------------------------------------*/

.sort-th {
	cursor: pointer;
}

.fa {
	float: right;
}

.row-select {
	cursor: pointer;
}

.db-container {
	width: 100%;
	margin-left: var(--side-margin);
	margin-right: var(--side-margin);
}

/*-------------------------------------------------------------------------------*/

.tbl-sml {
	--table-row-height: 40px;
	--table-image-height: 40px;
	--table-row-padding: 0.25rem;
}

.tbl-med {
	--table-row-height: 75px;
	--table-image-height: 75px;
	--table-row-padding: 0.25rem;
}

.tbl-default {
	--table-row-height: 100px;
	--table-image-height: 100px;
	--table-row-padding: 0.45rem;
}

.tbl-img {
	width: auto;
	height: var(--table-image-height);
	border: solid 1px gray;
}

.td-db-text img {
	transition: transform 0.1s ease-in-out;
}

.td-db-text img:hover {
	transform: scale(1.03); /* 103% zoom */
	overflow: scroll;
}

/*-------------------------------------------------------------------------------*/

.grid-sml {
	--grid-image-min-width: 10%;
	--grid-image-max-width: 10.5%;
	--grid-image-image-height: 65%;
	--grid-image-height: 21vh;
}

.grid-med {
	--grid-image-min-width: 14%;
	--grid-image-max-width: 14.5%;
	--grid-image-image-height: 75%;
	--grid-image-height: 28.25vh;
}

.grid-default {
	--grid-image-min-width: 18%;
	--grid-image-max-width: 18.5%;
	--grid-image-image-height: 85%;
	--grid-image-height: 42.8vh;
}

.grid-img {
	min-width: var(--grid-image-min-width);
	max-width: var(--grid-image-max-width);
	height: var(--grid-image-height);
	background-color: var(--sidepanel-background-colour);
}

.grid-img img {
	transition: transform 0.1s ease-in-out;
	width: 90%;
	height: var(--grid-image-image-height);
	object-fit: contain;
	border: 1px solid gray;
}

.grid-img img:hover {
	transform: scale(1.03); /* 103% zoom */
	overflow: scroll;
}

.grid-img-text {
	text-align: center;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
}

.grid-centre {
	display: block;
	margin-left: auto;
	margin-right: auto;
	margin-top: auto;
	margin-bottom: auto;
}

.tbl-big-text {
	height: var(--table-row-height);
	min-width: 200px;
	overflow: auto;
}

.cross-ref-img {
	width: auto;
	height: calc(var(--table-image-height) / 2);
	border: solid 1px gray;
}

/*-------------------------------------------------------------------------------*/

td.census-table {
	width: 50%;
	padding-top: 0px;
	padding-bottom: 0px;
	padding-left: 4px;
	border-style: solid;
	border-width: 1px; /* Grid lines. */
	border-color: #cccccc;
}

/*===============================================================================*/
/* Stacked items. */
/*-------------------------------------------------------------------------------*/

@media only screen and (max-width: 640px) {
	/*@media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) {*/

	.grid-default {
		--grid-image-max-width: 100%;
	}

	.tbl-default {
		--table-row-padding: 0.75rem;
	}

	/* Force table to not be like tables anymore */
	table, thead, tbody, th.db, td.db {
		display: block;
		/*counter-reset: nRowNumber; // For info - using a variable */
		border-width: 0px;
	}

	table, tr.db {
		display: initial;
		position: relative;
		/*counter-increment: nRowNumber; // For info - using a variable */
	}

	/* Hide table headers (but not display: none;, for accessibility) */
	thead tr.db {
		position: absolute;
		top: -9999px;
		left: -9999px;
		height: 0px;
	}

	td.db {
		/* Behave  like a "row" */
		border: none;
		border-left: 1px solid #cccccc;
		border-right: 1px solid #cccccc;
		border-bottom: 1px solid #cccccc; /* Grid lines. */
		position: relative;
		top: 2px;
	}

	td.db::before {
		/* Now like a table header */
		position: absolute;
		/* Top/left values mimic padding */
		top: 0px;
		left: 6px;
		width: 45%;
		padding-right: 10px;
		white-space: nowrap; /* Crop any overflowing text. */
	}

	.table-responsive-lg {
		overflow-x: unset; /* Remove the horizontal scroll bar. */
	}

	.td-db-text {
		top: 0px;
		left: var(--table-heading-width);
		position: absolute;
		white-space: nowrap; /* Crop any overflowing text. */
	}

	tr.db:nth-child(odd) > td.db { /* Set the child of this row. */
		background-color: #e2e2e2; /* Set the striped colour. */
	}

	/* Label and position the data */
	/*--------------------*/
	td.db:nth-of-type(1) {
		height: 150px;
	}

		td.db:nth-of-type(1) .tbl-img { /* Set the image of this row. */
			margin-top: 4px; /* The space above the image. */
			height: 140px;
		}

		td.db:nth-of-type(1):before {
			content: "Image";
			margin-top: -1px; /* The space about the 'Image' label. */
		}
	/*--------------------*/
	td.db:nth-of-type(2):before {
		content: "Cat No";
	}

	td.db:nth-of-type(3):before {
		content: "Title";
	}

	td.db:nth-of-type(3) {
		white-space: nowrap;
		overflow: hidden;
	}

	td.db:nth-of-type(4):before {
		content: "Subject";
	}

	td.db:nth-of-type(5):before {
		content: "Date";
	}

	td.db:nth-of-type(6):before {
		content: "Place";
	}
	/*--------------------*/
	tr.db:nth-of-type(7) {
		height: var(--table-notes-height);
	}

	td.db:nth-of-type(7) {
		height: var(--table-notes-height);
		white-space: unset; /* Allow the text to overflow utilising the scrollable window. */
	}

	td.db:nth-of-type(7) .tbl-big-text {
		height: var(--table-notes-height);
		white-space: unset; /* Allow the text to overflow utilising the scrollable window. */
	}

	td.db:nth-of-type(7):before {
		content: "Notes";
	}
	/*--------------------*/
	tr.db:nth-of-type(8) {
		height: var(--table-people-height);
	}

	td.db:nth-of-type(8) {
		height: var(--table-people-height);
		white-space: unset; /* Allow the text to overflow utilising the scrollable window. */
	}

	td.db:nth-of-type(8) .tbl-big-text {
		height: var(--table-people-height);
		white-space: unset; /* Allow the text to overflow utilising the scrollable window. */
	}

	td.db:nth-of-type(8):before {
		content: "People";
	}
	/*--------------------*/
	td.db:nth-of-type(9):before {
		content: "Source";
	}

	td.db:nth-of-type(9) {
		white-space: nowrap;
		overflow: hidden;
	}

	/*-------------------------------------------------------------------------------*/

	.census-table-group {
		width: calc(100% - var(--table-heading-width));
	}

	tr.census-table {
		display: flex;
	}

	td.census-table {
		width: 100%;
		border: none;
		/*border-left: 1px solid #cccccc;*/
		border-bottom: 1px solid #cccccc; /* Grid lines. */
	}

	td.census-table > div.td-data {
		/*padding-left: 4px;*/
	}
}

/*===============================================================================*/
/* Lists */
/*-------------------------------------------------------------------------------*/

.edt-selected {
	border: solid;
	border-width: 1px;
	border-color: var(--table-edt-border-colour);
	height: fit-content;
}

table.edt-list {
	width: 100%;
}

tbody.edt-list {
	overflow-y: auto;
	height: 26px;
}

td.edt-list {
	width: 50%;
	padding-left: 5px;
	padding-right: 1px;
	border: 1px solid var(--table-edt-border-colour);
	text-overflow: ellipsis;
	overflow: hidden;
}

td.edt-list.setting {
	padding-left: 0px;
	/*position:relative;*/
}

/*.tbl-test {
	background-color: red;
}
*/
/*td.edt-list.setting:hover span.tbl-tool-tip {
	display: block;*/
	/*background-color: orange;*/
/*}*/
/*.edt-list:hover span.tool-tip {
	display: block;
}
*/
/*.edt-list.setting:hover span.tool-tip {
	display: block;
}
*/
/*.tbl-setting:hover span.tool-tip {
	display: block;
}

	<td class="tbl-setting" style="width: 30px">
*/
tbody.edt {
	height: var(--table-edt-row-height);
}

td.edt {
	width: 100%;
}

tr.edt {
	height: var(--table-edt-row-height);
	border: 1px solid var(--table-edt-border-colour);
}

td.edt {
	width: 110px; /* was 36% */
	padding-left: 5px;
	padding-right: 5px;
	border: 1px solid var(--table-edt-border-colour);
	background-color: var(--table-edt-label-background-colour);
}

td.edt-sub-table {
	overflow-y: auto;
	height: var(--edit-sub-table-height);
	display: block;
}

td.edt-show-list {
	width: 50%;
	padding-left: 5px;
	padding-right: 5px;
	border: 1px solid var(--table-edt-border-colour);
}

tr.edt.name {
/*	width: 270px;
	display: block;
*/
}

td.edt.name {
	width: var(--edit-label-width); /* was 25% */
}

td.edt.empty {
	width: var(--edit-label-width); /* was 25% */
	height: 29px;
}

td.edt.people {
	width: 80px; /* was 25% */
}

td.edt.place {
	width: var(--edit-label-width); /* was 22% */
}

td.edt.lived-at {
	width: var(--edit-label-width);
	height: 29px;
}

td.edt.button {
	width: 30px; /* was 9% */
	padding-left: 1px;
	padding-right: 1px;
	background-color: var(--table-edt-background-colour);
}

input.edt.date {
	width: 150px;
	height: 24px;
	margin-top: 1px;
	margin-right: 1px;
	margin-left: 1px;
	padding: 3px 10px 4px 4px;
	border: 0px;
}

select.edt,
input.edt {
	display: block;
	width: 100%;
	height: var(--table-edt-row-height);
	padding: 0rem 6px;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--table-edt-control-colour);
	background-color: var(--table-edt-background-colour);
	background-clip: padding-box;
	border: 0px;
	border-radius: 0;
	transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out
}

	select.edt:focus {
		border: 0px;
		outline: 3px solid var(--table-edt-focus-colour);
	}

	/*select.edt:focus-within {
		border: 0px;*/
		/*outline: 3px solid #68adf6cc;*/
	/*}

	select.edt:valid.modified {
		border: 0px;*/
		/*outline: 3px solid #68adf6cc;*/
	/*}*/

	input.edt:focus {
		border: 0px;
		outline: 3px solid var(--table-edt-focus-colour);
	}

label.edt {
	margin-bottom: 0px;
	white-space: break-spaces;
}

label.edt.date {
	width: 95px;
}

td.edt.date {
	display: flex;
	padding-left: 0px;
	padding-right: 0px;
	width: 210px;
	border: 0px;
	/*border-left: 1px solid var(--table-edt-border-colour);*/
	background-color: var(--table-edt-background-colour);
}

td.edt.checks {
	width: 165px; /* was 82% */
	height: 29px;
}

/*td.circa,*/
span.circa {
	margin-left: 2px;
	padding-left: 5px;
	padding-right: 5px;
	background-color: var(--table-edt-background-colour);
}

span.checkbox {
	padding-left: 5px;
	padding-right: 5px;
	background-color: var(--table-edt-background-colour);
	position: relative;
	top: 0px;
}

.circa.checkbox {
	padding-left: 5px;
	padding-right: 5px;
	background-color: var(--table-edt-background-colour);
	position: relative;
	top: 2px;
}

/*-------------------------------------------------------------------------------*/

@media only screen and (max-width: 640px) {

	tbody.edt {
		all: unset;
	}

	table.edt {
		height: 100%;
	}

	tr.edt, td.edt {
		height: 37px;
	}

	.db-container {
		width: 100%;
		position: relative;
		overflow-x: hidden;
		overflow-y: hidden;
	}
}
