/*
	Styles of single pages and sub-pages: moved here from the <style> blocks and
	style="" attributes of the includes in Phase 2b.

	This file comes last: the rules used to sit in the page after the site CSS and
	won ties against it, and still do. Page-wide rules are scoped with :where(body.…),
	which adds no specificity, so they match exactly what they matched before.
*/

@layer pages {
	/* Section pictures of the home sub-pages. Each include marks its first .inner with
	   page-<name>; when a side menu loads another sub-page over AJAX, the picture follows. */
	section:has(.page-apropos) {
		background-image: url("/img/ecriture/ecriture_L13.jpg");
	}

	section:has(.page-vie) {
		background-image: url("/img/sur-mesure/sur-mesure_L10.jpg");
	}

	section:has(.page-shop) {
		background-image: url("/img/papier/papier_L08.jpg");
	}

	section:has(.page-carandache) {
		background-image: url("/img/ecriture/ecriture_L15.jpg");
	}

	section:has(.page-savoir-faire),
	section:has(.page-selection) {
		background-image: url("/img/interieur/interieur_01b.jpg");
	}

	section:has(.page-papier) {
		background-image: url("/img/papier/papier_L25.jpg");
	}

	section:has(.page-ecriture) {
		background-image: url("/img/ecriture/ecriture_L24.jpg");
	}

	section:has(.page-sur-mesure) {
		background-image: url("/img/sur-mesure/sur-mesure_L27.jpg");
	}

	section:has(.page-fournitures) {
		background-image: url("/img/fournitures/fournitures_L13_blur.jpg");
	}

	section:has(.page-maroquinerie) {
		background-image: url("/img/maroquinerie/maroquinerie_L05.jpg");
	}

	/* Home page header: dark, at least the window height minus the bottom bar */
	body.hom > header[role="banner"] {
		background-color: #1b1919;
		min-height: calc(100vh - 44px);
	}

	/* Savoir-faire: photo grid with captions (content/savoir-faire_inc.php) */
	.photogrid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto auto;

		figure {
			margin: 0;
			padding: 0;
			position: relative;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
		}

		figcaption {
			margin: 0;
			position: absolute;
			bottom: auto;
			right: auto;
			padding: 8px 16px;
			font-size: 12px;
			font-style: normal;
			font-weight: 400;
			text-transform: uppercase;
			letter-spacing: 0.1em;
			text-shadow: none;
			background-color: rgba(201, 65, 52, 0.8);
			border-radius: 3px;
		}
	}

	/* Notre histoire: events side by side, scrolling sideways (content/notre-histoire_inc.php) */
	.events .inner {
		float: none;
		width: auto;
	}

	.events figure {
		margin-left: 0;
		margin-right: 0;
	}

	@media (width >= 500px) {
		.events {
			display: flex;
			gap: 4rem;
			overflow-x: scroll;
		}

		.events .event {
			min-width: 60vw;
		}
	}

	@media (width >= 62em) {
		.events .event {
			min-width: 35vw;
		}

		.events .event:not(:first-child) .inner {
			margin-left: 5%;
		}

		.events figure {
			float: none;
			width: auto;
		}
	}

	@media (width >= 86.375em) {
		.events {
			gap: 1rem;
		}

		.events .event {
			min-width: 32vw;
			padding: 0;
		}

		.events .inner {
			padding: 0 0 0 2rem;
			margin-right: 0;
		}
	}

	@media (width >= 100em) {
		.events .event {
			min-width: 20vw;
			padding: 0;
		}
	}

	/* Caran d'Ache: dark text on a light picture (content/carandache_inc.php) */
	div.sec .dark-text {
		color: #000;
		text-shadow: none;
	}

	/* Espace Créatif (hom_index.php, content/espacecreatif_inc.php) */
	section.espacecreatif h1 a {
		color: inherit;
	}

	.espacecreatif .logo {
		transition: border-radius 0.25s ease-in-out;
	}

	.espacecreatif .logo-bottom {
		margin-top: -100px;
	}

	@media (width >= 37.5em) {
		.espacecreatif .logo-atelier {
			display: flex;
			align-items: center;
			margin-bottom: 3rem;
		}

		.espacecreatif .logo-bottom {
			margin-top: 0;
		}

		.espacecreatif a:first-child .logo {
			border-radius: 50% 50% 0;
		}

		.espacecreatif a:first-child .logo:hover {
			border-radius: 0;
		}

		.espacecreatif .atelier--deco {
			display: block;
		}

		.espacecreatif .atelier--deco img {
			object-fit: cover;
			height: 100%;
		}
	}

	@media (width >= 48em) {
		section .inner--extra {
			padding: 0 10%;
			width: 80%;
		}
	}

	@media (width >= 62em) {
		section .inner--extra {
			margin-left: 25%;
			padding-left: 0;
			padding-right: 5%;
			width: auto;
		}
	}

	@media (width >= 86.375em) {
		section.espacecreatif .inner {
			border-color: #011799;
		}

		section .inner--extra {
			margin-left: 40%;
			padding-right: 0;
		}
	}

	/* History page (his_index.php): the pictures open in a lightbox */
	:where(body.his) figure:hover {
		cursor: pointer;
	}

	:where(body.his) figure:hover img {
		box-shadow: 0 3px 12px #ccc;
	}

	/* Account request (reg_index.php) and newsletter forms (for_index.php, body.newsletter) */
	:where(body.reg) div.sec .inner,
	:where(body.reg) div.sec .inner a,
	:where(body.reg) div.sec .aside {
		color: #000;
		text-shadow: none;
	}

	:where(body.reg) p.subject {
		display: none;
	}

	/* Account request form (content/compte_inc.php, form#registration) */
	#registration a {
		text-decoration: underline;
	}

	/* Required fields: grey; on the newsletter forms at every width */
	:where(body.newsletter) .req {
		background-color: #efefef;
	}

	:where(body.newsletter) input[type="submit"] {
		padding: 10px;
		background-color: #011799;
		color: #fff;
		text-transform: uppercase;
		border: 0;
	}

	:where(body.newsletter) textarea.req {
		padding: 1em;
		border: 0;
	}

	@media (width >= 48em) {
		section.reg h1 {
			margin-bottom: 0.25em;
		}

		:where(body.reg) label {
			margin-bottom: 0.5em;
		}

		/* Radios, checkboxes and image buttons keep line-height: normal (base.css) */
		:where(body.reg) label,
		:where(body.reg) input:where(:not([type="radio"], [type="checkbox"], [type="image"])),
		:where(body.reg) button,
		:where(body.reg) select,
		:where(body.reg) textarea {
			line-height: 16px;
		}

		:where(body.reg) .req {
			background-color: #efefef;
		}
	}

	@media (width >= 62em) {
		:where(body.reg) .form {
			max-width: 30em;
		}
	}

	@media (width >= 86.375em) {
		div.secreg {
			column-count: 2;
			column-gap: 5%;
		}
	}
}
