/* ============================================================
   Global Weather widget — yt-weather
   Modes: full / compact / product. Uses theme design tokens.
   ============================================================ */

.yt-weather {
	--ytw-radius: 14px;
	--ytw-shadow: 0 10px 30px rgba(4, 150, 132, 0.08);
	font-family: var(--font-primary);
	color: #1f2d2c;
	line-height: 1.5;
}

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

.ytw-num {
	font-family: var(--font-numeric);
	font-variant-numeric: tabular-nums;
}

/* ---------- Loading / error states ---------- */

.ytw-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 40px 16px;
	color: var(--color-text-light-gray);
	font-size: 14px;
}

.ytw-state--error {
	color: #b4554f;
	background: #fdf3f2;
	border: 1px solid #f0d4d2;
	border-radius: var(--ytw-radius);
}

.ytw-spinner {
	width: 28px;
	height: 28px;
	border: 3px solid var(--color-bg-teal-light);
	border-top-color: var(--color-primary);
	border-radius: 50%;
	display: inline-block;
	animation: ytw-spin 0.8s linear infinite;
}

@keyframes ytw-spin {
	to { transform: rotate(360deg); }
}

/* ---------- Toolbar (full mode) ---------- */

.ytw-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

.ytw-search {
	position: relative;
	flex: 1 1 320px;
	max-width: 460px;
	display: flex;
	align-items: center;
}

.ytw-search__input {
	width: 100%;
	height: 48px;
	padding: 0 52px 0 20px;
	border: 1.5px solid var(--color-border);
	border-radius: 999px;
	background: #fff;
	font-size: 15px;
	font-family: var(--font-primary);
	color: #1f2d2c;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ytw-search__input:focus {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 4px rgba(5, 174, 153, 0.12);
}

.ytw-search__geo {
	position: absolute;
	right: 6px;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 50%;
	background: var(--color-bg-teal-light);
	color: var(--color-primary-dark);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.ytw-search__geo:hover {
	background: #d6ede9;
}

.ytw-search__geo:disabled {
	opacity: 0.5;
	cursor: wait;
}

/* Autocomplete dropdown */
.ytw-ac {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--color-border-light);
	border-radius: 12px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	z-index: 30;
}

.ytw-ac__item {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 11px 18px;
	border: none;
	background: none;
	text-align: left;
	cursor: pointer;
	font-family: var(--font-primary);
}

.ytw-ac__item:hover {
	background: var(--color-bg-teal-light);
}

.ytw-ac__name {
	font-size: 14px;
	font-weight: 600;
	color: #1f2d2c;
}

.ytw-ac__sub {
	font-size: 12px;
	color: var(--color-text-light-gray);
}

/* Chips */
.ytw-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ytw-chip {
	padding: 8px 16px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-family: var(--font-primary);
	color: #425452;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ytw-chip:hover {
	border-color: var(--color-primary);
	color: var(--color-primary-dark);
	background: var(--color-bg-green-white);
}

/* ---------- Hero current card (full mode) ---------- */

.ytw-current--hero {
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	padding: 40px clamp(20px, 4vw, 48px);
	color: #fff;
	background: linear-gradient(135deg, #05ae99 0%, #079684 55%, #0a7d72 100%);
	box-shadow: var(--ytw-shadow);
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 32px;
	align-items: center;
}

.ytw-current__main {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"place icon"
		"temp  icon"
		"desc  desc";
	align-items: center;
	gap: 6px 20px;
}

.ytw-current__place { grid-area: place; }

.ytw-current__name {
	font-size: clamp(20px, 2.4vw, 28px);
	font-weight: 700;
	line-height: 1.2;
}

.ytw-current__sub {
	font-size: 13px;
	opacity: 0.85;
	margin-top: 2px;
}

.ytw-current__icon {
	grid-area: icon;
	width: clamp(64px, 8vw, 96px);
	height: clamp(64px, 8vw, 96px);
	color: rgba(255, 255, 255, 0.95);
}

.ytw-current__icon svg {
	width: 100%;
	height: 100%;
}

.ytw-current__temp {
	grid-area: temp;
	display: flex;
	align-items: flex-start;
	line-height: 1;
}

.ytw-current__temp .ytw-num {
	font-size: clamp(64px, 9vw, 104px);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.ytw-current__temp .ytw-unit {
	font-size: 22px;
	font-weight: 600;
	margin: 12px 0 0 4px;
	opacity: 0.9;
}

.ytw-current__desc {
	grid-area: desc;
	font-size: 14px;
	opacity: 0.9;
	margin-top: 6px;
}

/* Metric tiles on the hero card */
.ytw-current--hero .ytw-metrics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.ytw-current--hero .ytw-metric {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 12px;
	padding: 14px 16px;
	backdrop-filter: blur(4px);
}

.ytw-current--hero .ytw-metric__v {
	display: block;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
}

.ytw-current--hero .ytw-metric__l {
	display: block;
	font-size: 12px;
	opacity: 0.82;
	margin-top: 2px;
}

/* ---------- Compact card (shortcode / product) ---------- */

.ytw-card__title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 14px;
	color: #1f2d2c;
}

.ytw-card {
	background: linear-gradient(135deg, var(--color-bg-green-white), var(--color-bg-teal-light));
	border: 1px solid #cfe7e2;
	border-radius: var(--ytw-radius);
	padding: 22px 24px;
}

.ytw-card__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 14px;
}

.ytw-card__name {
	font-size: 17px;
	font-weight: 700;
	color: #1f2d2c;
	line-height: 1.25;
}

.ytw-card__desc {
	font-size: 13px;
	color: #54706c;
	margin-top: 2px;
}

.ytw-card__icon {
	width: 52px;
	height: 52px;
	color: var(--color-primary);
}

.ytw-card__icon svg {
	width: 100%;
	height: 100%;
}

.ytw-card__temp {
	display: flex;
	align-items: flex-start;
	line-height: 1;
}

.ytw-card__temp .ytw-num {
	font-size: 44px;
	font-weight: 700;
	color: #153833;
	letter-spacing: -0.02em;
}

.ytw-card__temp .ytw-unit {
	font-size: 14px;
	font-weight: 600;
	margin: 6px 0 0 2px;
	color: #54706c;
}

/* Light metric row */
.ytw-card .ytw-metrics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px dashed rgba(4, 150, 132, 0.25);
}

.ytw-card .ytw-metric {
	text-align: center;
}

.ytw-card .ytw-metric__v {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #153833;
}

.ytw-card .ytw-metric__l {
	display: block;
	font-size: 11.5px;
	color: #6a8480;
	margin-top: 2px;
}

.ytw-more {
	display: inline-block;
	margin-top: 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-primary-dark);
	text-decoration: none;
}

.ytw-more:hover {
	color: var(--color-primary);
	text-decoration: underline;
}

/* ---------- 7-day forecast ---------- */

.ytw-daily {
	margin-top: 22px;
}

.ytw-daylist {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 10px;
}

.ytw-day {
	background: #fff;
	border: 1px solid var(--color-border-light);
	border-radius: 12px;
	padding: 14px 8px;
	text-align: center;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ytw-day:hover {
	transform: translateY(-2px);
	border-color: var(--color-primary-light);
	box-shadow: 0 8px 20px rgba(5, 174, 153, 0.1);
}

.ytw-day__dow {
	font-size: 12px;
	font-weight: 600;
	color: #54706c;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ytw-day__icon {
	width: 38px;
	height: 38px;
	margin: 8px auto;
	color: var(--color-primary);
}

.ytw-day__icon svg {
	width: 100%;
	height: 100%;
}

.ytw-day__range {
	font-size: 14px;
}

.ytw-day__range b {
	font-weight: 700;
	color: #1f2d2c;
}

.ytw-day__range span {
	color: var(--color-text-light-gray);
	margin-left: 4px;
}

.ytw-day__pop {
	font-size: 11px;
	color: #4a8fb0;
	margin-top: 3px;
}

/* Compact/shortcode variant — same full-width adaptive grid as full page */
.ytw-daily--mini {
	margin-top: 14px;
}

.ytw-daily--mini .ytw-daylist {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 10px;
}

.ytw-daily--mini .ytw-day {
	padding: 12px 6px;
}

.ytw-daily--mini .ytw-day__icon {
	width: 34px;
	height: 34px;
	margin: 6px auto;
}

.ytw-daily--mini .ytw-day__range {
	font-size: 13px;
}

/* ---------- Credit ---------- */

.ytw-credit {
	margin-top: 22px;
	text-align: right;
	font-size: 12px;
	color: var(--color-text-light-gray);
}

.ytw-credit a {
	color: var(--color-primary-dark);
	text-decoration: none;
}

.ytw-credit a:hover {
	text-decoration: underline;
}

/* ---------- Product page wrapper ---------- */

.yt-weather-product {
	padding: 56px 0;
	background: var(--color-bg-green-gray);
}

.yt-weather-product .container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 40px);
}

.yt-weather-product .yt-weather {
	max-width: 760px;
	margin: 0 auto;
}

/* ---------- Standalone page ---------- */

/* Force a solid white header on the weather page so the (white) logo and
   dark nav links stay visible against the teal hero. The default transparent
   header is designed for the homepage's dark hero image. */
.yt-weather-template .l-header {
	top: 0;
	height: 90px;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.yt-weather-hero {
	background: linear-gradient(135deg, #05ae99 0%, #079684 55%, #0a7d72 100%);
	color: #fff;
	padding: calc(90px + 52px) 0 52px; /* 90px solid header + breathing room */
}

.yt-weather-hero .container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 40px);
}

.yt-weather-hero .page-subtitle {
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.85;
	margin-bottom: 10px;
	font-family: var(--font-numeric);
}

.yt-weather-hero .page-title {
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 800;
	line-height: 1.15;
	margin: 0;
	color: #fff;
}

.yt-weather-page {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 44px clamp(16px, 4vw, 40px) 72px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.ytw-current--hero {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.ytw-daylist {
		grid-template-columns: repeat(4, 1fr);
	}

	.ytw-daily--mini .ytw-daylist {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 640px) {
	.ytw-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.ytw-search {
		max-width: none;
	}

	.ytw-current--hero {
		padding: 28px 20px;
	}

	.ytw-current__main {
		grid-template-columns: 1fr auto;
	}

	.ytw-current--hero .ytw-metrics {
		grid-template-columns: repeat(2, 1fr);
	}

	.ytw-daylist {
		grid-template-columns: repeat(2, 1fr);
	}

	.ytw-daily--mini .ytw-daylist {
		grid-template-columns: repeat(2, 1fr);
	}

	.ytw-card__top {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.ytw-card__temp {
		grid-column: 1 / -1;
	}

	.ytw-card .ytw-metrics {
		grid-template-columns: repeat(3, 1fr);
	}
}
