/**
 * GenWeather Home — Premium chrome overlay for Core weather pages.
 * Presentation only. Does not alter Core templates or weather APIs.
 */

/* —— Sticky nav offset + admin bar —— */
html {
	scroll-padding-top: 5rem;
}

body.admin-bar .gwh-chrome--header {
	top: 32px;
}

body.admin-bar.gwh-weather-chrome {
	scroll-padding-top: calc(5rem + 32px);
	padding-top: calc(4.25rem + 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .gwh-chrome--header {
		top: 46px;
	}

	body.admin-bar.gwh-weather-chrome {
		scroll-padding-top: calc(5rem + 46px);
		padding-top: calc(4.25rem + 46px);
	}
}

/* —— Hide Core chrome (replaced by Premium nav/footer) —— */
body.gwh-weather-chrome .gw-topbar,
body.gwh-weather-chrome .gw-footer,
body.gwh-weather-chrome > a.gw-skip {
	display: none !important;
}

/* —— Shared shell width (align with Home --gwh-max) —— */
body.gwh-weather-chrome {
	--gw-max: 72rem;
	--gwh-pad: clamp(1rem, 3.2vw, 2.75rem);
}

body.gwh-weather-chrome .gw-shell {
	width: min(100% - (var(--gwh-pad) * 2), var(--gw-max));
	max-width: none;
	padding-left: 0;
	padding-right: 0;
	overflow: visible;
}

body.gwh-weather-chrome .gwh-site-footer {
	position: relative;
	z-index: 5;
	margin-top: 2rem;
	border-top: 1px solid rgba(238, 243, 251, 0.1);
	background: rgba(7, 11, 22, 0.88);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

body.gwh-weather-chrome[data-gw-theme="light"] .gwh-site-footer,
body.gwh-weather-chrome.gwh-theme-light .gwh-site-footer {
	border-top-color: rgba(15, 23, 42, 0.1);
	background: rgba(255, 255, 255, 0.92);
}

body.gwh-weather-chrome .gwh-chrome--header {
	z-index: 200;
	overflow: visible;
}

body.gwh-weather-chrome .gw-alerts {
	position: relative;
	z-index: 2;
}

body.gwh-weather-chrome .gw-hero {
	position: relative;
	z-index: 1;
}

@media (min-width: 768px) {
	body.gwh-weather-chrome {
		--gw-max: 92vw;
	}
}

@media (min-width: 1024px) {
	body.gwh-weather-chrome {
		--gw-max: 60rem;
	}
}

@media (min-width: 1280px) {
	body.gwh-weather-chrome {
		--gw-max: 76rem;
	}
}

@media (min-width: 1440px) {
	body.gwh-weather-chrome {
		--gw-max: 88rem;
	}
}

@media (min-width: 1600px) {
	body.gwh-weather-chrome {
		--gw-max: 98rem;
	}
}

@media (min-width: 1920px) {
	body.gwh-weather-chrome {
		--gw-max: 112rem;
	}
}

@media (min-width: 2560px) {
	body.gwh-weather-chrome {
		--gw-max: 128rem;
	}
}

/* —— Weather hero: roomier desktop stage —— */
body.gwh-weather-chrome .gw-hero {
	--gw-card-1-pad: 1.35rem 1.25rem 1.25rem;
}

body.gwh-weather-chrome .gw-hero__city {
	margin: 0 0 0.25rem;
}

body.gwh-weather-chrome .gw-hero__country,
body.gwh-weather-chrome .gw-hero__loc {
	margin-bottom: 1.1rem;
}

body.gwh-weather-chrome .gw-hero__stage {
	gap: 1rem 1.15rem;
}

@media (min-width: 900px) {
	body.gwh-weather-chrome .gw-hero {
		--gw-card-1-pad: 2rem 1.85rem 1.7rem;
	}

	body.gwh-weather-chrome .gw-hero__city {
		margin-bottom: 0.35rem;
		letter-spacing: -0.03em;
	}

	body.gwh-weather-chrome .gw-hero__stage {
		gap: 1.5rem 2rem;
		align-items: start;
	}

	body.gwh-weather-chrome .gw-hero__temp-block {
		max-width: none;
		padding-right: 0.35rem;
	}

	body.gwh-weather-chrome .gw-hero__summary {
		padding: 1.15rem 1.25rem 1.2rem;
	}

	body.gwh-weather-chrome .gw-hero__visual {
		margin-top: 0.35rem;
		padding-left: 0.5rem;
	}

	body.gwh-weather-chrome .gw-hero__icon,
	body.gwh-weather-chrome .gw-hero-wx {
		width: clamp(6.5rem, 10vw, 8.5rem);
		height: clamp(6.5rem, 10vw, 8.5rem);
		--gw-wx-size: clamp(6.5rem, 10vw, 8.5rem);
	}
}

@media (min-width: 1280px) {
	body.gwh-weather-chrome .gw-hero__stage {
		gap: 1.75rem 2.5rem;
	}

	body.gwh-weather-chrome .gw-hero__temp {
		font-size: clamp(4.5rem, 6vw, 5.5rem);
	}
}

@media (min-width: 1600px) {
	body.gwh-weather-chrome .gw-hero__stage {
		gap: 2rem 3rem;
	}
}

/* —— Conditions grid: 1 / 2 / 3–4 columns —— */
body.gwh-weather-chrome .gw-details {
	grid-template-columns: minmax(0, 1fr);
	gap: 0.65rem;
}

@media (min-width: 640px) {
	body.gwh-weather-chrome .gw-details {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	body.gwh-weather-chrome .gw-details {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.75rem;
	}
}

@media (min-width: 1440px) {
	body.gwh-weather-chrome .gw-details {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

body.gwh-weather-chrome .gw-detail {
	min-height: 4rem;
	min-width: 0;
}

/* —— Alert collapse (presentation layer) —— */
body.gwh-weather-chrome .gw-alerts {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

body.gwh-weather-chrome .gw-alert-chip.gwh-alert-extra {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	margin: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	border-width: 0 !important;
	pointer-events: none;
	transform: translateY(-4px);
	transition:
		max-height 0.32s var(--gwh-ease, cubic-bezier(0.22, 1, 0.36, 1)),
		opacity 0.28s ease,
		transform 0.28s ease,
		margin 0.28s ease,
		padding 0.28s ease,
		border-width 0.28s ease;
}

body.gwh-weather-chrome .gw-alert-chip.gwh-alert-extra.is-revealed {
	max-height: 14rem;
	opacity: 1;
	margin: 0 !important;
	padding: 0.85rem 0.95rem !important;
	border-width: 1px !important;
	border-left-width: 4px !important;
	pointer-events: auto;
	transform: none;
}

body.gwh-weather-chrome .gwh-alerts-toggle {
	align-self: flex-start;
	margin: 0.1rem 0 0.15rem;
	padding: 0.45rem 0.85rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.08);
	color: inherit;
	font: 600 0.85rem/1.2 system-ui, sans-serif;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

body.gwh-weather-chrome .gwh-alerts-toggle:hover,
body.gwh-weather-chrome .gwh-alerts-toggle:focus-visible {
	background: rgba(59, 158, 255, 0.18);
	border-color: rgba(59, 158, 255, 0.45);
	outline: none;
}

body.gwh-weather-chrome[data-gw-theme="light"] .gwh-alerts-toggle {
	border-color: rgba(15, 23, 42, 0.14);
	background: rgba(15, 23, 42, 0.04);
}

@media (prefers-reduced-motion: reduce) {
	body.gwh-weather-chrome .gw-alert-chip.gwh-alert-extra {
		transition: none;
	}
}

/* —— Light theme chrome polish on weather —— */
body.gwh-weather-chrome[data-gw-theme="light"] .gwh-chrome--header,
body.gwh-weather-chrome.gwh-theme-light .gwh-chrome--header {
	background: rgba(255, 255, 255, 0.86);
}

body.gwh-weather-chrome[data-gw-theme="light"] .gwh-nav__dropdown,
body.gwh-weather-chrome[data-gw-theme="light"] .gwh-nav__drawer,
body.gwh-weather-chrome[data-gw-theme="light"] .gwh-nav-search-panel,
body.gwh-weather-chrome[data-gw-theme="light"] .gwh-search__results {
	background: rgba(255, 255, 255, 0.98);
	color-scheme: light;
}

/* —— Condition-aware ambient FX (presentation only; respects reduced motion) —— */
body.gwh-weather-chrome .gw-sky {
	overflow: hidden;
}

body.gwh-weather-chrome[data-gw-condition="clear"] .gw-fx--glow,
body.gwh-weather-chrome[data-gw-condition="Clear"] .gw-fx--glow {
	opacity: 0.55;
	animation: gwh-sun-breathe 9s ease-in-out infinite;
}

body.gwh-weather-chrome[data-gw-condition="clouds"] .gw-fx--cloud,
body.gwh-weather-chrome[data-gw-condition="Clouds"] .gw-fx--cloud,
body.gwh-weather-chrome[data-gw-condition="fog"] .gw-fx--cloud {
	opacity: 0.45;
	animation: gwh-cloud-drift 48s linear infinite;
}

body.gwh-weather-chrome[data-gw-condition="rain"] .gw-rain-layer,
body.gwh-weather-chrome[data-gw-condition="Rain"] .gw-rain-layer,
body.gwh-weather-chrome[data-gw-condition="drizzle"] .gw-rain-layer {
	opacity: 0.7;
	background-image: repeating-linear-gradient(
		-18deg,
		transparent 0,
		transparent 10px,
		rgba(180, 210, 255, 0.18) 10px,
		rgba(180, 210, 255, 0.18) 11px
	);
	background-size: 18px 28px;
	animation: gwh-rain-fall 0.85s linear infinite;
}

body.gwh-weather-chrome[data-gw-condition="snow"] .gw-snow-layer,
body.gwh-weather-chrome[data-gw-condition="Snow"] .gw-snow-layer {
	opacity: 0.65;
	background-image:
		radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.75), transparent),
		radial-gradient(2px 2px at 70% 40%, rgba(255, 255, 255, 0.55), transparent),
		radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 255, 255, 0.65), transparent),
		radial-gradient(2px 2px at 85% 15%, rgba(255, 255, 255, 0.5), transparent);
	background-size: 140px 140px;
	animation: gwh-snow-fall 11s linear infinite;
}

body.gwh-weather-chrome[data-gw-condition="thunderstorm"] .gw-fx--lightning,
body.gwh-weather-chrome[data-gw-condition="Thunderstorm"] .gw-fx--lightning {
	opacity: 0.35;
	animation: gwh-lightning 7s ease-in-out infinite;
}

@keyframes gwh-sun-breathe {
	0%, 100% { transform: scale(1); opacity: 0.45; }
	50% { transform: scale(1.06); opacity: 0.65; }
}

@keyframes gwh-cloud-drift {
	0% { transform: translateX(-4%); }
	100% { transform: translateX(4%); }
}

@keyframes gwh-rain-fall {
	0% { background-position: 0 0; }
	100% { background-position: 18px 28px; }
}

@keyframes gwh-snow-fall {
	0% { background-position: 0 0, 40px 20px, 10px 60px, 80px 10px; }
	100% { background-position: 0 140px, 40px 160px, 10px 200px, 80px 150px; }
}

@keyframes gwh-lightning {
	0%, 88%, 100% { opacity: 0; }
	90% { opacity: 0.55; }
	92% { opacity: 0.1; }
	94% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
	body.gwh-weather-chrome .gw-fx--glow,
	body.gwh-weather-chrome .gw-fx--cloud,
	body.gwh-weather-chrome .gw-rain-layer,
	body.gwh-weather-chrome .gw-snow-layer,
	body.gwh-weather-chrome .gw-fx--lightning {
		animation: none !important;
	}
}
