/* =========================================================================
   20MN Simple Events — layout and sensible defaults.
   Colours, fonts and spacing are meant to be overridden per element in
   WPBakery (20MN Events elements) or Elementor.

   --bnb-accent / --bnb-card-bg / --bnb-ink come from Events > Settings.
   ====================================================================== */

:root {
	--bnb-accent: #a1264e;
	--bnb-card-bg: #faf3ea;
	--bnb-ink: #2b2b2b;
	--bnb-hairline: rgba(0, 0, 0, 0.12);
}

.bnb-events-scope,
.bnb-upcoming-scope,
.bnb-calendar-scope { display: block; }

/* ---- shared ---------------------------------------------------------- */

.bnb-event-stretch {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
	text-decoration: none;
}
.bnb-event-stretch:focus-visible {
	outline: 2px solid var(--bnb-accent);
	outline-offset: 2px;
}
.bnb-event-titlelink { color: inherit; text-decoration: none; }
.bnb-event-titlelink:hover { text-decoration: underline; }

.bnb-events-empty-message { margin: 0; opacity: 0.8; }

.bnb-event-ticket {
	position: relative;
	z-index: 2;
	display: inline-block;
	margin-top: 14px;
	padding: 9px 20px;
	background: var(--bnb-accent);
	color: #fff;
	border-radius: 4px;
	font-size: 0.9em;
	line-height: 1.3;
	text-decoration: none;
	transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.bnb-event-ticket:hover { opacity: 0.88; color: #fff; }

/* ---- categories + filter row ----------------------------------------- */

/* --bnb-cat-color is set inline per event / per term; it falls back to the
   site accent so nothing depends on a category having a colour. */

.bnb-is-hidden { display: none !important; }

.bnb-event-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
	position: relative;
	z-index: 2;
}
.bnb-event-cat {
	display: inline-block;
	padding: 3px 10px;
	font-size: 0.72em;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 100px;
	color: #fff;
	background: var(--bnb-cat-color, var(--bnb-accent));
	transition: opacity 0.2s ease;
}
a.bnb-event-cat:hover { opacity: 0.85; color: #fff; }

.bnb-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 22px;
}
.bnb-filter-btn {
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	font-size: 0.85em;
	line-height: 1.4;
	text-decoration: none;
	color: inherit;
	background: transparent;
	border: 1px solid var(--bnb-hairline);
	border-radius: 100px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.bnb-filter-btn:hover,
.bnb-filter-btn.is-active {
	background: var(--bnb-cat-color, var(--bnb-accent));
	border-color: var(--bnb-cat-color, var(--bnb-accent));
	color: #fff;
}
.bnb-filter-btn:focus-visible {
	outline: 2px solid var(--bnb-cat-color, var(--bnb-accent));
	outline-offset: 2px;
}
.bnb-filter-empty {
	margin: 0 0 22px;
	opacity: 0.8;
}

/* A day whose entries were all filtered out should not keep its marker. */
.bnb-cal-day--filtered-empty { background-image: none; }

/* Calendar entries take their category colour when one is set. */
.bnb-cal-event { background: var(--bnb-cat-color, var(--bnb-accent)); }

/* The row date box and card badge follow the category colour too. */
.bnb-event-row-datebox { border-color: var(--bnb-cat-color, var(--bnb-accent)); }
.bnb-event-row-month { color: var(--bnb-cat-color, var(--bnb-accent)); }
.bnb-event-badge { border-color: var(--bnb-cat-color, var(--bnb-accent)); }
.bnb-event-badge-month { color: var(--bnb-cat-color, var(--bnb-accent)); }
.bnb-event-accent { background: var(--bnb-cat-color, var(--bnb-accent)); }

/* ---- card grid ------------------------------------------------------- */

.bnb-events {
	display: grid;
	gap: 24px;
	grid-template-columns: 1fr;
}
.bnb-events--cols-2 { grid-template-columns: 1fr; }
.bnb-events--cols-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
	.bnb-events--cols-2, .bnb-events--cols-3, .bnb-events--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
	.bnb-events--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.bnb-events--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.bnb-event {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--bnb-card-bg);
	border-radius: 12px;
	padding: 24px;
	border-style: solid;
	border-width: 0;
	border-color: transparent;
	transition: transform 0.25s ease, box-shadow 0.25s ease,
		background-color 0.25s ease, border-color 0.25s ease;
}
.bnb-event--clickable { cursor: pointer; }
.bnb-event-inner { position: relative; }
.bnb-event-inner > * { position: relative; }
.bnb-event-description a,
.bnb-event-title a { position: relative; z-index: 2; }

.bnb-event-thumb {
	margin: -24px -24px 18px;
	position: relative;
}
.bnb-event-thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
}

.bnb-event-accent {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--bnb-accent);
	display: block;
	z-index: 2;
}

.bnb-event-badge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: 1px solid var(--bnb-cat-color, var(--bnb-accent));
	margin-bottom: 12px;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}
.bnb-event-badge-month {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bnb-cat-color, var(--bnb-accent));
	line-height: 1.3;
	transition: color 0.25s ease;
}
.bnb-event-badge-day {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 22px;
	line-height: 1.1;
	color: var(--bnb-ink);
	transition: color 0.25s ease;
}
.bnb-event-divider {
	width: 48px;
	border-bottom: 2px dotted var(--bnb-accent);
	margin: 0 0 12px;
}
.bnb-event--past { opacity: 0.55; }
.bnb-event-date {
	font-size: 0.85em;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 4px;
	color: var(--bnb-accent);
}
.bnb-event-title { margin: 0 0 4px; transition: color 0.2s ease; }
.bnb-event-time { font-weight: 600; margin-bottom: 4px; }
.bnb-event-location { font-size: 0.9em; opacity: 0.85; margin-bottom: 10px; }
.bnb-event-description p:last-child { margin-bottom: 0; }
.bnb-event-description--excerpt p { margin: 0; }

/* Read more ---------------------------------------------------------- */

.bnb-event-more {
	position: relative;
	z-index: 2;
	display: inline-block;
	margin-top: 10px;
	color: var(--bnb-accent);
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
}
.bnb-event-more:hover { text-decoration: underline; }
.bnb-event-more-arrow {
	/* A leading space inside an inline-block is collapsed away, so the gap
	   has to be a margin. */
	display: inline-block;
	margin-left: 0.3em;
	transition: transform 0.2s ease;
}
.bnb-event:hover .bnb-event-more-arrow,
.bnb-event-row:hover .bnb-event-more-arrow,
.bnb-event-more:hover .bnb-event-more-arrow { transform: translateX(3px); }

/* Card layout: push the actions to the bottom so a grid of cards with
   different description lengths still lines its links up. */
.bnb-event-inner { display: flex; flex-direction: column; flex: 1 1 auto; }
.bnb-event-inner > .bnb-event-more,
.bnb-event-inner > .bnb-event-ticket { margin-top: auto; align-self: flex-start; }
.bnb-event-inner > .bnb-event-more + .bnb-event-ticket { margin-top: 12px; }

/* ---- upcoming rows --------------------------------------------------- */

.bnb-event-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 18px 0;
	border-bottom: 1px solid var(--bnb-hairline);
	background: transparent;
	transition: background-color 0.25s ease;
}
.bnb-upcoming .bnb-event-row:first-child { border-top: 1px solid var(--bnb-hairline); }
.bnb-event-row--past { opacity: 0.55; }
.bnb-event-row--clickable { cursor: pointer; }
.bnb-event-row-body { position: relative; min-width: 0; }
.bnb-event-row-body > * { position: relative; }
.bnb-event-row-title a,
.bnb-event-row-description a { position: relative; z-index: 2; }

.bnb-event-row-datebox {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	border: 1px solid var(--bnb-cat-color, var(--bnb-accent));
	background: transparent;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}
.bnb-event-row-thumb { flex: 0 0 auto; }
.bnb-event-row-thumb img { display: block; width: 72px; height: 72px; object-fit: cover; }
.bnb-event-row-month, .bnb-event-row-day { transition: color 0.25s ease; }
.bnb-event-row-month {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bnb-cat-color, var(--bnb-accent));
	line-height: 1.3;
}
.bnb-event-row-day {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 26px;
	line-height: 1.1;
	color: var(--bnb-ink);
}
.bnb-event-row-title {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.15em;
	font-weight: 600;
	margin: 0 0 2px;
	transition: color 0.2s ease;
}
.bnb-event-row-when { font-size: 0.9em; color: #555; }
.bnb-event-row-location { font-size: 0.9em; opacity: 0.8; }
.bnb-event-row-description { margin-top: 8px; font-size: 0.9em; }
.bnb-event-row-description p:last-child { margin-bottom: 0; }

/* ---- calendar -------------------------------------------------------- */

.bnb-calendar-wrap { position: relative; }
.bnb-cal-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}
.bnb-cal-title {
	margin: 0;
	font-size: 1.4em;
	line-height: 1.2;
	flex: 1 1 auto;
	text-align: center;
	order: 2;
}
.bnb-cal-toolbar .bnb-cal-nav:first-child { order: 1; }
.bnb-cal-toolbar .bnb-cal-nav:not(:first-child) { order: 3; }

.bnb-cal-nav,
.bnb-cal-viewbtn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	font-size: 1.05em;
	line-height: 1;
	background: transparent;
	color: inherit;
	border: 1px solid var(--bnb-hairline);
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.bnb-cal-today-btn { font-size: 0.85em; }
.bnb-cal-nav:hover,
.bnb-cal-viewbtn:hover {
	background: var(--bnb-accent);
	border-color: var(--bnb-accent);
	color: #fff;
}
.bnb-cal-nav[disabled] { opacity: 0.5; cursor: default; }

.bnb-cal-views {
	display: flex;
	gap: 6px;
	margin-bottom: 12px;
	justify-content: flex-end;
}
.bnb-cal-viewbtn[aria-pressed="true"] {
	background: var(--bnb-accent);
	border-color: var(--bnb-accent);
	color: #fff;
}

table.bnb-cal {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0;
	background: transparent;
}
table.bnb-cal th,
table.bnb-cal td {
	border: 1px solid var(--bnb-hairline);
	vertical-align: top;
	text-align: left;
	padding: 6px;
	background: transparent;
}
table.bnb-cal thead th {
	text-align: center;
	font-size: 0.75em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 700;
	padding: 8px 4px;
	vertical-align: middle;
}
table.bnb-cal td { height: 110px; }
.bnb-cal-day--outside { background: rgba(0, 0, 0, 0.02); }
.bnb-cal-day--outside .bnb-cal-daynum { opacity: 0.35; }
.bnb-cal-day--past { opacity: 0.55; }
.bnb-cal-day--today { box-shadow: inset 0 0 0 2px var(--bnb-accent); }

.bnb-cal-daynum {
	display: block;
	font-size: 0.85em;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 4px;
	color: var(--bnb-ink);
}
.bnb-cal-events { display: flex; flex-direction: column; gap: 3px; }
.bnb-cal-event {
	display: block;
	padding: 3px 6px;
	font-size: 0.78em;
	line-height: 1.3;
	border-radius: 3px;
	background: var(--bnb-cat-color, var(--bnb-accent));
	color: #fff;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
a.bnb-cal-event:hover { opacity: 0.85; color: #fff; }
.bnb-cal-event-time { opacity: 0.85; margin-right: 3px; }
.bnb-cal-event-title { font-weight: 600; }
.bnb-cal-more { font-size: 0.72em; opacity: 0.75; padding-left: 2px; }
.bnb-cal-empty { margin-top: 14px; text-align: center; }

.bnb-cal-monthlist { display: none; }
.bnb-cal-listview { display: none; }
.bnb-view-list .bnb-cal-shell-holder { display: none; }
.bnb-view-list .bnb-cal-listview { display: block; }

.bnb-cal-loading { opacity: 0.45; transition: opacity 0.15s ease; }

@media (max-width: 767px) {
	/* "Show the month as a list" */
	.bnb-cal-shell--mobilelist .bnb-cal-scroll { display: none; }
	.bnb-cal-shell--mobilelist .bnb-cal-monthlist { display: block; }
	.bnb-cal-shell--mobilelist .bnb-cal-empty { display: none; }

	/* "Keep the grid" — it scrolls sideways instead of squashing. */
	.bnb-cal-shell--mobilegrid .bnb-cal-scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.bnb-cal-shell--mobilegrid table.bnb-cal { min-width: 620px; }

	table.bnb-cal td { height: 84px; }
	.bnb-cal-event { font-size: 0.72em; }
}

/* ---- single event page ----------------------------------------------- */

.bnb-single-event { position: relative; }
.bnb-single-title { margin: 0 0 18px; }
.bnb-single-image { margin: 0 0 24px; }
.bnb-single-image img { display: block; width: 100%; height: auto; }

.bnb-single-meta {
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 0 0 28px;
	padding: 20px 0;
	border-top: 1px solid var(--bnb-hairline);
	border-bottom: 1px solid var(--bnb-hairline);
}
.bnb-single-meta--past { opacity: 0.75; }
.bnb-single-datebox {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 86px;
	height: 86px;
	border: 1px solid var(--bnb-accent);
}
.bnb-single-month {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bnb-accent);
	line-height: 1.4;
}
.bnb-single-day {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 34px;
	line-height: 1;
	color: var(--bnb-ink);
}
.bnb-single-year { font-size: 11px; letter-spacing: 0.1em; opacity: 0.7; }
.bnb-single-facts p { margin: 0 0 4px; }
.bnb-single-facts p:last-child { margin-bottom: 0; }
.bnb-single-when { font-size: 1.1em; font-weight: 600; }
.bnb-single-location { opacity: 0.85; }
.bnb-single-past-note { font-size: 0.9em; font-style: italic; opacity: 0.75; }

.bnb-single-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 30px;
}
.bnb-single-actions .bnb-event-ticket { margin-top: 0; }
.bnb-event-ics,
.bnb-event-back {
	display: inline-block;
	padding: 9px 18px;
	border: 1px solid var(--bnb-accent);
	color: var(--bnb-accent);
	border-radius: 4px;
	font-size: 0.9em;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.bnb-event-ics:hover,
.bnb-event-back:hover { background: var(--bnb-accent); color: #fff; }

.bnb-single-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	margin-top: 36px;
	padding-top: 20px;
	border-top: 1px solid var(--bnb-hairline);
}
.bnb-single-pagination a {
	max-width: 48%;
	text-decoration: none;
	font-weight: 600;
}
.bnb-single-next { text-align: right; margin-left: auto; }
.bnb-single-pagination span {
	display: block;
	font-size: 0.75em;
	font-weight: 400;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
	margin-bottom: 2px;
}

@media (max-width: 600px) {
	.bnb-single-meta { flex-direction: column; align-items: flex-start; gap: 14px; }
	.bnb-single-pagination a { max-width: 100%; }
}

/* ---- accessibility helper ------------------------------------------- */
/* The plugin styles its own class rather than relying on the theme's
   .screen-reader-text, which not every theme ships. */

.bnb-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.bnb-event, .bnb-event-row, .bnb-event-row-datebox, .bnb-event-badge,
	.bnb-event-badge-month, .bnb-event-badge-day, .bnb-cal-event,
	.bnb-cal-nav, .bnb-cal-viewbtn, .bnb-event-ticket,
	.bnb-event-more, .bnb-event-more-arrow,
	.bnb-event-cat, .bnb-filter-btn { transition: none; }
}
