/* Events archive (page-events-archive.php). All rules are scoped to .pan-events. */

.pan-events {
	--pan-navy: #1f4e96;
	--pan-ink: #2b2f33;
	--pan-line: #6b7a8a;
	--pan-active: #1a7aab;
	--pan-gap: 12px;
	padding-top: 100px;
	padding-bottom: 60px;
}

/* Location colors (white text on each badge is >= 4.5:1) */
.pan-events .loc--baltimore  { --loc: #1f63d8; }
.pan-events .loc--tucson     { --loc: #b85a00; --loc-pin: #f7941d; }
.pan-events .loc--miami      { --loc: #2e7d5b; }
.pan-events .loc--atlanta    { --loc: #c8102e; }
.pan-events .loc--nationwide { --loc: #6a3d9a; }

.pan-events [hidden] { display: none !important; }

/* ---------- Location tabs ---------- */
.pan-tabs { max-width: 800px; margin: 0 auto 34px; }
.pan-tabs ul {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--pan-ink);
}
.pan-tabs li { 
	flex: 1; 
	margin: 0; 
	padding: 0; 
	border-right: 1px solid var(--pan-ink); 
	list-style: none!important;
}
.pan-tabs li:last-child { border-right: 0; }
.pan-tabs a {
	display: block;
	padding: 13px 8px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--pan-ink);
	text-decoration: none;
}
.pan-tabs a:hover { background: #eef5f9; }
.pan-tabs a.is-active { background: var(--pan-active); color: #fff; }
.pan-tabs a:focus-visible { outline: 3px solid #0b3d5c; outline-offset: -3px; }

/* ---------- Toolbar ---------- */
.pan-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pan-gap); margin-bottom: 28px; }
.pan-field { position: relative; }
.pan-field--sort { margin-left: auto; }
.pan-field--search { flex: 0 1 240px; }
.pan-field--search .pan-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #555; pointer-events: none; }
.pan-toolbar input[type="search"],
.pan-toolbar select {
	height: 44px;
	margin: 0;
	padding: 0 30px 0 14px!important;
	font-size: 14px;
	color: var(--pan-ink);
	background-color: #fff;
	border: 1px solid #8b949c;
	border-radius: 2px;
	box-shadow: none;
}
.pan-toolbar input[type="search"] { width: 100%; padding-left: 38px; }
.pan-toolbar select { cursor: pointer; }
.pan-toolbar input:focus-visible,
.pan-toolbar select:focus-visible { outline: 3px solid #0b3d5c; outline-offset: 1px; }
.pan-clear { margin: -12px 0 20px; font-size: 14px; }

/* ---------- Intro (single location) ---------- */
.pan-intro { margin-bottom: 34px; }
.pan-intro h2 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; color: var(--pan-ink); }
.pan-intro p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--pan-ink); }

/* ---------- Sections ---------- */
.pan-section { margin-bottom: 40px; }
.pan-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.pan-section__title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 22px; line-height: 1.2; }
.pan-section__head .pan-section__title { margin-bottom: 0; }
.pan-section__title--loc { color: var(--pan-navy); }
.pan-section__title--loc .pan-icon { color: var(--loc-pin, var(--loc)); }
.pan-section__title--latest { color: var(--pan-ink); }
.pan-section__title--latest .pan-icon { color: #f7941d; }
.pan-viewall { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--pan-navy); text-decoration: none; white-space: nowrap; }
.pan-viewall:hover { text-decoration: underline; }

/* ---------- Grid ---------- */
.pan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--pan-gap); }
.pan-grid--wide { grid-template-columns: repeat(2, 1fr); }

/* ---------- Card ---------- */
.pan-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--pan-line);
	min-width: 0;
}
.pan-card:focus-within { outline: 3px solid #0b3d5c; outline-offset: 2px; }
.pan-card__media { position: relative; aspect-ratio: 1.83 / 1; overflow: hidden; background: #e8edf1; }
.pan-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pan-badge {
	position: absolute;
	top: 14px;
	right: 10px;
	padding: 3px 18px;
	border-radius: 999px;
	background: var(--loc, #555);
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
}
.pan-card__body { display: flex; flex-direction: column; flex: 1; padding: 10px 12px 12px; }
.pan-card__text { flex: 1; }
.pan-card__date { display: flex; align-items: center; gap: 5px; margin: 0 0 2px; font-size: 13px; color: #444; }
.pan-card__title { margin: 0 0 2px; font-size: 20px; line-height: 1.25; font-weight: 700; }
.pan-card__title a { color: var(--pan-ink); text-decoration: none; }
.pan-card__link::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.pan-card__excerpt { margin: 0; font-size: 13px; line-height: 1.4; color: #444; }
.pan-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--pan-ink); }

/* Wide card (featured / nationwide) */
.pan-card--wide .pan-card__media { aspect-ratio: 2.6 / 1; }
.pan-card--wide .pan-card__body { flex-direction: row; align-items: center; gap: 16px; padding: 14px 16px; }
.pan-btn {
	display: inline-block;
	padding: 11px 17px;
	background: #1f4e96;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	border: 0;
	white-space: nowrap;
}

/* Tags (event type) */
.pan-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.5; background: #eceff1; color: #333; }
.pan-tag--community        { background: #dbeafe; color: #1e4fa8; }
.pan-tag--festival         { background: #ffe8d0; color: #8a4300; }
.pan-tag--wellness         { background: #ede4f7; color: #5b2d8e; }
.pan-tag--education        { background: #d9f0fb; color: #0b5a80; }
.pan-tag--caregiver-support{ background: #e4e6fa; color: #3b3f9e; }

/* ---------- Featured carousel ---------- */
.pan-carousel { position: relative; }
.pan-carousel__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc(50% - (var(--pan-gap) / 2));
	gap: var(--pan-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.pan-carousel__track::-webkit-scrollbar { display: none; }
.pan-carousel__track > .pan-card { scroll-snap-align: start; }
.pan-carousel__track:focus-visible { outline: 3px solid #0b3d5c; outline-offset: 3px; }
.pan-carousel__btn {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	padding: 0;
	background: #fff;
	color: var(--pan-ink);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
	cursor: pointer;
}
.pan-carousel__btn:focus-visible { outline: 3px solid #0b3d5c; outline-offset: 2px; }
.pan-carousel__btn--prev { left: -16px; }
.pan-carousel__btn--next { right: -16px; }
@media (prefers-reduced-motion: no-preference) {
	.pan-carousel__track { scroll-behavior: smooth; }
}

/* ---------- Empty state ---------- */
.pan-empty { padding: 80px 0; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.pan-grid { grid-template-columns: repeat(2, 1fr); }
	.pan-field--sort { margin-left: 0; }
}
@media (max-width: 640px) {
	.pan-events { padding-top: 60px; }
	.pan-tabs ul { flex-wrap: wrap; }
	.pan-tabs li { flex: 1 0 33.33%; border-bottom: 1px solid var(--pan-ink); }
	.pan-tabs li:nth-child(3n) { border-right: 0; }
	.pan-toolbar > .pan-field { flex: 1 1 100%; }
	.pan-toolbar select { width: 100%; }
	.pan-grid,
	.pan-grid--wide { grid-template-columns: 1fr; }
	.pan-carousel__track { grid-auto-columns: 88%; }
	.pan-carousel__btn--prev { left: -8px; }
	.pan-carousel__btn--next { right: -8px; }
	.pan-card--wide .pan-card__body { flex-direction: column; align-items: flex-start; }
	.pan-section__head { flex-direction: column; align-items: flex-start; gap: 4px; }
}