/*
Theme Name: Capucins
Theme URI: https://brest.virtual-room.com/
Author: Capucins
Description: Page d'accueil de la fermeture du Laser Game et du Quiz Boxing. Thème blocs, une composition par section, identique dans l'éditeur et sur le site.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.4.6
Text Domain: capucins
*/

/*
 * Ces règles sont aussi chargées dans l'éditeur (add_editor_style),
 * pour que le placement des décors reste le même qu'en front.
 */

html,
body {
	margin: 0;
	overflow-x: hidden;
}

/* Traits continus, même orange que les boutons, dans le sens /. */
:root {
	--capucins-hatch: url("assets/hatch.png?v=2");
}

:where(.wp-site-blocks :focus-visible) {
	outline: 2px solid var(--wp--preset--color--orange);
	outline-offset: 3px;
}

.wp-element-button,
.wp-block-button__link {
	border-radius: 0 !important;
	background-color: #c84a31 !important;
	clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}

.capucins-hero {
	position: relative;
	overflow: visible;
}

.capucins-stripes {
	position: static;
	background: none;
	overflow: visible;
}

.capucins-stripes::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: -0.45rem;
	width: 220px;
	height: 220px;
	pointer-events: none;
	background-image: var(--capucins-hatch);
	background-repeat: repeat;
	background-size: 10px 10px;
	image-rendering: pixelated;
}

.capucins-vr-link a,
.capucins-vr-link a:hover {
	color: #e25d44;
}

.capucins-continue.has-background {
	background-color: #c84a31 !important;
}

.capucins-bascule {
	position: relative;
}

.capucins-logo {
	position: absolute;
	z-index: 3;
	right: max(1.5rem, calc(50% - 560px));
	bottom: 0.55rem;
	width: 168px;
	margin: 0 !important;
}

.capucins-logo img {
	width: 100%;
	height: auto;
	display: block;
}

.capucins-card a:where(:not(.wp-element-button)),
.capucins-phone a {
	color: inherit;
	text-decoration: none;
}

.capucins-address {
	opacity: 0.72;
}

.capucins-bascule .wp-block-column > .wp-block-group {
	height: 100%;
	box-sizing: border-box;
}

.capucins-phone {
	border-radius: 0 !important;
	width: 100%;
	box-sizing: border-box;
}

.capucins-phone p {
	margin: 0;
}

.capucins-phone a {
	display: block;
	margin: -0.72rem -1rem;
	padding: 0.72rem 1rem;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.capucins-phone a:hover,
.capucins-phone a:focus-visible {
	background-color: #ffffff;
	color: #141414;
}

.capucins-card .wp-block-buttons,
.capucins-card .wp-block-button,
.capucins-card .wp-block-button__link {
	width: 100%;
	box-sizing: border-box;
}

.capucins-card .wp-block-button__link {
	text-align: center;
	justify-content: center;
}

.capucins-card.has-background {
	position: absolute;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	width: min(1040px, calc(100% - 5rem));
	z-index: 2;
	overflow: visible;
	padding-top: 3.4rem !important;
}

.capucins-card.has-background::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 132px;
	height: 132px;
	border-radius: 0 10px 0 0;
	pointer-events: none;
	background-image: var(--capucins-hatch);
	background-repeat: repeat;
	background-size: 10px 10px;
	image-rendering: pixelated;
}

.capucins-card.has-background > *:not(.capucins-poster) {
	position: relative;
	z-index: 1;
}

.capucins-scene {
	position: relative;
	background-color: #ffffff;
	min-height: 0;
	overflow: visible;
}

.capucins-building {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
}

.capucins-building img {
	display: block;
	width: 100%;
	height: auto;
}

.capucins-sign,
.capucins-poster {
	position: absolute;
	z-index: 4;
	margin: 0 !important;
}

.capucins-sign {
	left: max(2rem, calc(50% - 460px));
	bottom: 11%;
	width: min(420px, 34vw);
}

.capucins-poster {
	top: calc(100% - 8px);
	right: -72px;
	bottom: auto;
	width: min(250px, 22vw);
	transform: rotate(6deg);
	transform-origin: right top;
	filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.3));
	z-index: 5;
}

.capucins-poster img {
	display: block;
	width: 100%;
	height: auto;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	background-color: #b03f29 !important;
	color: var(--wp--preset--color--white) !important;
}

@media (max-width: 1300px) {
	.capucins-poster {
		right: 0.5rem;
		width: min(220px, 24vw);
	}
}

/* iPad portrait : les colonnes WordPress se cassent sous 782px.
   On garde le rendu desktop pour que l'affiche reste calée comme sur grand écran. */
@media (max-width: 781px) and (min-width: 701px) {
	.capucins-card .wp-block-columns,
	.capucins-bascule .wp-block-columns {
		flex-wrap: nowrap !important;
	}

	.capucins-card .wp-block-column,
	.capucins-bascule .wp-block-column {
		flex-basis: 0 !important;
		flex-grow: 1 !important;
	}

	.capucins-card .wp-block-column[style*="268px"] {
		flex-basis: 240px !important;
		flex-grow: 0 !important;
		flex-shrink: 0 !important;
	}
}

@media (max-width: 700px) {
	.capucins-stripes {
		display: none;
	}

	.capucins-logo {
		position: relative;
		right: auto;
		bottom: auto;
		width: 120px;
		margin: 0.5rem 0 0 auto !important;
	}

	.capucins-card.has-background {
		position: relative;
		top: auto;
		left: auto;
		transform: none;
		width: calc(100% - 2rem) !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	.capucins-card.has-background::after {
		width: 88px;
		height: 88px;
	}

	.capucins-scene {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding: 1rem 0 0;
	}

	.capucins-building {
		width: 100%;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.capucins-sign {
		position: absolute;
		margin: 0 !important;
		z-index: 4;
		left: 3%;
		right: auto;
		top: auto;
		bottom: 2%;
		width: 46%;
	}

	.capucins-poster {
		display: block;
		position: absolute;
		right: 0;
		left: auto;
		top: calc(100% - 12px);
		bottom: auto;
		width: 118px;
		margin: 0 !important;
		transform: rotate(3deg);
		transform-origin: right top;
		z-index: 5;
	}
}

/*
 * Dans l'éditeur, chaque bloc est position:relative.
 * On rend les blocs intermédiaires statiques pour que la carte,
 * l'affiche, le logo et les rayures se calent comme sur le site.
 */
.capucins-hero,
.capucins-bascule,
.capucins-scene {
	position: relative !important;
}

.capucins-hero .block-editor-block-list__block,
.capucins-bascule .block-editor-block-list__block,
.capucins-scene .block-editor-block-list__block {
	position: static !important;
}

.capucins-scene > .capucins-card,
.capucins-scene .capucins-poster,
.capucins-scene .capucins-sign,
.capucins-scene .capucins-building,
.capucins-hero .capucins-stripes,
.capucins-bascule .capucins-logo {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.capucins-hero .capucins-stripes {
	position: static !important;
}

.capucins-scene .capucins-card.has-background,
.capucins-bascule .capucins-logo,
.capucins-scene .capucins-poster,
.capucins-scene .capucins-sign {
	position: absolute !important;
}

@media (max-width: 700px) {
	.capucins-bascule {
		padding-bottom: 0.75rem !important;
	}

	.capucins-bascule .capucins-logo {
		position: relative !important;
		top: auto !important;
		right: auto !important;
		bottom: auto !important;
		left: auto !important;
		width: 132px;
		margin: 0.15rem 0.15rem 0 auto !important;
	}

	.capucins-scene .capucins-card.has-background {
		position: relative !important;
		top: auto !important;
		left: auto !important;
		transform: none !important;
		width: calc(100% - 2rem) !important;
		margin: 0 auto !important;
	}

	.capucins-scene .capucins-sign {
		width: 30%;
		left: 3%;
		right: auto !important;
		bottom: 4%;
		top: auto !important;
	}

	.capucins-scene .capucins-poster {
		top: calc(100% + 14px) !important;
		right: 0.4rem !important;
		bottom: auto !important;
		width: 100px;
	}
}
