/* BHD Craft Shows: square cards, all the same size. Uses the theme's colors when available. */
.cs-empty { color: var(--color-muted, #666); }

/* The list: cards are the same size whether there is one show or many (3 across, filling from the left). */
.cs-list {
	--cs-tab-h: 34px;  /* height of the date tab that sits on top of each card */
	--cs-gap: 32px;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: calc(var(--cs-gap) + var(--cs-tab-h)) var(--cs-gap);
	padding-top: var(--cs-tab-h);
}
.entry-content > .cs-list { max-width: none; }

/* The square card */
.cs-card {
	position: relative;
	box-sizing: border-box;
	width: calc((100% - 2 * var(--cs-gap)) / 3);
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: var(--color-surface, #fff);
	border: 1px solid var(--color-line, #e4e2dc);
	border-radius: var(--radius, 10px);
	min-width: 0;
}

/* The date: a tab on the top-left edge of the card. */
.cs-card__date {
	position: absolute;
	top: calc(var(--cs-tab-h) * -1);
	left: -1px;
	height: var(--cs-tab-h);
	max-width: calc(100% - 24px);
	margin: 0;
	padding: 0 18px;
	display: flex;
	align-items: center;
	background: var(--color-accent, #3a6b4f);
	color: #fff;
	font-size: .92rem;
	font-weight: 700;
	letter-spacing: .02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border-radius: var(--radius, 10px) var(--radius, 10px) 0 0;
}

/* Top of the card: the flyer, or the short description if there is no flyer. */
.cs-card__fill { flex: 1 1 0; min-height: 90px; display: flex; }
.cs-card__media { position: relative; flex: 1; background: #efede7; border-radius: 8px; overflow: hidden; }
.cs-card__media a { position: absolute; inset: 0; display: block; }
.cs-card__media--empty { display: flex; align-items: center; justify-content: center; color: #b9b5a8; }
.cs-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.cs-card__blurb {
	margin: 0;
	color: var(--color-muted, #555);
	font-size: .92rem;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Bottom of the card: the key facts. */
.cs-card__body { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.cs-card__title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.25;
	min-height: 2.5em; /* always two lines tall, so every card's picture area is the same size */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cs-card__time { margin: 0; font-size: .92rem; font-weight: 600; }
.cs-card__where {
	margin: 0;
	font-size: .86rem;
	line-height: 1.35;
	min-height: 2.7em;
	color: var(--color-muted, #555);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cs-card__links { margin: 6px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.cs-btn {
	display: inline-block;
	background: var(--color-accent, #3a6b4f);
	color: #fff;
	border: 2px solid var(--color-accent, #3a6b4f);
	text-decoration: none;
	padding: 7px 14px;
	border-radius: 8px;
	font: inherit;
	font-size: .86rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}
.cs-btn:hover { background: #2d543d; border-color: #2d543d; color: #fff; }
.cs-btn--ghost { background: transparent; color: var(--color-accent, #3a6b4f); }
.cs-btn--ghost:hover { background: var(--color-accent, #3a6b4f); color: #fff; }
.cs-link { color: var(--color-accent, #3a6b4f); }

/* Compact list (home page): short cards with no flyer, pop-up or map. */
.cs-list--compact { --cs-gap: 24px; }
.cs-card--compact { aspect-ratio: auto; padding: 14px 18px; gap: 0; }
.cs-card--compact .cs-card__title { font-size: 1.05rem; }

/* Details & map pop-up */
.cs-dialog {
	width: min(92vw, 760px);
	max-height: 90vh;
	padding: 0;
	border: 0;
	border-radius: var(--radius, 10px);
	background: var(--color-surface, #fff);
	color: var(--color-text, #2e2e2e);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.cs-dialog::backdrop { background: rgba(30, 30, 30, .55); }
.cs-dialog__inner { position: relative; padding: 28px; }
.cs-dialog__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font-size: 2rem;
	line-height: 1;
	color: var(--color-muted, #555);
	cursor: pointer;
}
.cs-dialog__close:hover { background: #efede7; color: var(--color-text, #2e2e2e); }
.cs-dialog__date { margin: 0 0 4px; color: var(--color-accent, #3a6b4f); font-weight: 700; }
.cs-dialog__title { margin: 0 40px 8px 0; font-size: 1.6rem; line-height: 1.25; }
.cs-dialog__time { margin: 0 0 10px; font-weight: 600; }
.cs-dialog__where, .cs-dialog__booth { margin: 0 0 10px; }
.cs-dialog__flyer { margin: 14px 0; }
.cs-dialog__flyer img { max-width: 100%; max-height: 420px; width: auto; height: auto; margin: 0 auto; border-radius: 8px; border: 1px solid var(--color-line, #e4e2dc); display: block; }
.cs-dialog__desc p { margin: 0 0 10px; }
.cs-dialog .cs-card__links { margin: 14px 0; }
.cs-dialog__map iframe { width: 100%; height: 320px; border: 0; border-radius: 8px; display: block; background: #efede7; }

/* Smaller screens: three across becomes two, then one. Cards stay square. */
@media (max-width: 1000px) {
	.cs-card { width: calc((100% - var(--cs-gap)) / 2); }
}
@media (max-width: 700px) {
	.cs-card { width: 100%; }
	.cs-dialog__inner { padding: 20px; }
	.cs-dialog__map iframe { height: 260px; }
}

/* Show names are headings (h2) now; keep them looking the same as before. */
.cs-card__title,
.cs-dialog__title { font-weight: 700; letter-spacing: 0; }
.cs-dialog :focus-visible { outline: 3px solid var(--forest, #223d2e); outline-offset: 2px; box-shadow: 0 0 0 3px #fff; }
