/**
 * Cards (ek-core). The card design itself lives in the Bricks global classes
 * (ek-poster, ek-event-card, ek-grid-cards…); this file only adds what Bricks can't hold:
 * the "no results" box of query loops, the empty-state text from {ek_empty_state} and the
 * Place map element.
 * --ek-card-ratio / --ek-place-ratio are printed inline from Event Kothay → Settings → Cards.
 */

/* Bricks puts the loop's "no results" text in this wrapper, inside the grid. */
:is(.ek-grid-cards, .ek-grid-orgs, .ek-rail) > .bricks-posts-nothing-found {
	grid-column: 1 / -1;
	flex: 1 1 100%;
	width: 100%;
	padding: clamp(24px, 4vw, 40px) var(--space-24, 24px);
	border: 1px dashed rgba(0, 0, 0, 0.18);
	border-radius: var(--radius-lg, 12px);
	background: rgba(0, 0, 0, 0.025);
	color: var(--ink-5, #666);
	font-size: var(--fs-ui, 15px);
	text-align: center;
}

.ek-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-8, 8px);
	max-width: 36rem;
	margin: 0 auto;
}

.ek-empty p {
	margin: 0;
}

.ek-empty__title {
	color: #000;
	font-size: var(--fs-title-s, 18px);
	font-weight: 700;
	letter-spacing: var(--ls-tight, -0.04em);
	line-height: 1.3;
}

.ek-empty__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-8, 8px);
	margin-top: var(--space-8, 8px) !important;
}

.ek-empty__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--space-18, 18px);
	border: 1px solid #000;
	border-radius: var(--radius-pill, 960px);
	color: #000;
	font-size: var(--fs-ui-s, 14px);
	font-weight: 700;
	text-decoration: none;
}

.ek-empty__link:first-child {
	background: var(--ek-cta, #006400);
	color: #fff;
}

.ek-empty__link:hover {
	opacity: 0.85;
}

.ek-empty__link:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

/* Place map (element ek-place-map). */
.ek-map {
	position: relative;
	width: 100%;
	aspect-ratio: var(--ek-map-ratio, 4 / 3);
	overflow: hidden;
	border-radius: var(--radius-xl, 16px);
	background: #e9eef3;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.ek-map__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/*
 * Main images that open full size in Bricks' lightbox (event poster/cover, organizer cover,
 * place photo; their lightbox ID starts with "ek-main-"): zoom cursor plus a small expand
 * badge, so phones, which have no cursor, show it too.
 */
a.bricks-lightbox[data-pswp-id^="ek-main-"] {
	cursor: zoom-in;
}

a.bricks-lightbox[data-pswp-id^="ek-main-"]::after {
	content: "";
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 18px no-repeat;
	opacity: 0.85;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

a.bricks-lightbox[data-pswp-id^="ek-main-"]:is(:hover, :focus-visible)::after {
	opacity: 1;
	transform: scale(1.08);
}

/* The frames clip overflow, so the focus ring goes inside the edge; the white ring on the
   badge keeps focus visible on dark images too. */
a.bricks-lightbox[data-pswp-id^="ek-main-"]:focus-visible {
	outline: 3px solid #111;
	outline-offset: -3px;
}

a.bricks-lightbox[data-pswp-id^="ek-main-"]:focus-visible::after {
	box-shadow: 0 0 0 3px #fff;
}

@media (prefers-reduced-motion: reduce) {
	a.bricks-lightbox[data-pswp-id^="ek-main-"]::after {
		transition: none;
	}
}

/*
 * Organizer cards (organizers listing, home): the logo takes the initials' box (class
 * ek-initials) when there is one. Shown whole on white, since not every logo is square.
 */
.ek-org-card img.ek-initials {
	box-sizing: border-box;
	object-fit: contain;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Organizer on event cards (home "Featured events", 0.21.9): logo or initials + name. */
/* .brxe-block: Bricks' block rules (column, full width) load after this file. */
.ek-card-orgs.brxe-block {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--space-6, 6px) var(--space-12, 12px);
	margin-top: var(--space-6, 6px);
	min-width: 0;
}

.ek-card-org.brxe-block {
	display: flex;
	flex-direction: row;
	align-items: center;
	width: auto;
	gap: var(--space-8, 8px);
	min-width: 0;
	max-width: 100%;
	font-size: var(--fs-meta, 13px);
	font-weight: 600;
	color: #333;
}

.ek-card-org__logo {
	flex: none;
	width: 28px;
	height: 28px;
	box-sizing: border-box;
	border-radius: 8px;
	object-fit: contain;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.ek-card-org__initials {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background-color: var(--bricks-color-col-be4ego, #ececec);
	color: #000;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.ek-card-org__initials[data-color="rose"] {
	background-color: var(--bricks-color-col-gbjuf6, #dedede);
}

.ek-card-org__initials[data-color="periwinkle"] {
	background-color: var(--bricks-color-col-676l1y, #f5f5f5);
}

.ek-card-org__name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The logo and the name stay on one line on phones too (Bricks' block wraps there): a long
   name ends with "…" beside the logo instead of dropping under it (0.49.7, user request
   2026-11-27). */
.ek-card-orgs.brxe-block > .ek-card-org.brxe-block {
	flex-wrap: nowrap;
}

/* Category page head (0.21.9): heading and description, with the category image beside. */
.ek-term-head.brxe-block {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-16, 16px) clamp(24px, 4vw, 48px);
	width: 100%;
}

.ek-term-head__copy.brxe-block {
	display: flex;
	flex: 1 1 420px;
	flex-direction: column;
	gap: var(--space-16, 16px);
	min-width: 0;
}

.ek-term-head__image.brxe-image {
	flex: 0 1 380px;
	width: 100%;
	max-width: 380px;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--radius-xl, 20px);
}

/* Phones (0.49.11, user request 2026-11-27): the heading and description on the left, the
   image beside them on the right, square. */
@media (max-width: 767px) {
	.ek-term-head.brxe-block {
		flex-wrap: nowrap;
		column-gap: var(--space-16, 16px);
	}

	.ek-term-head__copy.brxe-block {
		flex: 1 1 0;
		gap: var(--space-8, 8px);
	}

	.ek-term-head__image.brxe-image {
		flex: 0 0 104px;
		width: 104px;
		max-width: 104px;
		aspect-ratio: 1 / 1;
		border-radius: var(--radius-lg, 16px);
	}
}

/*
 * Attraction cards (0.29.0): "Open now · closes 5 pm" with a dot, green when open
 * (text element with class ek-open-status and data-open="{ek_is_open}").
 */
.ek-open-status {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	color: #444;
	font-size: var(--fs-meta, 13px);
	font-weight: 600;
}

.ek-open-status::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #b3261e;
}

.ek-open-status[data-open="1"]::before {
	background: #1a7f37;
}

/*
 * Card tags (0.45.0): a long label ("Learning · Workshop") must not run under the
 * admission tag on narrow cards. The label ends with "…" instead; next to an admission
 * tag it keeps to about 60% of the poster (the admission tag keeps its full width).
 */
.ek-poster__tag.brxe-text-basic {
	display: block;
	max-width: calc(100% - 2 * var(--space-12, 12px));
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ek-poster:has(> .ek-poster__tag--end) > .ek-poster__tag--start.brxe-text-basic {
	max-width: calc(60% - var(--space-12, 12px) - 4px);
}

/* Narrow cards (two per row on phones): the label is the main category only, "Film"
   instead of "Film · Screening" ({ek_filing_label:html}). */
.ek-poster.brxe-block {
	container: ek-poster / inline-size;
}

@container ek-poster (max-width: 260px) {
	.ek-filing-type {
		display: none;
	}

	/* A little tighter, so "Theatre" and "Ticketed" fit side by side at 360 px. */
	.ek-poster.brxe-block > .ek-poster__tag.ek-pill.brxe-text-basic {
		top: 10px;
		padding-right: 9px;
		padding-left: 9px;
	}

	.ek-poster.brxe-block > .ek-poster__tag--start.ek-pill.brxe-text-basic {
		left: 10px;
	}

	.ek-poster.brxe-block > .ek-poster__tag--end.ek-pill.brxe-text-basic {
		right: 10px;
	}
}

/*
 * Badges under the title (0.49.0, user request 2026-11-27): on phones, event lists
 * (ek-grid-cards--list: the events listing and the organizer / place pages) show their
 * cards as rows with a small poster whose tags are hidden, so the card body repeats the
 * category and admission pills right under the title (block ek-event-card__badges,
 * elements lebdg* / pobdg* / ppbdg*). Hidden everywhere else: the poster has them.
 */
.ek-event-card__badges.brxe-block {
	display: none;
}

@media (max-width: 767px) {
	.ek-grid-cards--list .ek-event-card__badges.brxe-block {
		display: flex;
		flex-flow: row wrap;
		gap: 6px;
		margin-top: 2px;
	}

	.ek-grid-cards--list .ek-event-card__badges > .ek-pill.brxe-text-basic {
		padding: 3px 9px;
		font-size: 12px;
	}

	/* The white pill sits on the white card here, not on a picture. */
	.ek-grid-cards--list .ek-event-card__badges > .ek-pill--white.brxe-text-basic {
		box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
	}
}

/*
 * Homepage "Upcoming events" (0.49.1 phones, 0.49.4 every screen, user requests 2026-11-27):
 * the events listing's cards (grid hulst0, loop hu000k); the date-tile rows are gone.
 */

/*
 * Organizer page head (0.49.1, user request 2026-11-27): a bigger logo (132 px since
 * 0.49.4), shown whole (contain, on white); on phones the name on the left, the logo on
 * the right (block ek-org-head__logo in the copy ek-org-head__copy, template 187). The
 * type · address pill sits under the description since 0.49.4.
 */
.ek-org-head__logo.brxe-block > .ek-initials--xl {
	width: 132px;
	height: 132px;
}

.ek-org-head__logo.brxe-block > img.ek-initials--xl {
	box-sizing: border-box;
	padding: 10px;
	background: #fff;
	object-fit: contain;
}

@media (max-width: 767px) {
	.ek-org-head__copy.brxe-block {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: var(--space-16, 16px);
		align-items: center;
		justify-items: start;
	}

	.ek-org-head__copy.brxe-block > * {
		grid-column: 1 / -1;
	}

	.ek-org-head__copy.brxe-block > .ek-org-head__logo {
		grid-column: 2;
		grid-row: 1;
		align-self: center;
		margin: 0;
	}

	.ek-org-head__copy.brxe-block > .ek-org-head__logo + * {
		grid-column: 1;
		grid-row: 1;
		align-self: center;
		margin: 0;
	}

	.ek-org-head__logo.brxe-block > .ek-initials--xl {
		width: 92px;
		height: 92px;
		font-size: 32px;
	}

	.ek-org-head__logo.brxe-block > img.ek-initials--xl {
		padding: 7px;
	}
}

/*
 * Listing pagination (0.49.4, user request 2026-11-27): round 44 px buttons; the current
 * page bold on black. Bricks' pagination element (events, organizers, places listings).
 */
.brxe-pagination .bricks-pagination ul {
	gap: var(--space-8, 8px);
}

.brxe-pagination .bricks-pagination .page-numbers:is(a, span) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 var(--space-12, 12px);
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: var(--radius-pill, 960px);
	background: #fff;
	color: #000;
	font-size: 17px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
}

.brxe-pagination .bricks-pagination a.page-numbers:hover {
	border-color: #000;
}

.brxe-pagination .bricks-pagination .page-numbers.current {
	border-color: var(--ek-cta, #006400);
	background: var(--ek-cta, #006400);
	color: #fff;
	font-weight: 800;
}

.brxe-pagination .bricks-pagination .page-numbers.dots {
	border-color: transparent;
	background: none;
}

/*
 * "Read more" ({ek_description_more}, 0.49.8; organizer page head): 3 lines; when there is
 * more (readmore.js adds is-long) "… Read more" sits at the end of the 3rd line (0.49.11,
 * user request 2026-11-27): the box is 3 lines high, a float as tall as 2 lines pushes the
 * button (first in the box, floated right) down to the 3rd line, and the text wraps around
 * it. Opened, the button moves under the text. Without the script the whole text shows.
 * Paragraph gaps are one line high, so the cut always falls between lines.
 */
.ek-readmore__text {
	line-height: 1.5;
}

.ek-readmore__text > * {
	margin: 0;
}

.ek-readmore__text > :not(.ek-readmore__toggle) + :not(.ek-readmore__toggle) {
	margin-top: 1.5em;
}

.ek-readmore.is-long:not(.is-open) > .ek-readmore__text {
	height: 4.5em;
	overflow: hidden;
}

.ek-readmore.is-long:not(.is-open) > .ek-readmore__text::before {
	content: "";
	float: right;
	width: 0;
	height: calc(100% - 1.5em);
}

.ek-readmore__toggle {
	position: relative;
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	cursor: pointer;
}

.ek-readmore.is-long:not(.is-open) .ek-readmore__toggle {
	float: right;
	clear: right;
	padding-left: 0.3em;
}

/* Opened: on its own line under the text. */
.ek-readmore.is-open .ek-readmore__toggle {
	display: inline-block;
	margin-top: 0.5em;
}

.ek-readmore__dots {
	margin-right: 0.3em;
}

.ek-readmore.is-open .ek-readmore__dots {
	display: none;
}

.ek-readmore__label {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* A taller tap area than the line. */
.ek-readmore__toggle::after {
	content: "";
	position: absolute;
	inset: -8px -4px;
}

.ek-readmore__toggle[hidden] {
	display: none;
}

.ek-readmore__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * Card sliders (0.51.0, homepage sections; user request 2026-12-01): a Bricks block with the
 * classes `ek-grid-cards ek-slider` holds the card loop (up to 8) and, last, the "See all" card
 * (`ek-see-all-card`). One sideways row with snapping: 4 cards on desktop, 3 on tablets, 2 and
 * a bit of the next on phones (swipe; the row runs to the screen edges). slider.js adds the
 * Previous / Next buttons to the section head on larger screens.
 * The class is doubled to outweigh Bricks' inline `.ek-grid-cards.brxe-block { display: grid }`.
 */
.ek-slider.ek-slider.brxe-block {
	--ek-slider-per: 4;
	--ek-slider-gap: var(--space-20, 20px);
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: var(--ek-slider-gap);
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	/* Room for focus rings and the card shadow inside the clipped row. */
	margin-block: -6px;
	padding-block: 6px;
}

.ek-slider.ek-slider.brxe-block::-webkit-scrollbar {
	display: none;
}

.ek-slider.ek-slider.brxe-block > * {
	flex: 0 0 calc((100% - (var(--ek-slider-per) - 1) * var(--ek-slider-gap)) / var(--ek-slider-per));
	min-width: 0;
	scroll-snap-align: start;
}

.ek-slider.ek-slider.brxe-block > .bricks-posts-nothing-found {
	flex: 1 1 100%;
}

.ek-slider.ek-slider.brxe-block:has(> .bricks-posts-nothing-found) > .ek-see-all-card {
	display: none;
}

@media (max-width: 991px) {
	.ek-slider.ek-slider.brxe-block {
		--ek-slider-per: 3;
	}
}

@media (max-width: 767px) {
	.ek-slider.ek-slider.brxe-block {
		--ek-slider-per: 2.2;
		--ek-slider-gap: 12px;
		width: calc(100% + 2 * var(--gutter, 16px));
		max-width: none;
		margin-inline: calc(var(--gutter, 16px) * -1);
		padding-inline: var(--gutter, 16px);
		scroll-padding-inline: var(--gutter, 16px);
	}
}

/* The Promoted tooltip opens below its label inside a row (the row clips what is above it). */
.ek-slider .ek-promo.is-open .ek-promo__tip,
.ek-slider a:focus-visible .ek-promo__tip {
	top: calc(100% + 8px);
	bottom: auto;
}

@media (hover: hover) {
	.ek-slider .ek-promo:hover .ek-promo__tip {
		top: calc(100% + 8px);
		bottom: auto;
	}
}

/* "See all" card: the poster's shape, an arrow, the text and the section's count. */
.ek-see-all-card.brxe-block {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	align-self: flex-start;
	justify-content: center;
	aspect-ratio: var(--ek-card-ratio, 4/5);
	padding: var(--space-16, 16px);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--radius-lg, 12px);
	background: rgba(0, 0, 0, 0.035);
	color: #000;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.ek-slider:has(.ek-place-card) > .ek-see-all-card.brxe-block {
	aspect-ratio: var(--ek-place-ratio, 4/3);
}

.ek-see-all-card.brxe-block::before {
	content: "";
	width: 48px;
	height: 48px;
	margin-bottom: 6px;
	border-radius: 50%;
	background: var(--ek-cta, #006400) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
	transition: transform 0.15s ease;
}

.ek-see-all-card.brxe-block:is(:hover, :focus-visible) {
	background: rgba(0, 0, 0, 0.06);
}

.ek-see-all-card.brxe-block:is(:hover, :focus-visible)::before {
	transform: translateX(3px);
}

.ek-see-all-card__title {
	font-size: var(--fs-title-s, 18px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: var(--ls-tight, -0.02em);
}

.ek-see-all-card__meta {
	color: var(--ink-5, #666);
	font-size: var(--fs-ui, 14px);
}

@media (max-width: 767px) {
	.ek-see-all-card.brxe-block::before {
		width: 40px;
		height: 40px;
		background-size: 18px;
	}

	.ek-see-all-card__title {
		font-size: 16px;
	}
}

/* Previous / Next (slider.js), in the section head after "See all"; not on phones. */
.ek-slider__end {
	display: flex;
	flex: none;
	gap: var(--space-16, 16px);
	align-items: center;
}

.ek-slider__nav {
	display: flex;
	gap: 8px;
}

.ek-slider__nav[hidden] {
	display: none;
}

.ek-slider__btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.16);
	border-radius: 50%;
	background: #fff;
	color: #000;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.ek-slider__btn--prev svg {
	transform: scaleX(-1);
}

.ek-slider__btn:hover:not(:disabled) {
	border-color: #000;
	background: #f2f2f2;
}

.ek-slider__btn:focus-visible {
	outline: 2px solid var(--ek-cta, #006400);
	outline-offset: 2px;
}

.ek-slider__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (max-width: 767px) {
	.ek-slider__nav {
		display: none;
	}
}

/*
 * Section heads on phones (0.51.5). The Bricks class ek-section-head puts the heading on its own
 * row and "See all" at the right of the row below (next to the count). slider.js wraps the link
 * in .ek-slider__end, so it gets the same place here. A head without a count line has nothing
 * beside "See all": heading and link share one row instead of leaving an empty one.
 */
@media (max-width: 767px) {
	.ek-section-head.brxe-block > .ek-slider__end {
		grid-column: 2;
		justify-self: end;
	}

	.ek-section-head.brxe-block:not(:has(.ek-section-head__text > :not(.ek-h2))) .ek-h2.brxe-heading {
		grid-column: 1;
	}
}
