/* WXSIM Weather Forecast */

.dfwx {
	--dfwx-ink: #17222b;
	--dfwx-muted: #53606c;
	--dfwx-line: #dce3ea;
	--dfwx-soft: #f3f6f9;
	--dfwx-navy: #004c93;
	--dfwx-blue: #0a62c2;
	--dfwx-warm: #b7410e;
	--dfwx-cool: #1c5fae;
	--dfwx-focus: #0a62c2;
	--dfwx-radius: 14px;

	color: var(--dfwx-ink);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
	max-width: 1100px;
	margin: 0 auto 3rem;
	text-align: left;
}

.dfwx *,
.dfwx *::before,
.dfwx *::after {
	box-sizing: border-box;
}

/* Neutralise theme heading, list and table styles inside the widget. */
.dfwx h2,
.dfwx h3,
.dfwx h4 {
	margin: 0;
	padding: 0;
	border: 0;
	color: inherit;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: normal;
	text-transform: none;
	background: none;
}

.dfwx h2::before,
.dfwx h2::after,
.dfwx h3::before,
.dfwx h3::after,
.dfwx h4::before,
.dfwx h4::after,
.dfwx li::before,
.dfwx li::after {
	content: none;
	display: none;
}

.dfwx p,
.dfwx dl,
.dfwx dd,
.dfwx figure {
	margin: 0;
	padding: 0;
}

.dfwx ul,
.dfwx ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dfwx li {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
}

.dfwx svg {
	max-width: none;
	overflow: visible;
}

.dfwx-icon {
	display: block;
	flex: none;
}

.dfwx-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.dfwx :focus-visible,
.dfwx [tabindex="0"]:focus-visible {
	outline: 3px solid var(--dfwx-focus);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Heading                                                             */
/* ------------------------------------------------------------------ */

.dfwx-head {
	margin-bottom: 1rem;
}

.dfwx .dfwx-head__title {
	font-size: 1.6rem;
	color: var(--dfwx-ink);
}

.dfwx-head__meta {
	margin-top: 0.25rem;
	color: var(--dfwx-muted);
}

.dfwx-notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid #c98400;
	border-radius: 6px;
	background: #fff6e3;
	color: #4d3500;
}

/* ------------------------------------------------------------------ */
/* Current conditions: the panel takes the colour of the sky           */
/* ------------------------------------------------------------------ */

.dfwx-now {
	--dfwx-sub: #e1eaf3;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 1.75rem 2.5rem;
	padding: clamp(1.25rem, 3.2vw, 2.25rem);
	border-radius: var(--dfwx-radius);
	color: #fff;
	background: linear-gradient(180deg, #0b2140 0%, #173a63 100%);
}

.dfwx-now--night  { background: linear-gradient(180deg, #0a1d38 0%, #183a62 100%); }
.dfwx-now--clear  { background: linear-gradient(180deg, #0a4a8f 0%, #145fae 100%); }
.dfwx-now--partly { background: linear-gradient(180deg, #1b4672 0%, #33608c 100%); }
.dfwx-now--cloudy { background: linear-gradient(180deg, #374757 0%, #4d5e70 100%); }
.dfwx-now--rain   { background: linear-gradient(180deg, #1f3247 0%, #3a5270 100%); }
.dfwx-now--snow   { background: linear-gradient(180deg, #3a4f66 0%, #4f6680 100%); }
.dfwx-now--fog    { background: linear-gradient(180deg, #46525e 0%, #56636f 100%); }
.dfwx-now--storm  { background: linear-gradient(180deg, #1c222e 0%, #333d4f 100%); }

.dfwx-now__main {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-width: 0;
}

.dfwx-now__icon {
	width: clamp(72px, 11vw, 104px);
	height: auto;
}

.dfwx-now__reading {
	min-width: 0;
}

.dfwx-now__temp {
	font-size: clamp(4rem, 10vw, 6.25rem);
	font-weight: 300;
	line-height: 0.95;
	letter-spacing: -0.035em;
	color: #fff;
}

.dfwx-now__unit {
	display: inline-block;
	margin-left: 0.08em;
	font-size: 0.34em;
	font-weight: 400;
	letter-spacing: 0;
	vertical-align: top;
	transform: translateY(0.35em);
	color: var(--dfwx-sub);
}

.dfwx-now__cond {
	margin-top: 0.6rem;
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.3;
}

.dfwx-now__sub {
	margin-top: 0.35rem;
	color: var(--dfwx-sub);
}

.dfwx-now__hilo span + span {
	margin-left: 1rem;
}

.dfwx-now__hilo strong {
	color: #fff;
	font-weight: 600;
}

.dfwx-now__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	align-self: center;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.dfwx-now__stats > div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.dfwx-now__stats > div:nth-child(odd) {
	margin-right: 1.25rem;
}

.dfwx-now__stats dt {
	color: var(--dfwx-sub);
	font-size: 0.9rem;
}

.dfwx-now__stats dd {
	font-weight: 600;
	text-align: right;
}

.dfwx-now__story {
	grid-column: 1 / -1;
	max-width: 46rem;
}

.dfwx .dfwx-now__story-title {
	font-size: 1rem;
	margin-bottom: 0.2rem;
	color: #fff;
}

.dfwx-now__story p {
	font-size: 1.05rem;
	line-height: 1.55;
}

.dfwx-now__at {
	grid-column: 1 / -1;
	margin-top: -0.75rem;
	font-size: 0.85rem;
	color: var(--dfwx-sub);
}

.dfwx--compact .dfwx-now {
	grid-template-columns: 1fr;
}

.dfwx--compact .dfwx-now__at {
	margin-top: -1rem;
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

.dfwx-section {
	margin-top: 2.5rem;
}

.dfwx .dfwx-section__title {
	margin-bottom: 0.85rem;
	font-size: 1.25rem;
	color: var(--dfwx-ink);
}

/* Hourly strip */

.dfwx-hourly__scroll {
	position: relative;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	border: 1px solid var(--dfwx-line);
	border-radius: var(--dfwx-radius);
	scrollbar-width: thin;
}

.dfwx-hourly__list {
	display: flex;
	min-width: max-content;
}

.dfwx-hour {
	position: relative;
	display: flex;
	flex: 0 0 4.75rem;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	padding: 0.75rem 0.25rem 0.9rem;
	text-align: center;
	scroll-snap-align: start;
}

.dfwx-hour + .dfwx-hour {
	border-left: 1px solid #edf1f5;
}

.dfwx-hour + .dfwx-hour--newday {
	border-left: 1px solid #aebccb;
}

.dfwx-hour--now {
	background: var(--dfwx-soft);
}

.dfwx-hour__day {
	min-height: 1.25rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--dfwx-navy);
}

.dfwx-hour__time {
	font-size: 0.85rem;
	color: var(--dfwx-muted);
	white-space: nowrap;
}

.dfwx-hour--now .dfwx-hour__time {
	font-weight: 600;
	color: var(--dfwx-ink);
}

.dfwx-hour__icon {
	margin: 0.2rem 0 0.1rem;
}

.dfwx-hour__temp {
	font-size: 1.15rem;
	font-weight: 600;
}

.dfwx-hour__note {
	min-height: 2.3em;
	padding: 0 0.15rem;
	font-size: 0.74rem;
	line-height: 1.15;
	color: var(--dfwx-cool);
}

.dfwx-hour__wind {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	font-size: 0.78rem;
	color: var(--dfwx-muted);
	white-space: nowrap;
}

.dfwx-arrow {
	display: inline-flex;
	color: #6d7b89;
}

/* 7-day list */

.dfwx-days {
	border-top: 1px solid var(--dfwx-line);
}

.dfwx-days__item {
	border-bottom: 1px solid var(--dfwx-line);
}

.dfwx-day {
	position: relative;
	display: grid;
	grid-template-columns: 9rem 2.75rem minmax(9rem, 15rem) 4rem 2.75rem minmax(5rem, 1fr) 2.75rem 1.25rem;
	grid-template-areas: "name icon cond pop lo range hi chev";
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0.6rem;
	cursor: pointer;
	list-style: none;
	border-radius: 8px;
}

.dfwx-day::-webkit-details-marker {
	display: none;
}

.dfwx-day::marker {
	content: "";
}

.dfwx-day:hover {
	background: var(--dfwx-soft);
}

.dfwx-day:focus-visible {
	outline: 3px solid var(--dfwx-focus);
	outline-offset: -3px;
}

.dfwx-day__name    { grid-area: name; line-height: 1.25; }
.dfwx-day__icon    { grid-area: icon; }
.dfwx-day__cond    { grid-area: cond; }
.dfwx-day__pop     { grid-area: pop; }
.dfwx-day__lo      { grid-area: lo; }
.dfwx-range        { grid-area: range; }
.dfwx-day__hi      { grid-area: hi; }
.dfwx-day__chev    { grid-area: chev; }

.dfwx-day__name strong {
	display: block;
	font-weight: 600;
}

.dfwx-day__name > span {
	font-size: 0.85rem;
	color: var(--dfwx-muted);
}

.dfwx-day__pop {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.9rem;
	color: var(--dfwx-cool);
}

.dfwx-day__lo,
.dfwx-day__hi {
	font-size: 1.05rem;
	text-align: right;
}

.dfwx-day__lo {
	color: var(--dfwx-cool);
}

.dfwx-day__hi {
	font-weight: 600;
	color: var(--dfwx-warm);
	text-align: left;
}

.dfwx-range {
	position: relative;
	height: 6px;
	border-radius: 3px;
	background: #e5eaf0;
}

.dfwx-range__bar {
	position: absolute;
	top: 0;
	bottom: 0;
	border-radius: 3px;
	background: linear-gradient(90deg, #5b95d6, #e08a4b);
}

.dfwx-day__chev {
	display: inline-flex;
	color: var(--dfwx-muted);
	transition: transform 0.2s ease;
}

.dfwx-dd[open] .dfwx-day__chev {
	transform: rotate(180deg);
}

.dfwx-day__more {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 17rem;
	gap: 1.5rem 2.5rem;
	padding: 0.4rem 0.6rem 1.4rem calc(9rem + 0.75rem + 2.75rem + 0.75rem + 0.6rem);
}

.dfwx-day__text {
	max-width: 42rem;
}

.dfwx .dfwx-day__text h4 {
	font-size: 0.95rem;
	color: var(--dfwx-navy);
}

.dfwx-day__text p + h4 {
	margin-top: 0.9rem;
}

.dfwx-day__text p {
	margin-top: 0.15rem;
}

.dfwx-day__facts > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid #edf1f5;
	font-size: 0.92rem;
}

.dfwx-day__facts dt {
	color: var(--dfwx-muted);
}

.dfwx-day__facts dd {
	font-weight: 600;
	text-align: right;
}

/* Chart */

.dfwx-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	margin-bottom: 0.6rem;
	font-size: 0.85rem;
	color: var(--dfwx-muted);
}

.dfwx-legend li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.dfwx-legend__key {
	display: inline-block;
	width: 18px;
	height: 0;
	border-top: 3px solid;
}

.dfwx-legend__key--temp   { border-color: #c2410c; }
.dfwx-legend__key--dew    { border-color: #5b8fcb; border-top-width: 2px; }
.dfwx-legend__key--precip { height: 10px; border: 0; border-radius: 2px; background: #2a78d2; width: 10px; }
.dfwx-legend__key--night  { height: 12px; border: 1px solid #cfd9e4; border-radius: 2px; background: #e9eff6; width: 16px; }

.dfwx-chart__plot {
	position: relative;
	overflow-x: auto;
	padding: 0.25rem 0.25rem 0;
	border: 1px solid var(--dfwx-line);
	border-radius: var(--dfwx-radius);
	scrollbar-width: thin;
}

.dfwx-chart__plot svg {
	display: block;
	width: 100%;
	min-width: 760px;
	height: auto;
}

.dfwx-chart svg text {
	font-family: inherit;
	font-size: 13px;
	fill: var(--dfwx-muted);
}

.dfwx-chart .dfwx-c-day {
	font-weight: 600;
	fill: var(--dfwx-ink);
}

.dfwx-c-night      { fill: #e9eff6; }
.dfwx-c-grid       { stroke: #e6ebf0; stroke-width: 1; }
.dfwx-c-midnight   { stroke: #c6d1dc; stroke-width: 1; }
.dfwx-c-base       { stroke: #c6d1dc; stroke-width: 1; }
.dfwx-c-freeze     { stroke: #6f9fd6; stroke-width: 1.2; stroke-dasharray: 2 4; }
.dfwx-chart .dfwx-c-freeze-label { font-size: 11px; fill: #2c66a8; }
.dfwx-c-precip     { fill: #2a78d2; }
.dfwx-c-dew        { fill: none; stroke: #5b8fcb; stroke-width: 1.6; stroke-linejoin: round; }
.dfwx-c-temp       { fill: none; stroke: #c2410c; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.dfwx-c-hi-dot     { fill: #fff; stroke: #c2410c; stroke-width: 2; }
.dfwx-c-lo-dot     { fill: #fff; stroke: #1c5fae; stroke-width: 2; }
.dfwx-chart .dfwx-c-hi { font-weight: 700; fill: #b7410e; }
.dfwx-chart .dfwx-c-lo { font-weight: 700; fill: #1c5fae; }
.dfwx-c-cross      { stroke: #17222b; stroke-width: 1; stroke-opacity: 0.55; }
.dfwx-c-cursor     { fill: #c2410c; stroke: #fff; stroke-width: 2; }

.dfwx-tip {
	position: absolute;
	z-index: 2;
	min-width: 9rem;
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--dfwx-line);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(16, 36, 60, 0.14);
	font-size: 0.82rem;
	line-height: 1.35;
	pointer-events: none;
	transform: translate(14px, -50%);
	white-space: nowrap;
}

.dfwx-tip[hidden] {
	display: none;
}

.dfwx-tip--left {
	transform: translate(calc(-100% - 14px), -50%);
}

.dfwx-tip strong {
	display: block;
	font-weight: 600;
}

.dfwx-tip span {
	display: block;
	color: var(--dfwx-muted);
}

.dfwx-chart__cap {
	margin-top: 0.6rem;
	max-width: 46rem;
	font-size: 0.92rem;
	color: var(--dfwx-muted);
}

/* Data table */

.dfwx-table {
	margin-top: 1rem;
}

.dfwx-table > summary {
	display: inline-block;
	padding: 0.4rem 0;
	color: var(--dfwx-blue);
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dfwx-table__scroll {
	position: relative;
	max-height: 32rem;
	margin-top: 0.5rem;
	overflow: auto;
	border: 1px solid var(--dfwx-line);
	border-radius: 10px;
}

.dfwx-table table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.dfwx-table th,
.dfwx-table td {
	padding: 0.45rem 0.75rem;
	border: 0;
	border-bottom: 1px solid #edf1f5;
	text-align: left;
	vertical-align: top;
	background: none;
	white-space: nowrap;
}

.dfwx-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #fff;
	color: var(--dfwx-muted);
	font-weight: 600;
	box-shadow: inset 0 -1px 0 var(--dfwx-line);
}

.dfwx-table tbody th {
	font-weight: 600;
}

.dfwx-table .dfwx-table__day th {
	padding-top: 0.8rem;
	background: var(--dfwx-soft);
	color: var(--dfwx-navy);
}

.dfwx-table .dfwx-num {
	text-align: right;
}

/* Footer */

.dfwx-foot {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--dfwx-line);
	font-size: 0.85rem;
	color: var(--dfwx-muted);
}

.dfwx-foot p + p {
	margin-top: 0.35rem;
}

/* ------------------------------------------------------------------ */
/* Small screens                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 820px) {
	.dfwx-now {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.dfwx-now__at {
		margin-top: -0.5rem;
	}

	.dfwx-day {
		grid-template-columns: minmax(0, 1fr) 2.75rem 2.5rem 2.5rem 1rem;
		grid-template-areas:
			"name icon lo hi chev"
			"cond icon pop pop chev";
		row-gap: 0.1rem;
		column-gap: 0.6rem;
	}

	.dfwx-day__cond {
		font-size: 0.9rem;
		color: var(--dfwx-muted);
	}

	.dfwx-day__pop {
		justify-content: flex-end;
		font-size: 0.85rem;
	}

	.dfwx-range {
		display: none;
	}

	.dfwx-day__hi {
		text-align: right;
	}

	.dfwx-day__more {
		grid-template-columns: 1fr;
		padding: 0.25rem 0.6rem 1.25rem;
	}
}

@media (max-width: 480px) {
	.dfwx-now__stats > div {
		display: block;
		padding: 0.5rem 0;
	}

	.dfwx-now__stats > div:nth-child(odd) {
		margin-right: 1rem;
	}

	.dfwx-now__stats dt {
		font-size: 0.8rem;
	}

	.dfwx-now__stats dd {
		text-align: left;
	}

	.dfwx-hour {
		flex-basis: 4.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dfwx * {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media (forced-colors: active) {
	.dfwx-now {
		border: 1px solid CanvasText;
	}

	.dfwx-range__bar {
		background: CanvasText;
	}
}

@media print {
	.dfwx-now {
		color: #000;
		background: none !important;
		border: 1px solid #999;
	}

	.dfwx-now__sub,
	.dfwx-now__stats dt,
	.dfwx-now__at,
	.dfwx-now__unit {
		color: #333;
	}

	.dfwx-hourly__scroll,
	.dfwx-chart__plot {
		overflow: visible;
	}
}
