/*
 * Base layer: forms, site title, menu and assorted fixes.
 *
 * Part of the Web Weasel child theme. Loaded from inc/enqueue-assets.php.
 * Order matters: this file is printed after the previous module.
 */

/* Forms */
.forminator-ui label {
	width: unset;
}
.forminator-ui .forminator-checkbox__wrapper {
	align-items: baseline;
}
.forminator-ui .forminator-checkbox__label p {
	margin-top: 0;
}
.forminator-ui .forminator-button {
	-webkit-box-shadow: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}
.forminator-ui .forminator-button:hover {
	-webkit-box-shadow: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	background-color: var(--wp--preset--color--primary-alt-accent);
	color: var(--wp--preset--color--base);
}
.forminator-ui .forminator-button-submit,
.forminator-ui .forminator-button-submit:hover {
	border-radius: 999px !important;
}
.forminator-ui .forminator-button-submit:hover {
	background-color: var(--wp--preset--color--ww-orange-700) !important;
}
/* Site title */
.site-title {
	width: fit-content;
}
.site-title a:where(:not(.wp-element-button)) {
	text-decoration: none;
}

/* Menu */
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close {
	background: linear-gradient(150deg,rgb(34,64,64) 0%,rgb(17,90,92) 100%) !important;
}
.wp-block-navigation__responsive-container {
	padding-top 0 !important;
	padding-left:0 !important;
}
.wp-block-navigation__responsive-container-close {
    right: 1rem !important;
}

/* Off-canvas menu CTAs ("Demarrer un projet" / "Demander un diagnostic
   gratuit"): each ships with a 50% width (wp-block-button__width-50) from
   the block editor, which puts them side by side inside the mobile/tablet
   overlay and wraps the longer label mid-word ("DIAGNOSTI" / "C GRATUIT").
   Stack them full width instead, matching the nav links above them. */
.wp-block-navigation__responsive-container .wp-block-buttons {
	flex-direction: column;
	width: 100%;
}
.wp-block-navigation__responsive-container .wp-block-buttons .wp-block-button,
.wp-block-navigation__responsive-container .wp-block-buttons .wp-block-button__width-50 {
	width: 100%;
}
.wp-block-navigation__responsive-container .wp-block-buttons .wp-block-button__link {
	width: 100%;
	text-align: center;
}

/* Touch target: the hamburger toggle measured 32x32px, under the 44px
   comfort recommendation (Apple/Google) even though it still clears the
   WCAG 2.5.8 AA minimum of 24x24px. Grow the clickable area via a minimum
   size rather than the icon itself. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
}

/* Various fixes */
input[type=checkbox], input[type=radio] {
	padding:0;
}

/* Sticky footer: push the footer to the bottom of the viewport on short
   pages instead of leaving a white gap beneath it. */
html, body {
	min-height: 100%;
}
body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
	min-height: 100vh;
}
.wp-site-blocks main {
	flex: 1 0 auto;
}

/* --- Header layout: keep nav on one line --- */

/* 1. Nav labels never wrap */
.site-header .wp-block-navigation .wp-block-navigation-item__content {
  white-space: nowrap;
}

/* 2. Nav keeps its natural width */
.site-header nav.wp-block-navigation {
  flex-shrink: 0;
}

/* 3. Logo group absorbs the shrink instead */
.site-header .wp-block-group.is-content-justification-left {
  min-width: 0;
  flex-shrink: 1;
}
.site-header .wp-block-group.is-content-justification-left > .wp-block-image {
  min-width: 0;
  flex-shrink: 1;
}
.site-header .wp-block-group.is-content-justification-left > .wp-block-image img {
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Slug anchors: the ollie-child/post-anchor block and its [ww_anchor] twin.
   Out of flow on purpose. In flow the empty target would count as one more
   flex item inside a card and add a whole blockGap of dead space; taken out
   of flow with no top/left, it keeps its static position, so the browser
   still scrolls to the card it sits in. */
.ww-anchor {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	scroll-margin-top: var(--ww-anchor-offset, 2rem);
}

/* Empêche le scroll horizontal causé par les sections alignfull (bordées en 100vw,
   qui dépasse la largeur visible dès qu'une barre de défilement verticale est présente) --
   confirmé sur la section hero (.sky-background > .clouds, 200% de large) à 320px. */
html, body {
	overflow-x: hidden;
}
