/*
Page frame: header (logo, hero), sections and their columns, side menus,
bottom navigation bar, footer, figures and slider placement.

Mobile first: the base rules come first, then one block per breakpoint, widest
last, in the same order as before the move to plain CSS.
*/

@layer layout {
	/* Header */
	[role="banner"] {
		margin: 0 auto;
		padding-top: var(--baseline);
		width: 90%;
	}

	header[role="banner"] {
		width: 100%;
		padding: 0;
	}

	/* Header picture helpers: the slideshow (div.hero.cover) and the logo (div.branding.center);
	   the campaign header (content/special-cover_inc.php) uses div.cover too */
	div.cover {
		background-size: cover, cover;
		background-position: 50% 45%, 50% 50%;
		background-repeat: no-repeat, no-repeat;
	}

	div.center {
		background-position: center;
		background-repeat: no-repeat;
	}

	div.branding {
		height: 100px;
	}

	header[role="banner"] div.branding {
		background-color: var(--color-branding);
		background-image: url(/img/brachard_head_black_v3_170.png);
		background-position-y: 18px;
		background-repeat: no-repeat;
		background-size: 140px;
	}

	div.hero {
		height: 320px;
	}

	header[role="banner"] div.hero {
		position: relative;
		background-color: #1a1919;
	}

	div.branding h1,
	div.hero h2 {
		text-indent: 100%;
		white-space: nowrap;
		overflow: hidden;
	}

	/* Sections */
	#content {
		width: 100%;
		overflow: hidden;
	}

	section {
		padding: 24px 24px 1px 0;
		background-size: cover;
		box-shadow: 0 1px 24px #000;

		h1 {
			height: 64px;
			margin-bottom: 0;
			margin-left: 24px;
			background-repeat: no-repeat;
			background-position: 0 0;
			background-size: auto 64px;
		}
	}

	section h1 {
		font-size: 3.6rem;
		font-weight: lighter;
	}

	section img {
		width: 100%;
	}

	section.where {
		padding-right: 0;
	}

	section div.sec {
		padding-left: 24px;
	}

	section.where div.sec {
		padding-left: 48px;
		padding-right: 48px;
	}

	div.sec .inner {
		padding-top: 1em;

		ul {
			margin-left: -5px;
		}
	}

	.inner h3 {
		font-weight: normal;
		text-transform: uppercase;
		letter-spacing: 0.1em;
	}

	/* The page content slides right when a side menu opens on mobile */
	.wrap {
		position: relative;
		left: 0;
	}

	.wrap.active {
		left: 12em;
		transition: all 0.3s ease-in;
	}

	/* Side menus of the sections (sub-pages), loaded over AJAX by js/script.js */
	a.menu-link {
		float: left;
		margin-top: 20px;
		padding: 0;
	}

	img.menu-handle {
		width: auto;
		height: 44px;
		margin-left: -40px;
		margin-right: 24px;
	}

	aside.oc {
		background: rgba(0, 0, 0, 0.5);
		color: #fff;
		padding: 0 1em;
		clear: both;
		overflow: hidden;
	}

	#navwho {
		background-color: var(--color-who);
	}

	#navwhat {
		background-color: var(--color-what);
	}

	.js aside.oc {
		width: 8em;
		height: 90%;
		position: absolute;
		top: 20px;
		left: -12em;
	}

	.oc ul {
		font-size: 1.4rem;
		text-transform: uppercase;
	}

	.oc ul li {
		list-style-type: none;
		border: 1px solid rgba(255, 255, 255, 0.5);
		border-width: 0 0 1px 0;
	}

	.oc ul li:last-child {
		border: none;
	}

	.oc ul li a {
		display: block;
		padding: 1em 0;
	}

	/* Figures and sliders: full width of the column on mobile */
	.fullwidth,
	figure {
		margin: 0 -24px var(--baseline-rem) -24px;
	}

	.fullwidth iframe {
		margin: 0 auto;
	}

	figcaption {
		margin-left: 48px;
		font-size: 1.2rem;
		font-style: italic;
	}

	/* The slider's own adjustments are at the end of vendor/flexslider.css; its place in the
	   columns (div.flexslider) is set with the figures in the breakpoint blocks below */

	/* Bottom navigation bar (inc/partials/nav.php) */
	[role="navigation"] {
		margin: 0 auto var(--baseline);
		width: 90%;
		background-color: transparent;
		border: 0;

		p {
			margin-bottom: 0;
			padding: 6px 11px;
			color: #ffffff;
		}

		a {
			color: #ffffff;
		}
	}

	nav[role="navigation"] {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		width: 100%;
		margin: 0;
		padding: 0;
		border-width: 0;
		box-shadow: 0 1px 9px rgba(0, 0, 0, 1);
		z-index: 1000;

		ul {
			margin: 0;
			padding: 0;
			display: flex;
		}

		ul li {
			flex: 1;
			padding: 0;
			list-style-type: none;
			font-size: 1.4rem;
			text-align: center;
			background-color: transparent;
		}

		ul li a {
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
			gap: 0.5em;
			width: 100%;
			height: 34px;
			padding-top: 5px;
			padding-bottom: 5px;
			text-transform: uppercase;
			font-size: 1.8rem;
			color: #ffffff;
			text-shadow: 0 -1px 1px #333333;
			text-decoration: none;
			transition: all 0.2s ease-in-out;
		}

		.nav-label {
			font-size: 1.2rem;
			letter-spacing: 0.1em;
			text-shadow: none;
		}

		.dark-label .nav-label {
			color: black;
		}

		i {
			font-style: normal;
		}

		ul li.espacecreatif {
			background-color: var(--color-espacecreatif);
		}

		ul li.who {
			background-color: var(--color-who);
		}

		ul li.what {
			background-color: var(--color-what);
		}

		ul li.where {
			background-color: var(--color-where);
		}

		ul li.shop {
			background-color: var(--color-shop);
		}

		ul li.home {
			background-color: var(--color-home);
		}
	}

	/* iPhone home indicator */
	nav#navigation ul li {
		padding-bottom: env(safe-area-inset-bottom);
	}

	/* Footer (inc/partials/footer.php) */
	.content {
		margin: 0 auto;
		width: 90%;
	}

	footer[role="contentinfo"] {
		padding: var(--baseline) 48px calc(3 * var(--baseline)) 48px;
		border: 0;
		color: #7a7a7a;
		background-color: var(--color-footer);

		p {
			font-size: 1.2rem;
			text-align: center;
		}

		a {
			color: #fff;
		}
	}

	/* Matomo opt-out (production only) */
	footer[role="contentinfo"] details {
		font-size: 1.2rem;
		text-align: center;
	}

	#matomo-opt-out {
		margin-block-start: 1rem;
	}

	[role="contentinfo"] small {
		display: block;
		margin: 0 auto var(--baseline);
		width: 90%;
	}

	/* 600px */
	@media (width >= 37.5em) {
		section h1 {
			height: 1.75em;
			margin-bottom: 0.25em;
			font-size: 4rem;
			background-size: auto 1.75em;
		}
	}

	/* 768px: sections get columns, the side menus become a row of buttons */
	@media (width >= 48em) {
		figure {
			margin: 0 0 var(--baseline-rem) 0;
		}

		figcaption {
			margin-left: 0;
		}

		a.menu-link {
			display: none;
		}

		.wrap.active {
			left: 0;
		}

		.sec {
			clear: none;
			margin-left: 30%;
		}

		section h1 {
			margin-bottom: 1.5em;
			padding-left: 0;
			margin-left: 10%;
		}

		section h1 {
			height: 1.979em;
			font-size: 4.8rem;
			background-size: auto 1.979em;
		}

		section {
			padding: 24px 0;

			&::before,
			&::after {
				display: table;
				content: "";
			}

			&::after {
				clear: both;
			}
		}

		.wrap {
			padding-bottom: 6em;
		}

		.wrap:last-child {
			padding-bottom: 0;
		}

		#navwho,
		#navwhat {
			background-color: transparent;
		}

		.js aside.oc {
			position: absolute;
			float: none;
			top: -50px;
			left: 0;
			bottom: auto;
			width: 100%;
			height: auto;
			padding: 0;
			margin: 0;
			text-align: center;
			background-color: transparent;

			ul {
				margin-bottom: 0;
				font-size: 1.1rem;
				text-transform: uppercase;
				letter-spacing: 0.1em;
			}

			li {
				display: inline-block;
				padding: 0 0.25em;
				border: 0;
			}

			a {
				padding: 3px 10px;
				background-color: rgba(0, 0, 0, 0.25);
				border-radius: 3px;
				transition: background-color 0.3s ease-out;

				&:hover,
				&:focus {
					background-color: rgb(0, 0, 0);
					text-decoration: none;
				}
			}

			a.current {
				background-color: rgb(0, 0, 0);
			}
		}

		section div.sec {
			margin-left: 0;
			padding-left: 0;
		}

		div.sec .inner {
			padding-top: 0;
		}

		section .inner {
			float: none;
			width: 80%;
			padding: 0 10%;
		}

		section figure,
		div.flexslider,
		div.aside {
			margin-left: 10%;
			margin-right: 10%;
		}

		p a[href="#top"] {
			display: none;
		}

		.fullwidth,
		figure {
			margin: 0 0 var(--baseline-rem) 0;
		}
	}

	/* 992px: the logo moves to the top left corner and stays there */
	@media (width >= 62em) {
		header[role="banner"] {
			position: relative;
		}

		div.cover {
			background-size: 50vh, cover;
		}

		div.branding {
			position: fixed;
			top: 0;
			left: 4%;
			width: 172px;
			height: 172px;
			z-index: 1000;
		}

		header[role="banner"] div.branding {
			background-position-y: center;
		}

		nav[role="navigation"] ul li a {
			font-size: 2rem;
		}

		.js aside.oc {
			width: 95%;
			text-align: right;
		}

		section h1,
		section .inner,
		section figure,
		div.flexslider,
		div.aside {
			padding-left: 0;
			margin-left: 25%;
			margin-right: 5%;
		}

		section {
			padding: 48px 0 96px 0;
		}

		section.where {
			padding-bottom: 24px;
		}

		section .inner {
			float: none;
			width: auto;
			padding-right: 0;
		}
	}

	/* 1152px */
	@media (width >= 72em) {
		div.branding {
			left: 5%;
		}

		.js aside.oc a {
			padding: 8px 16px;
		}
	}

	/* 1382px: text column on the left, pictures on the right */
	@media (width >= 86.375em) {
		section h1,
		div.wrap,
		footer[role="contentinfo"] div.contact {
			max-width: 1440px;
			margin-left: 20%;
			margin-right: 5%;
		}

		section.where div.wrap {
			margin-left: auto;
			margin-right: auto;
		}

		section h1 {
			padding-left: 0;
			font-size: 6.4rem;
			margin-bottom: 1.75em;
		}

		div.branding {
			z-index: 100;
		}

		.js aside.oc {
			top: -70px;
			width: 100%;

			ul {
				font-size: 1.2rem;
			}
		}

		nav[role="navigation"] ul li a {
			font-size: 2.4rem;
		}

		section {
			padding: 72px 0;
		}

		section h1 {
			height: 1.719em;
			margin-bottom: 1.2em;
			background-size: auto 1.719em;
		}

		section figure,
		div.flexslider,
		div.aside {
			margin-left: 40%;
			margin-right: 0;
		}

		section .inner {
			float: left;
			width: 30%;
			margin-left: 0;
			padding: 0 2% 5% 2%;
			border-left: 2px solid rgba(255, 255, 255, 0.25);
		}

		section .inner.full {
			float: none;
			width: auto;
			padding-right: 0;
			padding-bottom: 0;
		}
	}

	/* 1700px */
	@media (width >= 106em) {
		section {
			padding: 96px 0;
		}

		section h1 {
			height: 2.063em;
			margin-bottom: 1.2em;
			background-size: auto 2.063em;
		}

		.js aside.oc a {
			padding: 8px 16px;
		}
	}

	/* High-density screens: sharper logo */
	@media (resolution >= 1.5dppx) {
		header[role="banner"] div.branding {
			background-image: url(/img/brachard_head_black_v3_340@2x.png);
			background-size: 140px;
		}
	}
}
