/* House of Rocks Coverage Calculator
 * -------------------------------------------------------------------------
 * Palette matched to the House of Rocks site (values read from the live
 * theme's compiled CSS). Change these variables to re-skin the whole widget:
 *   --hor-accent      = brand.primary  #C7160B   (buttons, accents)
 *   --hor-accent-dark = darker brand red         (button hover)
 *   --hor-ink         = near-black headings
 *   --hor-text        = gray.400       #4C4C4C   (body / label text)
 *   --hor-border      = gray.300 -> softened     (borders, dividers)
 * Fonts follow the site: Manrope (body/UI) and Tanker (display headings +
 * result figures). Both @font-face families are already loaded globally by
 * the theme on any page the shortcode appears on, so we just reference them.
 * ------------------------------------------------------------------------- */
.hor-cc{
	--hor-accent:#C7160B;       /* brand.primary */
	--hor-accent-dark:#9F1209;  /* darker brand red for hover */
	--hor-accent-soft:#fbeceb;  /* tint of brand red */
	--hor-ink:#1d1d1d;          /* display headings */
	--hor-text:#4C4C4C;         /* gray.400 body text */
	--hor-muted:#7a7a7a;
	--hor-border:#e2e2df;       /* softened gray.300 */
	--hor-border-strong:#cccccc;/* gray.300 */
	--hor-surface:#ffffff;
	--hor-panel:#f6f5f2;
	--hor-font-body:'Manrope',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
	--hor-font-head:'Tanker','Manrope',sans-serif;

	max-width:940px;
	margin:1.75em auto;
	padding:0;
	background:var(--hor-surface);
	border:1px solid var(--hor-border);
	border-radius:16px;
	color:var(--hor-text);
	font-family:var(--hor-font-body);
	font-size:16px;
	line-height:1.45;
	box-sizing:border-box;
	overflow:hidden;
	box-shadow:0 1px 3px rgba(20,20,20,.05), 0 30px 60px -34px rgba(20,20,20,.4);
}
.hor-cc *{box-sizing:border-box;}
/* Fix: an explicit display on a class beats the UA [hidden] rule, so enforce it. */
.hor-cc [hidden]{display:none !important;}

/* ---------- Header (dark, bold) ---------- */
.hor-cc-head{
	position:relative;
	padding:34px 32px 30px;
	background:var(--hor-ink);
	color:#fff;
	overflow:hidden;
}
/* Thin brand rule across the very top of the widget. */
.hor-cc-head::after{
	content:"";
	position:absolute;
	top:0;left:0;right:0;
	height:4px;
	background:var(--hor-accent);
}
.hor-cc-eyebrow{
	display:inline-flex;
	align-items:center;
	gap:10px;
	font-weight:700;
	font-size:12px;
	letter-spacing:.16em;
	text-transform:uppercase;
	color:#fff !important;
	margin-bottom:14px;
}
.hor-cc-eyebrow::before{
	content:"";
	width:22px;height:3px;border-radius:2px;
	background:var(--hor-accent);
}
.hor-cc-title{
	font-family:var(--hor-font-head);
	font-weight:normal;
	text-transform:uppercase;
	color:#fff !important;
	font-size:clamp(2.15rem, 2vw + 1.5rem, 3rem);
	line-height:.95;
	letter-spacing:.01em;
	margin:0 0 12px;
}
.hor-cc-intro{
	margin:0;
	color:#c6c6c6 !important;
	font-size:15px;
	max-width:52ch;
}
.hor-cc-note{
	margin:12px 0 0;
	color:#9a9a9a !important;
	font-size:12.5px;
	line-height:1.5;
	font-style:italic;
	max-width:60ch;
}

/* ---------- Two-column body ---------- */
.hor-cc-body{
	display:grid;
	grid-template-columns:1fr 1fr;
	align-items:stretch;
}
.hor-cc-form{
	min-width:0;
	display:flex;
	flex-direction:column;
	padding-bottom:22px;
}
.hor-cc-output{
	min-width:0;
	display:flex;
	flex-direction:column;
	padding:28px;
	background:var(--hor-panel);
	border-left:1px solid var(--hor-border);
}

/* ---------- Steps ---------- */
.hor-cc-step{
	display:flex;
	gap:16px;
	padding:26px 28px;
}
/* Divider only BETWEEN steps — never below the last step (above Calculate). */
.hor-cc-step + .hor-cc-step{
	border-top:1px solid var(--hor-border);
}
.hor-cc-step-num{
	flex:0 0 auto;
	width:30px;height:30px;
	display:flex;align-items:center;justify-content:center;
	border-radius:50%;
	background:var(--hor-accent);
	color:#fff;
	font-family:var(--hor-font-head);
	font-size:16px;
	line-height:1;
	margin-top:1px;
}
.hor-cc-step-body{flex:1 1 auto;min-width:0;}
.hor-cc-step-title{
	font-weight:700;
	font-size:13px;
	letter-spacing:.08em;
	text-transform:uppercase;
	color:var(--hor-ink);
	margin:4px 0 16px;
}

/* ---------- Fields ---------- */
.hor-cc-selects{
	display:grid;
	grid-template-columns:1fr;
	gap:14px;
}
.hor-cc-field{margin:0;}
.hor-cc-label{
	display:block;
	font-weight:700;
	font-size:12px;
	letter-spacing:.05em;
	text-transform:uppercase;
	color:var(--hor-muted);
	margin-bottom:6px;
}
/* Small "Optional" hint shown under a field label. */
.hor-cc-optional{
	display:block;
	margin:-3px 0 7px;
	font-size:11px;
	font-weight:500;
	letter-spacing:.01em;
	text-transform:none;
	color:#9a9a9a;
}
.hor-cc-select,
.hor-cc-input{
	width:100%;
	padding:13px 14px;
	border:1px solid var(--hor-border-strong);
	border-radius:8px;
	background:#fff;
	font-family:var(--hor-font-body);
	font-size:16px;
	color:var(--hor-ink);
	transition:border-color .12s ease, box-shadow .12s ease;
	-webkit-appearance:none;appearance:none;
}
.hor-cc-input::placeholder{color:#a5a5a5;}
.hor-cc-select{
	background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234C4C4C' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
	background-repeat:no-repeat;
	background-position:right 14px center;
	padding-right:36px;
	cursor:pointer;
}
.hor-cc-select:focus,
.hor-cc-input:focus{
	outline:none;
	border-color:var(--hor-accent);
	box-shadow:0 0 0 3px rgba(199,22,11,.12);
	box-shadow:0 0 0 3px color-mix(in srgb, var(--hor-accent) 15%, transparent);
}
.hor-cc-select:disabled{
	background-color:#f2f2f0;
	color:#a5a5a5;
	cursor:not-allowed;
}

/* ---------- Measurement inputs ---------- */
.hor-cc-measure{margin:0;}
.hor-cc-hint{
	margin:0;
	color:var(--hor-muted);
	font-size:14px;
	font-style:italic;
}
.hor-cc-measure-grid{
	display:grid;
	grid-template-columns:1fr 1fr;
	gap:14px;
	opacity:0;
	transform:translateY(6px);
	transition:opacity .3s ease, transform .3s ease;
}
.hor-cc-measure-grid.hor-in{opacity:1;transform:none;}
.hor-cc-thumb{
	grid-column:1/-1;
	width:100%;
	max-height:190px;
	object-fit:cover;
	border-radius:6px;
	margin-bottom:2px;
}

/* ---------- Buttons ---------- */
.hor-cc-btn{
	display:block;
	width:calc(100% - 56px);
	margin:6px 28px 0;
	padding:16px 20px;
	background:var(--hor-accent);
	color:#fff;
	border:2px solid var(--hor-accent);
	border-radius:8px;
	font-family:var(--hor-font-body);
	font-size:15px;
	font-weight:700;
	letter-spacing:.06em;
	text-transform:uppercase;
	cursor:pointer;
	transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .1s ease,opacity .15s ease;
}
.hor-cc-btn:hover:not(:disabled){
	background:var(--hor-accent-dark);
	border-color:var(--hor-accent-dark);
	box-shadow:0 8px 20px -10px rgba(199,22,11,.7);
}
.hor-cc-btn:active:not(:disabled){transform:translateY(1px);box-shadow:none;}
.hor-cc-btn:disabled{opacity:.4;cursor:not-allowed;}
.hor-cc-btn-outline{
	background:#fff;
	color:var(--hor-accent);
	border:2px solid var(--hor-accent);
	margin-top:0;
}
/* Fill with brand red and flip text to white on hover. */
.hor-cc-btn-outline:hover:not(:disabled){
	background:var(--hor-accent);
	border-color:var(--hor-accent);
	color:#fff;
}

/* ---------- Error ---------- */
.hor-cc-error{
	margin:18px 28px 0;
	padding:12px 15px;
	background:var(--hor-accent-soft);
	border:1px solid #f0bdb9;
	color:#9F1209;
	border-radius:6px;
	font-size:14px;
	font-weight:600;
}

/* ---------- Output placeholder ---------- */
.hor-cc-placeholder{
	flex:1 1 auto;
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	text-align:center;
	gap:16px;
	min-height:240px;
	color:var(--hor-muted);
	padding:24px;
}
.hor-cc-placeholder-icon{
	color:#b7b1a6;
	padding:18px;
	background:#efece7;
	border-radius:50%;
	box-sizing:content-box;
}
.hor-cc-placeholder p{margin:0;font-size:14px;max-width:26ch;line-height:1.5;}

/* ---------- Result ---------- */
.hor-cc-result{
	margin:0 0 16px;
	padding:26px 28px 22px;
	background:#fff;
	border:1px solid var(--hor-border);
	border-radius:12px;
	box-shadow:0 1px 2px rgba(20,20,20,.04), 0 12px 34px -20px rgba(20,20,20,.32);
	opacity:0;
	transform:translateY(10px);
	transition:opacity .4s ease, transform .4s ease;
}
.hor-cc-result.hor-in{opacity:1;transform:none;}

.hor-cc-result-label{
	display:flex;
	align-items:center;
	gap:10px;
	font-size:12px;
	font-weight:700;
	letter-spacing:.12em;
	text-transform:uppercase;
	color:var(--hor-muted);
}
.hor-cc-result-tick{
	display:inline-block;
	width:22px;
	height:3px;
	border-radius:2px;
	background:var(--hor-accent);
	flex:0 0 auto;
}

.hor-cc-result-figure{
	display:flex;
	align-items:baseline;
	gap:10px;
	flex-wrap:wrap;
	margin:14px 0 2px;
}
.hor-cc-result-qty{
	font-family:var(--hor-font-head);
	font-weight:normal;
	color:var(--hor-accent);
	font-size:clamp(3.25rem, 3.5vw + 1.5rem, 4.5rem);
	line-height:.9;
	letter-spacing:-.01em;
	font-variant-numeric:tabular-nums;
	font-feature-settings:"tnum" 1;
}
.hor-cc-result-unit{
	font-family:var(--hor-font-head);
	text-transform:uppercase;
	color:var(--hor-ink);
	font-size:clamp(1.35rem, 1vw + 1rem, 1.75rem);
	line-height:1;
}

.hor-cc-result-meta{
	display:grid;
	grid-template-columns:1fr 1fr;
	gap:2px 20px;
	margin:20px 0 0;
	padding:16px 0 0;
	border-top:1px solid var(--hor-border);
}
.hor-cc-meta-item{display:flex;flex-direction:column;gap:4px;}
.hor-cc-meta-label{
	margin:0;
	font-size:11px;
	font-weight:700;
	letter-spacing:.08em;
	text-transform:uppercase;
	color:#6a6a6a;
}
.hor-cc-meta-value{
	margin:0;
	font-size:16px;
	font-weight:600;
	color:var(--hor-ink);
	font-variant-numeric:tabular-nums;
}

.hor-cc-result-note{
	margin:14px 0 0;
	font-size:13px;
	color:var(--hor-text);
	font-style:italic;
}

.hor-cc-ref{
	display:flex;
	align-items:center;
	gap:8px;
	margin:16px 0 0;
	padding:14px 0 0;
	border-top:1px solid var(--hor-border);
	font-size:13.5px;
	line-height:1.45;
	color:#6a6a6a;
}
.hor-cc-ref-icon{flex:0 0 auto;margin-top:1px;color:#a2a2a2;}

/* ---------- Quote ---------- */
.hor-cc-quote{padding:0;}
.hor-cc-quote-open{transition:opacity .25s ease;}
/* Animated expand: grid-template-rows 0fr -> 1fr smoothly reveals the form. */
.hor-cc-quote-reveal{
	display:grid;
	grid-template-rows:0fr;
	transition:grid-template-rows .38s ease;
}
.hor-cc-quote-reveal.is-open{grid-template-rows:1fr;}
.hor-cc-quote-reveal-inner{
	overflow:hidden;
	opacity:0;
	visibility:hidden;
	transition:opacity .3s ease .04s, visibility .38s ease;
}
.hor-cc-quote-reveal.is-open .hor-cc-quote-reveal-inner{opacity:1;visibility:visible;}
.hor-cc-quote-form{
	margin-top:14px;
	padding:20px;
	background:#fff;
	border:1px solid var(--hor-border);
	border-radius:8px;
	display:grid;
	gap:14px;
}
.hor-cc-quote-lead{margin:0;color:var(--hor-text);font-size:14px;}
.hor-cc-quote-form .hor-cc-btn{width:100%;margin:4px 0 0;}
.hor-cc-quote-msg{
	font-size:14px;
	font-weight:600;
	padding:11px 14px;
	border-radius:6px;
}
.hor-cc-ok{background:#e7f4e4;color:#255e1f;}
.hor-cc-bad{background:var(--hor-accent-soft);color:#9F1209;}

/* ---------- Responsive ---------- */
/* Collapse to a single column: form on top, estimate below. */
@media (max-width:760px){
	.hor-cc-body{grid-template-columns:1fr;}
	.hor-cc-output{
		border-left:0;
		border-top:1px solid var(--hor-border);
	}
	.hor-cc-placeholder{min-height:0;}
}
@media (max-width:560px){
	.hor-cc{border-radius:12px;}
	.hor-cc-head{padding:26px 20px 22px;}
	.hor-cc-step{padding:22px 20px;gap:12px;}
	.hor-cc-measure-grid{grid-template-columns:1fr;}
	.hor-cc-output{padding:22px 20px;}
	.hor-cc-result{padding:22px 20px 20px;}
	.hor-cc-btn{width:calc(100% - 40px);margin:6px 20px 0;}
	.hor-cc-form{padding-bottom:20px;}
	.hor-cc-error{margin:18px 20px 0;}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
	.hor-cc *,
	.hor-cc *::before,
	.hor-cc *::after{
		transition-duration:.001ms !important;
		animation-duration:.001ms !important;
	}
	.hor-cc-result,
	.hor-cc-measure-grid{opacity:1 !important;transform:none !important;}
}
