/**
 * Events page -- intro-section hero, events-tabs (Upcoming/Monthly),
 * tab-content panels (JS-switched), event cards grid.
 */

/* === INTRO HERO === */
.intro-section { margin-bottom: 2rem; }

.intro-container {
	background-color: var(--fbc-primary);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	padding: 2.5rem;
	border-radius: var(--fbc-radius);
	box-shadow: var(--fbc-shadow-md);
	text-align: center;
	position: relative;
	color: var(--fbc-white);
	border-left: 5px solid var(--fbc-gold);
	overflow: hidden;
}

.intro-container::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(3, 25, 49, 0.7);
	z-index: 0;
	border-radius: var(--fbc-radius);
}

.intro-container > * { position: relative; z-index: 1; }

.intro-container h1 {
	color: var(--fbc-white);
	margin-bottom: 0.75rem;
	font-size: clamp(2rem, 4vw, 2.6rem);
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.intro-container > p {
	color: rgba(255, 255, 255, 0.95);
	font-size: 1.1rem;
	max-width: 850px;
	margin: 0 auto;
	line-height: 1.7;
}

/* === EVENTS TABS (content-switching) === */
.events-tabs {
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	gap: 0.5rem;
	background: var(--fbc-card-bg);
	border-radius: var(--fbc-radius);
	box-shadow: var(--fbc-shadow-sm);
	padding: 0.5rem;
	max-width: 720px;
	margin: 2.5rem auto 2rem;
	justify-content: center;
}

.events-tabs .tab-item {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	border-radius: var(--fbc-radius-pill);
	transition: background var(--fbc-transition);
	cursor: pointer;
}

.events-tabs .tab-item .tab-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.4rem;
	min-height: 44px;
	box-sizing: border-box;
	font-family: var(--fbc-font-heading);
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--fbc-primary);
	text-decoration: none;
	white-space: nowrap;
	width: 100%;
	justify-content: center;
	border-radius: var(--fbc-radius-pill);
	transition: background var(--fbc-transition), color var(--fbc-transition);
}

.events-tabs .tab-item .tab-indicator {
	display: none;
}

.events-tabs .tab-item:hover .tab-link,
.events-tabs .tab-item:focus-within .tab-link,
.events-tabs .tab-item.active .tab-link {
	background: var(--fbc-primary);
	color: var(--fbc-white);
}

.events-tabs .tab-item.active .tab-link {
	background: var(--fbc-primary);
	color: var(--fbc-gold);
}

/* === TAB CONTENT PANELS === */
.tab-content { display: none; }
.tab-content.active {
	display: block;
	animation: fbc-tab-fade-in 0.4s ease;
}

.next-few-weeks,
.monthly-view {
	margin: 2rem 0;
}

.next-few-weeks h2,
.monthly-view h2 {
	text-align: center;
	font-size: 2rem;
	margin-bottom: 1.75rem;
	color: var(--fbc-primary);
	position: relative;
	padding-bottom: 0.75rem;
}

.next-few-weeks h2::after,
.monthly-view h2::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 80px;
	height: 3px;
	background-color: var(--fbc-gold);
}

@media (min-width: 601px) {
	.events-tabs {
		border-radius: var(--fbc-radius-pill);
		flex-direction: row;
	}
}

/* === LEGACY view-toggle (kept for fallback) === */
.events-view-toggle {
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	gap: 0.5rem;
	background: var(--fbc-card-bg);
	border-radius: var(--fbc-radius);
	box-shadow: var(--fbc-shadow-sm);
	padding: 0.5rem;
	max-width: 720px;
	margin: 2.5rem auto 2rem;
	justify-content: center;
}

.events-view-tab {
	justify-content: center;
}

.events-view-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1.2rem;
	border-radius: var(--fbc-radius-pill);
	font-family: var(--fbc-font-heading);
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--fbc-primary);
	background: transparent;
	transition: all var(--fbc-transition);
}

.events-view-tab i { color: var(--fbc-gold); }

.events-view-tab:hover,
.events-view-tab:focus,
.events-view-tab.active {
	background: var(--fbc-primary);
	color: var(--fbc-white);
}

.events-view-tab:hover i,
.events-view-tab:focus i,
.events-view-tab.active i {
	color: var(--fbc-gold);
}

@media (min-width: 601px) {
	.events-view-toggle {
		border-radius: var(--fbc-radius-pill);
		flex-direction: row;
	}
	.events-view-tab { justify-content: flex-start; }
}

.events-section {
	margin-bottom: 3.5rem;
	scroll-margin-top: calc(var(--fbc-navbar-height) + 24px);
}

.events-section .section-title {
	text-align: center;
	font-size: 2.25rem;
	margin-bottom: 1.75rem;
	position: relative;
	padding-bottom: 0.85rem;
}

.events-section .section-title::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 80px;
	height: 3px;
	background-color: var(--fbc-gold);
}

.events-month-group { margin-bottom: 2.5rem; }

.events-month-heading {
	font-size: 1.5rem;
	color: var(--fbc-primary);
	border-bottom: 2px solid var(--fbc-gold);
	padding-bottom: 0.4rem;
	margin: 0 auto 1.25rem;
	display: inline-block;
}

/* === LEAD PARAGRAPH === */
.events-lead {
	max-width: 800px;
	margin: 0 auto 2rem;
	text-align: center;
	font-size: 1.1rem;
	line-height: 1.7;
	color: var(--fbc-text-light);
}

/* === EVENT CARD MODAL TRIGGER === */
.event-card {
	cursor: pointer;
}

.event-card:focus-visible {
	outline: var(--fbc-focus-ring);
	outline-offset: var(--fbc-focus-offset);
}

/* === EVENT MODAL === */
.event-modal {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.event-modal[hidden] { display: none; }

.event-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(2, 14, 29, 0.78);
	backdrop-filter: blur(4px);
	cursor: pointer;
	animation: fbc-evt-fade 0.2s ease;
}

@keyframes fbc-evt-fade { from { opacity: 0; } to { opacity: 1; } }

.event-modal-dialog {
	position: relative;
	background: var(--fbc-card-bg);
	border-radius: var(--fbc-radius);
	box-shadow: var(--fbc-shadow-lg);
	max-width: 640px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	animation: fbc-evt-rise 0.25s ease;
	border-top: 5px solid var(--fbc-gold);
}

@keyframes fbc-evt-rise {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}

.event-modal-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var(--fbc-bg);
	color: var(--fbc-primary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	transition: all var(--fbc-transition);
	z-index: 2;
}

.event-modal-close:hover,
.event-modal-close:focus-visible {
	background: var(--fbc-gold);
	color: var(--fbc-on-gold);
}

.event-modal-body {
	padding: 1.5rem 1.25rem 1.5rem;
}

.event-modal-body h2 {
	font-size: 1.4rem;
	color: var(--fbc-primary);
	margin-bottom: 1rem;
	padding-right: 2rem;
}

.event-modal-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-bottom: 1.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.95rem;
	color: var(--fbc-text-light);
}

.event-modal-meta > span {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.event-modal-meta i {
	color: var(--fbc-gold);
	font-size: 0.9rem;
}

.event-modal-desc {
	line-height: 1.75;
	color: var(--fbc-text);
}

.event-modal-desc p { margin-bottom: 0.85rem; }

.event-modal-actions {
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (min-width: 601px) {
	.event-modal-body {
		padding: 2rem 2.25rem 2.25rem;
	}
	.event-modal-body h2 { font-size: 1.75rem; }
	.event-modal-meta { gap: 0.75rem 1.5rem; }
}

/* === MOBILE POLISH (events page only; scoped to .event-card) === */

/* Stack date / time / location on their own lines so they do not crush
   into one run-on string on narrow screens. */
.event-card .fbc-card-meta {
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.35rem;
}

/* Category label as a readable badge. Navy text on a pale-gold tint passes
   WCAG AA (~9:1) where the old gold-on-white text did not (~1.9:1). Meaning
   is carried by the text label, not color alone. */
.event-card .fbc-card-eyebrow {
	display: inline-block;
	align-self: flex-start;
	background: rgba(218, 165, 32, 0.15);
	color: var(--fbc-primary);
	padding: 0.2rem 0.6rem;
	border: 1px solid rgba(218, 165, 32, 0.45);
	border-radius: var(--fbc-radius-pill);
	margin-bottom: 0.6rem;
}

/* Details control: guarantee a 44px tap target. */
.event-card .fbc-card-link {
	min-height: 44px;
	align-items: center;
}

/* Clear vertical separation between stacked cards on mobile so they do not
   read as one block. */
.event-archive-grid {
	row-gap: 1.5rem;
}

@media (min-width: 601px) {
	/* Restore the inline, wrapping meta row on wider screens. */
	.event-card .fbc-card-meta {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.75rem;
	}
}
