/* ===========================================================================
 * Weather widget (Open-Meteo) — floating card + location permission modal.
 * Uses the theme's shared design tokens so it blends into both themes.
 * ======================================================================== */

.ltt-weather {
	position: fixed;
	right: clamp(0.75rem, 3vw, 1.5rem);
	bottom: clamp(0.75rem, 3vw, 1.5rem);
	z-index: 9998;
	font-family: var(--font, inherit);
	--w-surface: var(--surface, #fff);
	--w-ink: var(--ink, #11333b);
	--w-soft: var(--ink-soft, #4f6166);
	--w-line: var(--line, rgba(0, 0, 0, .12));
	--w-accent: var(--brand-gold, #c9a227);
	--w-radius: var(--radius, 16px);
}

/* Collapsed pill button */
.ltt-weather__toggle {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .55rem .8rem;
	border: 1px solid var(--w-line);
	border-radius: 999px;
	background: var(--w-surface);
	color: var(--w-ink);
	box-shadow: var(--shadow-md, 0 10px 30px rgba(0, 0, 0, .15));
	cursor: pointer;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	transition: transform .18s ease, box-shadow .18s ease;
}
.ltt-weather__toggle:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg, 0 18px 48px rgba(0, 0, 0, .2));
}
.ltt-weather__icon {
	font-size: 1.35rem;
	line-height: 1;
}
.ltt-weather__temp {
	min-width: 2.6ch;
	text-align: left;
	font-variant-numeric: tabular-nums;
}

/* Expanded panel */
.ltt-weather__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + .6rem);
	width: min(320px, calc(100vw - 1.5rem));
	padding: 1rem 1.1rem 1.05rem;
	background: var(--w-surface);
	border: 1px solid var(--w-line);
	border-radius: var(--w-radius);
	box-shadow: var(--shadow-lg, 0 18px 48px rgba(0, 0, 0, .18));
	color: var(--w-ink);
	animation: lttw-pop .2s ease;
}
.ltt-weather__panel[hidden] {
	display: none;
}
@keyframes lttw-pop {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ltt-weather__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .75rem;
}
.ltt-weather__loc {
	margin: 0;
	font-weight: 700;
	font-size: .98rem;
	line-height: 1.2;
}
.ltt-weather__desc {
	margin: .15rem 0 0;
	font-size: .82rem;
	color: var(--w-soft);
}
.ltt-weather__unit {
	display: inline-flex;
	flex: 0 0 auto;
	border: 1px solid transparent;
	border-radius: 999px;
	overflow: hidden;
}
.ltt-weather__unit button {
	border: 0;
	background: transparent;
	color: var(--w-soft);
	font: inherit;
	font-weight: 700;
	font-size: .82rem;
	padding: .25rem .55rem;
	cursor: pointer;
}
.ltt-weather__unit button.is-active {
	background: var(--w-accent);
	color: #fff;
}

.ltt-weather__body {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: .9rem;
}
.ltt-weather__big {
	font-size: 2.4rem;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.ltt-weather__meta {
	margin: 0;
	display: grid;
	gap: .3rem;
	font-size: .8rem;
}
.ltt-weather__meta dt {
	color: var(--w-soft);
	display: inline;
}
.ltt-weather__meta dd {
	margin: 0 0 0 .35rem;
	display: inline;
	font-weight: 700;
}
.ltt-weather__meta > div {
	white-space: nowrap;
}

.ltt-weather__foot {
	margin: .85rem 0 0;
	font-size: .72rem;
	color: var(--w-soft);
	border-top: 1px solid var(--w-line);
	padding-top: .55rem;
}

/* ---- Location permission modal ---- */
.ltt-weather-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}
.ltt-weather-modal[hidden] {
	display: none;
}
.ltt-weather-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 25, .55);
	backdrop-filter: blur(2px);
}
.ltt-weather-modal__card {
	position: relative;
	width: min(420px, 100%);
	background: #ffffff;
	border: 1px solid var(--w-line);
	border-radius: calc(var(--w-radius) + 4px);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
	padding: 1.75rem 1.5rem 1.5rem;
	text-align: center;
	animation: lttw-pop .22s ease;
}
.ltt-weather-modal__icon {
	font-size: 2.4rem;
	line-height: 1;
	margin-bottom: .5rem;
}
.ltt-weather-modal__title {
	margin: 0 0 .5rem;
	font-size: 1.25rem;
	color: var(--w-ink);
}
.ltt-weather-modal__text {
	margin: 0 0 1.25rem;
	color: var(--w-soft);
	font-size: .92rem;
	line-height: 1.5;
}
.ltt-weather-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	justify-content: center;
}
.ltt-weather-modal__actions .btn {
	min-width: 130px;
}

/* Mobile: keep the panel and modal comfortably inside small screens */
@media (max-width: 480px) {
	.ltt-weather__panel {
		right: 50%;
		transform: translateX(50%);
		bottom: calc(100% + .5rem);
	}
	.ltt-weather__body {
		flex-direction: column;
		align-items: flex-start;
		gap: .5rem;
	}
	.ltt-weather__big {
		font-size: 2rem;
	}
}
