/*
 Theme Name:   JD Batiment
 Theme URI:    https://understrap.com
 Description:  JD Batiment Understrap Child Theme
 Author:       the Understrap Contributors
 Author URI:   https://github.com/understrap/understrap-child/graphs/contributors
 Template:     understrap
 Version:      1.3.1
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  understrap-child
 Tags: one-column, custom-menu, featured-images, theme-options, translation-ready
 GitHub Theme URI: understrap/understrap-child
*/

.wp-block-media-text>.wp-block-media-text__content {
	padding-left: 0 !important;
}

h1.page-title,
h1.entry-title {
	margin-top: 1rem;
	margin-bottom: 2rem;
}

#main {
	padding-bottom: 2em;
}

.wrapper {
	padding: 0;
}

/*
	Header
	--------------
*/

nav.bg-primary {
	background-color: #414141 !important;
}

.custom-logo-link img {
	max-height: 80px;
	width: auto;
}

@media (max-width: 990px) {
	.custom-logo-link img {
		max-width: 300px;
		height: auto;
	}
}

@media (max-width: 380px) {
	.custom-logo-link img {
		max-width: 240px;
		height: auto;
	}
}

@media (max-width: 600px) {
	.wp-block-media-text__content {
		margin-top: 20px;
	}

	#wrapper-footer-full .wp-block-group {
		grid-template-columns: repeat(auto-fill, minmax(min(10em, 100%), 1fr));
	}
}

/* Menu principal */

.navbar-nav .nav-link {
	color: #fff !important;
	font-size: smaller;
	font-weight: 600;
}

.navbar-nav .nav-link:hover {
	color: orange !important;
}

.navbar-nav .nav-item:last-child a {
	color: orange !important;
}

.home .navbar-toggler {
	background-color: #e98b22 !important;
}

/* Footer */

#wrapper-footer-full,
#wrapper-static-hero {
	background-color: #414141 !important;
	color: white !important;
}

.home #wrapper-footer-full,
.home #wrapper-static-hero {
	background: #fff !important;
	color: #333 !important;
}

#wrapper-footer-full {
	font-size: 0.85rem;
	font-weight: 600;
}

#menu-bas-de-page a {
	text-decoration: none;
	color: inherit;
}

#menu-bas-de-page a:hover,
#menu-bas-de-page a:active {
	color: orange;
}

.site-footer {
	display: none !important;
}

/*
  Page d'accueil
	--------------
*/

.home #wrapper-navbar .navbar {
	background: transparent !important;
}

.home #main-nav {
	padding: 0;
}

.navbar-brand {
	padding-top: 5px !important;
	padding-bottom: 0 !important;
}

.home .navbar-nav .nav-link {
	color: #333 !important;
	font-size: smaller;
	font-weight: 600;
}

.home .navbar-nav .nav-link:hover {
	color: orange !important;
}

/* Style des articles avec image mise en avant */

/* Conteneur du post */
.wp-block-post {
	position: relative;
	overflow: hidden;
}

/* Image */
.wp-block-post-featured-image img {
	display: block;
	transition: transform 0.4s ease;
	width: 100%;
	height: auto;
}

/* Overlay */
.wp-block-post::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.2);
	opacity: 0;
	transition: opacity 0.4s ease;
}

/* Titre centré */
.wp-block-post-title {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	width: 90%;
	z-index: 2;
	opacity: 0;
	transition: opacity 0.4s ease, transform 0.4s ease;
	pointer-events: none;
	/* le bloc ne capte pas la souris */
}

/* Lien du titre (reste cliquable) */
.wp-block-post-title a {
	pointer-events: auto;
	/* réactive le clic uniquement sur le lien */
	color: #fff !important;
	text-decoration: none;
	font-size: 1.2rem;
}

.wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.1);
}

.wp-block-post:hover::after {
	opacity: 1;
}

.wp-block-post:hover .wp-block-post-title {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.05);
}

.wp-block-post:hover .wp-block-post-title a:hover {
	color: #ff8000 !important;
}

.domaines img:hover {
	transform: scale(1.1);
	transition: transform 0.4s ease;
}


/*
	Porfolio réalisations (archive-realisations.php)
 -------------------------------------------------
*/

.realisations-filters {
	text-align: center;
	margin-bottom: 30px;
}

.filter-button {
	color: #fff !important;
	border: none;
	padding: 10px 20px;
	margin: 0 2px 5px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: .5rem;
}

.filter-button.active,
.filter-button:hover {
	background: #333;
}

/*
	Page archive réalisations - bouton des filtres
	----------------------------------------------
*/
.realisations-item {
	aspect-ratio: 16 / 9;
}

/* Image qui couvre tout le bloc */
.realisations-item img.realisations-thumb {
	aspect-ratio: 16 / 9;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
	display: block;
}

#realisations-grid>ul {
	margin: -5px;
}

.realisations-item {
	width: calc(33.333% - 10px);
	margin: 5px;
	box-sizing: border-box;
}

@media (max-width: 780px) {
	.realisations-item {
		width: calc(50% - 8px);
		margin: 4px;
	}
}

@media (max-width: 500px) {
	.realisations-item {
		width: 100%;
	}
}

/* Images en noir et blanc avec effet couleur au survol */
.logos-nb img {
	filter: grayscale(100%);
	transition: filter 0.5s ease;
	-webkit-filter: grayscale(100%);
}

.logos-nb img:hover {
	filter: grayscale(0%);
}

/*
	listes avec chevrons
	----------------------------------------------------
*/
/* Couleurs / taille centralisées */
:root {
	--chev-color: #ff6600;
	/* couleur du chevron */
	--chev-size: 1.5rem;
	/* taille du chevron */
	--chev-gap: 0.6rem;
	/* espacement entre chevron et texte */
}

/* supprimer puces par défaut et remettre alignement */
#menu-bas-de-page,
ul.liste-chevrons {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

/* chaque item a un padding gauche pour laisser la place au chevron */
#menu-bas-de-page li,
ul.liste-chevrons li {
	position: relative;
	padding-left: 1.3rem;
	margin-bottom: 0.5rem;
}

/* chevron via pseudo-élément : caractère '›' (U+203A) */
#menu-bas-de-page li::before,
ul.liste-chevrons li::before {
	content: '\203A';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	color: var(--chev-color);
	font-size: var(--chev-size);
	line-height: 1;
	display: inline-block;
	width: var(--chev-size);
	text-align: center;
}

/*
	liseret orange avant les titres de page et d'article
	----------------------------------------------------
*/
.page-title,
.entry-title,
.ligne-avant-titre {
	position: relative;
	padding-left: 2.3em;
	line-height: 1.4;
}

/* Ligne avant le titre */
.page-title::before,
.entry-title::before,
.ligne-avant-titre::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 2em;
	height: 4px;
	background-color: orange;
}

@media (max-width: 380px) {
	.ligne-avant-titre {
		padding-left: 1em;
	}

	.ligne-avant-titre::before {
		display: none;
	}
}

/*
	Formulaire Contact Form 7
	--------------------------
*/
.wpcf7 input[type=submit] {
	background-color: orange;
	border: none;
	color: #000;
	padding: 10px 20px;
	cursor: pointer;
	font-size: 1rem;
}

.wpcf7 input[type=submit]:focus {
	background-color: orange;
}
