/* =====================================================
   CUSTOM EVENTS COLLECTION
   FILE: /wp-content/themes/child/includes/events-collection/events-collection.css
   ===================================================== */

#main .cec-wrapper {
	--cec-bg: #eef4fb;
	--cec-card-bg: #ffffff;
	--cec-border: #e2eaf3;
	--cec-text: #1a2233;
	--cec-muted: #6b7a96;
	--cec-accent: #2251d4;
	--cec-red: #e53935;
	--cec-radius: 30px;
	--cec-shadow: 0 2px 16px rgba(34,81,212,0.07);
	--cec-shadow-hover: 0 8px 32px rgba(34,81,212,0.13);
	--cec-transition: 0.22s cubic-bezier(.4,0,.2,1);
	box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 80px 0 0;
}

#main .cec-wrapper * {font-family: 'Outfit';}

#main .cec-wrapper *,
#main .cec-wrapper *::before,
#main .cec-wrapper *::after {
	box-sizing: border-box;
}

/* ── Filter Bar ── */
#main .cec-wrapper .cec-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1600px;
    padding: 0;
    margin: auto;
    width: calc(100% - 30px);
    border-bottom: 1px solid #99AAE0;
}

/* ── Tabs ── */
#main .cec-wrapper .cec-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    flex: 1;
}

#main .cec-wrapper .cec-tab {
	display: inline-block;
	font-size: 18px;
	color: var(--cec-muted);
	text-decoration: none !important;
	padding: 25px 0;
	position: relative;
	transition: color var(--cec-transition);
	white-space: nowrap;
	margin-right: 36px;
	background: none !important;
	border: none;
	box-shadow: none !important;
	cursor: pointer;
	line-height: 1.3;
}

#main .cec-wrapper .cec-event-date time {
    line-height: normal;
}

#main .cec-wrapper .cec-tab:last-child { margin-right: 0; }

#main .cec-wrapper .cec-tab:hover {
	color: var(--cec-text);
	text-decoration: none !important;
	background: none !important;
}

#main .cec-wrapper .cec-tab--active {
	color: var(--cec-text);
}

#main .cec-wrapper .cec-tab--active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--cec-accent);
    border-radius: 0;
}

#main .cec-wrapper .cec-tab--active::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--cec-accent);
    z-index: 9;
}

/* ── Divider ── */
#main .cec-wrapper .cec-divider {
	width: 100%;
	height: 1px;
	background: var(--cec-border);
	margin: 0 0 36px;
	border: none;
}

/* ── Category Dropdown ── */
#main .cec-wrapper .cec-category-dropdown {
	position: relative;
	flex-shrink: 0;
}

#main .cec-wrapper .cec-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    background: linear-gradient(90deg, #0064D5 0%, #6B5396 100%) !important;
}

#main .cec-wrapper .cec-cat-btn:hover {
	background: #1840b0 !important;
}

#main .cec-wrapper .cec-cat-arrow {
	display: inline-flex;
	align-items: center;
	transition: transform var(--cec-transition);
}

#main .cec-wrapper .cec-category-dropdown.open .cec-cat-arrow {
	transform: rotate(180deg);
}

#main .cec-wrapper .cec-cat-menu {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--cec-border);
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.12);
	list-style: none;
	padding: 8px 0;
	margin: 0;
	z-index: 9999;
}

#main .cec-wrapper .cec-category-dropdown.open .cec-cat-menu { display: block; }

#main .cec-wrapper .cec-cat-item {
	display: block;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 500;
	color: var(--cec-text) !important;
	text-decoration: none !important;
	transition: background var(--cec-transition), color var(--cec-transition);
	background: transparent !important;
	box-shadow: none !important;
	cursor: pointer;
}

#main .cec-wrapper .cec-cat-item:hover,
#main .cec-wrapper .cec-cat-item--active {
	background: var(--cec-bg) !important;
	color: var(--cec-accent) !important;
}

/* ── Events List ── */
#main .cec-wrapper .cec-events-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    transition: opacity 0.2s ease;
    max-width: 1630px;
    margin: auto;
    padding: 0 15px;
}

/* ── Event Card ── */
#main .cec-wrapper .cec-event-card {
	display: grid;
	grid-template-columns: 300px 1fr auto;
	align-items: center;
	gap: 0 32px;
	background: var(--cec-card-bg);
	border-radius: var(--cec-radius);
	box-shadow: var(--cec-shadow);
	overflow: hidden;
	transition: box-shadow var(--cec-transition), transform var(--cec-transition);
	padding: 20px;
	margin: 0;
	border: none !important;
}

#main .cec-wrapper .cec-event-card:hover {
	box-shadow: var(--cec-shadow-hover);
	transform: translateY(-2px);
}

/* ── Event Image ── */
#main .cec-wrapper .cec-event-image {
	width: 300px;
	min-height: 220px;
	flex-shrink: 0;
	overflow: hidden;
	margin: 0; padding: 0;
	align-self: stretch;
	border-radius: 15px;
}

#main .cec-wrapper .cec-event-image a {
	display: block;
	width: 100%; height: 100%;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	box-shadow: none !important;
}

#main .cec-wrapper .cec-event-image img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

#main .cec-wrapper .cec-event-card:hover .cec-event-image img { transform: scale(1.04); }

#main .cec-wrapper .cec-event-image--placeholder {
	width: 100%; height: 100%;
	background: linear-gradient(135deg, #2251d4 0%, #6c8ef5 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 56px;
	font-weight: 700;
}

/* ── Event Content ── */
#main .cec-wrapper .cec-event-content {
	padding: 15px 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

/* ── Date Badge ── */
#main .cec-wrapper .cec-event-date {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1.5px solid var(--cec-border);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--cec-muted);
	width: fit-content;
	background: transparent;
	margin: 0;
}

#main .cec-wrapper .cec-event-date svg { color: var(--cec-accent); flex-shrink: 0; }

/* ── Title ── */
#main .cec-wrapper .cec-event-title {
	font-size: 22px !important;
	font-weight: 700 !important;
	color: var(--cec-text) !important;
	margin: 4px 0 0 !important;
	line-height: 1.25 !important;
	letter-spacing: -0.02em !important;
	padding: 0 !important;
}

#main .cec-wrapper .cec-event-title a {
	color: var(--cec-text) !important;
	text-decoration: none !important;
	transition: color var(--cec-transition);
	font-size: inherit !important;
	font-weight: inherit !important;
	background: none !important;
	box-shadow: none !important;
	padding: 0 !important;
}

#main .cec-wrapper .cec-event-title a:hover { color: var(--cec-accent) !important; }

/* ── Excerpt ── */
#main .cec-wrapper .cec-event-excerpt {
	font-size: 16px;
	color: var(--cec-muted);
	line-height: normal;
	margin: 0; 
	padding: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Location ── */
#main .cec-wrapper .cec-event-location {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 15px;
	color: var(--cec-muted);
	margin-top: 4px; padding: 0;
}

#main .cec-wrapper .cec-event-location svg { flex-shrink: 0; color: var(--cec-muted); }

/* ── CTA Button — uses theme .button style automatically ── */
#main .cec-wrapper .cec-event-cta { flex-shrink: 0; }

/* ── No Events ── */
#main .cec-wrapper .cec-no-events {
	text-align: center;
	padding: 60px 0;
	color: var(--cec-muted);
	font-size: 16px;
}

/* ── Load More ── */
#main .cec-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.cec-events-container {
    padding: 80px 0;
    background: #F5FAFF;
}

/* ═══════════════════════════════════════════════════
   SHIMMER SKELETON LOADER
   ═══════════════════════════════════════════════════ */

/* Shimmer animation */
@keyframes cec-shimmer {
	0%   { background-position: -600px 0; }
	100% { background-position: 600px 0; }
}

#main .cec-wrapper .cec-shimmer-pulse {
	background: linear-gradient(90deg, #e8edf5 25%, #f4f7fc 50%, #e8edf5 75%);
	background-size: 600px 100%;
	animation: cec-shimmer 1.4s ease-in-out infinite;
	border-radius: 6px;
}

/* Shimmer card — same grid as real card */
#main .cec-wrapper .cec-shimmer-card {
	display: grid;
	grid-template-columns: 300px 1fr auto;
	align-items: center;
	gap: 0 32px;
	background: var(--cec-card-bg);
	border-radius: var(--cec-radius);
	box-shadow: var(--cec-shadow);
	overflow: hidden;
	padding: 0 32px 0 0;
	margin: 0;
}

/* Shimmer image block */
#main .cec-wrapper .cec-shimmer-image {
	width: 300px;
	height: 220px;
	align-self: stretch;
	border-radius: 0;
	flex-shrink: 0;
}

/* Shimmer content area */
#main .cec-wrapper .cec-shimmer-content {
	padding: 28px 0;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Shimmer line */
#main .cec-wrapper .cec-shimmer-line {
	height: 14px;
	border-radius: 6px;
	display: block;
}

/* Shimmer CTA placeholder */
#main .cec-wrapper .cec-shimmer-cta {
	flex-shrink: 0;
}

/* ── Hide plugin's own pagination ── */
.tribe-events-nav-pagination,
.tribe-events__nav-pagination,
.tribe-events-c-nav,
.tribe-events-footer,
a.tribe-events-nav-next,
a.tribe-events-nav-previous {
	display: none !important;
}

/* ── Responsive: tablet ── */
@media (max-width: 960px) {
	#main .cec-wrapper .cec-event-card,
	#main .cec-wrapper .cec-shimmer-card {
		grid-template-columns: 220px 1fr;
		grid-template-rows: 1fr auto;
		gap: 0 24px;
		padding-right: 20px;
	}
	#main .cec-wrapper .cec-event-image,
	#main .cec-wrapper .cec-shimmer-image {
		width: 220px; height: auto; min-height: 180px; grid-row: 1 / 3;
	}
	#main .cec-wrapper .cec-event-cta,
	#main .cec-wrapper .cec-shimmer-cta { grid-column: 2; padding-bottom: 20px; }
}

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
	#main .cec-wrapper { padding: 24px 16px 60px; }
	#main .cec-wrapper .cec-filter-bar { gap: 12px; flex-direction: column; border: none; padding: 25px 0 15px; }
	#main .cec-wrapper .cec-tabs { border-bottom: 1px solid #99AAE0; margin-bottom: 10px; justify-content: space-between; }
	#main .cec-wrapper .cec-tab { font-size: 14px; margin-right: 20px; }
	#main .cec-wrapper .cec-event-card, #main .cec-wrapper .cec-shimmer-card { grid-template-columns: 1fr; padding: 0 0 20px; }
	#main .cec-wrapper .cec-event-image, #main .cec-wrapper .cec-shimmer-image { width: 100%; aspect-ratio: 1.43 / 1; grid-row: auto; }
	#main .cec-wrapper .cec-event-content { padding: 16px 20px 0; }
	#main .cec-wrapper .cec-event-cta, #main .cec-wrapper .cec-shimmer-cta { grid-column: 1; padding: 0 20px 0; margin-top: 10px; }
	#main .cec-wrapper .cec-shimmer-content { padding: 16px 20px 0; }
	#main .cec-wrapper .cec-cat-btn { font-size: 15px; }
	#main .cec-wrapper .cec-event-title { font-size: 20px !important; }
}