/* Section "cab-espaces" (sections/cab-espaces.php, prefix ce-). Loaded in the <head> by hec_enqueue_section_styles(), or inline by hec_section_style() (functions.php). */
/* Spaces */
.ce-root {
	--ce-wm: clamp(22rem, 40vw, 36rem);
	--ce-curve: clamp(4rem, 2rem + 6vw, 8rem);
	position: relative;
	isolation: isolate;
	overflow: clip;
	padding-block: var(--space-section);
	background: var(--c-ivoire-100); /* plain at both edges: page header above, paper gallery below */
	color: var(--c-cacao-900);
	font-family: var(--f-sans);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
}
.ce-root::before { /* the logo's crescent in mustard, top right */
	content: "";
	position: absolute;
	top: 6rem;
	right: calc(var(--ce-wm) * -0.35);
	z-index: -1;
	width: var(--ce-wm);
	aspect-ratio: 732 / 788;
	background: var(--c-ambre-500);
	-webkit-mask: url("../../img/watermark-arc-mask.svg") center / contain no-repeat;
	mask: url("../../img/watermark-arc-mask.svg") center / contain no-repeat;
	opacity: 0.16;
	pointer-events: none;
}
.ce-root .ce-halo { top: 40%; left: -14rem; width: min(44rem, 140vw); opacity: 0.6; }
.ce-inner { position: relative; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-gutter); }
.ce-head { display: grid; gap: var(--space-5); margin-bottom: clamp(3.5rem, 2rem + 4vw, 6rem); }
.ce-root .ce-title, .ce-gal .ce-title { /* canvas title style, as on the home page */
	max-width: 14em;
	margin: 0;
	color: inherit;
	font-family: var(--f-serif);
	font-size: var(--fs-title);
	font-weight: var(--fw-title);
	font-variation-settings: "opsz" 144, "SOFT" 100;
	line-height: var(--lh-title);
	letter-spacing: var(--ls-title);
	text-wrap: balance;
}
.ce-title-em { color: var(--c-brun-500); font-style: italic; font-weight: 400; }
.ce-intro { max-width: 60ch; margin: 0; color: var(--c-cacao-700); }
.ce-root .ce-btn { margin-top: var(--space-5); }
.ce-hint { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-5) 0 0; color: var(--c-cacao-600); font-size: var(--fs-caption); }
.ce-hint svg { flex: none; color: var(--c-ambre-700); }

.ce-root .ce-list { display: grid; gap: clamp(4rem, 2.5rem + 5vw, 7.5rem); margin: 0; padding: 0; list-style: none; }
.ce-row { display: grid; }
.ce-media { position: relative; isolation: isolate; }
.ce-media::before { /* thin mustard frame, offset up and outwards */
	content: "";
	position: absolute;
	inset: calc(var(--space-4) * -1) var(--space-4) var(--space-4) calc(var(--space-4) * -1);
	z-index: -1;
	border: 1px solid var(--c-ambre-500);
	border-radius: var(--ce-curve) var(--radius-lg) var(--radius-lg) var(--radius-lg);
	pointer-events: none;
}
.ce-row:nth-child(even) .ce-media::before {
	inset: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-4) var(--space-4);
	border-radius: var(--radius-lg) var(--ce-curve) var(--radius-lg) var(--radius-lg);
}

/* A photo that opens the viewer */
.ce-root .ce-zoom, .ce-gal .ce-tile {
	position: relative;
	display: block;
	overflow: hidden;
	color: var(--c-cacao-900);
	text-decoration: none;
	cursor: zoom-in;
}
.ce-root .ce-zoom {
	border-radius: var(--ce-curve) var(--radius-lg) var(--radius-lg) var(--radius-lg);
	box-shadow: var(--shadow-lg);
}
.ce-row:nth-child(even) .ce-zoom { border-radius: var(--radius-lg) var(--ce-curve) var(--radius-lg) var(--radius-lg); }
.ce-root .ce-img, .ce-gal .ce-tile-img {
	display: block;
	width: 100%;
	object-fit: cover;
	transition: scale 0.8s var(--ease-doux);
}
.ce-root .ce-img { height: auto; aspect-ratio: 3 / 2; }
.ce-zoom::after, .ce-tile::after { /* a light veil on hover */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(31 18 11 / 0.35), transparent 55%);
	opacity: 0;
	transition: opacity 0.4s;
	pointer-events: none;
}
.ce-root .ce-zoom:hover .ce-img, .ce-gal .ce-tile:hover .ce-tile-img { scale: 1.05; }
.ce-zoom:hover::after, .ce-tile:hover::after { opacity: 1; }
.ce-badge { /* magnifier, with "Agrandir" sliding out on hover */
	position: absolute;
	top: var(--space-4);
	right: var(--space-4);
	z-index: 1;
	display: inline-flex;
	align-items: center;
	height: 2.75rem;
	padding: 0 0.8125rem;
	border-radius: var(--radius-pill);
	background: color-mix(in srgb, var(--c-ivoire-50) 92%, transparent);
	box-shadow: var(--shadow-md);
	color: var(--c-btn);
	font-size: var(--fs-label);
	font-weight: 600;
	line-height: 1;
	transition: background-color 0.3s, color 0.3s;
}
.ce-badge svg { flex: none; }
.ce-badge-text { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 0.4s var(--ease-doux), margin 0.4s var(--ease-doux); }
.ce-zoom:hover .ce-badge, .ce-tile:hover .ce-badge { background: var(--c-ambre-500); color: var(--c-on-accent); }
.ce-zoom:hover .ce-badge-text, .ce-tile:hover .ce-badge-text { max-width: 6rem; margin-left: var(--space-2); }
.ce-root .ce-zoom:focus-visible, .ce-gal .ce-tile:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 4px; }

/* The card beside the photo */
.ce-card {
	position: relative;
	z-index: 1;
	margin: calc(var(--space-7) * -1) var(--space-4) 0; /* phones: over the bottom of the photo */
	padding: var(--space-6);
	border: 1px solid var(--c-lin-300);
	border-radius: var(--radius-lg);
	background: var(--c-ivoire-50);
	box-shadow: var(--shadow-lg);
}
.ce-num { /* large outlined numeral, filled with mustard when the row is hovered */
	margin: 0 0 var(--space-4);
	color: transparent;
	font-family: var(--f-serif);
	font-size: clamp(2.5rem, 2rem + 1.4vw, 3.5rem);
	font-style: italic;
	font-weight: 300;
	line-height: 0.9;
	-webkit-text-stroke: 1px var(--c-ambre-500);
	transition: color 0.4s;
}
.ce-row:hover .ce-num { color: var(--c-ambre-500); }
.ce-root .ce-term {
	margin: 0 0 var(--space-3);
	color: var(--c-cacao-900);
	font-family: var(--f-serif);
	font-size: var(--fs-citation);
	font-weight: 400;
	font-variation-settings: "opsz" 48, "SOFT" 100;
	line-height: 1.2;
	letter-spacing: -0.01em;
}
.ce-text { max-width: 46ch; margin: 0; color: var(--c-cacao-700); }

/* Gallery: the other photos in a mosaic */
.ce-gal {
	--ce-wm: clamp(20rem, 34vw, 30rem);
	position: relative;
	isolation: isolate;
	overflow: clip;
	padding-block: var(--space-section);
	background: var(--c-lin-200);
	color: var(--c-cacao-900);
	font-family: var(--f-sans);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
}
.ce-gal::before { /* the crescent, top left this time */
	content: "";
	position: absolute;
	top: calc(var(--ce-wm) * -0.1);
	left: calc(var(--ce-wm) * -0.18);
	z-index: -1;
	width: var(--ce-wm);
	aspect-ratio: 732 / 788;
	background: var(--c-ambre-500);
	-webkit-mask: url("../../img/watermark-arc-mask.svg") center / contain no-repeat;
	mask: url("../../img/watermark-arc-mask.svg") center / contain no-repeat;
	opacity: 0.16;
	pointer-events: none;
}
.ce-gal .ce-halo { top: 30%; right: -12rem; width: min(40rem, 140vw); opacity: 0.6; }
.ce-gal .ce-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: clamp(8.5rem, 4rem + 16vw, 12rem);
	gap: var(--space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}
.ce-cell { min-width: 0; }
.ce-cell--big { grid-column: span 2; grid-row: span 2; }
.ce-cell--tall { grid-row: span 2; }
.ce-cell--wide { grid-column: span 2; }
.ce-gal .ce-tile { height: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.ce-cell--big .ce-tile { border-radius: var(--ce-curve, 6rem) var(--radius-lg) var(--radius-lg) var(--radius-lg); }
.ce-gal .ce-tile-img { height: 100%; }
.ce-gal .ce-badge { top: var(--space-3); right: var(--space-3); }
.ce-tile-cap { /* the photo's name in a small pill */
	position: absolute;
	bottom: var(--space-3);
	left: var(--space-3);
	z-index: 1;
	max-width: calc(100% - 2 * var(--space-3));
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-pill);
	background: color-mix(in srgb, var(--c-ivoire-50) 92%, transparent);
	color: var(--c-cacao-900);
	font-size: var(--fs-caption);
	font-weight: 600;
	line-height: 1.2;
}

@media (min-width: 768px) {
	.ce-head { grid-template-columns: 1.1fr 1fr; align-items: end; }
	.ce-card { width: min(80%, 34rem); margin: calc(var(--space-8) * -1) var(--space-6) 0 auto; } /* tablets: over the bottom of the photo, alternating sides */
	.ce-row:nth-child(even) .ce-card { margin: calc(var(--space-8) * -1) auto 0 var(--space-6); }
	.ce-gal .ce-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(9rem, 1rem + 14vw, 15rem); gap: var(--space-4); }
	.ce-gal .ce-badge { top: var(--space-4); right: var(--space-4); bottom: auto; left: auto; }
	.ce-tile-cap { bottom: var(--space-4); left: var(--space-4); }
}
@media (min-width: 1024px) {
	.ce-row { /* photo on 8 of 12 columns, the card on 5, one column over the photo */
		grid-template-columns: repeat(12, minmax(0, 1fr));
		align-items: center;
	}
	.ce-media { grid-row: 1; grid-column: 1 / span 8; }
	.ce-card { grid-row: 1; grid-column: 8 / -1; width: auto; margin: 0; padding: var(--space-7); }
	.ce-row:nth-child(even) .ce-media { grid-column: 5 / -1; }
	.ce-row:nth-child(even) .ce-card { grid-column: 1 / span 5; margin: 0; }
	.ce-badge { top: auto; bottom: var(--space-5); left: var(--space-5); right: auto; } /* on the outer corner, away from the card */
	.ce-row:nth-child(even) .ce-badge { left: auto; right: var(--space-5); }
}
@media (hover: hover) {
	.ce-gal .ce-badge { opacity: 0; transition: opacity 0.3s, background-color 0.3s, color 0.3s; } /* mouse: the magnifier shows on hover */
	.ce-gal .ce-tile:hover .ce-badge, .ce-gal .ce-tile:focus-visible .ce-badge { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ce-root .ce-img, .ce-gal .ce-tile-img, .ce-zoom::after, .ce-tile::after, .ce-badge, .ce-badge-text, .ce-num { transition: none; }
}
