/**
 * MDC membership calculator.
 *
 * Every rule is scoped under .mdc-calc. The calculator was supplied as a standalone
 * page and styled bare elements: body, header, h1, table, th, td and a bare *. Dropped
 * into the theme unscoped, those would restyle the whole page.
 *
 * The scoping also runs the other way. Beaver Builder and the theme style button,
 * input, table and a heavily, so the rules below are deliberately specific enough to
 * win inside the calculator without needing !important.
 */

.mdc-calc {
	--beige: #F0DDCC;
	--cream: #F6F1EB;
	--card: #FFFFFF;
	--ink: #000000;
	--body: #434343;
	--muted: #7A7167;
	--line: #E0D2C2;
	--line-soft: #EDE4D9;
	--terra: #C04732;
	--terra-dk: #9E3826;
	--gold: #9B6C1B;
	--good: #2F6B4F;
	--good-bg: #E7F0EA;
	--bad: #A8382A;
	--bad-bg: #F8E7E3;

	color: var(--body);
	font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
	font-weight: 400;
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	padding: 0 18px 40px;
	box-sizing: border-box;
	/*
	 * clip, not hidden. Nothing inside here is meant to stick out sideways, since the
	 * three tables scroll within their own .scroller, so any horizontal overflow is a
	 * bug and should not be allowed to put a scrollbar on the page or on a neighbouring
	 * section. clip is used rather than hidden because hidden on one axis forces the
	 * other axis to compute as auto, which would turn this into a scroll container and
	 * clip anything overhanging the top, exactly as it did to the Recommended badge.
	 */
	overflow-x: clip;
}

.mdc-calc--beige {
	background: var(--beige);
	padding-top: 8px;
}

.mdc-calc *,
.mdc-calc *::before,
.mdc-calc *::after {
	box-sizing: border-box;
}

.mdc-calc p,
.mdc-calc h2,
.mdc-calc h3,
.mdc-calc table,
.mdc-calc label,
.mdc-calc div {
	margin: 0;
	padding: 0;
}

/*
 * Matches the 1180px the membership cards and price tables use. The calculator was
 * originally a standalone page at 920px, which left it visibly narrower than the
 * section above it once both were on /membership/.
 */
.mdc-calc__wrap {
	max-width: 1180px;
	margin: 0 auto;
}

.mdc-calc__header {
	text-align: center;
	padding: 40px 0 30px;
}

.mdc-calc__title {
	font-family: "Source Serif 4", Georgia, serif;
	font-weight: 700;
	font-size: clamp( 30px, 5vw, 44px );
	line-height: 1.15;
	color: var(--ink);
	margin: 0;
	padding: 0;
	text-transform: none;
	letter-spacing: normal;
}

.mdc-calc .sub {
	color: var(--body);
	font-weight: 300;
	font-size: 18px;
	max-width: 52ch;
	margin: 14px auto 0;
}

.mdc-calc .rule {
	width: 56px;
	height: 1px;
	background: var(--terra);
	margin: 24px auto 0;
}

.mdc-calc .panel {
	background: var(--card);
	border: 1px solid var(--line);
	padding: 28px 26px;
	margin-bottom: 20px;
}

.mdc-calc .panel h2 {
	font-family: "Source Serif 4", serif;
	font-weight: 700;
	font-size: 26px;
	color: var(--ink);
	margin-bottom: 4px;
	line-height: 1.25;
	text-transform: none;
	letter-spacing: normal;
}

.mdc-calc .panel .hint {
	color: var(--muted);
	font-weight: 300;
	font-size: 15px;
	margin-bottom: 20px;
}

.mdc-calc .grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 240px, 1fr ) );
	gap: 12px 28px;
}

.mdc-calc .field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line-soft);
}

.mdc-calc .field:last-child {
	border-bottom: none;
}

.mdc-calc .field label {
	font-size: 16px;
	flex: 1;
	color: var(--ink);
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
	margin: 0;
}

.mdc-calc .field .note {
	display: block;
	font-size: 13px;
	color: var(--muted);
	font-weight: 300;
}

.mdc-calc .stepper {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.mdc-calc .stepper button {
	width: 32px;
	height: 32px;
	min-height: 0;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--card);
	color: var(--terra);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	font-family: inherit;
	font-weight: 400;
	padding: 0;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	text-shadow: none;
}

.mdc-calc .stepper button:hover {
	background: var(--cream);
	color: var(--terra);
}

.mdc-calc .stepper button:focus-visible {
	outline: 2px solid var(--terra);
	outline-offset: 1px;
}

.mdc-calc .stepper input {
	width: 54px;
	height: 32px;
	min-height: 0;
	text-align: center;
	border: 1px solid var(--line);
	border-left: none;
	border-right: none;
	border-radius: 0;
	font-family: inherit;
	font-size: 16px;
	background: var(--card);
	color: var(--ink);
	padding: 0;
	margin: 0;
	box-shadow: none;
}

/* The number spinners fight the bespoke steppers either side of them. */
.mdc-calc .stepper input::-webkit-outer-spin-button,
.mdc-calc .stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mdc-calc .stepper input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

.mdc-calc .pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mdc-calc .pill {
	padding: 9px 17px;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--card);
	cursor: pointer;
	font-family: "Rubik", -apple-system, sans-serif;
	font-weight: 400;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
	line-height: 1.4;
	min-height: 0;
	box-shadow: none;
	text-shadow: none;
}

.mdc-calc .pill[aria-pressed="true"] {
	background: var(--terra);
	border-color: var(--terra);
	color: #fff;
}

.mdc-calc .pill:focus-visible {
	outline: 2px solid var(--terra);
	outline-offset: 2px;
}

.mdc-calc .scroller {
	overflow-x: auto;
	/* Without this the 600px table below can push the container wider than its column. */
	max-width: 100%;
	border: 1px solid var(--line);
	background: var(--card);
}

.mdc-calc table {
	border-collapse: collapse;
	width: 100%;
	min-width: 600px;
	margin: 0;
	border: none;
	background: none;
}

.mdc-calc th,
.mdc-calc td {
	padding: 12px 16px;
	text-align: right;
	font-size: 16px;
	border: none;
	border-bottom: 1px solid var(--line-soft);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	background: none;
	color: inherit;
}

.mdc-calc th:first-child,
.mdc-calc td:first-child {
	text-align: left;
}

.mdc-calc thead th {
	font-family: "Rubik", sans-serif;
	font-weight: 400;
	font-size: 11px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--muted);
	border-bottom: 1px solid var(--line);
}

.mdc-calc tbody tr {
	background: none;
}

.mdc-calc tbody tr:last-child td {
	border-bottom: none;
}

.mdc-calc tr.total td {
	font-weight: 600;
	background: var(--cream);
	border-top: 1px solid var(--line);
	color: var(--ink);
}

.mdc-calc td.win {
	color: var(--good);
	background: var(--good-bg);
}

.mdc-calc td.lose {
	color: var(--bad);
	background: var(--bad-bg);
}

.mdc-calc td.pick {
	box-shadow: inset 3px 0 0 var(--terra);
}

.mdc-calc .result {
	background: var(--card);
	border: 1px solid var(--line);
	border-top: 3px solid var(--terra);
	padding: 34px 26px;
	text-align: center;
	margin-top: 20px;
}

.mdc-calc .result .lab {
	font-family: "Rubik", sans-serif;
	font-size: 11px;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: var(--muted);
}

.mdc-calc .result .name {
	font-family: "Source Serif 4", serif;
	font-weight: 700;
	font-size: 40px;
	color: var(--terra-dk);
	line-height: 1.15;
	margin: 8px 0;
}

.mdc-calc .result .amt {
	font-size: 19px;
	color: var(--ink);
	margin-bottom: 6px;
}

.mdc-calc .result .msg {
	color: var(--muted);
	font-weight: 300;
	font-size: 15px;
	max-width: 56ch;
	margin: 0 auto;
}

.mdc-calc .result .ledger {
	max-width: 390px;
	margin: 24px auto 0;
	text-align: left;
}

.mdc-calc .result .lrow {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line-soft);
	font-size: 16px;
}

.mdc-calc .result .lrow:last-child {
	border-bottom: none;
	border-top: 1px solid var(--line);
	margin-top: 4px;
	padding-top: 13px;
	font-weight: 600;
	color: var(--good);
}

.mdc-calc .result .lrow span:last-child {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.mdc-calc .cta {
	display: inline-block;
	margin-top: 26px;
	padding: 15px 34px;
	/*
	 * Gold, matching every other button on the site, including the theme's WooCommerce
	 * buttons and the Join buttons on the membership cards. Terracotta is kept for links
	 * and accents, which is how the child theme's own CSS uses it.
	 */
	background: var(--gold);
	color: #fff;
	font-family: "Rubik", sans-serif;
	font-size: 12px;
	letter-spacing: .18em;
	text-transform: uppercase;
	text-decoration: none;
	border: 1px solid #674812;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1.4;
}

/* Black on hover, as the theme does to every other button. */
.mdc-calc .cta:hover,
.mdc-calc .cta:focus {
	background: #000;
	border-color: #000;
	color: #fff;
	text-decoration: none;
}

.mdc-calc .cta:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

.mdc-calc .drawer {
	border: 1px solid var(--line);
	background: var(--card);
	margin-top: 12px;
}

.mdc-calc .drawer summary {
	padding: 16px 20px;
	cursor: pointer;
	font-family: "Rubik", sans-serif;
	font-size: 12px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--terra);
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
}

.mdc-calc .drawer summary::-webkit-details-marker {
	display: none;
}

.mdc-calc .drawer summary::after {
	content: "+";
	font-size: 18px;
	line-height: 1;
}

.mdc-calc .drawer[open] summary::after {
	content: "\2212";
}

.mdc-calc .drawer summary:focus-visible {
	outline: 2px solid var(--terra);
	outline-offset: -2px;
}

.mdc-calc .drawer .scroller {
	border: none;
	border-top: 1px solid var(--line);
}

.mdc-calc .drawer .pad {
	padding: 14px 20px 18px;
	font-size: 14px;
	color: var(--muted);
	font-weight: 300;
}

.mdc-calc .xl-note {
	background: var(--cream);
	border: 1px solid var(--line);
	border-left: 3px solid var(--gold);
	padding: 22px 24px;
	text-align: center;
	margin-top: 12px;
	font-size: 16px;
}

.mdc-calc .xl-note strong {
	font-weight: 600;
	color: var(--ink);
}

.mdc-calc .comingsoon {
	font-family: "Rubik", sans-serif;
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--gold);
	border: 1px solid var(--line);
	padding: 8px 14px;
	white-space: nowrap;
	flex-shrink: 0;
}

.mdc-calc .foot {
	margin-top: 26px;
	font-size: 14px;
	color: var(--muted);
	font-weight: 300;
	line-height: 1.8;
}

.mdc-calc .foot strong {
	font-weight: 600;
	color: var(--body);
}

@media ( max-width: 560px ) {

	.mdc-calc {
		font-size: 16px;
		padding: 0 15px 30px;
	}

	.mdc-calc .panel {
		padding: 22px 17px;
	}

	.mdc-calc th,
	.mdc-calc td {
		padding: 10px 13px;
		font-size: 15px;
	}

	.mdc-calc .result .name {
		font-size: 33px;
	}
}
