/**
 * 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, icon-size and badge variables are intentionally NOT declared here.
	 * Each one carries its default at the point of use, as var(--x, default),
	 * and get_custom_style_output() in class-forecast-by-soren-shortcodes.php
	 * emits a variable only when the admin set a value. Declaring the defaults
	 * as variables in this static file would invite a cascade-order bug: if
	 * anything on a client site reorders CSS (a minifier/combiner/cache), a
	 * hardcoded default here could silently win over an admin-configured
	 * color. A var() fallback can't, because it only applies when nothing
	 * sets the variable at all.
	 *
	 * The defaults match forecast_by_soren_default_settings(), which the admin
	 * shows as each blank field's placeholder.
	 *
	 * Typography is the opposite case and lives here as literal values. As of
	 * 5.3.0 the Element Editor emits a rule per element only for properties
	 * someone actually set, so these literals are the design's real defaults —
	 * they have to survive an empty Element Editor. A per-element rule beats
	 * them on specificity (two classes to one), so there's no cascade risk.
	 */
	--forecast-space-xs: 0.35rem;
	--forecast-space-sm: 0.65rem;
	--forecast-space-md: 1rem;
	--forecast-space-lg: 1.5rem;
	--forecast-space-xl: 2.25rem; /* overridden per-site by Section Spacing */
	--forecast-radius: 8px;
	box-sizing: border-box;
	color: var(--forecast-color-text, #333333);
	font-family: inherit;
}

.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 carry their defaults
	   as var() fallbacks and are only set by the inline admin style when
	   changed. Background is intentionally not settable — Cornerstone's own
	   section controls it. */
	align-items: center;
	background: transparent;
	color: var(--forecast-bar-text-color, #333333);
	display: inline-flex;
	font-family: var(--forecast-bar-font, inherit);
	font-size: var(--forecast-bar-font-size, 0.95rem);
	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, #333333);
	text-decoration: none;
}

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

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

.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: var(--forecast-widget-bg, transparent);
	border: 0;
	border-radius: var(--forecast-widget-radius, 0);
	color: var(--forecast-color-text, #333333);
	font-size: 1.1rem;
	max-width: var(--forecast-widget-max-width, 100%);
	padding: var(--forecast-widget-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, #333333);
	font-family: inherit;
	font-size: 0.78rem;
	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: inherit;
	font-size: 3rem;
	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, clamp(7rem, 18vw, 11rem));
	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, #333333);
	display: flex;
	height: var(--forecast-icon-size-current, clamp(7rem, 18vw, 11rem));
	justify-content: center;
	order: 2;
	padding: 0;
	width: var(--forecast-icon-size-current, clamp(7rem, 18vw, 11rem));
}

.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, #333333);
	height: 100%;
	stroke: currentColor;
	width: 100%;
}

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

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

.forecast-widget__current-desc {
	color: inherit;
	font-size: 1.1rem;
	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, #333333);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0;
	margin-right: 0.35rem;
	text-transform: uppercase;
}

.forecast-widget__daily {
	border-top: 1px solid var(--forecast-border-color, rgba(54, 38, 22, 0.16));
	display: grid;
	gap: clamp(0.75rem, 1.8vw, 1.25rem);
	grid-template-columns: repeat(var(--forecast-daily-columns, 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: inherit;
	font-size: 0.78rem;
	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, #333333);
	display: flex;
	height: var(--forecast-icon-size-day, 3.35rem);
	justify-content: flex-start;
	width: var(--forecast-icon-size-day, 3.35rem);
}

.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: inherit;
	font-size: 1.1rem;
	gap: 0.25rem 0.5rem;
	line-height: 1.35;
	margin: 0;
}

.forecast-widget__temps strong {
	color: var(--forecast-color-accent, #333333);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0;
	text-transform: uppercase;
}

.forecast-widget__day-desc {
	color: inherit;
	font-size: 1.1rem;
	line-height: 1.35;
	margin: 0;
	opacity: 0.88;
}

.forecast-widget__unavailable {
	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, rgba(54, 38, 22, 0.16));
	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, rgba(54, 38, 22, 0.16));
	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, rgba(54, 38, 22, 0.16));
		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, clamp(7rem, 18vw, 11rem));
	}

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

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

/* ── Seasonal climate ───────────────────────────────────────────
   [forecast_seasons] on a community or destination page. Deliberately
   plainer than the weather widget: this is reference material read
   once while planning a trip, not a live readout. */

.fg-seasons {
	margin: var(--fg-seasons-margin, 0 0 2em);
}

.fg-seasons__heading {
	margin: 0 0 .75em;
	font-size: var(--fg-seasons-heading-size, 1.125rem);
}

.fg-seasons__grid {
	display: grid;
	/* Wraps on its own: as many cards per row as fit at the minimum width.
	   min() keeps one card from overflowing a column narrower than that. */
	grid-template-columns: repeat(auto-fit, minmax(min(var(--fg-season-min-width, 110px), 100%), 1fr));
	gap: var(--fg-seasons-gap, 12px);
}

.fg-season {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: var(--fg-season-padding, 14px 16px);
	background: var(--fg-season-bg, rgba(0, 0, 0, .03));
	border: var(--fg-season-border-width, 0) solid var(--fg-season-border-color, transparent);
	border-radius: var(--fg-season-radius, 8px);
	text-align: var(--fg-season-align, left);
}

.fg-season__name {
	font-size: var(--fg-season-name-size, .75rem);
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	opacity: .7;
}

.fg-season__temp {
	font-size: var(--fg-season-temp-size, 1.75rem);
	font-weight: 700;
	line-height: 1.1;
}

.fg-season__low {
	font-size: var(--fg-season-low-size, .8125rem);
	opacity: .65;
}

.fg-seasons__source {
	margin: .75em 0 0;
	font-size: var(--fg-seasons-source-size, .75rem);
	opacity: .6;
}
