/* ==========================================================================
   Events Listings – Frontend Styles
   ==========================================================================
   All colors / radii are exposed as CSS variables so the plugin Settings
   page can override them at runtime via wp_add_inline_style().
   ========================================================================== */

.wep-events-wrapper,
.wep-single-event {
	--wep-primary:            #0099b2; /* CBIE Pantone 2396 — teal */
	--wep-text:               #00263e; /* CBIE Pantone 2965 — darkest navy */
	--wep-text-muted:         #5b6770; /* CBIE Pantone 431 — slate */
	--wep-border:             #d5dadd;
	--wep-single-meta-bg:     #eeeeee;
	--wep-single-meta-text:   #00263e; /* CBIE Pantone 2965 — darkest navy */
	--wep-past-event-bg:      #eeeeee;
	--wep-past-meta-bar-bg:   #ffffff;
	--wep-past-meta-bar-text: #00263e; /* CBIE Pantone 2965 — darkest navy */
	--wep-meta-bar-bg:        #eeeeee;
	--wep-meta-bar-text:      #00263e; /* CBIE Pantone 2965 — darkest navy */
	--wep-filter-btn:         #01426a; /* CBIE Pantone 7694 — deep blue */
	--wep-filter-btn-hover:   #00263e; /* CBIE Pantone 2965 — darkest navy */
	--wep-action-btn:         #007096; /* CBIE Pantone 7705 — medium blue */
	--wep-action-btn-hover:   #01426a; /* CBIE Pantone 7694 — deep blue */
	--wep-radius:             6px;
}

.wep-events-wrapper {
	max-width: 900px;
	margin: 0 auto;
	font-family: inherit;
	color: inherit;
}

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.wep-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 2px solid #e2e8f0;
}

.wep-filter-types {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wep-type-btn {
	padding: 11px 24px;
	border: none;
	background: #eef1f5;
	color: var(--wep-text);
	border-radius: var(--wep-radius);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: background 0.15s, color 0.15s;
	font-family: inherit;
}

.wep-type-btn:hover {
	background: #e2e8ef;
}

.wep-type-btn.active {
	background: var(--wep-filter-btn);
	color: #fff;
}

.wep-type-btn.active:hover {
	background: var(--wep-filter-btn-hover);
}

/* Filter button hidden when its scope has no events (e.g. "Other IE events"
   with no upcoming events and no matching archive year selected). */
.wep-btn-hidden {
	display: none;
}

.wep-filter-year {
	margin-left: auto;
}

.wep-year-select {
	padding: 11px 16px;
	border: none;
	border-radius: var(--wep-radius);
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	background: #eef1f5;
	color: var(--wep-text);
	transition: background 0.15s;
}

.wep-year-select:hover {
	background: #e2e8ef;
}

.wep-year-select:focus {
	outline: none;
}

/* --------------------------------------------------------------------------
   Loading / Spinner
   -------------------------------------------------------------------------- */

.wep-events-container.wep-is-loading {
	min-height: 160px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wep-spinner {
	display: flex;
	justify-content: center;
	padding: 40px 0;
}

.wep-spinner span {
	display: block;
	width: 36px;
	height: 36px;
	border: 4px solid #e2e8f0;
	border-top-color: var(--wep-primary);
	border-radius: 50%;
	animation: wep-spin 0.7s linear infinite;
}

@keyframes wep-spin {
	to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   No events message
   -------------------------------------------------------------------------- */

.wep-no-events {
	text-align: center;
	padding: 48px 24px;
	color: #6b7280;
	font-size: 16px;
}

/* --------------------------------------------------------------------------
   Event card — bordered box
   -------------------------------------------------------------------------- */

.wep-event-card {
	border: 1px solid var(--wep-border);
	border-radius: var(--wep-radius);
	background: #fff;
	margin-bottom: 18px;
}

.wep-event-card:last-child {
	margin-bottom: 0;
}

.wep-past-event {
	background: var(--wep-past-event-bg);
	opacity: 0.75;
}

/* Past events use their own meta bar colors so the bar doesn't disappear
   against the past-event background. */
.wep-past-event .wep-meta-bar {
	background: var(--wep-past-meta-bar-bg);
	color: var(--wep-past-meta-bar-text);
}

/* Clickable accordion header: date badge + (dateline + title) + More/Less */
.wep-event-header {
	display: flex;
	align-items: center;
	gap: 22px;
	width: 100%;
	padding: 22px 26px;
	background: transparent;
	border: none;
	border-radius: var(--wep-radius);
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	color: inherit;
}

.wep-event-header:focus-visible {
	outline: 2px solid var(--wep-filter-btn);
	outline-offset: 2px;
}

/* Date badge — plain stacked text, no filled box */
.wep-event-date-badge {
	flex-shrink: 0;
	width: 54px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	line-height: 1;
}

.wep-date-day {
	display: block;
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.5px;
	color: var(--wep-primary);
}

.wep-date-month {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--wep-text);
}

/* Headings column: full date line above the title */
.wep-event-headings {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wep-event-dateline {
	font-size: 13px;
	color: var(--wep-text-muted);
}

.wep-event-title {
	margin: 0 !important;
	font-size: 19px !important;
	line-height: 1.3 !important;
	font-weight: 600 !important;
	color: var(--wep-text);
}

/* More / Less toggle */
.wep-event-toggle {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--wep-text);
	font-size: 15px;
	font-weight: 500;
}

.wep-toggle-less { display: none; }
.wep-event-card.wep-is-open .wep-toggle-more { display: none; }
.wep-event-card.wep-is-open .wep-toggle-less { display: inline; }

.wep-accordion-chevron {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wep-text);
	transition: transform 0.25s ease;
}

.wep-event-card.wep-is-open .wep-accordion-chevron {
	transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Accordion body
   -------------------------------------------------------------------------- */

.wep-event-body {
	padding: 0 26px 24px;
}

/* Horizontal meta bar — dark box with Time / Format / Cost, etc. */
.wep-meta-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px 36px;
	background: var(--wep-meta-bar-bg);
	color: var(--wep-meta-bar-text);
	border-radius: var(--wep-radius);
	padding: 16px 24px;
	margin-bottom: 18px;
	font-size: 14px;
}

.wep-meta-item {
	white-space: nowrap;
}

.wep-meta-item strong {
	font-weight: 700;
	margin-right: 4px;
}

/* Excerpt */
.wep-event-excerpt {
	font-size: 15px;
	line-height: 1.7;
	color: var(--wep-text-muted);
	margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Action buttons — Register (filled) + Read More (text link)
   -------------------------------------------------------------------------- */

.wep-event-actions {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.wep-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 28px;
	border-radius: var(--wep-radius);
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	text-decoration: none !important;
	line-height: 1;
	cursor: pointer;
	border: none;
	transition: background 0.15s;
}

.wep-btn-primary {
	background: var(--wep-action-btn);
	color: #fff !important;
}

.wep-btn-primary:hover {
	background: var(--wep-action-btn-hover);
}

.wep-btn-arrow {
	flex-shrink: 0;
}

.wep-readmore {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--wep-action-btn) !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none !important;
	transition: color 0.15s;
}

.wep-readmore:hover {
	color: var(--wep-action-btn-hover) !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 580px) {
	.wep-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.wep-filter-year {
		margin-left: 0;
	}

	.wep-year-select {
		width: 100%;
	}

	.wep-event-header {
		gap: 14px;
		padding: 18px;
	}

	.wep-event-date-badge {
		width: 46px;
	}

	.wep-date-day   { font-size: 24px; }
	.wep-date-month { font-size: 12px; }

	.wep-event-title { font-size: 17px !important; }

	.wep-event-toggle {
		font-size: 14px;
	}

	.wep-event-body {
		padding: 0 18px 20px;
	}

	/* Stack the meta items vertically on narrow screens */
	.wep-meta-bar {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 6px;
		padding: 16px 20px;
	}

	.wep-meta-item {
		white-space: normal;
	}
}

/* ==========================================================================
   Single Event
   ========================================================================== */

.single.single-event .heading-title {
	margin-bottom: 0;
}

.single-event .wep-single-event {
	margin-bottom: 50px;
}

/* --------------------------------------------------------------------------
   Single Event – Metadata Block
   -------------------------------------------------------------------------- */

/* Horizontal meta bar — same treatment as the accordion meta bar. Colors via
   Settings → Single Meta Background / Single Meta Text. */
.wep-single-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px 36px;
	background: var(--wep-single-meta-bg);
	color: var(--wep-single-meta-text);
	padding: 18px 24px;
	border-radius: var(--wep-radius);
	margin-bottom: 20px;
	font-size: 19px; /* ~30% larger than the accordion meta bar */
}

.wep-single-meta-item {
	white-space: nowrap;
}

.wep-single-meta-item strong {
	font-weight: 700;
	margin-right: 4px;
}

/* Type badges sit centered above the meta bar (reuses .wep-event-type-badge). */
.wep-single-type-badges {
	text-align: center;
	margin-bottom: 12px;
}

/* Register button — centered, below the meta box. */
.wep-single-register {
	text-align: center;
	margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   Single event responsive
   -------------------------------------------------------------------------- */

@media (max-width: 580px) {
	.wep-single-meta {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 6px;
		padding: 16px 20px;
	}

	.wep-single-meta-item {
		white-space: normal;
	}
}
