/*
 * Campo Vecchio - Palmeria header and plain pages.
 * Loaded by includes/theme-fixes.php on every front-end page.
 */

/*
 * Hamburger and close (X) buttons: no background. On Elementor pages the
 * site's button style (".elementor-kit-661 button") painted them blue;
 * IDs keep these rules ahead of it, hover and focus included.
 */
#sidebar-open,
#sidebar-open:hover,
#sidebar-open:focus,
#sidebar-open:active,
#sidebar-close,
#sidebar-close:hover,
#sidebar-close:focus,
#sidebar-close:active,
#secondary .dropdown-toggle,
#secondary .dropdown-toggle:hover,
#secondary .dropdown-toggle:focus,
#site-navigation .dropdown-toggle,
#site-navigation .dropdown-toggle:hover,
#site-navigation .dropdown-toggle:focus {
	border: 0;
	background: transparent;
	box-shadow: none;
}

/*
 * Menu font: Open Sans in every language. The site's "Additional CSS" sets it
 * on ".menu-menu-principal-container", the French menu only; the English
 * menu ("Main menu") fell back to the theme's Rufina.
 */
#site-navigation > div,
#site-mobile-navigation > div {
	font-family: "Open Sans", sans-serif;
}

/*
 * Header menu on mid-size screens. Palmeria keeps 114px on each side from
 * 992px up, so the menu only fitted on one line from about 1380px. Smaller
 * margins up to 1439px let it fit from about 1230px; below that,
 * theme-fixes.js adds "cv-nav-collapsed" and the hamburger takes over.
 */
@media (min-width: 992px) and (max-width: 1439px) {
	.site-header {
		padding-right: 3.125rem;
		padding-left: 3.125rem;
	}
}

@media (min-width: 992px) {
	body.cv-nav-collapsed .site-header .main-navigation {
		display: none;
	}

	body.cv-nav-collapsed #sidebar-open {
		display: block;
	}

	body.cv-nav-collapsed #secondary .mobile-navigation {
		display: block;
	}
}

/*
 * Pages and posts: one white card, like the accommodation pages. The beige
 * box came from the site's "Additional CSS" (.site-main { background-color:
 * #F5F0EC }) and sat inside the theme's white card, leaving a white band
 * above the title. Applies to any page using the theme's layout, Elementor
 * or not (Tarifs, Nos équipements...). The home page and the blog listing
 * keep it (the home's sections are designed on it).
 */
body.page:not(.home) .site-main,
body.single-post .site-main {
	background-color: transparent;
}

/* Results page cards: a light shadow now that they sit on white */
.mphb_sc_search_results-wrapper .cv-alt-card,
.cv-alt-list .cv-alt-card {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/*
 * Accommodation pages: the name at the top is now the page's main heading (h1,
 * it was an h2, so the page had none). Same look as before.
 */
.elementor-widget-text-editor h1.cv-room-title {
	margin: 0 0 0.5em;
	font-size: 1.9rem;
	line-height: 1.4;
}

/*
 * Photo mosaics (Jetpack "tiled gallery" blocks) when Jetpack is not running:
 * see includes/gallery-fallback.php. Rows of columns, 4px apart, each picture
 * filling its cell.
 */
body.cv-no-jetpack .wp-block-jetpack-tiled-gallery {
	margin-right: auto;
	margin-left: auto;
}

body.cv-no-jetpack .tiled-gallery__gallery {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	padding: 0;
}

body.cv-no-jetpack .tiled-gallery__row {
	display: flex;
	flex-direction: row;
	justify-content: center;
	width: 100%;
	margin: 0;
}

body.cv-no-jetpack .tiled-gallery__row + .tiled-gallery__row {
	margin-top: 4px;
}

body.cv-no-jetpack .tiled-gallery__col {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
}

body.cv-no-jetpack .tiled-gallery__col + .tiled-gallery__col {
	margin-left: 4px;
}

body.cv-no-jetpack .tiled-gallery__item {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	overflow: hidden;
	margin: 0;
	padding: 0;
}

body.cv-no-jetpack .tiled-gallery__item + .tiled-gallery__item {
	margin-top: 4px;
}

/* Two classes more than Elementor's ".elementor img { height: auto }". */
body.cv-no-jetpack .tiled-gallery__gallery .tiled-gallery__item img {
	display: block;
	flex: 1 1 auto;
	width: 100%;
	height: auto;
	min-height: 100%;
	max-width: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

/* Translated legal pages: "the French version prevails" (includes/legal-notice.php) */
.cv-legal-notice {
	margin: 0 0 2em;
	padding: 12px 16px;
	border-left: 4px solid #8998b3;
	border-radius: 4px;
	background: #f5f0ec;
	font-size: 0.95em;
}
