@import url('style/weathericons.css');

html {
	--color: #FFF;
	--background: #000;
	--a-color: hsl(var(--hihue), 100%, 80%);
	--b-color: hsl(var(--hihue), 100%, 33%);
	--a-background: hsl(var(--hihue), 100%, 15%);
	--label-color: #DC8;
	--small-opacity: .5;
	--pin-color: red;

	font: 30px "DejaVu Sans", "Noto Emoji", Verdana, sans-serif;
	font-variant-numeric: tabular-nums slashed-zero;
	background: var(--background);
	color: var(--color);
}
.bright {
	--color: #000;
	--background: #FFF;
	--a-color: hsl(var(--hihue), 100%, 20%);
	--label-color: hsl(120, 25%, 33%);
}
a {
	color: var(--color);
	text-decoration: none;
}

body {
	margin: 0;
}
body {
	display: grid;
	grid: auto / 22em 1fr;
	align-items: start;
	align-content: start;
	justify-content: space-between;
	grid-gap: 2ex;
	grid-auto-flow: row;
	height: 100vh;
}
.widget {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100vh;
	max-width: 100vw;
}
article + article {
	margin-top: 2ex;
}
article.clock p+* {
	font-size: 125%;
}
article:last-child {
	-overflow: hidden;
}

.unit {
	opacity: var(--small-opacity);
	margin-left: .15em;
}
.label, label {
	color: var(--label-color);
}
label {
	min-width: 1em;
	display: inline-block;
	text-align: center;
	vertical-align: text-bottom;
}
img {
	vertical-align: middle;
}

small {
	font-size: smaller; /* ~75% but less if nested */
}
.big small {
	font-size: 66.7%; /* smaller like ff */
}
big,
.big {
	font-weight: bold;
	font-size: 200%;
}
.icon {
	font-weight: normal;
	display: inline-block;
	vertical-align: middle;
}
.time {
	-webkit-text-stroke: .02em #888;
	color: #CCC;
}
.pri.big {
	font-size: 600%;
	font-weight: bold;
}
.bold, b {
	color: var(--a-color);
}
.big b,
.big.bold {
	-webkit-text-stroke: 3px var(--a-color);
	color: var(--b-color);
}

.widget ul {
	list-style: none;
	margin: auto;
	padding: 0;
	overflow: hidden;
}
.clock,
.weather {
	text-align: center;
}
.nobr {
	white-space: nowrap;
}
.inline li {
	display: inline-block;
	margin: 0 .3em 0 0;
}
.inline li[hidden] {
	display: none; /* hide inline */
}
article.weather {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}
.inline {
	display: contents; /* parent flex */
}
.inline > :last-child {
	flex-grow: 1;
}

h1 {
	text-align: center;
	text-transform: uppercase;
}
h1 a {
	border-bottom: 1px solid var(--b-color);
	padding: 0 1em;
}
h1, h2 {
	margin: 0 0 1ex;
	font-size: 150%;
}
* + h2 {
	margin-top: 2ex;
}
ul,
p {
	margin: 0;
	padding: 0;
}
s {
	opacity: .67;
}

@font-face {
	font-family: 'dashicons';
	src: url('style/dashicons.woff2') format('woff2');
}
.icon,
label {
	font-family: "dashicons", "Noto Emoji";
}
.dir,
label.sunset {
	transform: scale(1, -1);
	display: inline-block; /* for transform */
}

.wi {
	fill: #FFF;
	fill-opacity: .8;
	stroke: none;
	text-anchor: middle;
}
.hourly {
	margin-top: 2ex;
}

.favicon {
	margin-right: .1em;
	height: 2ex;
	width: auto;
	max-width: 2ex;
	object-fit: contain;
	vertical-align: -.3ex;
}
.dark .favicon.dark {
	filter: invert(100%) hue-rotate(180deg) brightness(80%) saturate(250%);
}
h1 img {
	height: 1.5em;
	box-sizing: border-box;
}
h1 .favicon {
	float: left;
}
h1 .right {
	float: right;
	padding: .1em 0 .4em .5em;
}
h1.right {
	position: absolute;
	right: .2em;
}

.ping {
	display: flex;
	justify-content: space-evenly;
	gap: 0 .8em;
}
.ping li {
	text-align: center;
}
.ping.right {
	display: block;
	float: right;
	margin-left: 1em;
}
.ping span {
	margin-left: .1em;
}
.ping.right span {
	display: inline-block;
	min-width: 3.5em;
	text-align: right;
}
.ping .status.error {
	color: #F80;
}

::view-transition-image-pair(root) {
	animation-duration: 2s;
}

@media (orientation: landscape) and (min-width: 96em) {
	.wotd.right {
		float: right;
		width: 20em;
		margin: 0 0 1em 1em;
	}
}
.w-wotd {
	overflow: hidden;
}
figure {
	position: relative;
	margin: 0;
	height: 100%;
}
figure > img,
.w-wotd img {
	width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
}
.gallery figure {
	min-height: 3em;
}
.crop img,
.crop {
	object-fit: cover;
	height: 100%;
	width: 100%;
	box-sizing: border-box;
}
figcaption {
	font-size: 75%;
	-opacity: var(--small-opacity);
	text-align: center;
	position: absolute;
	top: 0;
	background: #0008;
	box-sizing: border-box;
	padding: 1ex;
	width: 100%;
	transition: opacity 1s;
	hyphens: auto;
	hyphenate-limit-chars: 8 4 3;
	hyphenate-limit-last: always;
}
.cols figcaption,
figure.right > figcaption {
	position: static;
	padding: 1.5ex 0 0;
	opacity: .5;
}
.cols figure {
	display: flex;
	flex-direction: column-reverse;
}
.wotd .fresh figcaption,
.wotd.fresh figcaption {
	opacity: 0;
}

p.gallery {
	text-align: center;
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-gap: 1ex;
}
.gallery .overlay {
	position: absolute;
	right: .3em;
	bottom: .2em;
	width: 1em;
	height: 1em;
	overflow: hidden;
}

.w-radar {
	overflow: hidden;
	width: 100%;
	height: 500px;
	text-align: left;
}
.w-radar > div {
	position: absolute;
	height: 3328px;
	width: 2560px;
	left: -950px;
	top: -1740px;
	transform: scale(.65);
}
.w-radar img {
	position: absolute;
}
.w-radar img:nth-of-type(2) {
	/* cloud overlay right after background map */
	opacity: 0.7;
	transform: translate(804px, 1636px) scale(6.88);
	width: 1058px;
	height: 915px;
}
.w-radar figcaption {
	text-align: left;
	width: auto;
	background: none;
	text-shadow: 0 0 5px #000;
}
.pin {
	position: absolute;
	content: '';
	width: 1em;
	height: 1em;
	margin: -.5em;
	border-radius: 1em;
	background: color-mix(in srgb, var(--pin-color) 75%, transparent);
	box-shadow: 0 0 1em var(--pin-color);
}
.pin.small {
	width: .4em;
	height: .4em;
	margin: -.2em;
}
.pin.small:hover::after {
	position: absolute;
	content: '';
	width: 2em;
	height: 2em;
	margin: -1em;
	border-radius: 2em;
	border: .2em solid color-mix(in srgb, var(--pin-color) 50%, transparent);
}

.w-news > li {
	margin-top: 2ex;
}
.w-news > li > a {
	font-weight: bold;
}
.w-news, .w-news ul {
	display: inline; /* wrap around wotd float */
}
.w-news ul li {
	margin-left: 1.25em;
	margin-top: .5ex;
	list-style: disc;
	overflow-wrap: anywhere;
}
.w-news b {
	clear: both;
	float: right;
	margin-left: .5em;
}
.w-news b img {
	max-height: 9ex;
	margin-bottom: 0.6ex;
}

.cols,
.gallery {
	text-align: center;
	display: grid;
	grid-gap: 2ex 1ex;
}
.cols > *,
.gallery > * {
	margin: 0;
	display: flex;
	flex-direction: column;
}
ul.gallery li b {
	margin: 0 0 1ex;
}
ul.gallery li b img {
	width: 100%;
	margin: 0;
}
div.gallery figcaption,
ul.gallery li a {
	max-height: 6.2ex;
	overflow: hidden;
	font-size: 75%;
}
.gallery figcaption > .date {
	display: none;
}

.calendar {
	border-collapse: collapse;
	font: inherit; /* not default due to element replacement? */
	margin: 1px; /* workaround overflow bug */
	margin-top: 1ex;
}
.calendar th {
	font-weight: normal;
}
.calendar tr + tr th { /* weekdays */
	font-size: 75%;
	color: #888;
}
.calendar td {
	border: 1px solid #800;
	padding: 0 .2rem;
	text-align: center;
	vertical-align: top;
	line-height: 2rem;
	width: 14%;
}
.calendar td > span { /* day number */
	font-size: 75%;
}
.calendar td:nth-child(6) { /* weekend */
	border-left: 3px double #800;
}
.calendar td:nth-child(3),
.calendar td:nth-child(n+6) {
	background: #F002;
}
.calendar td.today {
	background: #F00A;
	font-size: 200%;
	font-weight: bold;
}
.calendar td.extra {
	opacity: var(--small-opacity);
	border-color: var(--a-background);
	border-width: 1px 0 0 1px; /* previous month, overrides subsequent days */
}
.calendar td.current ~ td.extra {
	border-width: 1px; /* next month */
}
.calendar td ul {
	margin-top: -1ex;
	margin-bottom: 1ex;
}
.calendar td li {
	font-weight: normal;
	text-align: left;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: fade;
	width: 5em;
	margin: 1ex 0 0;
}
.calendar button {
	margin: 1em;
	color: #444;
	background: none;
	border: 0;
}
.calendar .next:before {
	content: '>';
}
.calendar .prev:before {
	content: '<';
}

u {
	text-decoration: underline var(--a-color);
}
.replies small.footer,
footer, .footer {
	font-size: 80%;
	opacity: var(--small-opacity);
}
.footer {
	display: inline-block;
	margin-top: .35ex;
}
footer img {
	vertical-align: -20%;
}
h3 {
	margin: 0;
	font-size: 100%;
	font-weight: normal;
}
.replies dt,
.replies dd,
.w-news p {
	margin: 0;
	overflow: hidden;
}
.page ol,
.page p,
.w-news p {
	margin: .5ex 0;
}
h2 a,
h3 a,
.w-news div > a,
.replies dt a {
	color: var(--a-color);
	margin-right: .8em;
}
.replies a + em {
	margin-left: -.8em;
	margin-right: .8em;
}
.replies small {
	opacity: .8;
}
.replies .right {
	opacity: var(--small-opacity);
}
.replies .right strong {
	font-weight: normal;
	font-style: italic;
	display: inline-block;
}
.replies .right strong:after {
	content: ':';
	opacity: .5;
}
.replies .date {
	float: right;
	margin-left: 1em;
}
.replies img {
	max-height: 15ex;
}
.replies dd {
	margin-bottom: 1ex;
}
.replies dd img {
	float: right;
	margin-left: .4em;
}

.slide {
	display: grid;
	align-items: center;
	justify-items: center;
	text-align: center;
	position: relative;
	view-transition-name: sliding;
}
.slide > * {
	grid-area: 1 / 1;
	margin: 0;
	transition: opacity 1s;
	max-width: 100%;
	max-height: 100%;
	overflow: hidden;
}
.slide > :not(.current) {
	opacity: 0;
	z-index: -1;
}
.slide.debug > :not(.current) {
	opacity: .5;
}
.slide nav {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	font-size: 50%;
	&:hover {
		cursor: pointer;
	}
}

.fit {
	display: grid;
	grid-auto-rows: 1fr;
	margin: 1em;
	gap: 1em;
	overflow: hidden;
}
.fit > * {
	object-fit: contain;
	overflow: hidden;
}

::view-transition-group(sliding) {
	animation-duration: 1s;
}

@media screen and (display-mode: fullscreen) {
	body {
		overflow: hidden;
	}
}

@media (max-width: 80em) and (orientation: landscape) {
	body {
		font-size: 50%
	}
}

@media (orientation: portrait) {
	body {
		grid-template-columns: 1fr; /* no grid */
	}
	.widget {
		height: auto;
	}
}
