/******************************************************************************
 *                                                                            *
 *    This file is part of RPB Chessboard, a WordPress plugin.                *
 *    Copyright (C) 2013-2020  Yoann Le Montagner <yo35 -at- melix.net>       *
 *                                                                            *
 *    This program is free software: you can redistribute it and/or modify    *
 *    it under the terms of the GNU General Public License as published by    *
 *    the Free Software Foundation, either version 3 of the License, or       *
 *    (at your option) any later version.                                     *
 *                                                                            *
 *    This program is distributed in the hope that it will be useful,         *
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 *    GNU General Public License for more details.                            *
 *                                                                            *
 *    You should have received a copy of the GNU General Public License       *
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 *                                                                            *
 ******************************************************************************/



/******************************************************************************/
/*** Parsing error box ***/

.rpbui-chessgame-error {
	text-align: left;
	font-family: sans-serif;
	font-size: 12px;
	line-height: 1.3em;
	color: #800;
	background-color: #fdd;
	border: solid 1px #c00;
	padding: 0.75em;
}

.rpbui-chessgame-errorTitle {
	font-weight: bold;
	font-style: italic;
}

.rpbui-chessgame-errorMessage,
.rpbui-chessgame-errorAt,
.rpbui-chessgame-errorAtCode {
	margin-top: 0.4em;
}

.rpbui-chessgame-errorAtCode {
	white-space: pre-wrap;
	font-family: monospace;
	line-height: 1.5em;
	color: #400;
	border: solid 1px #aa0;
	background-color: #ffd;
	padding: 0.75em 1em 0.15em;
}



/******************************************************************************/
/*** PGN headers ***/

.rpbui-chessgame-colorTag {
	width : 1.2em;
	height: 1.2em;
	vertical-align: middle;
	display: inline-block;
	border: 1px solid black;
	margin-right: 0.25em;
}

.rpbui-chessgame-whitePlayer .rpbui-chessgame-colorTag {
	background-color: white;
}

.rpbui-chessgame-blackPlayer .rpbui-chessgame-colorTag {
	background-color: black;
}

.rpbui-chessgame-titleRatingGroup:before,
.rpbui-chessgame-round:before {
	content: "\a0("; /* \a0 == &nbsp; */
}

.rpbui-chessgame-titleRatingGroup:after,
.rpbui-chessgame-round:after {
	content: ")";
}

.rpbui-chessgame-playerTitle + .rpbui-chessgame-playerRating:before {
	content: "\a0"; /* \a0 == &nbsp; */
}

.rpbui-chessgame-round,
.rpbui-chessgame-annotator {
	font-style: italic;
}

.rpbui-chessgame-date + .rpbui-chessgame-site:before {
	content: "\a0\2013\a0"; /* \a0 == &nbsp;   \2013 == &ndash; */
}



/******************************************************************************/
/*** PGN body ***/

.rpbui-chessgame-move {
	font-weight: bold;
	display: inline-block;
	padding-left : 1px;
	padding-right: 1px;
}

.rpbui-chessgame-focusFieldContainer {
	position: fixed;
	bottom: 0px;
	right: 0px;
	width: 0px;
	height: 0px;
	overflow: hidden;
}

.rpbui-chessgame-focusField {
	opacity: 0;
}

.rpbui-chessgame-initialMove,
.rpbui-chessgame-moveNumber.rpbui-chessgame-hidden {
	display: none;
}

.ui-dialog-title .rpbui-chessgame-moveNumber.rpbui-chessgame-hidden {
	display: inline;
}

.rpbui-chessgame-clickableMoves .rpbui-chessgame-move:hover {
	text-decoration: underline;
	cursor: pointer;
}

.rpbui-chessgame-subVariation .rpbui-chessgame-move {
	font-weight: inherit;
}

span.rpbui-chessgame-variation:before {
	content: "(";
}

span.rpbui-chessgame-variation:after {
	content: ")";
}

.rpbui-chessgame-result {
	font-weight: bold;
}

span.rpbui-chessgame-move,
span.rpbui-chessgame-comment,
span.rpbui-chessgame-variation {
	margin-right: 0.4em;
}

span.rpbui-chessgame-move:last-child,
span.rpbui-chessgame-comment:last-child,
span.rpbui-chessgame-variation:last-child {
	margin-right: 0px;
}

div.rpbui-chessgame-subVariation {
	position: relative;
	left: 1.5em;
	width: calc(100% - 1.5em);
}

.rpbui-chessgame-alphaFont  { font-family: "Chess Alpha" , sans-serif; }
.rpbui-chessgame-meridaFont { font-family: "Chess Merida", sans-serif; }
.rpbui-chessgame-piratFont  { font-family: "Chess Pirat" , sans-serif; }



/******************************************************************************/
/*** Vertical spacing ***/

.rpbui-chessgame-headers > div {
	margin-bottom: 0.25em;
}

div.rpbui-chessgame-variation > div {
	margin-bottom: 0.5em;
}

.rpbui-chessgame-headers > div:last-child,
div.rpbui-chessgame-variation > div:last-child {
	margin-bottom: 0px;
}

.rpbui-chessgame-headers + .rpbui-chessgame-body {
	margin-top: 0.25em;
}

.rpbui-chessgame-headers + .rpbui-chessgame-body.rpbui-chessgame-moreSpace {
	margin-top: 0.5em;
}



/******************************************************************************/
/*** Navigation board ***/

.rpbui-chessgame-navigationBox.rpbui-chessgame-above,
.rpbui-chessgame-navigationBox.rpbui-chessgame-floatLeft,
.rpbui-chessgame-navigationBox.rpbui-chessgame-floatRight {
	margin-bottom: 0.5em;
}

.rpbui-chessgame-navigationBox.rpbui-chessgame-below {
	margin-top: 0.5em;
}

.rpbui-chessgame-navigationBox.rpbui-chessgame-floatLeft {
	float: left;
	margin-right: 0.5em;
}

.rpbui-chessgame-navigationBox.rpbui-chessgame-floatRight {
	float: right;
	margin-left: 0.5em;
}

.rpbui-chessgame-clearLeft {
	clear: left;
}

.rpbui-chessgame-clearRight {
	clear: right;
}

.rpbui-chessgame-scrollBox {
	display: flex;
	display: -webkit-flex;
	flex-direction: row;
	-webkit-flex-direction: row;
	align-items: flex-start;
	align-items: -webkit-flex-start;
}

.rpbui-chessgame-navigationBox.rpbui-chessgame-scrollLeft {
	margin-right: 0.5em;
}

.rpbui-chessgame-navigationBox.rpbui-chessgame-scrollRight {
	margin-left: 0.5em;
}

@media all and (max-width:480px) {
	.rpbui-chessgame-scrollBox {
		flex-direction: column;
		-webkit-flex-direction: column;
	}
	.rpbui-chessgame-navigationBox.rpbui-chessgame-scrollLeft {
		margin-right: 0em;
		margin-bottom: 0.75em;
	}
	.rpbui-chessgame-navigationBox.rpbui-chessgame-scrollRight {
		margin-left: 0em;
		margin-top: 0.75em;
	}
}

.rpbui-chessgame-scrollArea {
	overflow-y: auto;
}

.rpbui-chessgame-navigationButtons {
	text-align: center;
	margin-top: 0.75em;
}

.rpbui-chessgame-navigationButtons .ui-button {
	border-radius: 0px;
	-webkit-box-shadow: none;
	box-shadow: none;
	margin-left: 0px;
	margin-right: 0px;
	height: 28px;
	width: 36px;
}

.rpbui-chessgame-navigationButtons .ui-button:first-child,
.rpbui-chessgame-navigationButtons .ui-button.rpbui-chessgame-spaceAfter + .ui-button {
	border-top-left-radius: 4px;
	border-bottom-left-radius: 4px;
}

.rpbui-chessgame-navigationButtons .ui-button:last-child,
.rpbui-chessgame-navigationButtons .ui-button.rpbui-chessgame-spaceAfter {
	border-top-right-radius: 4px;
	border-bottom-right-radius: 4px;
}

.rpbui-chessgame-navigationButtons .ui-button.rpbui-chessgame-spaceAfter + .ui-button {
	margin-left: 6px;
}

.rpbui-chessgame-blobDownloadLink {
	display: none;
}

#rpbui-chessgame-navigationFrame {
	box-sizing: content-box;
	-moz-box-sizing: content-box;
	-webkit-box-sizing: content-box;
}



/******************************************************************************/
/*** Diagrams ***/

.rpbui-chessgame-diagramAnchor {
	display: none;
}

.rpbui-chessgame-body .rpbui-chessgame-comment .rpbui-chessgame-diagram {
	margin-top   : 0.25em;
	margin-bottom: 0.25em;
}

.rpbui-chessgame-body.rpbui-chessgame-moreSpace .rpbui-chessgame-comment .rpbui-chessgame-diagram {
	margin-top   : 0.5em;
	margin-bottom: 0.5em;
}
