/*
Theme Name: Yves Breads Splash
Description: A lightweight responsive splash-page theme for Yves Breads.
Version: 1.0.0
Author: EPIC Agency
Text Domain: yvesbreads-splash
*/

:root {
	--yb-page-max: 1686px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	min-height: 100%;
	background: #eef0f0;
}

body {
	margin: 0;
	min-width: 320px;
	min-height: 100vh;
	min-height: 100svh;
	background: #eef0f0;
	font-family: Arial, Helvetica, sans-serif;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

.yb-splash {
	position: relative;
	min-height: 100vh;
	min-height: 100svh;
	overflow: hidden;
	background-image: url('assets/images/bg.jpg');
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

.yb-splash__artwork {
	position: absolute;
	top: clamp(30px, 5.3vh, 60px);
	left: clamp(40px, 11vw, 190px);
	width: clamp(480px, 39vw, 656px);
	max-width: calc(100vw - 80px);
}

.yb-splash__image {
	width: 100%;
	height: auto;
}

/*
 * The supplied splash artwork contains the phone number and email address.
 * These transparent hit areas preserve the exact supplied design while
 * making the contact details usable links on desktop and touch devices.
 */
.yb-splash__contact-link {
	position: absolute;
	display: block;
	z-index: 2;
	border-radius: 6px;
	text-indent: -9999px;
	overflow: hidden;
	white-space: nowrap;
}

.yb-splash__contact-link:focus-visible {
	outline: 3px solid #f04b0b;
	outline-offset: 3px;
	background: rgba(255, 255, 255, 0.25);
}

.yb-splash__contact-link--phone {
	left: 27%;
	top: 80%;
	width: 50%;
	height: 7.5%;
}

.yb-splash__contact-link--email {
	left: 8%;
	top: 89%;
	width: 90%;
	height: 8%;
}

/* WordPress admin bar support when logged in. */
.admin-bar .yb-splash {
	min-height: calc(100vh - 32px);
	min-height: calc(100svh - 32px);
}

@media (max-width: 782px) {
	.admin-bar .yb-splash {
		min-height: calc(100vh - 46px);
		min-height: calc(100svh - 46px);
	}
}

/* Tablet: keep the supplied artwork prominent while protecting margins. */
@media (max-width: 980px) {
	.yb-splash__artwork {
		left: clamp(28px, 7vw, 70px);
		width: min(58vw, 610px);
	}
}

/*
 * Mobile treatment: favour the clean timber section of the background so the
 * supplied artwork remains easy to read, and center the artwork in the viewport.
 */
@media (max-width: 720px) {
	.yb-splash {
		display: flex;
		align-items: flex-start;
		justify-content: center;
		overflow-x: hidden;
		overflow-y: auto;
		padding: clamp(22px, 5vh, 42px) 4vw 34px;
		background-position: 46% center;
	}

	.yb-splash::before {
		content: '';
		position: absolute;
		inset: 0;
		background: rgba(255, 255, 255, 0.12);
		pointer-events: none;
	}

	.yb-splash__artwork {
		position: relative;
		top: auto;
		left: auto;
		z-index: 1;
		width: min(92vw, 520px);
		max-width: none;
	}
}

/* Very small phones: retain comfortable side margins and allow natural scroll. */
@media (max-width: 390px) {
	.yb-splash {
		padding-left: 3vw;
		padding-right: 3vw;
	}

	.yb-splash__artwork {
		width: 94vw;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
	}
}
