/* Contexto Events — jen lišta a výpis. Vzhled stránky akce dodávají třídy ctx-event-* z contexto-blocks. */

/* Lišta s odpočtem: fixní nad #header šablony (ten je taky fixní), header se posune o její výšku. */
.ctx-ev-bar {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: .55rem 3rem .55rem 1rem;
	background: #23232b;
	color: #fff;
	font-size: .9rem;
	line-height: 1.3;
}
.ctx-ev-bar[hidden] { display: none; }
.ctx-ev-bar__link {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .2rem .75rem;
	color: inherit !important;
	text-decoration: none !important;
}
.ctx-ev-bar__type {
	color: #059a9f;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}
.ctx-ev-bar__count { font-variant-numeric: tabular-nums; font-weight: 700; }
.ctx-ev-bar__cta { text-decoration: underline; }
.ctx-ev-bar__close {
	position: absolute;
	top: 50%;
	right: .5rem;
	transform: translateY(-50%);
	padding: .25rem .5rem;
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}
body.ctx-ev-bar-on { padding-top: var(--ctx-ev-bar-h, 0px); }
body.ctx-ev-bar-on #header { top: calc(var(--ctx-ev-bar-h, 0px) + var(--wp-admin--admin-bar--height, 0px)); }
@media (max-width: 781px) {
	.ctx-ev-bar { padding-block: .45rem; font-size: .8rem; }
	.ctx-ev-bar__title { display: none; }
}

/* Kotva „Chci se přihlásit“ nesmí zajet pod fixní lištu a header. */
.ctx-ev #registrace { scroll-margin-top: calc(var(--ctx-ev-bar-h, 0px) + var(--wp-admin--admin-bar--height, 0px) + 90px); }

/* Výpis /events */
.ctx-ev-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 2rem;
}
@media (max-width: 1024px) { .ctx-ev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ctx-ev-grid { grid-template-columns: 1fr; } }
.ctx-ev-card a {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: 20px;
	background: var(--ctx-color-soft, rgba(5, 154, 159, .08));
	color: inherit;
	text-decoration: none;
	transition: transform 160ms ease;
}
.ctx-ev-card a:hover { transform: translateY(-3px); }
.ctx-ev-card img,
.ctx-ev-card__ph {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.ctx-ev-card__ph { background: linear-gradient(135deg, rgba(5, 154, 159, .08), rgba(5, 154, 159, .38)); }
.ctx-ev-card__body { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.25rem 1.5rem; }
.ctx-ev-card__meta { color: var(--ctx-color-brand, #059a9f); font-size: .85rem; font-weight: 700; }
.ctx-ev-card__title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.ctx-ev-card__place { font-size: .9rem; opacity: .75; }
.ctx-ev-pagination { margin-top: 2rem; }
.ctx-ev-pagination .nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.ctx-ev-image img { display: block; width: 100%; height: auto; border-radius: 20px; }

/* Fotky autorů bývají portrét na výšku: čtverec bere horní část, ať zůstane hlava. */
.ctx-event-speaker-grid .ctx-event-speaker-photo img { object-position: 50% 0; }

/* Avatar speakera bez fotky. */
.ctx-event-speaker-photo .ctx-ev-avatar { display: block; width: 100%; height: 100%; }

/* Filtry na /events (?typ=, ?tema=). */
.ctx-ev-filterbar { padding-top: 2rem !important; padding-bottom: 0 !important; }
.ctx-ev-filters { display: grid; gap: .75rem; }
.ctx-ev-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ctx-ev-filters__label { margin-right: .25rem; font-size: .9rem; font-weight: 700; }
.ctx-ev-chip {
	display: inline-block;
	padding: .45rem 1rem;
	border: 1px solid rgba(35, 35, 43, .2);
	border-radius: 999px;
	color: inherit !important;
	font-size: .9rem;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background-color 160ms ease, border-color 160ms ease;
}
.ctx-ev-chip:hover { border-color: #059a9f; }
.ctx-ev-chip[aria-current="true"] { border-color: #059a9f; background: #059a9f; color: #fff !important; }
.ctx-ev-chip--topic { padding: .3rem .8rem; font-size: .85rem; }
.ctx-ev-card__topics { font-size: .8rem; color: #059a9f; }

/* Odkazy v boxu Kdy/Kde (Formát, Témata) na tmavém hero. */
.ctx-event-meta__value a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.ctx-ev-topics a + a { margin-left: .6rem; }

/* Natálie: compact only the two section joins on webinar 7538. */
body.ctx-webinar .ctx-event-page > .ctx-section:has(.wp-block-columns),
body.ctx-webinar .ctx-event-page > .ctx-section:has(.ctx-event-card-grid) {
  padding-bottom: clamp(2rem, 4.5vw, 4rem);
}
body.ctx-webinar .ctx-event-page > .ctx-section:has(.ctx-event-card-grid),
body.ctx-webinar .ctx-event-page > .ctx-section:has(.ctx-event-speaker-grid) {
  padding-top: clamp(2rem, 4.5vw, 4rem);
}
/* Keep the title at the top rather than at the bottom of the tall meta card. */
body.ctx-webinar .ctx-event-hero__grid {
  align-items: center;
}
/* Only the join between upcoming and past events, not other archive spacing. */
body.post-type-archive-ctx_event .ctx-event-page > #chystame {
  padding-bottom: clamp(2rem, 4.5vw, 4rem);
}
body.post-type-archive-ctx_event .ctx-event-page > #chystame + #probehlo {
  padding-top: clamp(2rem, 4.5vw, 4rem);
}

/* Webinar 7538: bring takeaways closer to hero, separate the following about copy. */
body.ctx-webinar .ctx-event-page > .ctx-section:has(.wp-block-columns) {
  padding-top: clamp(2rem, 4.5vw, 4rem);
}
body.ctx-webinar .ctx-section__inner > .wp-block-columns + h2 {
  margin-top: clamp(3rem, 5vw, 5rem);
}

/* Draft 7538: tighter transition from about to program, other gaps unchanged. */
body.ctx-webinar .ctx-event-page > .ctx-section:has(.wp-block-columns) {
  padding-bottom:clamp(1rem,2.25vw,2rem);
}
body.ctx-webinar .ctx-event-page > .ctx-section:has(.ctx-event-card-grid) {
  padding-top:clamp(1rem,2.25vw,2rem);
}

/* Legacy webinar content shares the approved compact spacing. */
body.ctx-webinar .ctx-event-page > .ctx-ev-content {padding-top:clamp(2rem,4.5vw,4rem);padding-bottom:clamp(2rem,4.5vw,4rem);}
body.ctx-webinar .ctx-ev-content .ctx-section__inner > :is(.wp-block-columns,.wp-block-list) + h2 {margin-top:clamp(3rem,5vw,5rem);}

/* Avoid accumulated spacing between featured image and webinar content. */
body.ctx-webinar .ctx-event-page > .ctx-ev-image {padding-bottom:clamp(1rem,2.25vw,2rem);}
body.ctx-webinar .ctx-event-page > .ctx-ev-image + .ctx-ev-content {padding-top:clamp(1rem,2.25vw,2rem);}
