/**
 * Мини-календарь Event Booking с подсказками.
 *
 * Сетку календаря оформляет CSS компонента — здесь только подсказка и мелкие
 * добавки к ячейкам, чтобы стили шаблона сайта не пришлось переопределять.
 *
 * @copyright  Copyright (C) 2026 INTR Systems
 * @license    GNU/GPL
 */

.eb-minicalendar-tooltip .ebmct-has-tooltip .eb_minical_link {
	cursor: pointer;
}

.eb-minicalendar-tooltip [data-calendar-result].is-loading {
	opacity: .5;
	transition: opacity .15s linear;
}

.eb-minicalendar-tooltip .ebmct-nav {
	cursor: pointer;
	text-decoration: none;
}

/* Подсказка на время показа переезжает в body, поэтому селектор не вложен
   в .eb-minicalendar-tooltip. */
.ebmct-popover {
	position: fixed;
	z-index: 1080;
	box-sizing: border-box;
	width: max-content;
	min-width: 220px;
	max-width: min(340px, calc(100vw - 16px));
	padding: 0;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	color: #222;
	font-size: 14px;
	line-height: 1.35;
	text-align: left;
}

.ebmct-popover[hidden] {
	display: none;
}

.ebmct-popover-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
	font-weight: 600;
}

.ebmct-close {
	padding: 0 4px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: .6;
}

.ebmct-close:hover,
.ebmct-close:focus {
	opacity: 1;
}

.ebmct-list {
	max-height: 60vh;
	margin: 0;
	padding: 4px 0;
	overflow-y: auto;
	list-style: none;
}

.ebmct-item {
	padding: 6px 10px 6px 12px;
	border-left: 3px solid var(--ebmct-accent, transparent);
}

.ebmct-item + .ebmct-item {
	border-top: 1px solid rgba(0, 0, 0, .06);
}

.ebmct-item-link {
	display: flex;
	align-items: baseline;
	gap: 8px;
	text-decoration: none;
	color: inherit;
}

.ebmct-item-link:hover .ebmct-title,
.ebmct-item-link:focus .ebmct-title {
	text-decoration: underline;
}

.ebmct-time {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
}

.ebmct-title {
	flex: 1 1 auto;
}

.ebmct-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
	font-size: 12px;
	opacity: .75;
}

.ebmct-badge {
	padding: 1px 6px;
	border-radius: 10px;
	background: rgba(0, 0, 0, .07);
	white-space: nowrap;
}

.ebmct-badge-full {
	background: rgba(200, 30, 30, .12);
	color: #a11;
}

.ebmct-item.is-full .ebmct-title {
	opacity: .7;
}

.ebmct-more {
	display: block;
	padding: 8px 10px;
	border-top: 1px solid rgba(0, 0, 0, .08);
	font-size: 13px;
	text-align: center;
}

/* Узкий экран: подсказка превращается в лист снизу — попадать пальцем в
   всплывающее окошко рядом с числом неудобно. */
.ebmct-popover.is-sheet {
	position: fixed;
	top: auto;
	right: 0;
	bottom: 0;
	left: 0;
	width: auto;
	max-width: none;
	border: 0;
	border-radius: 12px 12px 0 0;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, .25);
}

.ebmct-backdrop {
	position: fixed;
	z-index: 1079;
	inset: 0;
	background: rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
	.ebmct-popover {
		border-color: rgba(255, 255, 255, .16);
		background: #23262b;
		color: #e8e8e8;
	}

	.ebmct-popover-head,
	.ebmct-item + .ebmct-item,
	.ebmct-more {
		border-color: rgba(255, 255, 255, .12);
	}

	.ebmct-badge {
		background: rgba(255, 255, 255, .12);
	}

	.ebmct-badge-full {
		background: rgba(255, 90, 90, .18);
		color: #ff9a9a;
	}
}
