/* ==========================================================================
   Medien.Bayern -- mage-eventpress 5.x fix layer (loaded LAST)
   Loaded only when the plugin runs >= 5.0 (see inc/mage-event-5x.php).
   Counters rules of the 5.x plugin CSS that differ from the live (4.3.9)
   look. Values measured on live. The 4.x base rules live in
   05-mage-event-5x-base.css.
   ========================================================================== */

/* ---------- B: fixes for the 5.x plugin CSS ---------- */

/* B1: mep-event-list-modern.css is dequeued (inc/mage-event-5x.php);
   take over its loader rules: no skeleton, no pagination before ready. */
.mep_event_list_skeleton { display: none !important; }
.list_with_filter_section.mep_event_list:not(.mep-list-is-ready) .pagination_area { display: none !important; }

/* B2: list -- counter 5.x mpwem_style.css, values measured on live (4.3.9) */
.mep_event_list .mep_event_list_sec .mage_grid_box { gap: 0; }
.mep_event_list .mep-event-list-loop.mep_event_grid_item.filter_item { background-color: transparent; border-radius: 5px; justify-content: flex-start; }
.mep_event_list .mep-event-list-loop .mep_list_org_name .evl-cc { margin: 0; }
/* Full width (also wrong before the update): 90-inject.css uses calc(33% - 48px),
   a third is 33.333%. Only >= 992px; below that 30-structure-2.css is correct. */
@media (min-width: 992px) {
	#medienbayern .mep_event_list .filter_item.mep-event-list-loop.column_style { width: calc(33.333333% - 48px) !important; }
}
.mep_event_list .mep-event-list-loop.mep_event_grid_item .mep_list_thumb { border-radius: 0; }
.mep_event_list .mep-event-list-loop .mep_list_thumb .mep_bg_thumb { background-size: cover; background-position: center center; }
.mep_event_list .mep-event-list-loop div.mep-ev-start-date { height: auto; padding: 0; border-radius: 0; }
.mep_event_list .mep-event-list-loop div.mep-ev-start-date .mep-day { font-size: 15px; line-height: 1.8; }
.mep_event_list .mep-event-list-loop div.mep-ev-start-date .mep-month {
	background: var(--mpev-base-txt);
	color: var(--mpev-base);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.8;
	border-radius: 0;
}
.mep_event_list .mep-event-list-loop .mep-list-footer ul li h6 { font-weight: 400; }
.mep_event_list .mep-event-list-loop .mep_list_event_details h2.mep_list_title { margin: 0; padding: 0 0 5px; color: var(--mpev-base-txt); }

/* B3: single -- layout and gallery */
/* 40px below the layout: live printed a 20px element (+20px margin) after
   the container via a 4.x hook. Padding, not margin: a bottom margin would
   collapse into the theme's footer-reveal margin. */
.mb-mep5.mep-default-theme { gap: 0; padding-bottom: 40px; }
.mb-mep5 .mpwem_slider_skeleton { display: none !important; }
.mb-mep5 .superSlider .sliderAllItem,
.mb-mep5 .superSlider .sliderItem,
.mb-mep5 .superSlider .sliderShowcaseItem,
.mb-mep5 .superSlider [data-bg-image],
.mb-mep5 .mep-default-feature-slider img { border-radius: 0; }
/* 4.x showed every image at full width and natural height, top aligned;
   5.x crops to an average height with background-size: cover. */
.mb-mep5 .superSlider .sliderItem > div,
.mb-mep5 .superSlider .sliderShowcaseItem > div {
	background-size: 100% auto;
	background-position: center top;
	background-repeat: no-repeat;
}

/* B3b: gallery geometry as on live: main 100% - 288px, 10px gap, showcase
   278px, each thumbnail as tall as its image (5.x stretches them equally
   and lays a dark gradient ::before over every slide). */
.mb-mep5 div.superSlider .sliderItem > div::before,
.mb-mep5 div.superSlider .sliderShowcaseItem > div::before { display: none; }
/* 4.x: showcase 18.65% wide, gap var(--dMP_xs) = 10 / 8 / 5px (measured on live).
   One gap for both directions: main <-> thumbnails and between thumbnails. */
.mb-mep5 div.superSlider { --mb-thumb-gap: 10px; }
@media only screen and (max-width: 1199px) {
	.mb-mep5 div.superSlider { --mb-thumb-gap: 8px; }
}
@media only screen and (max-width: 767px) {
	.mb-mep5 div.superSlider { --mb-thumb-gap: 5px; }
}
.mb-mep5 div.superSlider .dFlex > .sliderAllItem { flex: 1 1 auto; width: auto; min-width: 0; }
.mb-mep5 div.superSlider .dFlex > .sliderShowcase.style_1 { flex: 0 0 18.65%; width: 18.65%; min-width: 18.65%; margin: 0 0 0 var(--mb-thumb-gap); gap: 0; }
.mb-mep5 div.superSlider .sliderShowcase.style_1 .sliderShowcaseItem { flex: 0 0 auto; height: auto; margin: 0 0 var(--mb-thumb-gap); }
.mb-mep5 div.superSlider .sliderShowcase.style_1 .sliderShowcaseItem:last-child { margin-bottom: 0; }
/* 5.x JS caps the showcase (inline max-height = average slide height), which
   cut off the last thumbnail on mobile. Let the thumbnails set the height. */
.mb-mep5 div.superSlider .dFlex { align-items: flex-start; }
.mb-mep5 div.superSlider .dFlex > .sliderShowcase.style_1 { max-height: none !important; overflow: visible; }
.mb-mep5 div.superSlider .sliderShowcase.style_1 .sliderShowcaseItem > div { height: auto; }

/* B4: single -- map without the 5.x card and title (5.x uses #id selectors) */
.mb-mep5 .mep-default-sidrbar-map #mpwem_map_area { margin: 0; padding: 0; background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
.mb-mep5 .mep-default-sidrbar-map #mpwem_map_area .map_title { display: none; }
.mb-mep5 .mep-default-sidrbar-map #mpwem_map_area .map_section { padding: 0; }
.mb-mep5 .mep-default-sidrbar-map #mpwem_map_area iframe {
	display: inline;
	width: 100%;
	height: 250px;
	min-height: 0;
	max-height: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* B5: single -- calendar button; 4.x printed these rules inline with the button */
#mep_add_calender_links { display: none; background: transparent; list-style: none; margin: 0; padding: 0; }
#mep_add_calender_button {
	border: 0 none;
	border-radius: 50px;
	display: inline-flex;
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	padding: 15px 35px;
	position: relative;
	text-align: center;
	text-transform: uppercase;
	z-index: 1;
	cursor: pointer;
}
.mep-default-sidrbar-social .mep-event-meta { text-align: center; }

/* B6: single -- sidebar lower block, counter 5.x mpwem_style.css */
.mep-default-sidebar .df-sidebar-part { border-radius: 0; box-shadow: none; }
.mb-mep5 .mep-default-sidrbar-events-schedule .mep-more-date { flex-direction: row; }

/* B7: the single layout no longer carries .default_theme (keeps the 5.x
   responsive rules off it). The 4.x rules that relied on the class: */
.mep-default-theme.mb-mep5 div.mep-default-feature-time { margin: 0 15px; }
.mb-mep5 .mep-default-sidrbar-price-seat { border-bottom: 1px solid #DDD; }
@media only screen and (max-width: 767px) {
	div.mep_flex.mb-mep5 { display: block; }
}
@media only screen and (max-width: 500px) {
	.mep-default-theme.mb-mep5 div.mep-default-feature-time { margin: 10px 0; }
}
.mep-default-sidrbar-events-schedule span.mep_date_scdl_start_datetime,
.mep-default-sidrbar-events-schedule span.mep_date_scdl_end_datetime { font-weight: 400; color: inherit; }
/* 5.x ".mep-events-wrapper ul:not(.mp_wp_editor ul)" out-specifies the 4.x rule */
.mep-events-wrapper .mep-default-sidrbar-social ul.mep-social-share { padding: 15px 0 0; }
/* live had an always-empty 4.x speaker block (24px + 5px) above the button */
/* ID level: 40-typography-1.css sets #medienbayern .mep-default-sidrbar-calender-btn margin 0 */
#medienbayern .mb-mep5 .mep-default-sidrbar-calender-btn { margin-top: 29px; }
/* Narrow sidebar (250-275px, 768-1199px): the fixed 18px button overflowed
   (also on live). Smaller type, never wider than the sidebar. */
@media only screen and (max-width: 1199px) {
	#medienbayern .mb-mep5 #mep_add_calender_button { font-size: 15px; padding: 0 10px; max-width: 100%; box-sizing: border-box; white-space: nowrap; }
}
