/* Spoon Me Loyalty -- full-screen card page. Mobile-first; the card itself
   uses container query units (cqw) so its overlaid text always scales
   exactly with the card image, on any phone. */

/*
 * This page still runs through get_header()/get_footer() (see
 * LJC_Customer::maybe_override_template()) so the site's floating bottom
 * nav -- which is injected via wp_footer, independent of the visible header
 * -- keeps working. We just hide the theme's visible logo bar + "My
 * account" page-title/breadcrumb banner (#Header_wrapper), and the theme's
 * real visible <footer id="Footer"> (get_footer() renders actual footer
 * content, not just the wp_footer() hook the floating nav needs), so the
 * screen looks like the old bare, edge-to-edge app page. Verified live that
 * this doesn't affect the floating nav's off-canvas menu, mini-cart, etc.,
 * since none of those live inside #Header_wrapper or #Footer.
 *
 * #Wrapper (the theme's outermost content div, painted by get_header())
 * has its own background color that's close to but not the same as ours,
 * and it paints over html/body -- so we force it to match here too, or the
 * scoop-empty.png artwork (baked in against our exact background color)
 * shows up as visibly mismatched squares.
 */
body.ljc-app #Header_wrapper,
body.ljc-app #Footer {
	display: none !important;
}

body.ljc-app #Wrapper {
	background: #e8d7c5 !important;
}

/* Belt-and-suspenders alongside assets/js/ljc-scroll-guard.js: make sure
   nothing (ours or the theme's) has left html/body unable to scroll. */
html:has( body.ljc-app ),
body.ljc-app {
	overflow: visible !important;
	height: auto !important;
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html,
body {
	margin: 0;
	padding: 0;
	background: #e8d7c5;
	overscroll-behavior: none;
}

body.ljc-app {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #3c3c40;
	min-height: 100vh;
	min-height: 100dvh;
}

.ljc-page {
	position: relative;
	max-width: 480px;
	margin: 0 auto;
	min-height: 100vh;
	min-height: 100dvh;
	padding: calc(env(safe-area-inset-top, 0px) + 22px) 7% calc(env(safe-area-inset-bottom, 0px) + 24px);
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

/* Back link */
.ljc-back {
	position: absolute;
	top: calc(env(safe-area-inset-top, 0px) + 14px);
	left: 4%;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	color: #3c3c40;
	font-size: 18px;
	text-decoration: none;
	line-height: 1;
}

/* Logo */
.ljc-logo {
	display: block;
	width: 54%;
	max-width: 260px;
	margin: 10px auto 6%;
}

/* Card */
.ljc-card-wrap {
	position: relative;
	width: 100%;
	container-type: inline-size;
	container-name: ljc-card;
	margin-bottom: 9%;
}

.ljc-card-bg {
	display: block;
	width: 100%;
	height: auto;
}

.ljc-member-since {
	position: absolute;
	top: 8%;
	right: 5%;
	display: flex;
	align-items: baseline;
	gap: 2.2cqw;
}

.ljc-member-since-label {
	font-size: 3.4cqw;
	line-height: 1.15;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #8a8a8f;
	text-align: right;
	white-space: nowrap;
}

.ljc-member-since-date {
	font-size: 5.4cqw;
	font-weight: 800;
	color: #4a4a4f;
	white-space: nowrap;
}

.ljc-card-number {
	position: absolute;
	left: 9.5%;
	top: 59%;
	font-size: 9.6cqw;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: #3c3c40;
	white-space: nowrap;
}

.ljc-card-name {
	position: absolute;
	left: 10%;
	top: 77.5%;
	font-size: 5.8cqw;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: #3c3c40;
	white-space: nowrap;
	max-width: 55%;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Scoops progress grid */
.ljc-scoops {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 4%;
	margin-bottom: 6%;
}

.ljc-scoop {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
}

/* Status line */
.ljc-status {
	text-align: center;
	font-weight: 800;
	letter-spacing: 0.02em;
	font-size: clamp(0.85rem, 4vw, 1.05rem);
	color: #3c3c40;
	margin: 0 0 7%;
}

.ljc-status-reward {
	color: #a9772f;
	font-size: clamp(0.95rem, 4.4vw, 1.15rem);
}

.ljc-status-sub {
	font-weight: 600;
	font-size: 0.75em;
	color: #8a8a8f;
}

/* QR code */
.ljc-qr-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 4%;
}

#ljc-qrcode {
	width: min(220px, 56vw);
}

#ljc-qrcode img,
#ljc-qrcode canvas {
	width: 100% !important;
	height: auto !important;
	display: block;
}

.ljc-card-hint {
	text-align: center;
	font-size: 0.8rem;
	color: #8a8a8f;
	margin: 0 0 8px;
}

/* Push content in nicely on short screens without ever hiding it */
@media (max-height: 700px) {
	.ljc-logo {
		margin: 4px auto 4%;
		width: 46%;
	}
	.ljc-card-wrap {
		margin-bottom: 6%;
	}
	.ljc-scoops {
		margin-bottom: 4%;
	}
}
