@import "./classic.css";
@import "../../lib/os-gui/blue.css";
@import url('https://fonts.googleapis.com/css?family=Charm|Princess+Sofia&display=swap');

:root {
	--theme-loaded: "winter.css";
}

/* Advent calendar-style tool buttons that flip to reveal thematic pixel art for each tool */
/* .tool-icon::before is a flap, and .tool-icon::after is an icon visible on the front of the flap, showing the classic theme's icons for usability */
/* The .tool-icon is used to show the revealed thematic icon. */
.tool-icon,
.tool-icon.use-svg { /* specificity needed for overriding classic theme; SVG is not supported yet for this theme */
	background-image: url("../../images/winter/tools.png");
	background-repeat: no-repeat;
	background-position: calc(-16px * var(--icon-index)) 0;
}
/* .tool-icon.use-svg {
	background-image: url("../../images/winter/tools.svg");
	background-position: calc(-16px * (var(--icon-index) * 2 + 1)) -16px;
} */
.tool-icon::before,
.tool-icon::after {
	content: " ";
	position: absolute;
	--border-width: 3px;
	/* inset doesn't have enough browser support for me */
	top: calc(-1 * var(--border-width));
	left: calc(-1 * var(--border-width));
	right: calc(-1 * var(--border-width));
	bottom: calc(-1 * var(--border-width));
	border-top: var(--border-width) solid var(--ButtonHilight);
	border-left: var(--border-width) solid var(--ButtonHilight);
	border-right: var(--border-width) solid var(--ButtonShadow);
	border-bottom: var(--border-width) solid var(--ButtonShadow);
	--transition-duration: 0.2s;
	transition: transform var(--transition-duration) ease-in-out;
	transform-origin: left;
	--side: -1;
}
.tool-icon::after {
	z-index: 3;
	background-image: url("../../images/classic/tools.png");
	background-repeat: no-repeat;
	background-position: calc(-16px * var(--icon-index)) 0;
	backface-visibility: hidden;
}
.tool-icon.use-svg::after {
	background-image: url("../../images/classic/tools.svg");
	background-position: calc(-16px * (var(--icon-index) * 2 + 1)) -16px;
}

.tool .tool-icon::before {
	border-width: 1px;
	background: linear-gradient(var(--gradient-direction), var(--ButtonFace), var(--ButtonShadow) 190%);
	background-position: 20px 0; /* starting gradient not visible */
	background-repeat: no-repeat; /* mustn't wrap to be invisible */
	background-color: var(--ButtonFace);
	transition: transform var(--transition-duration) ease-in-out, background-position var(--transition-duration) ease-in-out;
	z-index: 2;
	--gradient-direction: to left;
}
.tool.selected .tool-icon::before,
.tool.selected .tool-icon::after {
	transform: rotateY(calc(120deg * var(--side))) skewY(calc(-20deg * var(--side)));
}
.tool.selected .tool-icon::before {
	background-position: 0% 0% !important; /* !important to override .tool:nth-child(2n+1) .tool-icon::before */
}

.tool:nth-child(2n) .tool-icon::before,
.tool:nth-child(2n) .tool-icon::after {
	--side: 1;
	transform-origin: right;
	--gradient-direction: to right;
}
.tool:nth-child(2n+1) .tool-icon::before {
	background-position: -20px 0; /* opposite for transition to work right */
}

/* Fancy cursive menus */
.menus * {
	font-family: 'Princess Sofia', cursive;
	font-size: 20px;
}
.menu-button {
	padding: 5px 10px;
	height: 30px;
}
.menu-popup * {
	font-family: 'Charm', cursive;
	font-size: 18px;
}

/* Fanciful snow flakes for hotkey highlighting */
@supports (mix-blend-mode: overlay) {
	.menu-hotkey {
		text-decoration: none;
		position: relative;
	}
	.menu-hotkey::after {
		/* content: "❄️"; */
		/* font-size: 20px; */
		/* color: #fff; */
		content: "";
		width: 1em;
		height: 1em;
		/* Noto Color Emoji snowflake, brightened a bit. Original fill: #95c7ec */
		/* Source: https://github.com/googlefonts/noto-emoji/blob/9a5261d871451f9b5183c93483cbd68ed916b1e9/svg/emoji_u2744.svg */
		/* spell-checker: disable */
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E%3Cpath style='fill:%23aad1ef' d='m70 51-1-19s10-5 12-8 1-9-1-10c-2 0-11 7-12 6s4-6 4-8l-7-7-8 8s3 7 2 8-10-6-12-6c-3 1-2 5-1 7s15 9 15 9l-1 20h-3l-2 3-15-9-1-18c0-2-4-3-5-3l-4 16-6-10-9 2 3 12 10 2-12 14s3 3 6 2l11-8 16 8v3l1 1-16 9c-1 0-10-7-13-7s-5 4-5 4l12 9-10 5-4 9 11 3c2 0 4-8 5-9l1 2s3 11 5 11 4-3 5-4-1-15-1-15l15-8 2 2 4 1v17s-16 7-17 9l1 7 14-5v9s6 9 8 8l6-8-5-9c1 0 10 7 12 6 2 0 3-2 3-4S70 96 70 96V78l3-1 3-4 15 11 1 18 6 2 1-16 7 6 10-2-3-9c-1-2-8-1-8-1-1-1 11-5 11-7s-4-5-5-6l-15 7-17-10 1-2-1-2 17-10s15 6 16 5l3-3-12-7h9l5-10-12-3-5 6-1-13h-6l-2 18-16 9-2-3h-3z'/%3E%3Cpath style='fill:%23afe3ff' d='m76 56 19-10V26l-5 3-1 14-16 9 3 4zM99 44l8-8c2-1 9 2 9 2l1-3c-1-1-10-5-12-4s-5 7-5 7l-1 6zM99 51l-4 2s10 6 13 6 6-3 6-3h-5l-10-5zM77 70l-2 5 14 9s-1 15 1 17l4 2 1-22-18-11zM95 75s9-7 12-7 5 2 5 2l-13 7-4-2zM100 85l-1 4s3 8 6 8c2 1 10-2 11-3v-4s-7 3-9 2c-3 0-7-7-7-7zM59 55l-5 8c0 1 4 9 6 10h10l4-9-4-9H59zM63 22l-2-9 6-6-3-3c-2 0-9 6-9 8l4 9 4 1zM45 19s0 4 2 6c1 2 11 7 11 7l1 19h4V29l-10-5-8-5zM40 48l13 8 2-3-15-9zM30 40l3 3c2-1 2-19 2-19s-3-1-4 0l-1 16zM29 44c2 1 2 3 1 4L17 61s-3-1-3-3l11-11s-8 2-10 0l-4-14 5-1 2 11 11 1zM50 66l-16 9 4 3 14-9zM31 81l-6 4h-6l-4 10-3-1c-1-1 3-11 4-13h9l-10-7c-1-2 3-4 3-4s14 9 13 11zM33 86l-3 3 2 13h4l-3-16zM59 78v15l-14 9-1 5 19-10V78h-4zM83 109l-13-9v-6l12 10 1 5zM60 114l8 8-4 2c-1 0-9-7-9-9l4-9 3-1-2 9z'/%3E%3Cpath style='fill:%23fefefe' d='m71 62-2 4-1 4h-7c-2 0-3 4 0 4l10-1 5-10c0-2-4-7-6-8-1-2-4 0-2 3l3 4zM93 30c-2 0-2 3-2 6s1 6 3 6 1-5 1-7 1-5-2-5zM64 8c1 1-1 3-1 4-1 0-3 2-5 0s1-3 2-4h4zM63 28c-2 0-2 5-2 11 0 8 0 12 2 12s1-4 1-13c0-4 1-10-1-10zM15 33c-3 1-2 4-1 7 1 1 2 6 5 5 2-1 1-5 0-7 0-2-2-6-4-5zM92 90l-1 5 1 5c2 0 2-4 2-5 0-2 0-5-2-5zM63 78l-1 9c0 6-1 10 1 10 2-1 2-7 2-11s0-8-2-8zM37 78c1 1 5-2 8-3 4-2 8-4 7-6s-5 1-8 3c-3 1-8 4-7 6zM25 86l-5 1-2 4c-2 1-3-1-2-3 0-3 1-4 2-5l5-1c2 0 3 3 2 4z'/%3E%3C/svg%3E");
		/* spell-checker: enable */
		background-repeat: no-repeat;
		overflow: hidden;
		position: absolute;
		mix-blend-mode: overlay;
		left: 50%;
		bottom: 0.1em;
		transform: translateX(-50%);
		--base-transform: translateX(-50%);
		transform-origin: center;
		transition: width 0.2s ease-in-out, height 0.2s ease-in-out, bottom 0.2s ease-in-out, opacity 0.2s ease-in-out;
	}
	[aria-disabled=true] .menu-hotkey::after {
		opacity: 0.7;
		--is-disabled: 1;
	}
	/* This might obscure the purpose of the snowflake indicators, but it's fun. */
	.menu-button:hover .menu-hotkey::after,
	.highlight:not(.menu-button[aria-expanded="true"]) .menu-hotkey::after {
		animation: rotate-snowflake calc(4s + 6s * var(--is-disabled, 0)) linear infinite;
		opacity: calc(0.5 - 0.3 * var(--is-disabled, 0));
		width: 2em;
		height: 2em;
		bottom: -0.4em;
	}
	@keyframes rotate-snowflake {
		from {
			transform: var(--base-transform) rotate(0deg);
		}
		to {
			transform: var(--base-transform) rotate(360deg);
		}
	}
	/* This might clarify the purpose of the indicators, by asserting that "yes, this letter specifically is special" */
	.menu-button:not([aria-disabled=true]).highlight .menu-hotkey,
	.menu-item:not([aria-disabled=true]).highlight .menu-hotkey {
		color: red;
	}
}

/* a button to leave the Winter theme */
button.grinch-button {
	position: absolute;
	bottom: 0px;
	right: 0px;
	width: 100px;
	height: 179px;
	z-index: 2;
	background-image: url("../../images/winter/grinch-smile-spritesheet.png");
	border: 0;
	background-color: transparent;
	cursor: pointer;
}
