/**
 * AAA Events Shortcode Styles
 *
 * @package AAA_Templates
 */

/* ──────────────────────────────────────────
   Section container
   ────────────────────────────────────────── */
.aaa-events {
	font-family: 'Mona Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ──────────────────────────────────────────
   Two-column layout
   ────────────────────────────────────────── */
.aaa-events__content {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}

/* Left column: tabs + map */
.aaa-events__left {
	display: flex;
	flex-direction: column;
	gap: 32px;
	flex-shrink: 0;
	width: 730px;
}

/* Right column: calendar btn + event list */
.aaa-events__right {
	display: flex;
	flex-direction: column;
	gap: 32px;
	flex: 1;
	min-width: 0;
	align-self: stretch;
}

/* ──────────────────────────────────────────
   Location tabs
   ────────────────────────────────────────── */
.aaa-events__tabs {
	display: flex;
	gap: 16px;
	align-items: center;
	background: #fff;
	border: 1px solid #c4c4c4;
	border-radius: 12px;
	padding: 10px;
	height: 60px;
	box-sizing: border-box;
	/* Horizontal scroll — works on touch natively, JS adds click-drag for mouse. */
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	cursor: grab;
	scrollbar-width: none;       /* Firefox */
	-ms-overflow-style: none;    /* IE/Edge legacy */
}

.aaa-events__tabs::-webkit-scrollbar {
	display: none;               /* WebKit */
}

.aaa-events__tabs.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;       /* Disable smooth-scroll while dragging. */
	user-select: none;
}

.aaa-events__tab {
	background: transparent;
	border: none;
	padding: 8px 12px;
	font-size: 18px;
	font-weight: 500;
	color: #3f3f3f;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	font-family: inherit;
	white-space: nowrap;
	border-radius: 10px;
	line-height: 1.32;
	flex-shrink: 0;              /* Don't squish tabs when many overflow. */
}

.aaa-events__tabs.is-dragging .aaa-events__tab {
	cursor: grabbing;
}

.aaa-events__tab:hover {
	background: rgba(0, 0, 0, 0.04);
}

.aaa-events__tab.is-active {
	background: #333;
	color: #fff;
}

/* ──────────────────────────────────────────
   Calendar button
   ────────────────────────────────────────── */
.aaa-events__calendar-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #bf1d2d;
	color: #fff;
	padding: 6px 9px 6px 20px;
	border-radius: 10px;
	font-size: 18px;
	font-weight: 600;
	text-decoration: none;
	height: 60px;
	box-sizing: border-box;
	letter-spacing: -0.36px;
	line-height: 1.48;
	font-family: inherit;
	transition: background 0.2s ease;
	text-align: center;
}

.aaa-events__calendar-btn:hover {
	background: #a0171f;
	color: #fff;
}

/* ──────────────────────────────────────────
   Map
   ────────────────────────────────────────── */
.aaa-events__map {
	position: relative;
	border: 1px solid #c4c4c4;
	border-radius: 12px;
	overflow: hidden;
	height: 827px;
	width: 730px;
}

/* Fallback static image (only rendered when configured in settings). */
.aaa-events__map-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	z-index: 0;
}

/* The actual Leaflet canvas — sits above the fallback image. */
.aaa-events__map-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #e8f0f5;
	z-index: 1;
}

/* Inline JSON payload — never visible. */
.aaa-events__map-data {
	display: none;
}

/* Empty-state message when no location has coordinates. */
.aaa-events__map-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #666;
	gap: 12px;
	font-size: 15px;
	text-align: center;
	padding: 24px;
	background: rgba(232, 240, 245, 0.92);
	z-index: 2;
	pointer-events: none;
}

/* ──────────────────────────────────────────
   Leaflet marker icon overrides
   ────────────────────────────────────────── */
.aaa-events__marker img {
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
	user-select: none;
}

.aaa-events__marker--home {
	width: 40px !important;
	height: 40px !important;
}

.aaa-events__marker--pin {
	width: 32px !important;
	height: 40px !important;
}

.aaa-events__marker--plane {
	width: 28px !important;
	height: 28px !important;
}

.aaa-events__marker--plane img {
	transform-origin: 50% 50%;
	will-change: transform;
}

/* Make sure the Leaflet default white border/shadow on divIcons doesn't bleed through. */
.aaa-events .leaflet-marker-icon.aaa-events__marker {
	background: transparent;
	border: none;
}

/* ──────────────────────────────────────────
   Event list wrapper (white card container)
   ────────────────────────────────────────── */
.aaa-events__list-wrapper {
	position: relative;
	background: #fff;
	border: 1px solid #c4c4c4;
	border-radius: 12px;
	padding: 16px;
	overflow: hidden;
	/* Match map height: 827px */
	height: 827px;
	box-sizing: border-box;
}

.aaa-events__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow-y: auto;
	height: 100%;
	/* Bottom space so the last card can scroll up clear of the 148px fade
	   overlay — without this, the fade always covers the final card. */
	padding-bottom: 140px;
	box-sizing: border-box;
}

/* Custom scrollbar */
.aaa-events__list::-webkit-scrollbar {
	width: 4px;
}

.aaa-events__list::-webkit-scrollbar-track {
	background: transparent;
}

.aaa-events__list::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 4px;
}

/* Bottom fade */
.aaa-events__list-fade {
	position: absolute;
	bottom: -1px;
	left: 50%;
	transform: translateX(-50%);
	width: 518px;
	height: 148px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 100%);
	pointer-events: none;
	z-index: 1;
}

.aaa-events__empty {
	color: #666;
	font-size: 16px;
	text-align: center;
	padding: 40px 20px;
}

/* ──────────────────────────────────────────
   Event card
   ────────────────────────────────────────── */
.aaa-events__card {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 12px;
	background: #f6f7fa;
	border-radius: 10px;
}

/* Date badge */
.aaa-events__date-badge {
	flex-shrink: 0;
	width: 70px;
	height: 70px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #d4d4d4;
	border-radius: 4px;
	text-align: center;
	box-sizing: border-box;
}

.aaa-events__day {
	font-size: 20px;
	font-weight: 600;
	line-height: 1;
	color: #0a0a0a;
	font-family: inherit;
}

.aaa-events__month {
	font-size: 14px;
	font-weight: 400;
	color: #bf1d2d;
	font-family: inherit;
}

/* Card body */
.aaa-events__card-body {
	display: flex;
	flex-direction: column;
	gap: 20px;
	flex: 1;
	min-width: 0;
}

/* Top area: title + meta wrapping together */
.aaa-events__card-top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 17px;
}

.aaa-events__title {
	font-size: 20px;
	font-weight: 600;
	color: #0a0a0a;
	margin: 0;
	line-height: normal;
	font-family: inherit;
	width: 100%;
}

.aaa-events__time,
.aaa-events__location {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 16px;
	font-weight: 400;
	color: #3f3f3f;
	line-height: normal;
	white-space: nowrap;
}

.aaa-events__time svg,
.aaa-events__location svg {
	flex-shrink: 0;
}

/* View Events link */
.aaa-events__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 16px;
	font-weight: 600;
	color: #0a0a0a;
	text-decoration: none;
	font-family: 'Manrope', 'Mona Sans', sans-serif;
	line-height: normal;
	transition: color 0.2s ease;
}

.aaa-events__link:hover {
	color: #bf1d2d;
}

.aaa-events__link svg {
	flex-shrink: 0;
}

/* ──────────────────────────────────────────
   Responsive
   ────────────────────────────────────────── */
@media (max-width: 1200px) {
	.aaa-events__left {
		width: auto;
		flex: 1;
	}

	.aaa-events__map {
		width: 100%;
		height: 500px;
	}
}

@media (max-width: 768px) {
	.aaa-events__content {
		flex-direction: column;
	}

	.aaa-events__left {
		width: 100%;
	}

	.aaa-events__map {
		width: 100%;
		height: 420px;
	}

	.aaa-events__tabs {
		height: auto;
		/* overflow-x and touch scrolling already set on the base rule. */
	}

	.aaa-events__tab {
		font-size: 16px;
		padding: 8px 10px;
	}

	.aaa-events__list {
		max-height: none;
	}

	.aaa-events__list-wrapper {
		max-height: 827px;
		overflow-y: scroll;
	}

	.aaa-events__list-fade {
		display: none;
	}
}
