/**
 * MWOBS Weather — card and row layouts.
 *
 * Colours are custom properties on the wrapper; the background is set from
 * the plugin settings. Selectors are scoped under .mwobs-weather-wrap so theme
 * heading and list styles don't leak in.
 */

.mwobs-weather-wrap {
	--mwobs-bg: #5f6fa3;
	--mwobs-fg: #ffffff;
	--mwobs-muted: rgba(255, 255, 255, 0.82);
	--mwobs-faint: rgba(255, 255, 255, 0.72);
	--mwobs-rule: rgba(255, 255, 255, 0.32);
	--mwobs-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
	--mwobs-radius: 10px;

	margin: 0 0 1.5em;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.3;
}

.mwobs-weather-wrap *,
.mwobs-weather-wrap *::before,
.mwobs-weather-wrap *::after {
	box-sizing: border-box;
}

.mwobs-weather-wrap .mwobs-weather__name,
.mwobs-weather-wrap .mwobs-weather__condition,
.mwobs-weather-wrap .mwobs-weather__unavailable,
.mwobs-weather-wrap dl,
.mwobs-weather-wrap dt,
.mwobs-weather-wrap dd {
	margin: 0;
	padding: 0;
	border: 0;
	color: inherit;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.mwobs-weather-wrap .mwobs-weather__name {
	font-size: 20px;
	font-weight: 700;
	line-height: 26px;
}

.mwobs-weather-wrap dt,
.mwobs-weather-wrap dd {
	font-size: inherit;
	font-weight: 400;
	line-height: inherit;
}

.mwobs-weather-wrap .mwobs-weather__time {
	display: block;
	color: var(--mwobs-muted);
	font-size: 14px;
	line-height: 18px;
}

.mwobs-weather-wrap .mwobs-weather__now {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
}

.mwobs-weather-wrap .mwobs-weather__icon {
	display: block;
	flex: none;
}

.mwobs-weather-wrap .mwobs-weather__svg {
	display: block;
	width: 52px;
	height: 52px;
}

.mwobs-weather-wrap .mwobs-weather__temp {
	font-size: 48px;
	font-weight: 400;
	line-height: 1;
	white-space: nowrap;
}

.mwobs-weather-wrap .mwobs-weather__condition {
	font-size: 16px;
	line-height: 20px;
}

.mwobs-weather-wrap .mwobs-weather__detail {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.mwobs-weather-wrap .mwobs-weather__detail dd {
	text-align: right;
	white-space: nowrap;
}

.mwobs-weather-wrap .mwobs-weather__footer {
	color: var(--mwobs-faint);
	font-size: 12.5px;
	line-height: 16px;
}

.mwobs-weather-wrap .mwobs-weather__footer a {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.mwobs-weather-wrap .mwobs-weather__footer a:hover,
.mwobs-weather-wrap .mwobs-weather__footer a:focus {
	color: var(--mwobs-fg);
	text-decoration: underline;
}

.mwobs-weather-wrap .mwobs-weather__toggle {
	margin: 0;
	padding: 3px 5px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	box-shadow: none;
	color: var(--mwobs-fg);
	cursor: pointer;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	min-height: 0;
	text-transform: none;
}

.mwobs-weather-wrap .mwobs-weather__toggle:hover {
	background: rgba(255, 255, 255, 0.14);
}

.mwobs-weather-wrap .mwobs-weather__toggle:focus-visible,
.mwobs-weather-wrap .mwobs-weather__footer a:focus-visible {
	outline: 2px solid var(--mwobs-fg);
	outline-offset: 2px;
}

.mwobs-weather-wrap .mwobs-weather__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ */
/* Card                                                               */
/* ------------------------------------------------------------------ */

.mwobs-weather-wrap--card {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 20px;
}

.mwobs-weather-card {
	position: relative;
	width: 320px;
	max-width: 100%;
	padding: 14px 20px 20px;
	border-radius: var(--mwobs-radius);
	background: var(--mwobs-bg);
	box-shadow: var(--mwobs-shadow);
	color: var(--mwobs-fg);
	text-align: center;
}

.mwobs-weather-card .mwobs-weather__name {
	padding: 0 34px;
}

.mwobs-weather-card .mwobs-weather__toggle {
	position: absolute;
	top: 14px;
	right: 12px;
}

.mwobs-weather-card .mwobs-weather__time {
	margin-top: 4px;
}

.mwobs-weather-card .mwobs-weather__now {
	margin-top: 14px;
	padding-right: 4px;
}

.mwobs-weather-card .mwobs-weather__condition {
	margin-top: 14px;
}

.mwobs-weather-card .mwobs-weather__details {
	margin-top: 12px;
	padding-left: 22px;
	text-align: left;
	line-height: 23px;
}

.mwobs-weather-card .mwobs-weather__summary {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 8px;
	padding: 13px 0 0 22px;
	border-top: 1px solid var(--mwobs-rule);
	line-height: 20px;
}

.mwobs-weather-card .mwobs-weather__summary-item {
	white-space: nowrap;
}

.mwobs-weather-card .mwobs-weather__footer {
	margin-top: 13px;
}

.mwobs-weather-card .mwobs-weather__unavailable {
	margin: 18px 0 4px;
	color: var(--mwobs-muted);
}

/* ------------------------------------------------------------------ */
/* Rows                                                               */
/* ------------------------------------------------------------------ */

/* Rows respond to the width they are given, not the viewport. An explicit
   width keeps the query container from collapsing inside flex parents. */
.mwobs-weather-wrap--row {
	container-type: inline-size;
	width: 100%;
}

.mwobs-weather-rows {
	padding: 0 20px;
	border-radius: var(--mwobs-radius);
	background: var(--mwobs-bg);
	box-shadow: var(--mwobs-shadow);
	color: var(--mwobs-fg);
}

.mwobs-weather-row {
	display: grid;
	grid-template-columns: 170px minmax(160px, 1fr) minmax(0, 2.2fr);
	align-items: center;
	gap: 14px 28px;
	padding: 16px 0;
	border-bottom: 1px solid var(--mwobs-rule);
}

.mwobs-weather-row .mwobs-weather__now {
	justify-content: flex-start;
	gap: 12px;
}

.mwobs-weather-row .mwobs-weather__svg {
	width: 46px;
	height: 46px;
}

.mwobs-weather-row .mwobs-weather__temp {
	font-size: 40px;
}

.mwobs-weather-row .mwobs-weather__name {
	font-size: 18px;
	line-height: 24px;
}

.mwobs-weather-row .mwobs-weather__time {
	font-size: 13px;
}

.mwobs-weather-row .mwobs-weather__condition {
	margin-top: 4px;
	font-size: 15px;
}

.mwobs-weather-row .mwobs-weather__details {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0 24px;
	line-height: 22px;
}

.mwobs-weather-row .mwobs-weather__detail dt {
	color: var(--mwobs-muted);
}

.mwobs-weather-row.is-unavailable {
	grid-template-columns: 1fr;
}

.mwobs-weather-row .mwobs-weather__unavailable {
	margin-top: 2px;
	color: var(--mwobs-muted);
}

.mwobs-weather-rows > .mwobs-weather__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	padding: 8px 0;
}

.mwobs-weather-rows > .mwobs-weather__footer .mwobs-weather__toggle {
	margin-left: auto;
}

/* Medium: details drop below the temperature and name. */
@container (max-width: 719px) {
	.mwobs-weather-row {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.mwobs-weather-row .mwobs-weather__details {
		grid-column: 1 / -1;
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

/* Narrow: stack everything. */
@container (max-width: 419px) {
	.mwobs-weather-row {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.mwobs-weather-row .mwobs-weather__details {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
		column-gap: 16px;
	}
}

/* Shown only to administrators when a shortcode references a disabled station. */
.mwobs-weather-notice {
	padding: 8px 12px;
	border-left: 4px solid #dba617;
	background: #fcf9e8;
	color: #1d2327;
	font-size: 14px;
}
