/* Календарь праздников Казахстана — Alfarabius */
.alf-cal {
	--alf-state: #0e9f6e;
	--alf-religious: #8b5cf6;
	--alf-prof: #2563eb;
	--alf-off-bg: #fdecec;
	--alf-off-text: #d32f2f;
	--alf-line: #e6e8ec;
	--alf-muted: #6b7280;
	--alf-ink: inherit;
	--alf-hover: #f4f6f9;
	--alf-radius: 12px;
	box-sizing: border-box;
	width: 100%;
	color: var(--alf-ink);
	line-height: 1.35;
}
.alf-cal *, .alf-cal *::before, .alf-cal *::after { box-sizing: border-box; }

/* Шапка с листанием */
.alf-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
}
.alf-cal__title { font-size: 1.35em; font-weight: 700; text-align: center; flex: 1; }
.alf-cal__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--alf-line);
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	text-decoration: none !important;
	color: inherit;
	background: #fff;
	transition: background .15s, border-color .15s;
}
.alf-cal__nav:hover { background: var(--alf-hover); border-color: #cfd4dc; }
.alf-cal__nav.is-disabled { opacity: .3; pointer-events: none; }

/* Фильтры-галочки */
.alf-cal__filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.alf-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px 6px 9px;
	border: 1px solid var(--alf-line);
	border-radius: 999px;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
	background: #fff;
	transition: opacity .15s, background .15s;
}
.alf-chip:hover { background: var(--alf-hover); }
.alf-chip input { margin: 0; width: 15px; height: 15px; accent-color: #374151; }
.alf-chip:has(input:not(:checked)) { opacity: .55; }

/* Метки */
.alf-dot {
	display: inline-block;
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--alf-prof);
}
.alf-dot[data-type="state"], [data-type="state"] > .alf-dot { background: var(--alf-state); }
.alf-dot[data-type="religious"], [data-type="religious"] > .alf-dot { background: var(--alf-religious); }
.alf-dot[data-type="prof"], [data-type="prof"] > .alf-dot { background: var(--alf-prof); }
.alf-sq {
	display: inline-block;
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: var(--alf-off-bg);
	box-shadow: inset 0 0 0 1.5px var(--alf-off-text);
}

/* Сетка */
.alf-cal__grid {
	border-collapse: separate;
	border-spacing: 4px;
	table-layout: fixed;
	margin: 0 -4px;
	width: calc(100% + 8px);
	border: 0;
}
.alf-cal__grid th {
	padding: 4px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--alf-muted);
	text-align: center;
	border: 0;
	background: none;
}
.alf-cal__grid th abbr { text-decoration: none; border: 0; cursor: default; }
.alf-cal__grid th.is-we { color: var(--alf-off-text); }
.alf-cal__grid td {
	position: relative;
	height: 76px;
	padding: 0;
	vertical-align: top;
	border: 1px solid var(--alf-line);
	border-radius: 10px;
	background: #fff;
}
.alf-cal__grid td.is-pad { border-color: transparent; background: none; }
.alf-cal__grid td.is-off { background: var(--alf-off-bg); border-color: transparent; }
.alf-cell__num { display: block; padding: 7px 9px 0; font-weight: 600; font-size: 15px; }
.alf-cell.is-off .alf-cell__num { color: var(--alf-off-text); }
.alf-cell.is-today { box-shadow: inset 0 0 0 2px #111827; }

.alf-cell__btn {
	all: unset;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	height: 100%;
	min-height: inherit;
	border-radius: 9px;
	cursor: pointer;
	text-align: left;
}
.alf-cell__btn:hover { background: rgba(17, 24, 39, .045); }
.alf-cell__btn:focus-visible { outline: 2px solid #111827; outline-offset: 1px; }
.alf-cell__btn[aria-expanded="true"] { background: rgba(17, 24, 39, .07); }
.alf-cell__dots { display: flex; gap: 4px; padding: 0 9px 9px; }
.alf-cell.is-muted .alf-cell__btn { cursor: default; pointer-events: none; }

/* Скрытие по фильтрам */
.alf-hide-state .alf-cal__body [data-type="state"],
.alf-hide-state .alf-cal__list [data-type="state"],
.alf-hide-religious .alf-cal__body [data-type="religious"],
.alf-hide-religious .alf-cal__list [data-type="religious"],
.alf-hide-prof .alf-cal__body [data-type="prof"],
.alf-hide-prof .alf-cal__list [data-type="prof"],
.alf-hide-off .alf-ev--off,
.alf-list__day.is-hidden { display: none !important; }
.alf-hide-off .alf-cal__grid td.is-off { background: #fff; border-color: var(--alf-line); }
.alf-hide-off .alf-cell.is-off .alf-cell__num { color: inherit; }
.alf-hide-off .alf-cal__grid th.is-we { color: var(--alf-muted); }
.alf-hide-off .alf-list__off { display: none; }

/* Всплывающая подсказка */
.alf-popover {
	position: absolute;
	z-index: 99999;
	max-width: 320px;
	min-width: 200px;
	padding: 12px 14px;
	background: #fff;
	color: #111827;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(17, 24, 39, .16), 0 2px 6px rgba(17, 24, 39, .08);
	font-size: 15px;
	line-height: 1.35;
	animation: alf-pop .12s ease-out;
}
@keyframes alf-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.alf-popover ul { list-style: none; margin: 0; padding: 0; }
.alf-ev { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 4px 0; list-style: none; }
.alf-ev .alf-dot, .alf-ev .alf-sq { position: relative; top: -1px; }
.alf-ev a { color: inherit; text-decoration: underline; text-decoration-color: rgba(17, 24, 39, .3); text-underline-offset: 3px; }
.alf-ev a:hover { text-decoration-color: currentColor; }
.alf-ev--off span { color: var(--alf-off-text); }

/* Список месяца */
.alf-cal__list { margin-top: 28px; }
.alf-cal__list-title { font-size: 1.25em; margin: 0 0 12px; }
.alf-list { list-style: none; margin: 0; padding: 0; }
.alf-list__day {
	display: grid;
	grid-template-columns: 210px 1fr;
	gap: 4px 16px;
	padding: 10px 0;
	border-top: 1px solid var(--alf-line);
	margin: 0;
}
.alf-list__day:first-child { border-top: 0; }
.alf-list__day > ul { list-style: none; margin: 0; padding: 0; }
.alf-list__date { color: var(--alf-muted); font-size: 15px; padding-top: 4px; }
.alf-list__off {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	font-style: normal;
	font-size: 12px;
	background: var(--alf-off-bg);
	color: var(--alf-off-text);
}

/* Мини-версия */
.alf-cal--mini .alf-cal__widget-title { font-weight: 700; margin-bottom: 8px; }
.alf-cal--mini .alf-cal__head { margin-bottom: 6px; }
.alf-cal--mini .alf-cal__title { font-size: 1em; }
.alf-cal--mini .alf-cal__nav { width: 30px; height: 30px; font-size: 18px; }
.alf-cal--mini .alf-cal__grid { border-spacing: 2px; margin: 0 -2px; width: calc(100% + 4px); }
.alf-cal--mini .alf-cal__grid th { font-size: 11px; padding: 2px 0; }
.alf-cal--mini .alf-cal__grid td { height: 38px; border-radius: 8px; border-color: transparent; background: none; }
.alf-cal--mini .alf-cal__grid td.is-off { background: var(--alf-off-bg); }
.alf-cal--mini .alf-cell__btn { align-items: center; justify-content: center; border-radius: 7px; }
.alf-cal--mini .alf-cell__num { padding: 0; font-size: 13px; text-align: center; font-weight: 500; }
.alf-cal--mini .alf-cell > .alf-cell__num { padding-top: 10px; }
.alf-cal--mini .alf-cell__dots { padding: 2px 0 0; gap: 2px; justify-content: center; }
.alf-cal--mini .alf-dot { width: 5px; height: 5px; }
.alf-cal--mini .alf-cell.is-today { box-shadow: inset 0 0 0 1.5px #111827; }
.alf-cal--mini.is-loading .alf-cal__body { opacity: .4; transition: opacity .1s; }
.alf-cal__more { display: inline-block; margin-top: 8px; font-size: 14px; }

/* Телефоны */
@media (max-width: 640px) {
	.alf-cal--full .alf-cal__grid { border-spacing: 2px; margin: 0 -2px; width: calc(100% + 4px); }
	.alf-cal--full .alf-cal__grid td { height: 54px; border-radius: 8px; }
	.alf-cal--full .alf-cell__num { padding: 5px 6px 0; font-size: 14px; }
	.alf-cal--full .alf-cell__dots { padding: 0 6px 6px; gap: 3px; }
	.alf-cal--full .alf-dot { width: 6px; height: 6px; }
	.alf-cal__title { font-size: 1.15em; }
	.alf-cal__filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin: 0 -16px 12px;
		padding: 0 16px 2px;
	}
	.alf-cal__filters::-webkit-scrollbar { display: none; }
	.alf-chip { flex: none; font-size: 13px; padding: 5px 10px 5px 8px; }
	.alf-list__day { grid-template-columns: 1fr; }
	.alf-list__date { padding-top: 0; }
	.alf-popover.is-sheet {
		position: fixed;
		left: 12px !important;
		right: 12px;
		top: auto !important;
		bottom: 12px;
		max-width: none;
	}
}
