/**
 * Theme isolation for Events Loop Builder.
 * Scoped to .elb-loop-output so theme/content CSS cannot restyle cards.
 */

.elb-loop-output {
	isolation: isolate;
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
	width: 100%;
	display: block;
}

.elb-loop-output *,
.elb-loop-output *::before,
.elb-loop-output *::after {
	box-sizing: border-box;
}

/* Nested alignfull/alignwide (non-root) can overflow the content column.
 * Root section keeps Container Type Boxed / Full Width / Custom. */
.elb-loop-output .alignfull:not(.elb-is-root-container),
.elb-loop-output .alignwide:not(.elb-is-root-container) {
	margin-left: 0;
	margin-right: 0;
	left: auto;
	right: auto;
	width: 100%;
	max-width: 100%;
}

/* Container Type → Boxed */
.elb-loop-output > .wp-block-elb-flex-container.alignwide.elb-is-root-container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, var(--wp--style--global--content-size, 1200px));
	margin-left: auto;
	margin-right: auto;
}

/* Container Type → Full Width */
.elb-loop-output > .wp-block-elb-flex-container.alignfull.elb-is-root-container {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Inner wrap is display:flex with no direction (elb-blocks.css), so it defaults
 * to row and squeezes every card into a thin vertical strip. Stack list cards;
 * a grid wrapper is the only child, so column vs row does not change it. */
.elb-loop-output > .wp-block-elb-flex-container.elb-is-root-container > .elb-flex-container-inner-blocks-wrap {
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	width: 100%;
}

/* Theme.json / block library first-last child spacing. */
.elb-loop-output .wp-block-elb-flex-container,
.elb-loop-output [class*="wp-block-elb-event-"] {
	margin-block-start: 0;
	margin-block-end: 0;
	margin-inline-start: 0;
	margin-inline-end: 0;
	float: none;
	clear: none;
}

.elb-loop-output h1,
.elb-loop-output h2,
.elb-loop-output h3,
.elb-loop-output h4,
.elb-loop-output h5,
.elb-loop-output h6,
.elb-loop-output p,
.elb-loop-output figure,
.elb-loop-output blockquote {
	margin: 0;
	padding: 0;
	background: none;
	border: none;
	box-shadow: none;
	max-width: none;
	float: none;
}

/*
 * Title/excerpt Style-panel padding must win over the reset above.
 * (.elb-loop-output h3 beats a lone .elb-ti-* class; this selector is stronger.)
 */
.elb-loop-output :is(.wp-block-elb-event-title, .elb-event-title),
.elb-loop-output :is(.wp-block-elb-event-excerpt, .elb-event-excerpt) {
	padding: var(--elb-field-padding, 0);
	margin: var(--elb-field-margin, 0);
	box-sizing: border-box;
}

.elb-loop-output a:not(.elb-share__btn) {
	box-shadow: none;
	background: none;
}

.elb-loop-output ul,
.elb-loop-output ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.elb-loop-output img {
	max-width: 100%;
	width: 100%;
	height: 100%;
	display: block;
	float: none;
	margin: 0;
	padding: 0;
	border: none;
	box-shadow: none;
	vertical-align: top;
	object-fit: cover;
	object-position: center;
}

.elb-loop-output .wp-block-elb-event-image {
	margin: 0;
	padding: 0;
	float: none;
	max-width: 100%;
}

.elb-loop-output .wp-block-elb-event-image > a {
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: none;
	box-shadow: none;
	text-decoration: none;
}

.elb-loop-output .elb-ticket-btn,
.elb-loop-output .elb-ticket-link,
.elb-loop-output .elb-event-read-more a {
	appearance: none;
	-webkit-appearance: none;
	text-decoration: none !important;
	box-shadow: none;
	cursor: pointer;
}

/* Theme a:hover fills must not paint the full Get Tickets row (the rules also match on :hover;
   frontend.css carries the unscoped :hover copy). */
.elb-loop-output .wp-block-elb-event-read-more,
.elb-loop-output .elb-event-price-row {
	background-color: transparent !important;
	background-image: none !important;
}

.elb-loop-output .elb-ticket-link {
	background-image: none !important;
}

/* Theme link underlines only — do not strip button outline borders */
.elb-loop-output .elb-event-read-more a:not(.elb-ticket-btn) {
	border-bottom: none !important;
}

.elb-loop-output .wp-block-elb-flex-container:has(.elb-meta--on-image),
.elb-loop-output .elb-card__media-col {
	position: relative;
}

/* Image permalinks inherit z-index:11 from flex-container field links.
   Keep the media stacking context below date (5) / category (10) overlays
   (the overlay-parent :has() cases are in frontend.css). */
.elb-loop-output .elb-card__media-col > .wp-block-elb-event-image {
	position: relative;
	z-index: 1;
}

