/* ==========================================================================
   Events Listings – Frontend Styles
   ==========================================================================
   All colours / 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-meta {
	--wep-primary:        #2563eb;
	--wep-primary-hover:  #1d4ed8;
	--wep-primary-light:  #dbeafe;
	--wep-badge-text:     #ffffff;
	--wep-text:           #1f2937;
	--wep-text-muted:     #4b5563;
	--wep-border:         #e5e7eb;
	--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: 8px 20px;
	border: 2px solid var(--wep-primary);
	background: transparent;
	color: var(--wep-primary);
	border-radius: 999px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	transition: background 0.15s, color 0.15s;
	font-family: inherit;
}

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

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

.wep-filter-year {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.wep-filter-year label {
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
	color: #374151;
}

.wep-year-select {
	padding: 7px 10px;
	border: 2px solid #d1d5db;
	border-radius: var(--wep-radius);
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
	background: #fff;
	color: #374151;
	transition: border-color 0.15s;
}

.wep-year-select:focus {
	outline: none;
	border-color: var(--wep-primary);
}

/* --------------------------------------------------------------------------
   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
   -------------------------------------------------------------------------- */

.wep-event-card {
	border-bottom: 1px solid var(--wep-border);
}

.wep-event-card:last-child {
	border-bottom: none;
}

.wep-past-event {
	opacity: 0.72;
}

/* --------------------------------------------------------------------------
   Accordion header — clickable row showing date badge + title + chevron
   -------------------------------------------------------------------------- */

.wep-event-header {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	padding: 18px 8px;
	background: transparent;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	color: inherit;
	transition: background 0.15s;
}

.wep-event-header:hover {
	background: #f8fafc;
}

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

/* Date badge */
.wep-event-date-badge {
	flex-shrink: 0;
	width: 64px;
	min-height: 64px;
	background: var(--wep-primary);
	color: var(--wep-badge-text);
	border-radius: calc(var(--wep-radius) + 4px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 6px 4px;
	line-height: 1;
	gap: 1px;
}

.wep-date-day {
	display: block;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.5px;
}

.wep-date-month {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.wep-date-year {
	display: block;
	font-size: 10px;
	opacity: 0.8;
	margin-top: 2px;
}

/* Title (inside header button) */
.wep-event-title {
	flex: 1;
	margin: 0 !important;
	font-size: 18px !important;
	line-height: 1.35 !important;
	font-weight: 600 !important;
	color: var(--wep-text);
}

/* Chevron indicator */
.wep-accordion-chevron {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--wep-primary);
	transition: transform 0.25s ease;
}

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

/* --------------------------------------------------------------------------
   Accordion body — meta, excerpt, action buttons
   -------------------------------------------------------------------------- */

.wep-event-body {
	padding: 4px 8px 20px 90px; /* indent to align with title (badge width + gap) */
}

/* Meta rows */
.wep-event-meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.wep-meta-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	color: var(--wep-text-muted);
	line-height: 1.45;
}

.wep-meta-row strong {
	color: var(--wep-text);
	margin-right: 3px;
}

.wep-meta-icon {
	flex-shrink: 0;
	margin-top: 3px;
	color: #6b7280;
	display: flex;
	align-items: center;
}

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

/* --------------------------------------------------------------------------
   Action buttons
   -------------------------------------------------------------------------- */

.wep-event-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px;
}

.wep-btn {
	display: inline-block;
	padding: 9px 22px;
	border-radius: var(--wep-radius);
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	text-decoration: none !important;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	border: 2px solid transparent;
}

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

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

.wep-btn-secondary {
	background: transparent;
	color: var(--wep-primary) !important;
	border-color: var(--wep-primary);
}

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

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

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

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

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

	.wep-event-date-badge {
		width: 54px;
		min-height: 54px;
	}

	.wep-date-day   { font-size: 22px; }
	.wep-date-month { font-size: 10px; }
	.wep-date-year  { font-size: 9px; }

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

	.wep-event-body {
		padding: 4px 4px 18px 4px; /* on mobile, no left indent — full-width body */
	}
}

/* ==========================================================================
   Single Event – Metadata Block
   ========================================================================== */

.wep-single-meta {
	background: #f8fafc;
	border: 1px solid var(--wep-border);
	border-left: 4px solid var(--wep-primary);
	border-radius: calc(var(--wep-radius) + 2px);
	padding: 24px 28px;
	margin-bottom: 32px;
}

.wep-single-type-badges {
	margin-bottom: 16px;
}

/* Reuses .wep-event-type-badge from listing styles */

.wep-single-meta-list {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.wep-single-meta-row {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 8px 16px;
	padding: 9px 0;
	border-bottom: 1px solid var(--wep-border);
	align-items: baseline;
}

.wep-single-meta-row:last-child {
	border-bottom: none;
}

.wep-single-meta-row dt {
	font-size: 13px;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	white-space: nowrap;
}

.wep-single-meta-row dd {
	margin: 0;
	font-size: 15px;
	color: var(--wep-text);
	line-height: 1.45;
}

.wep-single-actions {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--wep-border);
}

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

@media (max-width: 580px) {
	.wep-single-meta {
		padding: 18px;
	}

	.wep-single-meta-row {
		grid-template-columns: 1fr;
		gap: 2px;
		padding: 10px 0;
	}

	.wep-single-meta-row dt {
		font-size: 11px;
	}

	.wep-single-meta-row dd {
		font-size: 14px;
	}
}
