/* ==========================================================================
   Kalendářový widget – vše je řízeno proměnnými v .gcw, snadno se ladí.
   ========================================================================== */

.gcw-wrap { container-type: inline-size; }

.gcw {
	--gcw-bg: #ffffff;
	--gcw-surface: #f6f7fd;
	--gcw-line: #e8eaf4;
	--gcw-text: #2b2f4a;
	--gcw-muted: #9aa0bd;
	--gcw-accent: #2f80ff;
	--gcw-radius: 16px;

	/* rozměry mřížky */
	--gcw-num-h: 28px;   /* výška řádku s číslem dne */
	--gcw-row-h: 22px;   /* výška jednoho pruhu události */
	--gcw-gap: 3px;      /* mezera mezi pruhy */

	position: relative;
	box-sizing: border-box;
	padding: 20px;
	color: var(--gcw-text);
	background: linear-gradient(160deg, #ffffff 0%, var(--gcw-surface) 100%);
	border-radius: var(--gcw-radius);
	/*box-shadow: 0 18px 40px -18px rgb(0 0 0 / 35%);*/
	font-family: inherit;
	line-height: 1.3;
}
.gcw *, .gcw *::before, .gcw *::after { box-sizing: inherit; }
.gcw button { font: inherit; color: inherit; cursor: pointer; border: 0;}
.gcw button:focus-visible { outline: 2px solid var(--gcw-accent); outline-offset: 2px; }

/* ---------- Hlavička ---------- */
.gcw__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2px;
	margin-bottom: 16px;
}
.gcw__nav { display: flex; align-items: center; gap: 2px; }
.gcw__title {
	margin: 0;
	min-width: 8.5em;
	text-align: center;
	font-size: 1.35rem;
	font-weight: 600;
	text-transform: capitalize;
}
.gcw__btn {
	width: 30px; height: 30px;
	border-radius: 50%;
	font-size: 1.6rem !important; line-height: 0.1 !important;
	color: var(--gcw-muted);
	transition: background .15s, color .10s;
}
.gcw__btn:hover { background: #F9B200; color: #fff; box-shadow: 0 2px 8px rgba(70, 80, 160, .15); }
.gcw__today {
	padding: 6px 14px;
	border-radius: 6px;
	font-size: .8rem;
	font-weight: 600;
	background: #fff;
	box-shadow: 0 2px 10px rgba(70, 80, 160, .15);
	transition: color .10s;
}
.gcw__today:hover { color: #F9B200; }

/* ---------- Dny v týdnu ---------- */
.gcw__weekdays {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}
.gcw__weekdays span {
	padding: 6px 0;
	text-align: center;
	font-size: .72rem;
	color: var(--gcw-muted);
}

/* ---------- Mřížka: každý týden je jedna řada ---------- */
.gcw__grid {
	background: var(--gcw-bg);
	border-radius: 12px;
	border-top: 1px solid var(--gcw-line);
	border-left: 1px solid var(--gcw-line);
	overflow: hidden;
	transition: opacity .15s;
}
.gcw.is-loading .gcw__grid { opacity: .45; pointer-events: none; }

.gcw-week {
	--rows: var(--r-collapsed, 0);
	position: relative;
	height: max(
		76px,
		calc(var(--gcw-num-h) + var(--rows) * (var(--gcw-row-h) + var(--gcw-gap)) + 8px)
	);
}
.gcw-week.is-expanded { --rows: var(--r-all, 0); }

/* vrstva 1: buňky dnů */
.gcw-week__days {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}
.gcw-day {
	padding: 5px 5px 0;
	border-right: 1px solid var(--gcw-line);
	border-bottom: 1px solid var(--gcw-line);
}
.gcw-day.is-other { background: #fafbff; }
.gcw-day__num {
	display: grid; place-items: center;
	margin-left: auto;
	min-width: 22px; height: 22px;
	padding: 0 4px;
	font-size: .72rem;
	border-radius: 999px;
}
.gcw-day.is-today { border-top: 2px solid #F9B200; }
.gcw-day.is-other .gcw-day__num { color: #c7cbe0; }
.gcw-day.is-today .gcw-day__num { color: #f9B200; font-weight: 600; font-size: .9rem; }

/* vrstva 2: události (pruhy přes více sloupců) */
.gcw-week__events {
	position: absolute;
	inset: var(--gcw-num-h) 0 0 0;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	grid-auto-rows: var(--gcw-row-h);
	row-gap: var(--gcw-gap);
	align-content: start;
	pointer-events: none; /* kliky procházejí na buňky dnů... */
}
.gcw-week__events > * { pointer-events: auto; } /* ...kromě samotných pruhů */

/* ---------- Události ---------- */
.gcw-event {
	--c: #f59e0b;
	display: flex;
	align-items: center;
	min-width: 0;
	margin: 0 3px;
	padding: 0 8px;
	border-radius: 5px;
	text-align: left;
	font-size: .7rem;
	font-weight: 600;
	color: #fff;
	background: var(--c);
	overflow: hidden;
	transition: transform .12s;
}
.gcw-event:hover { transform: translateY(-1px); }
.gcw-event__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 0 0 0}

/* vícedenní událost přetéká přes hranu týdne → rovný okraj */
.gcw-event.is-cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.gcw-event.is-cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
/* jednodenní akce s časem: tečka + text bez barevného pozadí */
.gcw-event.is-dot {
	gap: 6px;
	background: none;
	box-shadow: none;
	color: var(--gcw-text);
}
.gcw-event.is-dot::before {
	content: "";
	flex: none;
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--c);
}
.gcw-event.is-dot:hover {
	background: color-mix(in srgb, var(--c) 12%, transparent);
	transform: none;
}

.gcw-event.is-extra { display: none; }
.gcw-week.is-expanded .gcw-event.is-extra { display: flex; }
.gcw-week.is-expanded .gcw-more { display: none; }

.gcw-more {
	align-self: center;
	justify-self: start;
	margin-left: 6px;
	font-size: .66rem !important;
	color: var(--gcw-muted);
}
.gcw-more:hover { color: #F9B200; }

/* ---------- Legenda ---------- */
.gcw__legend {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 16px 0 0;
	padding: 0;
	font-size: .75rem;
	color: var(--gcw-muted);
}
.gcw__legend li { display: flex; align-items: center; gap: 7px; }
.gcw__legend li::before {
	content: "";
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--c);
}

.gcw__error { margin: 0; padding: 24px; text-align: center; font-size: .85rem; color: #b4435b; }

/* ---------- Detail události (popup) ---------- */
.gcw-pop {
	position: absolute;
	z-index: 5;
	width: min(260px, calc(100% - 24px));
	padding: 16px 18px 18px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 50px -12px rgba(50, 60, 130, .4);
	font-size: .8rem;
}
.gcw-pop[hidden] { display: none; }
.gcw-pop__close {
	position: absolute; top: 8px; right: 10px;
	font-size: 1.3rem; line-height: 1;
	color: var(--gcw-muted);
}
.gcw-pop__dot { width: 10px; height: 10px; margin-bottom: 8px; border-radius: 50%; background: var(--gcw-accent); }
.gcw-pop__title { margin: 0 0 2px; padding-right: 20px; font-size: 1rem; font-weight: 600; }
.gcw-pop__when { margin: 0 0 12px; color: var(--gcw-muted); font-size: .75rem; }
.gcw-pop__row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gcw-line); }
.gcw-pop__row[hidden] { display: none; }
.gcw-pop__row span { display: block; margin-bottom: 2px; font-size: .7rem; font-weight: 600; }
.gcw-pop__row p { margin: 0; color: var(--gcw-muted); }
.gcw-pop__link { display: inline-block; margin-top: 12px; font-size: .75rem; color: var(--gcw-accent); text-decoration: none; }
.gcw-pop__link:hover { text-decoration: underline; }

/* ---------- Úzký widget (sidebar, mobil): pruhy bez textu ---------- */
@container (max-width: 420px) {
	.gcw { padding: 12px; --gcw-num-h: 24px; --gcw-row-h: 6px; --gcw-gap: 3px; }
	.gcw-week { --rows: var(--r-all, 0); height: max(52px, calc(var(--gcw-num-h) + var(--rows) * (var(--gcw-row-h) + var(--gcw-gap)) + 6px)); }
	.gcw-day { padding: 3px 2px 0; }
	.gcw-day__num { margin: 0 auto; }
	.gcw-event { margin: 0 2px; padding: 0; border-radius: 3px; box-shadow: none; background: var(--c); }
	.gcw-event.is-cont-l { margin-left: 0; }
	.gcw-event.is-cont-r { margin-right: 0; }
	.gcw-event__title { display: none; }
	.gcw-event.is-extra { display: flex; }
	.gcw-more { display: none; }
	.gcw-event.is-dot { width: var(--gcw-row-h); height: var(--gcw-row-h); justify-self: center; border-radius: 50%; background: var(--c); }
	.gcw-event.is-dot::before { display: none; }
	.gcw__title { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	.gcw *, .gcw *::before, .gcw *::after { transition: none !important; }
}



/* vrstva s lany */
.gcw-ropes { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 4; }
.gcw-rope { animation: gcw-rope-in .35s ease-out both; }
@keyframes gcw-rope-in { from { opacity: 0; } to { opacity: 1; } }

/* zvýraznění události po kliknutí na pruh u plakátu */
.gcw-event.is-focus { animation: gcw-pulse 1.1s ease-out 2; }
@keyframes gcw-pulse {
0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); }
100% { box-shadow: 0 0 0 10px transparent; }
}
@media (prefers-reduced-motion: reduce) {
.gcw-rope, .gcw-event.is-focus { animation: none; }
}


   /* ---------- Carousel s plakáty ---------- */
#eventCarousel {
	--slot-h: 44px;               /* řádek s pruhem události */
	--ind-h: 30px;                /* řádek s tečkami */
	--poster-ratio: 1 / 1.414;    /* přepíše PHP podle nejvyššího plakátu */
	--poster-radius: 16px;
	position: relative;
}

/* řádek s pruhem události má vždy stejnou výšku, i když událost chybí */
.poster-event-slot { height: var(--slot-h); }
.poster-event-slot .gcw-link { height: 36px; margin: 0; padding: 0 14px; }

/* rámeček plakátu: pevný poměr stran, obrázek se vejde celý */
.poster-frame {
	position: relative;
	aspect-ratio: var(--poster-ratio);
	overflow: hidden;
	border-radius: var(--poster-radius);
	background: #eef0f8;
}
.poster-frame::before {            /* rozmazané pozadí z téhož plakátu */
	content: "";
	position: absolute;
	inset: -24px;
	background: var(--bg) center / cover no-repeat;
	filter: blur(22px) saturate(1.15);
	opacity: .6;
}
.poster-frame::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: inherit;
	pointer-events: none;
}
/* obrázek vyplní rámeček a zmenší se tak, aby byl vidět celý */
#eventCarousel .poster-frame img {
	position: absolute !important;
	inset: 0;
	z-index: 1;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	object-fit: contain !important;
	object-position: center !important;
	border-radius: 0 !important;
}
/* šipky: bílé kolečka */
#eventCarousel .carousel-control-prev,
#eventCarousel .carousel-control-next {
	top: var(--slot-h);
	bottom: var(--ind-h);
	width: 52px;
	opacity: 1;
}
#eventCarousel .carousel-control-prev { justify-content: flex-start; padding-left: 10px; margin-left: -26px;}
#eventCarousel .carousel-control-next { justify-content: flex-end; padding-right: 10px; margin-right: -26px;}
#eventCarousel .carousel-control-prev-icon,
#eventCarousel .carousel-control-next-icon {
	width: 35px;
	height: 36px;
	border-radius: 8px;
	background-color: #fff;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 40%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
	transition: transform .15s;
}
#eventCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
#eventCarousel .carousel-control-next:hover .carousel-control-next-icon { transform: scale(1.08); }
#eventCarousel .carousel-control-prev-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232b2f4a'%3E%3Cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
}
#eventCarousel .carousel-control-next-icon {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* tečky pod plakátem: malé šedé, aktivní protažená */
#eventCarousel .carousel-indicators {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: var(--ind-h);
	margin: 0;
}
#eventCarousel .carousel-indicators [data-bs-target] {
	box-sizing: border-box;
	flex: none;
	width: 8px;
	height: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: #c9ccd9;
	opacity: 1;
	transition: width .25s, background-color .25s;
}
#eventCarousel .carousel-indicators .active { width: 36px; background-color: #2b2f4a; }


/* carousel se přizpůsobí výšce plakátu (přebíjí pevné výšky z tématu) */
#sidebar-event #eventCarousel,
#sidebar-event #eventCarousel .carousel-inner,
#sidebar-event #eventCarousel .carousel-item {
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
}

/* ---------- Štítek události nad plakátem (pilulka) ---------- */
.gcw-link {
	--c: #f59e0b;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: auto;
	max-width: 100%;
	height: auto;
	margin: 0;
	padding: 7px 14px 7px 12px;
	border: 0;
	border-radius: 999px;
	font: inherit;
	font-size: .85rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: left;
	color: #2b2f4a;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 4px 14px -4px rgba(30, 40, 90, .35), inset 0 0 0 1px rgba(0, 0, 0, .05);
	cursor: pointer;
	transition: transform .12s, box-shadow .12s;
}
.gcw-link::before {               /* barevná tečka = barva události */
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--c);
}
.gcw-link::after { content: none; } /* zrušit původní šipku */
.gcw-link:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px -6px rgba(30, 40, 90, .4), inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.gcw-link__title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* štítek je v řádku nad plakátem svisle uprostřed */
.poster-event-slot { display: flex; align-items: center;     position: absolute;
    z-index: 4;
    left: 12px;
    top: 6px; }
.poster-event-slot .gcw-link { height: auto; margin: 0; padding: 7px 14px 7px 12px; }