/*
 * Shared styles for the ACF blocks.
 *
 * This file is loaded on the frontend and inside the block editor. Keep
 * selectors scoped to a block root so editor content outside the preview is
 * not affected.
 */

/* Manrope is also needed when the block is rendered inside the editor iframe. */
@font-face {
	font-display: swap;
	font-family: 'Manrope';
	font-style: normal;
	font-weight: 300;
	src: url('../fonts/manrope-v20-latin-300.woff2') format('woff2'),
		url('../fonts/manrope-v20-latin-300.ttf') format('truetype');
}

@font-face {
	font-display: swap;
	font-family: 'Manrope';
	font-style: normal;
	font-weight: 400;
	src: url('../fonts/manrope-v20-latin-regular.woff2') format('woff2'),
		url('../fonts/manrope-v20-latin-regular.ttf') format('truetype');
}

@font-face {
	font-display: swap;
	font-family: 'Manrope';
	font-style: normal;
	font-weight: 700;
	src: url('../fonts/manrope-v20-latin-700.woff2') format('woff2'),
		url('../fonts/manrope-v20-latin-700.ttf') format('truetype');
}

:root {
	--headline-color: #203F54;
	--text-color: #0A141B;
	--hero-background-color: rgba(32, 63, 84, 0.80);
	--cite-background-color: rgba(32, 63, 84, 0.95);
	--color-blue: #203F54;
	--color-white: #ffffff;
	--color-light-blue: #E0E4E7;
	--h1-size: clamp(2.625rem, 2rem + 2vw, 3.875rem);
	--h2-size: clamp(1.625rem, 1.3125rem + 1vw, 2.25rem);
	--text-size: clamp(1rem, 0.875rem + 0.4vw, 1.25rem);
}

/* Shared block typography and utilities. */
:where(
	.accordeon-block,
	.cite,
	.contact-block,
	.offer-grid-block,
	.offer-slider-block,
	.presse-block,
	.team-block,
	.text-image-block
) {
	color: var(--text-color);
	font-family: 'Manrope', sans-serif;
	font-size: var(--text-size);
	font-weight: 300;
}

:where(
	.accordeon-block,
	.cite,
	.contact-block,
	.offer-grid-block,
	.offer-slider-block,
	.presse-block,
	.team-block,
	.text-image-block
) :is(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
	color: var(--headline-color);
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: var(--h2-size);
}

:where(
	.accordeon-block,
	.cite,
	.contact-block,
	.offer-grid-block,
	.offer-slider-block,
	.presse-block,
	.team-block,
	.text-image-block
) :is(h1, .h1) {
	font-size: var(--h1-size);
	margin-bottom: 0;
}

:where(
	.accordeon-block,
	.cite,
	.contact-block,
	.offer-grid-block,
	.offer-slider-block,
	.presse-block,
	.team-block,
	.text-image-block
) :is(h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6) {
	font-size: var(--h2-size);
}

:where(
	.accordeon-block,
	.cite,
	.contact-block,
	.offer-grid-block,
	.offer-slider-block,
	.presse-block,
	.team-block,
	.text-image-block
) a {
	color: #3B749A;
	text-decoration: underline 1px;
	text-underline-offset: 4px;
}

:where(
	.accordeon-block,
	.cite,
	.contact-block,
	.offer-grid-block,
	.offer-slider-block,
	.presse-block,
	.team-block,
	.text-image-block
).bg-light-blue {
	background-color: var(--color-light-blue) !important;
}

.text-image-block .min-50vh {
	min-height: 50vh;
}

/* The text-image block uses a theme button, scoped to this block only. */
.text-image-block .btn {
	background: none;
	background-color: var(--color-blue);
	border: none;
	border-radius: 4px;
	box-shadow: none !important;
	color: var(--color-white);
	display: inline-block;
	font-weight: 700;
	margin-top: calc(var(--h2-size) * 0.8);
	padding: 10px 15px;
	text-decoration: none;
	transition: all ease-in-out 0.5s;
}

.text-image-block .btn:hover,
.text-image-block .btn:focus-visible {
	background: none;
	background-color: var(--color-blue);
	box-shadow: none !important;
	color: var(--color-white);
	filter: brightness(1.5);
}

.text-image-block .btn:focus-visible {
	box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Offer grid and slider. */
.offer-grid-block .offer-item,
.offer-slider-block .offer-item {
	aspect-ratio: 1 / 1;
	background-color: var(--color-blue);
	background-image: url();
	background-position: center center;
	background-size: cover;
	display: flex;
	align-items: end;
	height: auto;
	width: 100%;
}

.offer-grid-block .offer-item .offer-item-content,
.offer-slider-block .offer-item .offer-item-content {
	background-image: linear-gradient(180deg, rgba(32, 63, 84, 0.21) 25%, var(--color-blue) 88%);
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: end;
	hyphens: auto;
	padding: 45px 25px 25px 25px;
	width: 100%;
}

.offer-grid-block .offer-item .offer-item-content :is(h3, p, a),
.offer-slider-block .offer-item .offer-item-content :is(h3, p, a) {
	color: var(--color-white) !important;
	margin: 0;
	padding: 0;
}

.offer-grid-block .offer-item .offer-item-content a,
.offer-slider-block .offer-item .offer-item-content a {
	display: block;
	font-weight: 700;
	margin-top: 10px;
}

.offer-slider-block .offer-slider-button-next img,
.offer-slider-block .offer-slider-button-prev img {
	height: 17px;
	width: auto;
}

.offer-slider-block .offer-slider-button-prev,
.offer-slider-block .offer-slider-button-next {
	background: none;
	border: none;
}

/* Cite block. */
.cite {
	align-items: center;
	background-attachment: fixed;
	background-color: var(--color-blue);
	background-position: center center;
	background-size: cover;
	color: var(--color-white);
	display: flex;
	height: 75vh;
	justify-content: center;
	position: relative;
	text-align: center;
	width: 100%;
}

.cite::before {
	background-color: var(--cite-background-color);
	content: '';
	height: 100%;
	left: 0;
	min-height: 400px;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: 2;
}

.cite blockquote,
.cite .blockquote {
	color: var(--color-white);
	position: relative;
	text-shadow: 5px 5px 15px rgba(0, 0, 0, 0.6);
	z-index: 3;
}

/* Suboffers, team and press cards. */
.suboffers-block .offer-icons {
	align-items: center;
	background-color: var(--color-blue);
	border-radius: 60px;
	display: flex;
	height: 60px;
	justify-content: center;
	margin-bottom: var(--h2-size);
	padding: 15px;
	width: 60px;
}

.suboffers-block .offer-icons img {
	height: auto;
	width: 100%;
}

.team-block .team-item a,
.presse-block .news-item a {
	color: var(--text-color);
}

.team-block .team-item .team-name,
.presse-block .news-item h3.news-title {
	font-size: calc(var(--text-size) * 1.4) !important;
}

.team-block .team-item .team-name {
	margin-top: 20px;
}

.team-block .team-item svg,
.contact-block .contact-infos svg {
	margin-right: 20px;
}

.team-block .team-item .team-picture {
	aspect-ratio: 1 / 1;
	height: auto;
	margin-bottom: 15px;
	object-fit: cover;
	object-position: center center;
	width: 100%;
}

.presse-block .news-item .news-picture {
	aspect-ratio: 3 / 2;
	height: auto;
	margin-bottom: 15px;
	object-fit: cover;
	width: 100%;
}

/* Contact block. */
.contact-block .form-label {
	font-size: 1rem;
	font-weight: 700;
}

.contact-block .form-control {
	background-color: var(--color-light-blue);
	border: 1px solid var(--color-blue);
	padding: 10px 15px;
}

/* Accordion block. */
.accordeon-block .faq-accordion .accordion-item {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--color-blue);
	border-radius: 0;
	padding: 0;
}

.accordeon-block .faq-accordion .accordion-button {
	background: transparent;
	box-shadow: none;
	color: var(--color-blue);
	font-size: calc(var(--h2-size) * 0.8);
	font-weight: 700;
	line-height: 1.2;
	padding: 22px 0;
}

.accordeon-block .faq-accordion .accordion-button:not(.collapsed) {
	background: transparent;
	box-shadow: none;
	color: var(--color-blue);
}

.accordeon-block .faq-accordion .accordion-body {
	color: var(--text-color);
	font-size: 18px;
	line-height: 1.7;
	max-width: 90%;
	padding: 0 0 22px 0;
}

.accordeon-block .faq-accordion .accordion-button::after {
	opacity: .8;
	transform: scale(1.05);
}

.accordeon-block .faq-accordion .accordion-button:not(.collapsed)::after {
	transform: rotate(-180deg) scale(1.05);
}

@media (max-width: 768px) {
	.accordeon-block .faq-accordion .accordion-button {
		font-size: 20px;
		padding: 18px 0;
	}

	.accordeon-block .faq-accordion .accordion-body {
		font-size: 16px;
	}
}
