/* Louves: opening cover "Révélation au défilement" (public site only, not in the editor). */

/* --- Cover "Révélation au défilement": the title is cut out of a white sheet and shows the
   fresco; scrolling lifts the sheet off. Black text on white, blended with "screen" over the photo:
   black lets the photo through, white stays white. ------------------------------------------- */
.wp-block-cover.is-style-louves-reveal {
	isolation: isolate;
	min-height: 100vh;
	min-height: 100svh;
	padding: 0;
}
.is-style-louves-reveal .wp-block-cover__inner-container {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	max-width: none;
	padding: 0 3vw;
	color: #000;
	mix-blend-mode: screen;
}
/* The white sheet, behind the title (the container's blend mode makes it a stacking context). */
.is-style-louves-reveal .wp-block-cover__inner-container::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: #fff;
}
.is-style-louves-reveal .wp-block-cover__inner-container > * { max-width: none; }
.is-style-louves-reveal .wp-block-cover__inner-container h1,
.is-style-louves-reveal .wp-block-cover__inner-container h2 {
	margin: 0;
	color: #000;
	font-family: var(--wp--preset--font-family--display);
	font-size: min(19vw, 36vh);
	font-weight: 900;
	letter-spacing: -.04em;
	line-height: .86;
	text-align: center;
	text-transform: uppercase;
}
/* The image shows through the letters in its own colours: no darkening (the artists, 2026-11-03,
   found the darkened letters dull). A pale image makes paler letters. */
/* The project caption sits under the cover (Louves admin), quiet. */
.louves-hero-caption { margin-top: .75rem !important; color: var(--wp--preset--color--muted); }
.louves-hero-caption a { color: inherit; }

@supports (animation-timeline: scroll()) {
	@media (prefers-reduced-motion: no-preference) {
		/* The cover is taller than the screen; photo and sheet stay pinned while it scrolls by. */
		.wp-block-cover.is-style-louves-reveal {
			display: block;
			height: 190vh;
		}
		.is-style-louves-reveal .wp-block-cover__image-background {
			position: sticky;
			top: 0;
			height: 100vh;
			height: 100svh;
		}
		.is-style-louves-reveal .wp-block-cover__inner-container {
			position: sticky;
			top: 0;
			height: 100vh;
			height: 100svh;
			margin-top: -100vh;
			margin-top: -100svh;
		}
		/* Sheet and title slide up together, like a sheet pulled off the wall. */
		.is-style-louves-reveal .wp-block-cover__inner-container::before,
		.is-style-louves-reveal .wp-block-cover__inner-container :is(h1, h2) {
			animation: louves-lift cubic-bezier(.5, 0, .7, 1) both;
			animation-timeline: scroll(root);
			animation-range: 0 75vh;
		}
	}
}
@keyframes louves-lift { to { transform: translateY(-100vh); } }

/* --- Opening "Dessin" (Louves admin): the same cover, over Clarisse's drawing, which paints itself
   (assets/draw.js), then the sheet drops onto it. Until the script is done ("is-drawn"), the image
   is hidden and the sheet waits above the screen. Without scripts the class "louves-js" is absent:
   drawing and sheet show as they are. ------------------------------------------------------------ */
.louves-draw svg.wp-block-cover__image-background { display: block; }
@media (prefers-reduced-motion: no-preference) {
	.louves-js .louves-draw .wp-block-cover__inner-container {
		transition: transform .6s cubic-bezier(.3, 0, .2, 1);
	}
	.louves-js .louves-draw:not(.is-drawn) img.wp-block-cover__image-background { visibility: hidden; }
	.louves-js .louves-draw:not(.is-drawn) .wp-block-cover__inner-container { transform: translateY(-100vh); }
}

/* Phones and tablets (the artists, 2026-11-10): the opening "Dessin" no longer fills the screen, so
   the introduction below shows on the first screen, fading in as the sheet lands. Phones: only as
   tall as the title. Tablets: an in-between height. Desktops (1200 px and more) keep the full-screen
   opening. */
@media (max-width: 1199px) {
	.wp-block-cover.is-style-louves-reveal.louves-draw {
		display: block;
		/* The title is min(19vw, 36vh) on two lines: some air around it, at most 60% of the screen. */
		height: min(60vh, min(19vw, 36vh) * 2.8);
		height: min(60svh, min(19vw, 36vh) * 2.8);
		min-height: 0 !important; /* the block's own inline style asks for 100vh */
	}
	.is-style-louves-reveal.louves-draw .wp-block-cover__image-background,
	.is-style-louves-reveal.louves-draw .wp-block-cover__inner-container {
		position: absolute;
		inset: 0;
		height: 100%;
		margin-top: 0;
	}
	.louves-draw + .wp-block-spacer { height: var(--wp--preset--spacing--40) !important; }
}
@media (max-width: 743px) {
	/* The drawing takes the first screen, less the header and room for the introduction; the doors
	   start below the fold (Laurent, 2026-11-13: smaller, it looked cramped, and the first door
	   peeked in). Never shorter than the title. */
	.wp-block-cover.is-style-louves-reveal.louves-draw {
		height: max(50vw, 100vh - 5.25rem - 15.5rem);
		height: max(50vw, 100svh - 5.25rem - 15.5rem);
	}
	/* The title as wide as the screen allows ("ATELIER" is the longest word). */
	.is-style-louves-reveal.louves-draw .wp-block-cover__inner-container h1 { font-size: 20.8vw; }
	.louves-draw ~ .louves-intro.has-large-font-size { font-size: 1.1875rem !important; line-height: 1.35; }
	.louves-draw ~ .louves-intro + .wp-block-spacer { height: 6rem !important; }
}
@media (max-width: 1199px) and (prefers-reduced-motion: no-preference) {
	.louves-js .louves-draw ~ .louves-intro { transition: opacity .8s ease .6s, transform .8s ease .6s; }
	.louves-js .louves-draw:not(.is-drawn) ~ .louves-intro { opacity: 0; transform: translateY(1.5rem); }
}
