/* =========================================================
   SGN HERO
   Reproduction des proportions du Hero historique SGN.
   Typographie officielle : Cooper Hewitt.
   ========================================================= */

.sgn-hero {
	position: relative;
	width: 100%;
	height: 640px;
	min-height: 620px;
	max-height: 680px;
	margin: 0 !important;
	overflow: hidden;
	background: #071e3a;
	color: #fff;
	font-family:
		var(--wp--preset--font-family--cooper-hewitt),
		"Cooper Hewitt",
		Arial,
		Helvetica,
		sans-serif;
}

.sgn-header-shell + .sgn-hero {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}

/*
 * L'ancien site travaillait sur une zone de contenu large.
 * Cela donne notamment le bon retrait horizontal du texte.
 */
.sgn-hero .sgn-container {
	width: min(1440px, calc(100% - 48px));
	margin-inline: auto;
}

/* Slides */

.sgn-hero__viewport,
.sgn-hero__slide {
	position: absolute;
	inset: 0;
}

.sgn-hero__slide {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 1200ms ease,
		visibility 1200ms ease;
}

.sgn-hero__slide.is-active {
	z-index: 2;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Image */

.sgn-hero__media,
.sgn-hero__overlay {
	position: absolute;
	inset: 0;
}

.sgn-hero__media {
	z-index: 0;
}

.sgn-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;

	/*
	 * Comportement automatique :
	 * aucune configuration de cadrage à faire dans l'admin.
	 */
	object-position: center top;
}

/*
 * Dégradé repris des règles historiques SGN.
 */
.sgn-hero__overlay {
	z-index: 1;
	background:
		linear-gradient(
			90deg,
			rgba(4, 24, 48, 0.82) 0%,
			rgba(5, 45, 88, 0.68) 42%,
			rgba(0, 149, 201, 0.26) 100%
		);
	pointer-events: none;
}

/* Composition */

.sgn-hero__inner {
	position: relative;
	z-index: 3;
	height: 100%;
	display: block;
}

.sgn-hero__content {
	box-sizing: border-box;
	width: 580px;
	max-width: 580px;
	padding-top: 72px;
	padding-bottom: 104px;

	opacity: 0;
	transform: translateY(14px);

	transition:
		opacity 900ms ease 280ms,
		transform 950ms ease 280ms;
}

.sgn-hero__slide.is-active .sgn-hero__content {
	opacity: 1;
	transform: translateY(0);
}

/* Titre : dimensions historiques */

.sgn-hero__title {
	max-width: 560px;
	margin: 0 0 12px;
	color: #fff;

	font-family:
		var(--wp--preset--font-family--cooper-hewitt),
		"Cooper Hewitt",
		Arial,
		Helvetica,
		sans-serif;

	font-size: 48px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0;
	text-transform: uppercase;
}

/* Texte : dimensions historiques */

.sgn-hero__text {
	max-width: 500px;
	margin: 0 0 24px;
	color: #fff;

	font-family:
		var(--wp--preset--font-family--cooper-hewitt),
		"Cooper Hewitt",
		Arial,
		Helvetica,
		sans-serif;

	font-size: 17px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
}

/* Boutons */

.sgn-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
}

.sgn-hero__button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;

	min-width: 150px;
	min-height: 46px;

	padding: 12px 24px;
	border: 0;

	font-family:
		var(--wp--preset--font-family--cooper-hewitt),
		"Cooper Hewitt",
		Arial,
		Helvetica,
		sans-serif;

	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;

	transition:
		background-color 180ms ease,
		color 180ms ease;
}

.sgn-hero__button--primary {
	background: #3379bd;
	color: #fff;
}

.sgn-hero__button--primary:hover,
.sgn-hero__button--primary:focus-visible {
	background: #17418a;
	color: #fff;
}

.sgn-hero__button--secondary {
	background: #fff;
	color: #17202a;
}

.sgn-hero__button--secondary:hover,
.sgn-hero__button--secondary:focus-visible {
	background: #fff24b;
	color: #071e3a;
}

.sgn-hero__button-icon {
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 9px solid currentColor;
}

/* =========================================================
   Cartouche de slide — bas droite
   ========================================================= */

.sgn-hero__slide-info {
	position: absolute;
	z-index: 5;
	right: 0;
	bottom: 0;

	width: min(440px, 32vw);
	min-height: 96px;

	display: grid;
	grid-template-columns: 70px 1fr;
	align-items: center;

	background: rgba(4, 24, 48, 0.86);

	/*
	 * Entrée HORIZONTALE depuis la droite.
	 */
	opacity: 0;
	transform: translateX(80px);

	transition:
		opacity 900ms ease 650ms,
		transform 1100ms cubic-bezier(.18, .7, .25, 1) 650ms;
}

.sgn-hero__slide.is-active .sgn-hero__slide-info {
	opacity: 1;
	transform: translateX(0);
}

.sgn-hero__slide-number {
	display: flex;
	align-items: center;
	justify-content: center;

	height: 100%;

	color: #fff24b;
	font-size: 28px;
	font-weight: 500;
	line-height: 44px;

	border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.sgn-hero__slide-label {
	padding: 18px 24px;

	color: #fff;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
}

/* =========================================================
   Navigation centrale basse
   ========================================================= */

.sgn-hero__navigation {
	position: absolute;
	z-index: 6;

	left: 50%;
	bottom: 0;

	width: 132px;
	height: 64px;

	display: grid;
	grid-template-columns: 1fr 1px 1fr;
	align-items: center;

	background: #fff;
	transform: translateX(-50%);
}

.sgn-hero__arrow {
	width: 100%;
	height: 100%;

	display: grid;
	place-items: center;

	padding: 0;
	border: 0;

	background: transparent;
	color: #a8afb5;

	font-family: inherit;
	font-size: 27px;
	font-weight: 400;

	cursor: pointer;

	transition:
		background-color 180ms ease,
		color 180ms ease;
}

.sgn-hero__arrow:hover,
.sgn-hero__arrow:focus-visible {
	background: #f5f7fa;
	color: #17418a;
}

.sgn-hero__nav-separator {
	width: 1px;
	height: 36px;
	background: #e0e4e7;
}

.sgn-hero__status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =========================================================
   Tablette — valeurs historiques adaptées
   ========================================================= */

@media (max-width: 991px) {
	.sgn-hero {
		height: 560px;
		min-height: 560px;
		max-height: none;
	}

	.sgn-hero__content {
		width: 560px;
		max-width: 560px;
		padding-top: 64px;
		padding-bottom: 90px;
	}

	.sgn-hero__title {
		font-size: 40px;
		line-height: 1.1;
	}

	.sgn-hero__text {
		max-width: 500px;
	}

	.sgn-hero__slide-info {
		width: min(380px, 42vw);
	}
}

/* =========================================================
   Mobile — valeurs historiques adaptées
   ========================================================= */

@media (max-width: 599px) {
	.sgn-hero {
		height: auto;
		min-height: 520px;
	}

	.sgn-hero .sgn-container {
		width: calc(100% - 32px);
	}

	.sgn-hero__image {
		object-position: center top;
	}

	.sgn-hero__content {
		width: 100%;
		max-width: 100%;
		min-height: 520px;

		padding-top: 84px;
		padding-bottom: 72px;
	}

	.sgn-hero__title {
		max-width: 100%;
		font-size: 30px;
		line-height: 1.12;
	}

	.sgn-hero__text {
		max-width: 100%;
		font-size: 15px;
		line-height: 1.55;
	}

	.sgn-hero__button {
		min-width: 0;
		padding: 11px 18px;
		white-space: normal;
	}

	.sgn-hero__slide-info {
		display: none;
	}

	.sgn-hero__navigation {
		width: 112px;
		height: 56px;
	}
}

/* Accessibilité */

@media (prefers-reduced-motion: reduce) {
	.sgn-hero__slide,
	.sgn-hero__content,
	.sgn-hero__slide-info {
		transition: none;
		transform: none;
	}
}

/* =========================================================
   SGN Hero — calage final sur le rendu historique
   ========================================================= */

/*
 * Dimensions historiques conservées.
 */
.sgn-hero {
	height: 640px;
	min-height: 620px;
	max-height: 680px;
}

/*
 * L'ancien Citygovt plaçait visuellement le contenu
 * plus bas que ne le laisse penser son simple padding CSS.
 * On reproduit ici le résultat final visible.
 */
.sgn-hero__content {
	width: 580px;
	max-width: 580px;
	padding-top: 150px;
	padding-bottom: 104px;
}

/* Valeurs réellement utilisées sur l'ancien SGN. */
.sgn-hero__title {
	max-width: 560px;
	margin: 0 0 12px;
	font-family:
		var(--wp--preset--font-family--cooper-hewitt),
		"Cooper Hewitt",
		Arial,
		sans-serif;
	font-size: 48px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0;
	text-transform: uppercase;
}

.sgn-hero__text {
	max-width: 500px;
	margin: 0 0 24px;
	font-family:
		var(--wp--preset--font-family--cooper-hewitt),
		"Cooper Hewitt",
		Arial,
		sans-serif;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.5;
}

/*
 * Cadrage automatique unique.
 * L'administrateur n'a rien à régler photo par photo.
 */
.sgn-hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/*
 * L'entrée du contenu reste discrète et lente,
 * comme dans la séquence historique.
 */
.sgn-hero__content {
	opacity: 0;
	transform: translateY(10px);
	transition:
		opacity 1100ms ease 300ms,
		transform 1200ms ease 300ms;
}

.sgn-hero__slide.is-active .sgn-hero__content {
	opacity: 1;
	transform: translateY(0);
}

/* Cartouche : entrée horizontale uniquement. */
.sgn-hero__slide-info {
	opacity: 0;
	transform: translateX(90px);
	transition:
		opacity 900ms ease 650ms,
		transform 1200ms cubic-bezier(.18,.7,.25,1) 650ms;
}

.sgn-hero__slide.is-active .sgn-hero__slide-info {
	opacity: 1;
	transform: translateX(0);
}

@media (max-width: 991px) {
	.sgn-hero__content {
		padding-top: 110px;
	}

	.sgn-hero__title {
		font-size: 40px;
	}
}

@media (max-width: 599px) {
	.sgn-hero__content {
		padding-top: 84px;
	}

	.sgn-hero__title {
		font-size: 30px;
	}

	.sgn-hero__text {
		font-size: 15px;
	}
}

/* Ajustement typographique final du Hero */
@media (min-width: 992px) {
	.sgn-hero__title {
		font-size: 45px;
	}

	.sgn-hero__text {
		font-size: 16px;
	}

	.sgn-hero__button {
		font-size: 13px;
	}
}

/* =========================================================
   Alignement final Hero / Header
   ========================================================= */

@media (min-width: 783px) {

	.sgn-hero__inner {
		width: min(1200px, calc(100% - 40px));
		margin-inline: auto;
	}

	.sgn-hero__content {
		margin-left: 12px;
	}

}

/* =========================================================
   Implantation finale du Hero
   ========================================================= */

@media (min-width: 783px) {

	.sgn-hero .sgn-hero__inner {
		width: min(1200px, calc(100% - 40px));
		height: 100%;
		margin-inline: auto;
		padding-inline: 0;
	}

	.sgn-hero .sgn-hero__content {
		width: min(650px, 56vw);
		max-width: 650px;
		margin-left: 12px;
	}

	.sgn-hero .sgn-hero__title {
		max-width: 650px;
	}
}

@media (min-width: 783px) and (max-width: 1200px) {

	.sgn-hero .sgn-hero__content {
		width: min(610px, 58vw);
		max-width: 610px;
		margin-left: 0;
	}
}

/* Raccord direct Header / Hero */
.wp-block-sgn-hero,
.sgn-hero {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}

/* =========================================================
   Suppression définitive du gap Header / Hero
   ========================================================= */

.wp-site-blocks > .wp-block-template-part + .wp-block-sgn-hero,
.wp-site-blocks > .wp-block-template-part + .sgn-hero,
.wp-site-blocks > header + .wp-block-sgn-hero,
.wp-site-blocks > header + .sgn-hero {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}

.wp-block-sgn-hero,
.sgn-hero,
.sgn-hero__viewport {
	padding-top: 0 !important;
}


/* =========================================================
   Homepage : aucun block-gap entre Header et Hero
   ========================================================= */

body.home .wp-site-blocks > :first-child {
	margin-block-end: 0 !important;
	margin-bottom: 0 !important;
}

body.home .wp-site-blocks > :first-child + * {
	margin-block-start: 0 !important;
	margin-top: 0 !important;
}
