/* Porty Live Weather: [porty_weather_sidebar] card and strip layouts */

.porty-weather-sidebar {
	--pws-pink: #ff61b6;       /* brand accent: bars only */
	--pws-pink-text: #ffb8df;  /* small labels: >= 4.5:1 across the whole gradient */
	--pws-navy: #163e73;
	--pws-yellow: #ffd400;     /* NOW and HIGH */
	--pws-blue: #7fd2ff;       /* LOW */
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	border-radius: 14px;
	padding: 14px;
	background: linear-gradient(145deg, #244f63, #4c563b);
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.porty-weather-sidebar * {
	box-sizing: border-box;
}

/* The current background photo, darkened by an inline gradient (see photo_style()). */
.porty-weather-sidebar.pws-has-photo {
	background-size: cover;
	background-position: center;
}

.porty-weather-sidebar--unavailable p {
	margin: 0;
	font-size: 14px;
}

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

/* Header */
.pws-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.pws-head .pws-logo {
	width: 54px;
	height: 54px;
	object-fit: contain;
	flex: 0 0 54px;
}

.pws-head div {
	min-width: 0;
}

.pws-head strong {
	display: block;
	font-size: 21px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
	color: #fff;
}

.pws-head strong::after {
	content: "";
	display: block;
	width: 48px;
	height: 4px;
	border-radius: 4px;
	background: var(--pws-pink);
	margin-top: 6px;
}

.pws-head span {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* Now */
.pws-now {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 2px 13px;
	border-bottom: 1px solid rgba(255, 255, 255, .22);
}

.pws-now-label {
	margin-bottom: 4px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .08em;
	color: var(--pws-yellow);
}

.pws-temp {
	font-size: 58px;
	font-weight: 800;
	line-height: .9;
	letter-spacing: -3px;
}

.pws-condition {
	font-size: 18px;
	font-weight: 800;
	margin-top: 7px;
}

.pws-range {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: 15px;
	font-weight: 700;
	margin-top: 6px;
}

.pws-range span {
	white-space: nowrap;
}

.pws-range b {
	font-size: 13px;
	font-weight: 800;
}

.pws-high b {
	color: var(--pws-yellow);
}

.pws-low b {
	color: var(--pws-blue);
}

/* Facts */
.pws-facts {
	display: grid;
	grid-template-columns: .8fr 1.5fr;
	gap: 8px;
	margin: 0;
	padding: 11px 0;
}

.pws-facts > div {
	min-width: 0;
}

.pws-facts dt {
	color: var(--pws-pink-text);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .04em;
}

.pws-facts dd {
	margin: 2px 0 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
}

.pws-facts .pws-water {
	grid-column: 1 / -1;
	padding-top: 8px;
	border-top: 1px solid rgba(255, 255, 255, .16);
}

/* Days
 *
 * A <div role="list"> rather than a <ul>: widget areas style their list items with
 * selectors we cannot outrank (e.g. .widget ul li { margin-bottom } with the margin
 * taken off :last-child), which made every card but the last one shorter. */
.pws-days {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
	gap: 7px;
}

.pws-days > div {
	min-width: 0;
	text-align: center;
	background: rgba(7, 29, 53, .72);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 10px;
	padding: 8px 3px;
}

.pws-days b {
	display: block;
	font-size: 12px;
}

.pws-days strong {
	display: block;
	font-size: 17px;
	line-height: 1;
}

.pws-days small {
	display: block;
	font-size: 12px;
	margin-top: 3px;
	color: var(--pws-blue);
}

.pws-credit {
	font-size: 11px;
	margin-top: 9px;
}

/* Icons (decorative; aria-hidden) */
.pws-icon {
	position: relative;
	display: inline-block;
	width: 58px;
	height: 48px;
	flex: 0 0 58px;
}

.pws-now > .pws-icon {
	transform: scale(1.2);
	transform-origin: center;
}

.pws-days .pws-icon {
	display: block;
	margin: 3px 0 -1px 50%;
	transform: translateX(-50%) scale(.62);
	transform-origin: center;
}

.pws-sun {
	position: absolute;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #ffd400;
	border: 4px solid #ff9f1c;
	left: 12px;
	top: 5px;
	box-shadow: 0 -18px 0 -15px #ffd400, 0 18px 0 -15px #ffd400, 18px 0 0 -15px #ffd400, -18px 0 0 -15px #ffd400;
}

.pws-moon {
	position: absolute;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	left: 10px;
	top: 4px;
	box-shadow: 9px -4px 0 0 #f4f1c9;
}

.pws-cloud {
	position: absolute;
	width: 46px;
	height: 20px;
	border-radius: 14px;
	background: #f7f8fb;
	border: 2px solid #d8e2ef;
	left: 6px;
	top: 20px;
}

.pws-cloud::before,
.pws-cloud::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: #f7f8fb;
	border: 2px solid #d8e2ef;
	border-bottom: 0;
}

.pws-cloud::before {
	width: 22px;
	height: 22px;
	left: 7px;
	top: -14px;
}

.pws-cloud::after {
	width: 18px;
	height: 18px;
	right: 5px;
	top: -10px;
}

.pws-icon--rain i,
.pws-icon--storm i {
	position: absolute;
	width: 3px;
	height: 11px;
	background: #35a7ff;
	border-radius: 2px;
	top: 43px;
	transform: rotate(20deg);
}

.pws-icon--rain i:nth-of-type(1),
.pws-icon--storm i:nth-of-type(1) {
	left: 17px;
}

.pws-icon--rain i:nth-of-type(2),
.pws-icon--storm i:nth-of-type(2) {
	left: 29px;
}

.pws-icon--rain i:nth-of-type(3),
.pws-icon--storm i:nth-of-type(3) {
	left: 41px;
}

.pws-flake {
	position: absolute;
	left: 26px;
	top: 38px;
	width: 3px;
	height: 14px;
	background: #fff;
	border-radius: 2px;
	box-shadow: 0 0 0 1px #d8e2ef;
}

.pws-flake::before,
.pws-flake::after {
	content: "";
	position: absolute;
	inset: 0;
	background: inherit;
	border-radius: inherit;
	transform: rotate(60deg);
}

.pws-flake::after {
	transform: rotate(-60deg);
}

.pws-icon--mist i {
	position: absolute;
	left: 7px;
	width: 45px;
	height: 4px;
	border-radius: 4px;
	background: #f7f8fb;
}

.pws-icon--mist i:nth-child(1) {
	top: 12px;
}

.pws-icon--mist i:nth-child(2) {
	top: 24px;
}

.pws-icon--mist i:nth-child(3) {
	top: 36px;
}

@media (max-width: 260px) {
	.porty-weather-sidebar {
		padding: 10px;
	}

	.pws-head .pws-logo {
		width: 46px;
		height: 46px;
		flex-basis: 46px;
	}

	.pws-head strong {
		font-size: 18px;
	}

	.pws-temp {
		font-size: 50px;
	}

	.pws-condition {
		font-size: 16px;
	}

	.pws-facts {
		grid-template-columns: 1fr;
	}

	.pws-days {
		gap: 4px;
	}
}

/* Strip: [porty_weather_sidebar layout="strip"]
 *
 * Laid out by the width of its container, not of the screen: wide (900px and up),
 * medium (600-899px) and phone (under 600px).
 */
.porty-weather-strip-wrap {
	container-type: inline-size;
	width: 100%;
}

/* width="wide": extends beyond the content column, centred on it, up to 940px but never
 * wider than the screen (100vw includes a desktop scrollbar, hence the 48px). The container
 * queries then give it the one-row layout.
 *
 * Themes constrain the direct children of the post content with selectors we cannot
 * outrank (Twenty Twenty's .entry-content > :not(.alignwide):not(...) caps them at 580px,
 * and block themes set margins with !important). The theme styles the plain
 * .porty-weather-strip-outer instead, and this wrapper, one level down, is left alone. */
.porty-weather-strip-wrap.pwx-wide {
	width: min(940px, calc(100vw - 48px));
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.porty-weather-strip {
	--pwx-pink-text: #ffb8df;
	--pwx-yellow: #ffd400;
	--pwx-blue: #7fd2ff;
	position: relative;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 16px 14px;
	width: 100%;
	padding: 14px 18px 22px;
	border-radius: 14px;
	background: #15384a;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.porty-weather-strip * {
	box-sizing: border-box;
}

.porty-weather-strip--unavailable p {
	margin: 0;
	font-size: 14px;
}

.pwx-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pwx-brand .pws-logo {
	width: 58px;
	height: 58px;
	object-fit: contain;
}

.pwx-brand b {
	font-size: 19px;
	font-weight: 800;
	line-height: 1;
}

.pwx-brand b::after {
	content: "";
	display: block;
	width: 46px;
	height: 4px;
	margin-top: 6px;
	border-radius: 3px;
	background: #ff61b6;
}

.pwx-now {
	display: flex;
	align-items: center;
	gap: 9px;
}

.pwx-temp small {
	display: block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .06em;
	color: var(--pwx-yellow);
}

.pwx-temp strong {
	display: block;
	font-size: 42px;
	font-weight: 800;
	line-height: .95;
}

.pwx-temp span {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	font-weight: 700;
}

.pwx-facts {
	display: grid;
	/* Each fact is as wide as it needs (the wind is the longest), and any spare room is
	 * shared out evenly. */
	grid-template-columns: repeat(4, auto);
	align-items: center;
	min-width: 0;
	margin: 0;
}

.pwx-facts > div {
	min-width: 0;
	padding: 0 8px;
	border-left: 1px solid rgba(255, 255, 255, .27);
}

.pwx-facts dt {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .04em;
	color: var(--pwx-pink-text);
}

.pwx-facts dd {
	margin: 3px 0 0;
	font-size: 14px;
	font-weight: 800;
}

.pwx-facts .pwx-high dt {
	color: var(--pwx-yellow);
}

.pwx-facts .pwx-low dt {
	color: var(--pwx-blue);
}

.pwx-facts .pwx-water {
	grid-column: 1 / -1;
	margin-top: 8px;
	padding-top: 8px;
	border-left: 0;
	border-top: 1px solid rgba(255, 255, 255, .16);
}

.pwx-listen {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 10px 14px;
	border-radius: 999px;
	background: var(--pwx-yellow);
	color: #15384a;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .02em;
	text-decoration: none;
	white-space: nowrap;
}

.pwx-listen:hover,
.pwx-listen:focus {
	background: #ffe13f;
	color: #15384a;
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pwx-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding-left: 2px;
	border-radius: 50%;
	background: #c2185b;
	color: #fff;
	font-size: 11px;
}

.pwx-credit {
	position: absolute;
	right: 14px;
	bottom: 5px;
	max-width: calc(100% - 28px); /* A long photo credit is cut short, not spilled outside. */
	overflow: hidden;
	font-size: 10px;
	opacity: .8;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.porty-weather-strip.pwx-no-listen {
	grid-template-columns: auto auto minmax(0, 1fr);
}

@container (max-width: 899px) {
	.porty-weather-strip,
	.porty-weather-strip.pwx-no-listen {
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		gap: 12px 16px;
	}

	/* Top row: brand, now and the button; the facts get a full-width row below. */
	.pwx-now {
		grid-row: 1;
		grid-column: 2;
		justify-self: center;
	}

	.pwx-listen {
		grid-row: 1;
		grid-column: 3;
		justify-self: end;
	}

	.pwx-facts {
		grid-template-columns: repeat(4, minmax(72px, 1fr));
		grid-column: 1 / -1;
		padding-top: 10px;
		border-top: 1px solid rgba(255, 255, 255, .21);
	}

	.pwx-facts > div:first-child,
	.pwx-facts .pwx-water {
		padding-left: 0;
		border-left: 0;
	}
}

@container (max-width: 599px) {
	.porty-weather-strip,
	.porty-weather-strip.pwx-no-listen {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 16px 16px 12px;
	}

	.pwx-now {
		justify-content: center;
	}

	.pwx-facts {
		grid-template-columns: repeat(2, 1fr);
		row-gap: 10px;
		text-align: center;
	}

	.pwx-facts > div,
	.pwx-facts > div:first-child {
		padding: 0 6px;
		border-left: 0;
	}

	.pwx-listen {
		width: 100%;
	}

	.pwx-credit {
		position: static;
		max-width: none;
		text-align: right;
		white-space: normal;
	}
}

@container (max-width: 359px) {
	.porty-weather-strip,
	.porty-weather-strip.pwx-no-listen {
		padding-left: 12px;
		padding-right: 12px;
	}

	.pwx-brand {
		justify-content: center;
	}

	.pwx-brand .pws-logo {
		width: 46px;
		height: 46px;
	}

	.pwx-temp strong {
		font-size: 36px;
	}

	.pwx-listen {
		font-size: 11px;
		white-space: normal;
	}
}
