/* chargement des polices */
@font-face {
	font-family: 'Public-Sans-Black';
	src: local('Public-Sans-Black'), url('Polices/Public-sans/PublicSans-Black.woff'), format('woff');
}
@font-face {
	font-family: 'Public-Sans-Bold';
	src: local('Public-sans-bold'), url('Polices/Public-sans/PublicSans-Bold.woff'), format('woff');
}
@font-face {
	font-family: 'Gowunbatang-Regular';
	src: local('Gowunbatang-Regular'), url('Polices/GowunBatang/GowunBatang-Regular.woff'), format('woff');
}

:root {
	--surface-bg: #0f172a;
	--card-bg: rgba(255, 255, 255, 0.03);
	--card-border: rgba(255, 255, 255, 0.08);
	--text-main: #f8fafc;
	--text-muted: #94a3b8;
	--accent: #D1271C;
	--transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Code CSS pour ordinateur */
@media (min-width: 769px) {
	body {
		width: 100%;
		margin: 0;
		display: grid;
		place-items: center;
		min-height: 100vh;
		background-color: #FFFCF4;
		font-family: 'Public-Sans-Black', sans-serif;
		color: var(--text-main);
		-webkit-font-smoothing: antialiased;
	}

	#carousel {
		position: absolute;
		width: 100%;
		top: 160px;
		z-index: 0;
		margin: 0;
		padding: 0;
		background-color: #FFFCF4;
	}

	.carousel-wrapper {
		position: relative;
		top: -4rem;
		width: 100%;
		padding: 0;
		margin: 0;
		box-sizing: border-box;
	}

	.carousel {
		display: flex;
		gap: 1.5rem;
		margin: 0;
		margin-top: -1em;
		padding: 0;
	  
	 /* FIX: Generous, equal padding prevents shadow/edge clipping 
		and keeps the top:50% scroll buttons perfectly centered. */
		padding: 4rem 1.5rem; 
		box-sizing: border-box;
		list-style: none;
	  
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		scrollbar-width: none;
	  
		scroll-marker-group: after;
	}

	.carousel::-webkit-scrollbar {
		display: none;
	}

	.carousel::scroll-button(left),
	.carousel::scroll-button(right) {
		content: "";
		position: absolute;
		bottom: -2rem;
		transform: translateY(-50%);
		width: 2rem;
		height: 2rem;
		border-radius: 50%;
		background-color: #4C0297;
		backdrop-filter: blur(12px);
		border: 1px solid var(--card-border);
		cursor: pointer;
		transition: var(--transition);
		z-index: 10;
	}

	.carousel::scroll-button(left) {
		left: 31rem;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f8fafc'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'%3E%3C/path%3E%3C/svg%3E");
		background-size: 40%;
		background-position: center;
		background-repeat: no-repeat;
	}

	.carousel::scroll-button(right) {
		right: 31rem;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f8fafc'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'%3E%3C/path%3E%3C/svg%3E");
		background-size: 40%;
		background-position: center;
		background-repeat: no-repeat;
	}

	.carousel::scroll-button(*):hover {
		background-color: var(--accent);
		border-color: var(--accent);
		transform: translateY(-50%) scale(1.1);
		box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
	}

	.carousel::scroll-marker-group {
		display: flex;
		justify-content: center;
		align-items: center;
		gap: 0.6rem;
		margin-top: -2rem; 
	}

	.card {
		flex: 0 0 calc(100% - 1rem);
		padding: 0;
		margin: 0;
		scroll-snap-align: center;
		background: var(--card-bg);
		border: 1px solid var(--card-border);
		border-radius: 24px;
		overflow: hidden;
		box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
		transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
	}

	@media (min-width: 768px) { .card { flex: 0 0 calc(50% - 0.75rem); } }
	@media (min-width: 1024px) { .card { flex: 0 0 calc(33.333% - 1rem); } }

	.card:hover {
		transform: translateY(-8px);
		box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
		border-color: rgba(255, 255, 255, 0.15);
	}

	.title {
		/*width: 100%;
		height: 240px;*/
		padding: 0;
		overflow: hidden;
	}

	.card img {
		position: relative;
		float: left;
		top: 0;
		width: 12vw;
		padding: 0;
		margin: 0;
		margin-right: 0.4em;
		object-fit: cover;
		transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.card h3 {
		font-family: 'Public-Sans-Bold', sans-serif;
		color: #212320;
		margin: 0;
		padding: 0.5em 0em 0.5em 0.6em;
		font-size: 1em;
		font-weight: bold;
	}

	.card h4 {
		font-family: 'Public-Sans-Bold', sans-serif;
		color: #212320;
		margin: 0;
		padding: 0.5em 0em 0.5em 0.6em;
		font-size: 1em;
		font-weight: bold;
		text-align: center;
	}

	.card-content {
		max-height: 400px;
		padding: 0.8em;
	}

	.card-content p {
		font-family: "Gowunbatang-Regular", sans-serif;
		margin: 0;
		color: #212320;
		font-size: 0.9em;
		font-weight: lighter;
		text-align: justify;
		padding: 0.8em 1em 0.8em 1em;
	}

	.card-content iframe {
		width: 90%;
		height: 35vh;
	}

	div.card-content {
		text-align: center;
		padding: 0.4rem;
		margin: 0;
	}

	div.link {
		position: relative;
		margin-top: 0.6em;
		padding: 0.1em;
		width: 33%;
		height: 1.6em;
		bottom: 0.4em;
		left: 33%;
		background-color: #4C0297;
		border-radius: 5px;
		text-align: center;
	}

	div.link:hover {
		background-color: #D1271C;
	}

	.link a {
		font-family: 'Public-Sans-Bold';
		color: #FFFCF4;
		text-decoration: none;
	}

	.card::scroll-marker {
		content: "";
		display: block;
		width: 8px;
		height: 8px;
		border-radius: 4px;
		background-color: #4C0297;
		cursor: pointer;
		transition: var(--transition);
	}

	.card::scroll-marker:hover {
		background-color: #D1271C;
	}

	.card::scroll-marker:target-current {
		background-color: #212320;
		width: 24px;
		box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
	}
}

/* Code CSS pour mobile */
@media (max-width: 768px) {
	body {
		width: 100vw;
		margin: 0;
		display: grid;
		place-items: center;
		min-height: 100vh;
		background-color: #FFFCF4;
		font-family: 'Public-Sans-Black', sans-serif;
		color: var(--text-main);
		-webkit-font-smoothing: antialiased;
	}

	#carousel {
		position: absolute;
		width: 100%;
		top: 70px;
		z-index: 0;
		margin: 0;
		margin-top: 2vh; 
		padding: 0;
		background-color: #FFFCF4;
	}

	.carousel-wrapper {
		position: relative;
		top: -3rem;
		width: 100%;
		padding: 0;
		margin: 0;
		box-sizing: border-box;
	}

	.carousel {
		display: flex;
		gap: 1.5rem;
		margin: 0;
		margin-top: -1em;
		padding: 0;
		overflow-x: hidden;
	  
	 /* FIX: Generous, equal padding prevents shadow/edge clipping 
		and keeps the top:50% scroll buttons perfectly centered. */
		padding: 4rem 1.5rem; 
		box-sizing: border-box;
		list-style: none;
	  
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		scrollbar-width: none;
	  
		scroll-marker-group: after;
	}

	.carousel::-webkit-scrollbar {
		display: none;
	}

	.carousel::scroll-marker-group {
		display: flex;
		justify-content: center;
		align-items: center;
		gap: 0.6rem;
		margin-top: -2rem; 
	}

	.card {
		flex: 0 0 calc(100% - 1rem);
		padding: 0;
		margin: 0;
		scroll-snap-align: center;
		background: var(--card-bg);
		border: 1px solid var(--card-border);
		border-radius: 24px;
		overflow: hidden;
		box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
		transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
	}

	@media (min-width: 768px) { .card { flex: 0 0 calc(50% - 0.75rem); } }
	@media (min-width: 1024px) { .card { flex: 0 0 calc(33.333% - 1rem); } }

	.card:hover {
		transform: translateY(-8px);
		box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
		border-color: rgba(255, 255, 255, 0.15);
	}

	.title {
		/*width: 100%;
		height: 240px;*/
		padding: 0;
		overflow: hidden;
	}

	.card img {
		position: relative;
		top: 0;
		width: 100%;
		padding: 0;
		margin: 0;
		margin-right: 0.6em;
		object-fit: cover;
		transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.card h3 {
		font-family: 'Public-Sans-Bold', sans-serif;
		color: #212320;
		margin: 0;
		padding: 0.5em 1em 0.5em 1em;
		font-size: 1.2em;
		font-weight: bold;
	}

	.card h4 {
		font-family: 'Public-Sans-Bold', sans-serif;
		color: #212320;
		margin: 0;
		padding: 0.8em 0.2em 0.8em 0.2em;
		font-size: 1em;
		font-weight: bold;
		text-align: center;
	}

	.card-content {
		max-height: 400px;
		padding: 0.8em;
	}

	.card-content p {
		font-family: "Gowunbatang-Regular", sans-serif;
		margin: 0;
		color: #212320;
		font-size: 1em;
		font-weight: lighter;
		text-align: justify;
		padding: 0.8em 1em 0.8em 1em;
	}

	.card-content iframe {
		/*width: 90%;*/
		height: 28vh;
		margin-bottom: 0.4em;
	}

	div.card-content {
		text-align: center;
		padding: 0;
		margin: 0;
	}

	div.link {
		position: relative;
		margin-top: 0.6em;
		padding: 0.1em;
		width: 33%;
		height: 1.6em;
		bottom: 0.4em;
		left: 33%;
		background-color: #4C0297;
		border-radius: 5px;
		text-align: center;
	}

	div.link:hover {
		background-color: #D1271C;
	}

	.link a {
		font-family: 'Public-Sans-Bold';
		color: #FFFCF4;
		text-decoration: none;
	}

	.card::scroll-marker {
		content: "";
		display: block;
		width: 8px;
		height: 8px;
		border-radius: 4px;
		background-color: #4C0297;
		cursor: pointer;
		transition: var(--transition);
	}

	.card::scroll-marker:hover {
		background-color: #D1271C;
	}

	.card::scroll-marker:target-current {
		background-color: #212320;
		width: 24px;
		box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
	}
}