/*
 * Sidebar information blocks of the portal (currency: mod_currency, weather: mod_weather, calendar: mod_calendar).
 * Markup comes from components/com_currency/view.php, components/com_weather/wx_block.php and modules/mod_calendar_lib.php.
 * .nmb is the shared block shell; .nmb-fx, .nmb-wx and .nmcal are the block types (.nmcal also on the /calendar page).
 */

.nmb {
	--nmb-ink: #1e293b;
	--nmb-muted: #64748b;
	--nmb-line: #e5eaf1;
	--nmb-soft: #f3f6fa;
	--nmb-accent: #385C88;
	--nmb-up: #b42318;
	--nmb-down: #15803d;
	font-size: 13px;
	line-height: 1.4;
	color: var(--nmb-ink);
	font-variant-numeric: tabular-nums;
}

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

.nmb ul,
.nmb ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* caption line above a list */
.nmb-cap {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--nmb-muted);
}

/* footer: data note on the left, link to the full page on the right */
.nmb-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 10px;
	margin-top: 8px;
	padding-top: 7px;
	border-top: 1px solid var(--nmb-line);
	font-size: 12px;
	color: var(--nmb-muted);
}

.nmb-foot a {
	margin-left: auto;
	color: var(--nmb-accent);
	font-weight: bold;
	text-decoration: none;
	white-space: nowrap;
}

.nmb-foot a:hover,
.nmb-foot a:focus {
	text-decoration: underline;
}

.nmb-empty {
	margin: 4px 0;
	color: var(--nmb-muted);
}

.nmb-up { color: var(--nmb-up); }
.nmb-down { color: var(--nmb-down); }
.nmb-same { color: var(--nmb-muted); }

/* ---------- currency ---------- */

.nmb-fx-list li {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	border-top: 1px solid var(--nmb-line);
}

.nmb-fx-list li:first-child {
	border-top: 0;
}

.nmb-fx-cc {
	min-width: 38px;
	padding: 2px 0;
	border-radius: 4px;
	background: var(--nmb-soft);
	color: var(--nmb-accent);
	font-size: 11px;
	font-weight: bold;
	letter-spacing: .04em;
	text-align: center;
}

.nmb-fx-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nmb-fx-val {
	text-align: right;
	line-height: 1.2;
}

.nmb-fx-val b {
	display: block;
	font-size: 15px;
}

.nmb-fx-d {
	display: block;
	font-size: 11px;
}

.nmb-fx-d.nmb-up::before { content: "\25B2\00A0"; font-size: 8px; vertical-align: 1px; }
.nmb-fx-d.nmb-down::before { content: "\25BC\00A0"; font-size: 8px; vertical-align: 1px; }

/* ---------- weather ---------- */

.nmb-wx-card {
	padding: 10px 12px;
	border-radius: 10px;
	background: linear-gradient(135deg, #eaf3fc, #f7fafd);
}

.nmb-night .nmb-wx-card {
	background: linear-gradient(135deg, #e6e9f2, #f4f5f9);
}

.nmb-wx-now {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nmb-wx-now .wx-ico {
	flex: none;
}

.nmb-wx-t {
	font-size: 34px;
	font-weight: 300;
	line-height: 1;
	white-space: nowrap;
}

.nmb-wx-d {
	min-width: 0;
	margin-left: 4px;
}

.nmb-wx-d b {
	display: block;
	font-size: 14px;
}

.nmb-wx-d span {
	color: var(--nmb-muted);
	font-size: 12px;
}

.nmb-wx-facts {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-top: 10px !important;
}

.nmb-wx-facts li {
	padding: 5px 6px;
	border-radius: 7px;
	background: rgba(255, 255, 255, .75);
	text-align: center;
}

.nmb-wx-facts span {
	display: block;
	color: var(--nmb-muted);
	font-size: 11px;
}

.nmb-wx-facts b {
	font-size: 12px;
	white-space: nowrap;
}

.nmb-wx-days {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	margin-top: 8px !important;
}

.nmb-wx-days li {
	padding: 4px 2px;
	text-align: center;
}

.nmb-wx-days .wx-ico {
	display: block;
	margin: 2px auto;
}

.nmb-wx-dn {
	display: block;
	font-size: 12px;
	font-weight: bold;
}

.nmb-wx-tt {
	display: block;
	color: var(--nmb-muted);
	white-space: nowrap;
}

.nmb-wx-tt b {
	color: var(--nmb-ink);
}

.nmb-wx-pop {
	display: block;
	color: #0284c7;
	font-size: 11px;
}

/* very narrow sidebars: keep the facts readable */
@media (max-width: 300px) {
	.nmb-wx-facts {
		grid-template-columns: 1fr;
	}
}

/* ---------- calendar ---------- */

.nmcal {
	--nmcal-we: #b42318;
	--nmcal-chip: #fdeee6;
	--nmcal-chip-ink: #9a3412;
}

.nmcal p {
	margin: 0;
}

/* month card */
.nmcal-card {
	position: relative;
	padding: 8px 8px 6px;
	border-radius: 12px;
	background: linear-gradient(160deg, #eaf3fc 0%, #f7fafd 70%);
	box-shadow: inset 0 0 0 1px rgba(56, 92, 136, .08);
}

.nmcal-nav {
	display: none;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 4px;
}

.nmcal-js .nmcal-nav {
	display: flex;
}

.nmcal-ttl {
	flex: 1;
	font-size: 15px;
	font-weight: bold;
	text-align: center;
	letter-spacing: .01em;
}

.nmcal-nav button,
.nmcal-x {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	box-shadow: 0 1px 2px rgba(30, 41, 59, .12);
	color: var(--nmb-accent);
	font: bold 18px/30px Arial, sans-serif;
	text-align: center;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.nmcal-nav button:hover {
	background: var(--nmb-accent);
	color: #fff;
}

.nmcal-nav button:disabled {
	background: transparent;
	box-shadow: none;
	color: #b8c2d0;
	cursor: default;
}

.nmcal button:focus-visible,
.nmcal a:focus-visible {
	outline: 2px solid #1a3a6e;
	outline-offset: 1px;
}

.nmcal-grid {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	table-layout: fixed;
}

.nmcal-grid caption {
	padding: 0 0 4px;
	font-size: 15px;
	font-weight: bold;
	text-align: center;
}

.nmcal-js .nmcal-grid caption {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nmcal-grid th {
	padding: 4px 0 6px;
	border: 0;
	background: none;
	color: var(--nmb-muted);
	font-size: 11px;
	font-weight: bold;
	text-align: center;
}

.nmcal-grid th:nth-child(n+6) {
	color: var(--nmcal-we);
}

.nmcal-grid td {
	height: 36px;
	padding: 1px 0;
	border: 0;
	text-align: center;
	vertical-align: middle;
}

.nmcal-off {
	display: none !important;
}

.nmcal-d {
	position: relative;
	display: block;
	width: 32px;
	height: 32px;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--nmb-ink);
	font: inherit;
	font-size: 13px;
	line-height: 32px;
	text-align: center;
}

.nmcal-grid td:nth-child(n+6) .nmcal-d {
	color: var(--nmcal-we);
}

.nmcal-past .nmcal-d {
	opacity: .55;
}

button.nmcal-d {
	font-weight: bold;
	cursor: pointer;
	transition: background .15s, box-shadow .15s, transform .1s;
}

button.nmcal-d:hover {
	background: #fff;
	box-shadow: 0 1px 4px rgba(30, 41, 59, .18);
	opacity: 1;
}

button.nmcal-d:active {
	transform: scale(.94);
}

/* event dot */
button.nmcal-has::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 3px;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--nmb-accent);
}

.nmcal-grid td:nth-child(n+6) button.nmcal-has::after {
	background: var(--nmcal-we);
}

/* today: filled accent circle */
.nmcal-grid td.nmcal-today .nmcal-d {
	background: var(--nmb-accent);
	box-shadow: 0 2px 6px rgba(56, 92, 136, .4);
	color: #fff;
	font-weight: bold;
	opacity: 1;
}

.nmcal-grid td.nmcal-today button.nmcal-has::after {
	background: #fff;
}

/* the chosen day */
.nmcal .nmcal-grid td button.nmcal-d[aria-pressed=true] {
	background: #fff;
	box-shadow: 0 0 0 2px var(--nmb-accent);
	color: var(--nmb-accent);
}

.nmcal .nmcal-grid td.nmcal-today button.nmcal-d[aria-pressed=true] {
	background: var(--nmb-accent);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--nmb-accent);
	color: #fff;
}

/* day panel under the grid */
.nmcal-day {
	position: relative;
	margin: 6px 0 2px;
	padding: 8px 34px 8px 10px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 4px rgba(30, 41, 59, .1);
	animation: nmcal-in .18s ease-out;
}

.nmcal-x {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 24px;
	height: 24px;
	box-shadow: none;
	background: var(--nmb-soft);
	font-size: 15px;
	line-height: 24px;
}

.nmcal-x:hover {
	background: var(--nmb-line);
}

.nmcal-dh {
	margin: 0 0 4px !important;
	font-size: 13px;
	font-weight: bold;
}

@keyframes nmcal-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

/* today / tomorrow */
.nmcal-sec {
	margin-top: 10px;
}

.nmcal-sec .nmb-cap b {
	color: var(--nmb-ink);
}

.nmcal ul.nmcal-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nmcal-list li {
	position: relative;
	margin: 0;
	padding: 5px 0 5px 12px;
	border-top: 1px solid var(--nmb-line);
	background: none;
	line-height: 1.35;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.nmcal-list li:first-child {
	border-top: 0;
}

.nmcal-list li::before {
	content: "";
	position: absolute;
	left: 1px;
	top: 11px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--nmb-accent);
	opacity: .5;
}

.nmcal-list a {
	color: var(--nmb-ink);
	text-decoration: none;
}

.nmcal-list a:hover,
.nmcal-list a:focus {
	color: var(--nmb-accent);
	text-decoration: underline;
}

.nmcal-list li.nmcal-nd,
.nmcal-list li.nmcal-more {
	padding-left: 0;
}

.nmcal-list li.nmcal-nd::before,
.nmcal-list li.nmcal-more::before {
	display: none;
}

.nmcal-list li.nmcal-nd a {
	color: var(--nmb-muted);
}

.nmcal-list li.nmcal-more a {
	color: var(--nmb-accent);
	font-weight: bold;
}

.nmcal-tm {
	display: inline-block;
	padding: 0 5px;
	border-radius: 4px;
	background: var(--nmb-soft);
	color: var(--nmb-accent);
	font-size: 11px;
	font-weight: bold;
	white-space: nowrap;
}

.nmcal-chip {
	display: inline-block;
	padding: 0 6px;
	border-radius: 9px;
	background: var(--nmcal-chip);
	color: var(--nmcal-chip-ink);
	font-size: 11px;
	font-weight: bold;
	line-height: 17px;
	vertical-align: 1px;
}

@media (prefers-reduced-motion: reduce) {
	.nmcal * {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 360px) {
	.nmcal-d {
		width: 34px;
		height: 34px;
		line-height: 34px;
	}

	.nmcal-grid td {
		height: 38px;
	}
}
