/* CBI responsive fixes (loaded after style.min.css) */

/* Media never wider than its container */
img, iframe, video, embed, object, .wp-caption { max-width: 100%; }
img { height: auto; }
.wp-caption { width: auto !important; }

/* Long strings and URLs wrap instead of widening the page */
#rc-content, #rc-sidebar, #rc-footer { overflow-wrap: break-word; word-wrap: break-word; }

/* Wide tables scroll inside their own box */
#rc-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Events Calendar views fit the theme column */
.tribe-common, .tribe-events, #tribe-events-pg-template { max-width: 100%; box-sizing: border-box; }
#tribe-events-pg-template { padding: 0 15px; }
.tribe-events-view img { max-width: 100%; height: auto; }

/* Phones and small tablets */
@media (max-width: 767px) {

	/* Home "What's New" feature: the theme hides it on small screens; show it stacked instead */
	body.home #rc-beta.rc-home-tabbed-display {
		display: block !important;
		padding: 0 0 10px !important;
	}
	body.home #rc-beta .uk-container { padding-left: 0; padding-right: 0; }
	body.home #rc-beta .rc-slider-container {
		display: flex !important;
		flex-direction: column-reverse !important;
		flex-wrap: nowrap !important;
		min-height: 0 !important;
		margin: 0 !important;
	}
	body.home #rc-beta .rc-slider-tabs,
	body.home #rc-beta .uk-width-medium-2-3 {
		width: 100% !important;
		flex: 0 0 auto !important;
		min-height: 0 !important;
		margin: 0 !important;
	}
	body.home #rc-beta .rc-slider-tabs > .uk-panel { min-height: 0 !important; height: auto !important; border-radius: 0; }
	body.home #rc-beta #rc-home-switcher,
	body.home #rc-beta #rc-home-switcher > li {
		height: 220px !important;
		min-height: 220px !important;
	}
	body.home #rc-beta .rc-slider-title { max-width: 100% !important; font-size: 1rem; }

	/* UIkit's tab script hides tab items it thinks do not fit; keep all of them in the list */
	body.home #rc-beta .uk-tab-left > li,
	body.home #rc-beta .uk-tab-left > li.uk-hidden {
		display: block !important;
		float: none !important;
		visibility: visible !important;
	}
	body.home #rc-beta .uk-tab-left > li.uk-tab-responsive { display: none !important; }
	body.home #rc-beta .uk-tab-left > li > a { white-space: normal; }
	body.home #rc-beta .uk-tab-left .uk-visible-large { display: none !important; }

	/* Footer columns stack */
	#rc-footer [class*="uk-width-"] { width: 100%; float: none; }

	/* Events list: keep the date and card inside the screen */
	.tribe-events-calendar-list__event-row { padding-left: 0; padding-right: 0; }
	.tribe-events-calendar-list__event-featured-image-wrapper { max-width: 100%; }

	/* Comfortable text and tap targets */
	#rc-content { padding-left: 15px; padding-right: 15px; }
	#rc-content h1 { font-size: 1.8rem; line-height: 1.2; }
	.uk-offcanvas-bar a { padding-top: 10px; padding-bottom: 10px; }
}

/* Home slider (tablet and up): the image column keeps a 16:9 shape at every width, so the slide image
   is not cropped to a short wide strip, and the image is anchored to the top. The tab list column
   keeps its own height; whichever is taller sets the row height. */
@media (min-width: 768px) {
	body.home #rc-beta .rc-slider-container { align-items: stretch; }
	body.home #rc-beta #rc-home-switcher { aspect-ratio: 16 / 9; height: 100%; }
	body.home #rc-beta #rc-home-switcher > li {
		background-size: cover;
		background-position: center top;
		background-repeat: no-repeat;
	}
	body.home #rc-beta .rc-slider-title { max-width: 100%; box-sizing: border-box; }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 959px) {
	body.home #rc-beta .uk-tab-left > li > a { padding: 8px; }
	body.home #rc-beta .rc-slider-header { font-size: 1rem; }
	#rc-main-menu .uk-navbar-nav > li > a { padding-left: 8px; padding-right: 8px; }
}

/* Default footer (used when no footer widgets are set) */
#rc-footer .rc-footer-fallback { color: rgba(255, 255, 255, 0.8); }
#rc-footer .rc-footer-fallback p { margin: 0 0 8px; }
#rc-footer .rc-footer-fallback a { color: rgba(255, 255, 255, 0.9); text-decoration: none; }
#rc-footer .rc-footer-fallback a:hover { color: #fff; text-decoration: underline; }
#rc-footer .rc-footer-links { margin: 0; padding: 0; list-style: none; }
#rc-footer .rc-footer-links li { padding: 3px 0; }
#rc-footer .rc-footer-copyright { color: rgba(255, 255, 255, 0.55); font-size: 0.9em; }
#rc-footer .rc-footer-admin-note { margin-top: 16px; color: rgba(255, 255, 255, 0.45); }

/* Home: Monthly eBulletin list and default footer buttons */
.rc-home-ebulletins { margin: 0; padding-left: 20px; list-style: disc; }
.rc-home-ebulletins li { padding: 2px 0; }
#rc-footer .rc-footer-fallback .uk-button { background: rgba(255, 255, 255, 0.85); color: #430c0d; border: none; border-radius: 16px; padding: 0 16px; }
#rc-footer .rc-footer-fallback .uk-button:hover { background: #fff; }
#rc-footer .rc-footer-fallback i { margin-right: 6px; }

/* Keep the page content in a centered column (the theme's own container widths).
   Higher specificity so later "max-width: 100%" patches do not stretch it edge to edge. */
body .uk-container.uk-container-center { max-width: 784px; }
@media (min-width: 1220px) {
	body .uk-container.uk-container-center { max-width: 960px; }
}

/* Breathing room around the home page grid (Latest Podcasts / Monthly eBulletin).
   Specific enough to beat the inline "content-visibility-fix" styles from the mu-plugins. */
body.home main#rc-main > .rc-content-section.rc-background-color-white {
	padding-top: 32px !important;
	padding-bottom: 32px !important;
}

/* UIkit grids use a negative left margin to offset the column gutter, so they must be allowed to be
   wider than their container. A global "max-width: 100%" on .uk-grid (mu-plugin) narrows every grid
   by one gutter and leaves the right edge short of the nav/footer. */
body .uk-container > .uk-grid:not(.uk-grid-collapse) { max-width: none; }

/* Sidebar layout: the mu-plugin sets "#rc-content { width: auto !important }", which would let the content column
   shrink-wrap instead of taking its 2/3 (3/4 on wide screens) grid width next to the sidebar. */
@media (min-width: 768px) {
	body #rc-content.uk-width-medium-2-3 { width: 66.6667% !important; }
	body #rc-sidebar.uk-width-medium-1-3 { width: 33.3333%; }
}
@media (min-width: 1220px) {
	body #rc-content.uk-width-xlarge-3-4 { width: 75% !important; }
	body #rc-sidebar.uk-width-xlarge-1-4 { width: 25%; }
}
#rc-sidebar .rc-sidebar-list { margin: 0; }
#rc-sidebar .rc-sidebar-list li { margin-bottom: 20px; }
#rc-sidebar .rc-sidebar-list li h3.rc-widget-title { margin: -12px -12px 12px; }
#rc-sidebar .rc-sidebar-fallback .gform_wrapper { margin: 0; }
#rc-sidebar .rc-sidebar-fallback input[type="text"],
#rc-sidebar .rc-sidebar-fallback input[type="email"] { max-width: 100%; }

/* ---- Events (The Events Calendar views) ---- */
/* Theme colours and font instead of the plugin's blue / sans-serif defaults */
.tribe-common {
	--tribe-color-accent-primary: #660e1b;
	--tribe-color-accent-primary-hover: #430c0d;
	--tribe-color-accent-primary-active: #430c0d;
	--tribe-color-link-accent: #660e1b;
	--tribe-font-family-base: "Lora", Georgia, serif;
}
.tribe-common, .tribe-common button, .tribe-common input,
.tribe-common .tribe-common-h1, .tribe-common .tribe-common-h2, .tribe-common .tribe-common-h3,
.tribe-common .tribe-common-h4, .tribe-common .tribe-common-h5, .tribe-common .tribe-common-h6,
.tribe-common .tribe-common-b1, .tribe-common .tribe-common-b2, .tribe-common .tribe-common-b3 {
	font-family: "Lora", Georgia, serif;
}
.tribe-common .tribe-common-c-btn, .tribe-common a.tribe-common-c-btn { background-color: #660e1b; border-radius: 4px; }
.tribe-common .tribe-common-c-btn:hover { background-color: #430c0d; }
.tribe-common a, .tribe-events .tribe-events-calendar-list__event-title-link { color: #660e1b; }
.tribe-events .tribe-events-calendar-list__month-separator-text,
.tribe-events .tribe-events-header__title-text { color: #660e1b; }

/* Search bar and view switcher read as grey bars like the original site */
.tribe-events .tribe-events-c-events-bar__search-container,
.tribe-events .tribe-events-c-search { background: #f5f5f5; }
.tribe-events .tribe-events-c-events-bar { border-color: #ddd; }

/* Search + view icons: the theme's global `svg { max-width:100%; height:auto }` collapses the
   plugin's icons, so give them explicit sizes, colours and click behaviour again. */
.tribe-events .tribe-common-c-svgicon { display: inline-block; max-width: none; overflow: visible; }
.tribe-events .tribe-events-c-search__input-control-icon-svg {
	position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
	pointer-events: none;
}
.tribe-events .tribe-events-c-search__input-control { position: relative; }
.tribe-events .tribe-events-c-search__input { padding-left: 36px; }
.tribe-events .tribe-events-c-search__input-control-icon-svg path { fill: #660e1b; }
.tribe-events .tribe-events-c-view-selector__button { cursor: pointer; position: relative; z-index: 2; }
.tribe-events .tribe-events-c-view-selector__button-icon-svg,
.tribe-events .tribe-events-c-view-selector__list-item-icon-svg { width: 18px; height: 18px; }
.tribe-events .tribe-events-c-view-selector__button-icon-caret-svg { width: 10px; height: 10px; }
.tribe-events .tribe-events-c-view-selector__button-icon-svg path,
.tribe-events .tribe-events-c-view-selector__list-item-icon-svg path,
.tribe-events .tribe-common-c-svgicon__svg-fill path { fill: #660e1b; }
.tribe-events .tribe-events-c-view-selector__list-item-link { cursor: pointer; }

/* Events bar buttons (search toggle + view selector): same size, no stray box/border,
   brand-coloured, with a subtle focus ring only for keyboard users. */
.tribe-events .tribe-events-c-events-bar__search-button,
.tribe-events .tribe-events-c-view-selector__button {
	background: transparent; border: 0; box-shadow: none; outline: 0;
	width: 36px; height: 36px; padding: 7px; margin: 0 4px 0 0;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 4px; cursor: pointer;
}
.tribe-events .tribe-events-c-events-bar__search-button:focus:not(:focus-visible),
.tribe-events .tribe-events-c-view-selector__button:focus:not(:focus-visible) { outline: 0; box-shadow: none; }
.tribe-events .tribe-events-c-events-bar__search-button:focus-visible,
.tribe-events .tribe-events-c-view-selector__button:focus-visible { outline: 2px solid #660e1b; outline-offset: 2px; }
.tribe-events .tribe-events-c-events-bar__search-button:hover,
.tribe-events .tribe-events-c-view-selector__button:hover { background: rgba(102, 14, 27, .08); }
.tribe-events .tribe-events-c-events-bar__search-button-icon,
.tribe-events .tribe-events-c-view-selector__button-icon {
	width: 22px; height: 22px; background-size: contain; background-repeat: no-repeat; background-position: center;
}
/* View-selector dropdown: it was inheriting the 36px button width, so "List"/"Month" wrapped letter by letter.
   Size it to its content, right-align under the button, and stack it above the search panel. */
.tribe-events .tribe-events-c-view-selector { position: relative; width: 100%; }
.tribe-events .tribe-events-c-view-selector .tribe-events-c-view-selector__content {
	width: max-content; min-width: 150px; left: auto; right: 0; z-index: 40;
}
.tribe-events .tribe-events-c-view-selector__list-item-link,
.tribe-events .tribe-events-c-view-selector__list-item-text { white-space: nowrap; writing-mode: horizontal-tb; }
.tribe-events .tribe-events-c-events-bar__search-container { z-index: 30; }

/* Events bar: no toggle buttons. The native search form is always visible, and the
   List / Month view links are shown inline instead of behind a dropdown button. */
.tribe-events .tribe-events-c-events-bar__search-button,
.tribe-events .tribe-events-c-view-selector__button { display: none !important; }
.tribe-events .tribe-events-c-events-bar__search-container {
	display: block !important; position: static !important; transform: none !important;
	width: 100%; height: auto !important; visibility: visible !important;
}
.tribe-events .tribe-events-header { display: flex; flex-wrap: wrap; align-items: center; }
.tribe-events .tribe-events-header > * { flex: 0 0 100%; max-width: 100%; }
.tribe-events .tribe-events-header__events-bar { display: block; width: 100%; margin: 0 0 16px; }
.tribe-events .tribe-events-c-events-bar__search,
.tribe-events .tribe-events-c-events-bar__search-form,
.tribe-events .tribe-events-c-search { width: 100%; max-width: 100%; }
.tribe-events .tribe-events-c-events-bar__views { width: 100%; }
.tribe-events .tribe-events-c-view-selector .tribe-events-c-view-selector__content {
	display: block !important; position: static !important; transform: none !important;
	width: 100%; min-width: 0; border: 0; box-shadow: none; padding: 8px 0 0; background: transparent;
}
.tribe-events .tribe-events-c-view-selector__list { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.tribe-events .tribe-events-c-view-selector__list-item { flex: 0 0 auto; width: auto; margin: 0; }
.tribe-events .tribe-events-c-view-selector__list-item-link { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; white-space: nowrap; }
.tribe-events .tribe-events-c-view-selector__list-item-text { white-space: nowrap; }
.tribe-events .tribe-events-c-view-selector__content { text-align: left; }

/* Same look at every width. The Customizer "Additional CSS" (database) paints the view tabs as a grey
   box and the button olive only at the medium breakpoint, so /events/, /events/list/ and /events/month/
   looked different. These selectors are stronger than those, and apply at all breakpoints. */
body .tribe-common.tribe-events .tribe-events-c-view-selector--tabs .tribe-events-c-view-selector__content,
body .tribe-common.tribe-events .tribe-events-c-view-selector .tribe-events-c-view-selector__content {
	background: transparent; padding: 8px 0 0; text-align: left; border: 0; box-shadow: none;
}
body .tribe-common.tribe-events .tribe-events-c-view-selector__list { justify-content: flex-start; }
body .tribe-common.tribe-events .tribe-events-c-events-bar__views { justify-content: flex-start; padding: 0 20px; }
body .tribe-common.tribe-events .tribe-events-c-view-selector__list-item-icon { display: none; }
body .tribe-common.tribe-events .tribe-events-c-view-selector__list-item { padding: 0 20px 0 0; }
body .tribe-common.tribe-events .tribe-events-c-view-selector__list-item-link { padding: 4px 0 5px; }
body .tribe-common.tribe-events .tribe-common-c-btn.tribe-events-c-search__button {
	background-color: #9d9b3c; border-radius: 6.4px; font-family: 'Roboto Slab', serif; font-weight: 400;
}
body .tribe-common.tribe-events .tribe-events-c-events-bar { border: 1px solid #ddd; background: #fff; padding-bottom: 8px; }

/* The plugin only applies its wide (single-row) search layout once its JS adds the
   `tribe-common--breakpoint-medium` class. If that class is missing (JS late/blocked, cached markup) the
   page falls back to the stacked mobile layout even on a wide screen, so /events/ looked different from
   /events/list/. Apply the same layout from a plain media query so it never depends on the JS. */
@media (min-width: 768px) {
	body .tribe-common.tribe-events .tribe-events-c-events-bar__search { display: flex; flex: auto; }
	body .tribe-common.tribe-events .tribe-events-c-search { display: flex; align-items: center; width: 100%; }
	body .tribe-common.tribe-events .tribe-events-c-search__input-group { display: flex; align-items: center; flex: auto; }
	body .tribe-common.tribe-events .tribe-events-c-search__input-control { flex: auto; margin: 12px 0; border-right: 0; }
	body .tribe-common.tribe-events .tribe-events-c-search__input { margin: -12px 0; }
	body .tribe-common.tribe-events .tribe-events-c-search__button { flex: none; margin: 0 0 0 12px; width: auto; }
}

/* Recolour the search magnifier to the brand maroon */
.tribe-events .tribe-events-c-events-bar__search-button-icon {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23660e1b'/%3E%3C/svg%3E");
}

/* Event cards: image beside the text, not stacked full width */
.tribe-events-calendar-list__event-row { margin-bottom: 24px; }
.tribe-events-calendar-list__event { background: #f5f5f5; border-radius: 4px; padding: 16px; }
.tribe-events-calendar-list__event-featured-image-wrapper { max-width: 100%; }
.tribe-events-calendar-list__event-featured-image { max-width: 240px; height: auto; }

/* Month view: calendar grid fills the whole events column (aligned with search bar / notice banner) */
.tribe-events .tribe-events-calendar-month,
.tribe-events .tribe-events-calendar-month__body,
.tribe-events .tribe-events-calendar-month__header { width: 100% !important; max-width: 100%; }
.tribe-events table.tribe-events-calendar-month { table-layout: fixed; border-collapse: collapse; }
.tribe-events .tribe-events-calendar-month__header-column,
.tribe-events .tribe-events-calendar-month__day { width: 14.2857%; }

/* The events column sits inside the standard container, so drop the extra gutters */
.rc-events-main #tribe-events-pg-template { padding: 0; }
.rc-events-main .tribe-events { padding-top: 0; }
.rc-events-wrap { padding-top: 10px; }

/* Subscribe to Podcast sidebar widget */
.rc-subscribe-podcast-list { list-style: none; margin: 0; padding: 0; }
.rc-subscribe-podcast-list li { margin: 0 0 8px; }
.rc-subscribe-podcast-list a { font-weight: 700; }
