/*
 * Adaptation mobile / tablette.
 * Chargé après style.css : n'a aucun effet au-dessus de 980 px.
 */

/* ---------- Largeur fluide (petits ordinateurs / tablettes paysage) ---------- */
@media (max-width: 980px) {
	.inner {
		width: auto;
		max-width: 940px;
		padding-left: 20px;
		padding-right: 20px;
		box-sizing: border-box;
	}
	section.projets,
	section.projets .carousel {
		min-width: 0;
	}

	section.projets .inner {
		padding-left: 0;
		padding-right: 0;
		max-width: none;
	}
}

/* ---------- Mise en page compacte (tablettes portrait et téléphones) ---------- */
@media (max-width: 900px) {

	html {
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}

	body {
		overflow-x: hidden;
		padding-bottom: 62px; /* place de la barre de menu fixe en bas */
	}

	body.home {
		padding-bottom: 0;
	}

	/* ----- En-tête : logo + langue, sous-menu en dessous ----- */
	header {
		position: sticky;
		top: 0;
		height: auto;
		z-index: 100;
		background: #fff;
	}

	.admin-bar header {
		top: 32px;
	}

	body.home header {
		position: static;
		height: 0;
		background: transparent;
	}

	header .inner {
		height: auto;
		min-height: 52px;
		padding: 10px 15px;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
	}

	header .inner > a img {
		display: block;
		height: 24px;
		width: auto;
		margin: 0;
	}

	header .inner .lang {
		position: static;
		width: auto;
		order: 2;
		white-space: nowrap;
	}

	header .inner .lang a {
		display: inline-block;
		font-size: 14px;
		padding: 8px 5px;
	}

	header .inner nav {
		position: static;
		order: 3;
		flex: 0 0 100%;
	}

	header .inner nav ul {
		display: flex;
		flex-wrap: wrap;
		margin-top: 6px;
	}

	header .inner nav ul li,
	header .inner nav ul li:first-child {
		float: none;
		padding: 6px 18px 6px 0;
		font-size: 12px;
	}

	header .inner nav .clr {
		display: none;
	}

	/* ----- Pied de page : adresse en flux normal, menu fixe en bas ----- */
	footer {
		position: static;
		height: auto;
		width: auto;
		background: #fff;
		border-top: 1px solid #d1d1d1;
	}

	footer .inner {
		padding: 16px 15px 12px;
		text-align: center;
	}

	footer .inner nav {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		height: auto;
		background: #fff;
		border-top: 1px solid #d1d1d1;
		z-index: 100;
	}

	footer .inner nav ul {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}

	footer .inner nav ul li {
		float: none;
		font-size: 11px;
		line-height: 44px;
	}

	footer .inner nav ul li a {
		height: 44px;
		padding-left: 8px;
		padding-right: 8px;
	}

	footer .inner nav .clr {
		display: none;
	}

	footer .inner .adresse,
	footer .inner .tel,
	footer .inner .menu2 {
		position: static;
		width: auto;
		margin: 0 0 10px;
		font-size: 12px;
		line-height: 18px;
	}

	footer .inner .menu2 ul {
		display: inline-block;
	}

	footer .inner .menu2 ul li {
		font-size: 12px;
	}

	footer .inner .menu2 .clr {
		display: none;
	}

	/* ----- Page d'accueil ----- */
	body.home footer {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		border-top: 0;
		z-index: 100;
	}

	body.home footer .inner {
		padding: 0;
	}

	body.home footer .inner nav {
		position: static;
	}

	body.home footer .inner .adresse,
	body.home footer .inner .tel,
	body.home footer .inner .menu2 {
		display: none;
	}

	#slider ul li,
	body.home {
		background-attachment: scroll;
	}

	#badeau_home {
		bottom: 70px;
	}

	#diapo #badeau_home {
		bottom: 22%;
	}

	#diapo #badeau_home a.entrer {
		font-size: 15px;
		padding: 12px 22px;
		margin: 0 4px;
	}

	/* ----- Pages de contenu ----- */
	#contenu,
	#contenu.contact,
	#contenu.page.reference {
		padding-top: 22px;
		padding-bottom: 30px;
	}

	#contenu h1 {
		font-size: 20px;
		line-height: 26px;
		margin-bottom: 16px;
	}

	#contenu p {
		font-size: 15px;
		line-height: 24px;
		text-align: left;
	}

	#contenu ul li,
	#contenu .adresse p,
	#contenu .formulaire p {
		font-size: 15px;
		line-height: 24px;
	}

	#contenu h2 {
		font-size: 18px;
		line-height: 24px;
	}

	#contenu q {
		padding: 15px 15px 15px 25px;
	}

	#contenu img.alignleft,
	#contenu img.alignright {
		float: none;
		display: block;
	}

	/* ----- Contact ----- */
	#contenu .formulaire,
	#contenu .adresse {
		float: none;
		width: auto;
		padding-left: 0;
	}

	#contenu .adresse .left,
	#contenu .adresse .right {
		float: none;
		width: auto;
		margin-left: 0;
	}

	#contenu .formulaire form .first,
	#contenu .formulaire form .last {
		float: none;
		width: auto;
		margin-right: 0;
	}

	#contenu .formulaire form input,
	#contenu .formulaire form select,
	#contenu .formulaire form textarea {
		width: 100%;
		box-sizing: border-box;
	}

	/* ----- Publications ----- */
	#contenu .inner ul.news li,
	#contenu .inner ul.news li:nth-child(2n-1) {
		float: none;
		clear: none;
		width: auto;
		display: flex;
		align-items: flex-start;
		margin-bottom: 26px;
	}

	#contenu .inner ul.news li img {
		float: none;
		flex: 0 0 85px;
		width: 85px;
		height: auto;
		margin: 0 16px 0 0;
	}

	#contenu .inner ul.news li .infos {
		float: none;
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
	}

	#contenu .inner ul.news li .infos p {
		width: auto;
		font-size: 13px;
		line-height: 19px;
		text-align: left;
	}

	#contenu .inner ul.news li .infos p.titre {
		font-size: 16px;
		line-height: 21px;
	}

	#contenu .inner ul.news li .infos a {
		font-size: 14px;
		display: inline-block;
		padding: 4px 0;
	}

	/* ----- Listes de réalisations (catégories) ----- */
	#contenu.page.reference > .inner > ul {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 20px 16px;
	}

	#contenu.page.reference > .inner > ul > li,
	#contenu.page.reference > .inner > ul > li:nth-child(3n),
	#contenu.page.reference > .inner > ul > li:nth-child(3n-2) {
		float: none;
		clear: none;
		width: auto;
		padding: 0 0 30px;
	}

	#contenu.page.reference > .inner > ul > li img {
		display: block;
		width: 100%;
		height: auto;
		margin-bottom: 6px;
	}

	#contenu.page.reference > .inner > ul > li p {
		font-size: 13px;
		line-height: 18px;
		padding-right: 26px;
	}

	#contenu.page.reference > .inner > ul > li a.plus {
		bottom: 30px;
		right: 4px;
	}

	/* ----- Liste de références avec menu latéral ----- */
	#contenu aside {
		position: static;
		width: auto;
		margin-bottom: 20px;
	}

	#contenu .content {
		width: auto;
		padding-left: 0;
		padding-top: 0;
	}

	#contenu .content ul {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 20px 16px;
	}

	#contenu .content ul li,
	#contenu .content ul li:nth-child(3n) {
		float: none;
		width: auto;
		margin: 0;
	}

	#contenu .content ul li a {
		width: auto;
		height: auto;
		padding: 5px;
	}

	/* ----- Fiche réalisation (carrousel) ----- */
	#contenu.ref-single {
		padding: 0;
	}

	section.projets {
		position: relative;
		top: auto;
		bottom: auto;
		width: 100%;
	}

	section.projets #wait {
		padding: 90px 0;
	}

	#contenu.ref-single section.projets .carousel ul li {
		padding: 0;
	}

	section.projets .carousel ul li .inner {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0;
		max-width: none;
	}

	section.projets .carousel ul li img {
		position: static;
		width: 100%;
		height: auto !important;
		max-width: 100%;
		max-height: 100%;
		margin: 0;
	}

	#contenu section.projets .infos h1 {
		width: auto;
		max-width: calc(100% - 70px);
		height: auto;
		line-height: 16px;
		padding: 6px 12px;
		font-size: 12px;
		top: 12px;
		left: 0;
		box-sizing: border-box;
	}

	#contenu section.projets .infos a.open {
		top: 12px;
		left: auto;
		right: 6px;
		width: 13px;
		height: 13px;
		padding: 9px;
		background-origin: content-box;
		background-clip: content-box;
		background-repeat: no-repeat;
	}

	#contenu section.projets .infos .the_content {
		top: 56px;
		left: 0;
		width: calc(100% - 30px);
		max-height: 70vh;
		background: rgba(255, 255, 255, 0.94);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	#contenu section.projets .infos .the_content p {
		font-size: 14px;
		line-height: 21px;
		text-align: left;
	}

	#contenu section.projets .infos a.next,
	#contenu section.projets .infos a.back,
	#contenu section.projets .infos a.prev {
		width: 38px;
		height: 38px;
		bottom: 8px;
		right: 8px;
		background-size: 22px 22px;
		background-position: center;
		background-repeat: no-repeat;
		background-color: rgba(255, 255, 255, 0.55);
	}

	#contenu section.projets .infos a.back {
		right: 52px;
	}

	#contenu section.projets .infos a.prev {
		right: 96px;
	}
}

/* ---------- Tablettes : vignettes plus grandes ---------- */
@media (min-width: 600px) and (max-width: 900px) {
	#contenu.page.reference > .inner > ul,
	#contenu .content ul {
		grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	}

	#contenu p,
	#contenu ul li {
		font-size: 16px;
	}
}

/* ---------- Petits téléphones ---------- */
@media (max-width: 380px) {
	header .inner > a img {
		height: 20px;
	}

	header .inner .lang a {
		font-size: 13px;
		padding: 8px 4px;
	}

	footer .inner nav ul li a {
		padding-left: 3px;
		padding-right: 3px;
	}

	footer .inner nav ul li {
		font-size: 9.5px;
	}
}

@media (max-width: 782px) {
	.admin-bar header {
		top: 46px;
	}
}
