/*
Theme Name: Photo Book Order
Description: Standalone, iframe-embeddable photo book order form for McCourt Photography.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: photobook-order
*/

:root {
	--pbo-brand: #104946;
	--pbo-brand-hover: #19736e;
	--pbo-cream: #f4f0ed;
	--pbo-text: #1f2a29;
	--pbo-muted: #5f6b6a;
	--pbo-border: #e2ddd8;
	--pbo-radius: 14px;
}

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

html, body {
	margin: 0;
	padding: 0;
}

body.pbo {
	font-family: Raleway, system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	color: var(--pbo-text);
	background: transparent; /* blends into the host page when framed */
	-webkit-font-smoothing: antialiased;
}

/* When framed, the parent sizes the iframe to the content: never scroll inside. */
.pbo-in-frame, .pbo-in-frame body { overflow: hidden; }

.pbo-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px;
}

.pbo h1, .pbo h2 {
	margin: 0 0 8px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--pbo-brand);
}
.pbo h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.pbo h2 { font-size: 1.35rem; }

.pbo-intro { margin: 0 0 8px; color: var(--pbo-muted); }

.pbo-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
	gap: 32px;
	align-items: start;
}
@media (max-width: 860px) {
	.pbo-grid { grid-template-columns: 1fr; gap: 20px; }
}

.pbo-card {
	background: #fff;
	border: 1px solid var(--pbo-border);
	border-radius: 18px;
	padding: 28px;
	box-shadow: 0 8px 30px rgba(16, 73, 70, 0.05);
}
@media (max-width: 560px) {
	.pbo-card { padding: 20px 16px; }
}

/* Sections */
.pbo-section {
	border: 0;
	margin: 0;
	padding: 24px 0 0;
	min-width: 0;
}
.pbo-section[hidden] { display: none; }
.pbo-section legend {
	float: left; /* lets the legend sit inside the fieldset padding like a normal heading */
	width: 100%;
	padding: 0;
	margin: 0 0 12px;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--pbo-brand);
}

.pbo-section legend + * { clear: both; }
.pbo-section:first-of-type { padding-top: 16px; }
.pbo-row { margin-bottom: 16px; }
.pbo-row:last-child { margin-bottom: 0; }
.pbo-row > label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.pbo-muted { color: var(--pbo-muted); font-weight: 400; }

.pbo input[type="text"],
.pbo input[type="email"],
.pbo input[type="date"],
.pbo select {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid #cfc8c2;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	color: inherit;
}
.pbo input:focus-visible,
.pbo select:focus-visible {
	outline: 2px solid var(--pbo-brand);
	outline-offset: 1px;
	border-color: var(--pbo-brand);
}

.pbo-note {
	margin: 6px 0 0;
	font-size: 0.875rem;
	color: var(--pbo-muted);
}

/* Image choice cards (real radio buttons, so keyboard + screen readers work) */
.pbo-choices {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}
.pbo-choices-small { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
	.pbo-choices-small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
	.pbo-choices { grid-template-columns: 1fr; }
	.pbo-choices-small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pbo-choice { position: relative; cursor: pointer; display: block; }
.pbo-choice input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.pbo-choice-body {
	display: block;
	height: 100%;
	border: 1px solid var(--pbo-border);
	border-radius: var(--pbo-radius);
	overflow: hidden;
	background: #fff;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.pbo-choice:hover .pbo-choice-body {
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.07);
}
.pbo-choice input:checked + .pbo-choice-body {
	border-color: var(--pbo-brand);
	box-shadow: 0 0 0 2px var(--pbo-brand);
}
.pbo-choice input:focus-visible + .pbo-choice-body {
	outline: 3px solid var(--pbo-brand-hover);
	outline-offset: 3px;
}
.pbo-choice img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--pbo-cream);
}
.pbo-choice-text { display: block; padding: 10px 12px; font-size: 0.95rem; }
.pbo-choice-text strong { display: block; }
.pbo-choices-small .pbo-choice-text { padding: 8px 10px; font-size: 0.875rem; }
.pbo-choice input:checked + .pbo-choice-body .pbo-choice-text strong::after {
	content: " ✓";
	color: var(--pbo-brand);
}

/* Price summary */
.pbo-summary dl { margin: 12px 0 0; }
.pbo-line {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid #efebe7;
}
.pbo-line dt, .pbo-line dd { margin: 0; }
.pbo-line dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.pbo-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--pbo-cream);
	color: var(--pbo-brand);
	font-size: 0.75rem;
	font-weight: 700;
	vertical-align: 1px;
}
.pbo-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin: 18px 0 0;
	font-size: 1.1rem;
	font-weight: 600;
}
.pbo-total span {
	font-size: 1.9rem;
	font-weight: 700;
	color: var(--pbo-brand);
	font-variant-numeric: tabular-nums;
}

/* Buttons */
.pbo-btn {
	display: block;
	width: 100%;
	margin-top: 20px;
	padding: 14px 18px;
	border: 0;
	border-radius: 12px;
	background: var(--pbo-brand);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease;
}
.pbo-btn:hover { background: var(--pbo-brand-hover); }
.pbo-btn:focus-visible { outline: 3px solid var(--pbo-brand-hover); outline-offset: 2px; }
.pbo-btn:disabled { opacity: 0.7; cursor: progress; }
.pbo-btn-secondary {
	display: inline-block;
	width: auto;
	background: transparent;
	color: var(--pbo-brand);
	border: 1px solid var(--pbo-brand);
}
.pbo-btn-secondary:hover { background: var(--pbo-cream); }

/* Notices */
.pbo-notice {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 20px;
}
.pbo-notice-error {
	background: #fff1f1;
	color: #8d1f1f;
	border: 1px solid #f1c2c2;
}

/* Thank-you screen */
.pbo-thanks { max-width: 640px; margin: 0 auto; }
.pbo-receipt {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 24px;
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid #efebe7;
}
.pbo-receipt dt { color: var(--pbo-muted); }
.pbo-receipt dd { margin: 0; font-weight: 600; }
.pbo-receipt .pbo-receipt-total {
	padding-top: 10px;
	border-top: 1px solid #efebe7;
	font-size: 1.15rem;
	color: var(--pbo-brand);
	font-weight: 700;
}

/* Utilities */
.pbo-sr, .pbo-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.pbo-hp { left: -9999px; }

@media (prefers-reduced-motion: reduce) {
	.pbo-choice-body, .pbo-btn { transition: none; }
	.pbo-choice:hover .pbo-choice-body { transform: none; }
}
