/* DinnerHelp price calculator. Every rule is scoped to .dhpc so Divi's
   global element styles (p padding, h2 colour, inputs) cannot leak in, and
   ours cannot leak out. */

.dhpc {
	--dhpc-olive: #79710d;
	--dhpc-gold: #ba9e57;
	--dhpc-ink: #1d1d1b;
	--dhpc-muted: #66655f;
	--dhpc-line: #e7e4dc;
	--dhpc-tint: rgba(121, 113, 13, 0.08);
	--dhpc-ring: rgba(121, 113, 13, 0.35);
	--dhpc-radius: 20px;

	box-sizing: border-box;
	max-width: 1080px;
	margin: 0 auto;
	padding: 8px 0 56px;
	font-family: "Comfortaa", sans-serif;
	color: var(--dhpc-ink);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.dhpc *,
.dhpc *::before,
.dhpc *::after {
	box-sizing: inherit;
}

.dhpc p,
.dhpc h1,
.dhpc h2,
.dhpc h3,
.dhpc dl,
.dhpc dd,
.dhpc fieldset,
.dhpc legend {
	margin: 0;
	padding: 0;
}

.dhpc fieldset {
	border: 0;
	min-width: 0;
}

.dhpc input {
	font-family: inherit;
	color: inherit;
}

.dhpc [hidden] {
	display: none !important;
}

/* Heading */

.dhpc-head {
	max-width: 680px;
	margin: 0 auto 36px;
	text-align: center;
}

.dhpc .dhpc-title {
	margin-bottom: 14px;
	font-family: inherit;
	font-size: clamp(28px, 4vw, 42px);
	font-weight: 700;
	line-height: 1.2;
	color: var(--dhpc-ink);
}

.dhpc .dhpc-lead {
	font-size: 16px;
	line-height: 1.7;
	color: var(--dhpc-muted);
}

/* Layout */

.dhpc-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.dhpc-form {
	display: grid;
	gap: 32px;
	padding: 30px;
	border-radius: var(--dhpc-radius);
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.dhpc .dhpc-label {
	display: block;
	margin-bottom: 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--dhpc-ink);
}

.dhpc .dhpc-label--split {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.dhpc-value {
	flex: none;
	font-size: 22px;
	font-weight: 700;
	color: var(--dhpc-olive);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Hours: selectable buttons */

.dhpc-hours {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.dhpc-option,
.dhpc-radio {
	position: relative;
	display: block;
	cursor: pointer;
}

.dhpc-option input,
.dhpc-radio input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.dhpc-option-box,
.dhpc-radio-box {
	display: block;
	border: 2px solid var(--dhpc-line);
	border-radius: 14px;
	background: #fff;
	font-weight: 700;
	transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.dhpc-option-box {
	padding: 14px 8px;
	font-size: 16px;
	text-align: center;
}

.dhpc-option:hover .dhpc-option-box,
.dhpc-radio:hover .dhpc-radio-box {
	border-color: var(--dhpc-gold);
}

.dhpc-option input:checked + .dhpc-option-box,
.dhpc-radio input:checked + .dhpc-radio-box {
	border-color: var(--dhpc-olive);
	background: var(--dhpc-tint);
	color: var(--dhpc-olive);
}

.dhpc-option input:focus-visible + .dhpc-option-box,
.dhpc-radio input:focus-visible + .dhpc-radio-box {
	outline: 3px solid var(--dhpc-ring);
	outline-offset: 2px;
}

/* Groceries: radio buttons */

.dhpc-groceries {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.dhpc-radio-box {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 100%;
	padding: 14px 16px;
	font-size: 14px;
	line-height: 1.35;
}

.dhpc-radio-dot {
	flex: none;
	width: 20px;
	height: 20px;
	border: 2px solid #c9c5ba;
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.dhpc-radio input:checked + .dhpc-radio-box .dhpc-radio-dot {
	border-color: var(--dhpc-olive);
	background: var(--dhpc-olive);
	box-shadow: inset 0 0 0 3px #fff;
}

/* Sliders: people and hourly rate */

.dhpc .dhpc-range {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 8px;
	margin: 12px 0 4px;
	border: 0;
	border-radius: 99px;
	background: linear-gradient(to right, var(--dhpc-olive) 0 var(--dhpc-fill, 50%), var(--dhpc-line) var(--dhpc-fill, 50%) 100%);
	outline: none;
	cursor: pointer;
}

.dhpc .dhpc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 28px;
	height: 28px;
	border: 3px solid var(--dhpc-olive);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	transition: box-shadow 0.15s;
}

.dhpc .dhpc-range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border: 3px solid var(--dhpc-olive);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.dhpc .dhpc-range:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 6px var(--dhpc-ring);
}

.dhpc .dhpc-range:focus-visible::-moz-range-thumb {
	box-shadow: 0 0 0 6px var(--dhpc-ring);
}

/* Result */

.dhpc-result {
	position: sticky;
	top: 110px;
	padding: 30px;
	border-radius: var(--dhpc-radius);
	background: linear-gradient(150deg, var(--dhpc-olive) 0%, #8a7f15 60%, var(--dhpc-gold) 140%);
	box-shadow: 0 24px 60px rgba(121, 113, 13, 0.28);
	color: #fff;
}

.dhpc-hero {
	padding: 22px 24px;
	border-radius: 16px;
	background: #fff;
	color: var(--dhpc-ink);
}

.dhpc .dhpc-hero-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dhpc-olive);
}

.dhpc .dhpc-hero-value {
	margin: 6px 0 4px;
	font-size: clamp(34px, 4.5vw, 44px);
	font-weight: 700;
	line-height: 1.1;
	color: var(--dhpc-olive);
	font-variant-numeric: tabular-nums;
}

.dhpc .dhpc-hero-note {
	font-size: 13px;
	color: var(--dhpc-muted);
}

.dhpc-yield {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 12px 0 8px;
}

.dhpc .dhpc-stat {
	padding: 14px 16px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.16);
	font-size: 14px;
	font-weight: 700;
}

.dhpc-stat-value {
	margin-right: 2px;
	font-size: 28px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.dhpc-lines {
	margin: 0 0 4px;
}

/* Wraps so a long amount drops under its label on narrow screens instead
   of squeezing the label onto three lines. */
.dhpc-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 14px;
}

.dhpc-line dt small {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.72);
}

.dhpc-line dd {
	margin-left: auto;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.dhpc-line--total {
	padding-top: 16px;
	border-bottom: 0;
	font-size: 16px;
	font-weight: 700;
}

.dhpc-line--total dd {
	font-size: 22px;
}

.dhpc .dhpc-note {
	margin-top: 14px;
	font-size: 12px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.78);
}

/* Responsive */

@media (max-width: 900px) {
	.dhpc-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dhpc-result {
		position: static;
	}
}

@media (max-width: 560px) {
	.dhpc {
		padding-bottom: 32px;
	}

	.dhpc-head {
		margin-bottom: 24px;
	}

	.dhpc-form,
	.dhpc-result {
		padding: 22px 18px;
	}

	.dhpc-form {
		gap: 28px;
	}

	.dhpc-hero {
		padding: 18px 20px;
	}

	.dhpc .dhpc-stat {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.dhpc .dhpc-label--split {
		align-items: flex-end;
	}
}

@media (max-width: 400px) {
	.dhpc-groceries {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dhpc * {
		transition: none !important;
	}
}

/* The standalone preview page: the calculator brings its own heading, and
   Divi's 80% container is too narrow on phones. */

.dhpc-page .main_title {
	display: none;
}

@media (max-width: 560px) {
	.dhpc-page #main-content .container {
		width: auto;
		margin: 0 16px;
	}
}
