/**
 * Forecast by Soren public styles.
 *
 * All selectors stay scoped to shortcode root classes so client sites can safely
 * override variables without the plugin leaking styles into the page builder.
 */

.forecast-bar,
.forecast-widget {
	/*
	 * Color, font, and icon-size variables are intentionally NOT defaulted here.
	 * get_custom_style_output() in class-forecast-by-soren-shortcodes.php always
	 * emits every one of them (real setting or its own default) in an inline
	 * <style> tag attached right after this stylesheet. Declaring the same
	 * variables again in this static file only invites a cascade-order bug: if
	 * anything on a client site reorders CSS (a minifier/combiner/cache), a
	 * hardcoded default here can silently win over an admin-configured color.
	 * Only true layout constants — never exposed as a setting — belong here.
	 */
	--forecast-space-xs: 0.35rem;
	--forecast-space-sm: 0.65rem;
	--forecast-space-md: 1rem;
	--forecast-space-lg: 1.5rem;
	--forecast-space-xl: 2.25rem;
	--forecast-radius: 8px;
	--forecast-border-color: rgba(54, 38, 22, 0.16);
	box-sizing: border-box;
	color: var(--forecast-color-text);
	font-family: var(--forecast-font-body);
}

.forecast-bar *,
.forecast-bar *::before,
.forecast-bar *::after,
.forecast-widget *,
.forecast-widget *::before,
.forecast-widget *::after {
	box-sizing: inherit;
}

.forecast-bar {
	/* See the note above — icon-color/text-color/font are always set by
	   the inline admin style, never defaulted here. Background is
	   intentionally not settable — Cornerstone's own section controls it. */
	align-items: center;
	background: transparent;
	color: var(--forecast-bar-text-color);
	display: inline-flex;
	font-family: var(--forecast-bar-font);
	font-size: var(--forecast-bar-font-size);
	font-weight: 600;
	gap: 0.35rem;
	line-height: 1;
	min-height: 1.75rem;
	text-decoration: none;
	vertical-align: middle;
	white-space: nowrap;
}

.forecast-bar:hover,
.forecast-bar:focus {
	color: var(--forecast-bar-text-color);
	text-decoration: none;
}

.forecast-bar:focus-visible {
	outline: 2px solid var(--forecast-color-accent);
	outline-offset: 3px;
}

.forecast-bar__icon {
	color: var(--forecast-bar-icon-color);
	display: inline-flex;
	flex: 0 0 auto;
	height: var(--forecast-bar-icon-size);
	width: var(--forecast-bar-icon-size);
}

.forecast-bar__icon svg,
.forecast-icon {
	display: block;
	height: 100%;
	overflow: visible;
	width: 100%;
}

.forecast-bar__temp,
.forecast-bar__text {
	color: currentColor;
	display: inline-block;
}

.forecast-bar--unavailable {
	font-size: 0.85rem;
}

.forecast-widget {
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--forecast-color-text);
	padding: clamp(1.5rem, 4vw, 3rem);
	width: 100%;
}

.forecast-widget__header {
	margin: 0 0 var(--forecast-space-xl);
}

.forecast-widget__eyebrow {
	color: var(--forecast-color-accent);
	font-family: var(--forecast-font-label);
	font-size: var(--forecast-font-size-label);
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
	margin: 0 0 var(--forecast-space-xs);
	text-transform: uppercase;
}

.forecast-widget__title {
	color: inherit;
	font-family: var(--forecast-font-heading);
	font-size: var(--forecast-font-size-heading);
	font-weight: 700;
	line-height: 1.05;
	margin: 0;
}

.forecast-widget__current {
	align-items: center;
	display: grid;
	gap: clamp(1.25rem, 4vw, 3rem);
	grid-template-columns: minmax(0, 1fr) var(--forecast-icon-size-current);
	margin-bottom: var(--forecast-space-xl);
}

.forecast-widget__current-icon {
	align-items: center;
	aspect-ratio: 1;
	background: transparent;
	border: 0;
	color: var(--forecast-color-accent);
	display: flex;
	height: var(--forecast-icon-size-current);
	justify-content: center;
	order: 2;
	padding: 0;
	width: var(--forecast-icon-size-current);
}

.forecast-widget__current-icon img,
.forecast-widget__day-icon img {
	display: block;
	height: auto;
	max-width: 100%;
}

.forecast-widget__current-icon svg,
.forecast-widget__day-icon svg {
	color: var(--forecast-color-accent);
	height: 100%;
	stroke: currentColor;
	width: 100%;
}

.forecast-widget__current-copy {
	min-width: 0;
	order: 1;
}

.forecast-widget__current-temp {
	color: inherit;
	font-family: var(--forecast-font-body);
	font-size: clamp(4rem, 10vw, 6.75rem);
	font-weight: 700;
	line-height: 0.95;
	margin: 0;
}

.forecast-widget__current-desc {
	color: inherit;
	font-size: var(--forecast-font-size-body);
	font-weight: 600;
	line-height: 1.35;
	margin: var(--forecast-space-sm) 0 0;
}

.forecast-widget__wind {
	color: inherit;
	font-size: 0.95rem;
	line-height: 1.4;
	margin: var(--forecast-space-sm) 0 0;
	opacity: 0.86;
}

.forecast-widget__wind span {
	color: var(--forecast-color-accent);
	font-family: var(--forecast-font-label);
	font-size: var(--forecast-font-size-label);
	font-weight: 700;
	letter-spacing: 0;
	margin-right: 0.35rem;
	text-transform: uppercase;
}

.forecast-widget__daily {
	border-top: 1px solid var(--forecast-border-color);
	display: grid;
	gap: clamp(0.75rem, 1.8vw, 1.25rem);
	grid-template-columns: repeat(7, minmax(0, 1fr));
	padding-top: var(--forecast-space-lg);
}

.forecast-widget--dark .forecast-widget__daily {
	border-top-color: rgba(243, 235, 224, 0.2);
}

.forecast-widget__day {
	background: transparent;
	border: 0;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.forecast-widget__day-name {
	color: inherit;
	font-family: var(--forecast-font-label);
	font-size: var(--forecast-font-size-label);
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.2;
	margin: 0;
	text-transform: uppercase;
}

.forecast-widget__day-icon {
	align-items: center;
	color: var(--forecast-color-accent);
	display: flex;
	height: var(--forecast-icon-size-day);
	justify-content: flex-start;
	width: var(--forecast-icon-size-day);
}

.forecast-weather-icon {
	/*
	 * No color declared here on purpose. This wrapper is shared between the
	 * widget's daily icons and the bar/badge icon (both go through
	 * render_weather_icon() in class-forecast-by-soren-shortcodes.php). Forcing
	 * --forecast-color-accent here unconditionally overrode the badge's own
	 * --forecast-bar-icon-color, which is set on .forecast-bar__icon and would
	 * otherwise reach this element by inheritance. Each context's own ancestor
	 * (.forecast-bar__icon, .forecast-widget__current-icon, .forecast-widget__day-icon)
	 * already sets the color that belongs there.
	 */
	display: inline-flex;
	height: 100%;
	width: 100%;
}

.forecast-widget__temps {
	color: inherit;
	display: flex;
	flex-wrap: wrap;
	font-family: var(--forecast-font-body);
	font-size: var(--forecast-font-size-body);
	gap: 0.25rem 0.5rem;
	line-height: 1.35;
	margin: 0;
}

.forecast-widget__temps strong {
	color: var(--forecast-color-accent);
	font-family: var(--forecast-font-label);
	font-size: var(--forecast-font-size-label);
	font-weight: 800;
	letter-spacing: 0;
	text-transform: uppercase;
}

.forecast-widget__day-desc {
	color: inherit;
	font-size: var(--forecast-font-size-body);
	line-height: 1.35;
	margin: 0;
	opacity: 0.88;
}

.forecast-widget__unavailable {
	font-family: var(--forecast-font-body);
	font-weight: 600;
	margin: 0;
}

/* Layout: Split — current conditions in a left rail, 7-day list on the right. */
.forecast-widget--layout-split {
	display: grid;
	gap: clamp(1.5rem, 4vw, 3rem);
	grid-template-areas:
		"header daily"
		"current daily";
	grid-template-columns: minmax(200px, 280px) 1fr;
}

.forecast-widget--layout-split .forecast-widget__header {
	grid-area: header;
	margin-bottom: 0;
}

.forecast-widget--layout-split .forecast-widget__current {
	align-content: start;
	grid-area: current;
	grid-template-columns: 1fr;
	justify-items: center;
	margin-bottom: 0;
	text-align: center;
}

.forecast-widget--layout-split .forecast-widget__current-icon {
	order: 1;
}

.forecast-widget--layout-split .forecast-widget__current-copy {
	order: 2;
}

.forecast-widget--layout-split .forecast-widget__wind {
	display: flex;
	justify-content: center;
}

.forecast-widget--layout-split .forecast-widget__daily {
	border-left: 1px solid var(--forecast-border-color);
	border-top: 0;
	display: flex;
	flex-direction: column;
	gap: var(--forecast-space-md);
	grid-area: daily;
	grid-template-columns: none;
	padding-left: clamp(1.5rem, 4vw, 3rem);
	padding-top: 0;
}

.forecast-widget--layout-split.forecast-widget--dark .forecast-widget__daily {
	border-left-color: rgba(243, 235, 224, 0.2);
}

.forecast-widget--layout-split .forecast-widget__day {
	align-items: center;
	border-bottom: 1px solid var(--forecast-border-color);
	flex-direction: row;
	gap: var(--forecast-space-md);
	justify-content: space-between;
	padding-bottom: var(--forecast-space-md);
}

.forecast-widget--layout-split.forecast-widget--dark .forecast-widget__day {
	border-bottom-color: rgba(243, 235, 224, 0.2);
}

.forecast-widget--layout-split .forecast-widget__day-name {
	flex: 0 0 3.5rem;
}

.forecast-widget--layout-split .forecast-widget__day-icon {
	flex: 0 0 auto;
	justify-content: center;
}

.forecast-widget--layout-split .forecast-widget__day-desc {
	display: none;
}

.forecast-widget--layout-split .forecast-widget__temps {
	flex: 0 0 auto;
	flex-wrap: nowrap;
	justify-content: flex-end;
}

/* Layout: Hero — large, centered icon and temperature. */
.forecast-widget--layout-hero .forecast-widget__header {
	text-align: center;
}

.forecast-widget--layout-hero .forecast-widget__current {
	grid-template-columns: 1fr;
	justify-items: center;
	text-align: center;
}

.forecast-widget--layout-hero .forecast-widget__current-icon {
	order: 1;
}

.forecast-widget--layout-hero .forecast-widget__current-copy {
	order: 2;
}

.forecast-widget--layout-hero .forecast-widget__current-temp {
	font-size: clamp(5rem, 15vw, 9.5rem);
}

.forecast-widget--layout-hero .forecast-widget__wind {
	display: flex;
	justify-content: center;
}

/* Layout: Cards — each day shown in its own elevated card. */
.forecast-widget--layout-cards .forecast-widget__daily {
	border-top: 0;
}

.forecast-widget--layout-cards .forecast-widget__day {
	align-items: center;
	background: rgba(0, 0, 0, 0.035);
	border-radius: var(--forecast-radius);
	padding: var(--forecast-space-md) var(--forecast-space-sm);
	text-align: center;
}

.forecast-widget--layout-cards.forecast-widget--dark .forecast-widget__day {
	background: rgba(255, 255, 255, 0.08);
}

.forecast-widget--layout-cards .forecast-widget__day-icon {
	justify-content: center;
	margin: 0 auto;
}

.forecast-widget--layout-cards .forecast-widget__temps {
	justify-content: center;
}

@media (max-width: 900px) {
	.forecast-widget__daily {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.forecast-widget--layout-split {
		grid-template-areas:
			"header"
			"current"
			"daily";
		grid-template-columns: 1fr;
	}

	.forecast-widget--layout-split .forecast-widget__daily {
		border-left: 0;
		border-top: 1px solid var(--forecast-border-color);
		padding-left: 0;
		padding-top: var(--forecast-space-lg);
	}

	.forecast-widget--layout-split.forecast-widget--dark .forecast-widget__daily {
		border-top-color: rgba(243, 235, 224, 0.2);
		border-left-color: transparent;
	}
}

@media (max-width: 640px) {
	.forecast-widget__current {
		align-items: flex-start;
		grid-template-columns: minmax(0, 1fr) var(--forecast-icon-size-current);
	}

	.forecast-widget__daily {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 420px) {
	.forecast-widget__daily {
		grid-template-columns: 1fr;
	}
}
