/* ---------------------------------------------------------------------------------------------------------------
   Home page sections of design A: hero, before/after pairs, six reasons, needle drawing, owner, contact.
   Loaded only where one of these classes is on the page (functions.php). Tokens only.
   --------------------------------------------------------------------------------------------------------------- */

/* hero: the photo fills the band on desktop; on phones it stands whole above the words */
.wp-block-group.haarpig-hero { position: relative; padding-block: 0; background: var(--hp-text); color: var(--hp-surface); }
.wp-block-group.haarpig-hero > .haarpig-hero__img { max-width: none; margin: 0 calc(var(--wp--style--root--padding-left, var(--hp-gutter)) * -1) !important; }
.haarpig-hero .haarpig-hero__img img { display: block; width: 100%; height: auto; border-radius: 0; }
.wp-block-group.haarpig-hero > .haarpig-hero__in { margin-block-start: 0; }
.haarpig-hero .haarpig-hero__in > * { margin-block: 0; }
.haarpig-hero .haarpig-hero__brand { display: flex; align-items: center; gap: .9rem; font-family: var(--hp-heading); font-size: var(--hp-xs); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.haarpig-hero .haarpig-hero__brand::before { content: ""; flex: none; width: 2.5rem; height: 3px; background: var(--hp-primary); }
.haarpig-hero .haarpig-hero__claim { margin-top: var(--hp-3); color: inherit; font-size: var(--hp-3xl); font-weight: 700; }
.haarpig-hero .haarpig-hero__in > .wp-block-buttons { margin-top: var(--hp-4); }
@media (min-width: 900px) {
	.wp-block-group.haarpig-hero { display: grid; min-height: min(76vh, 44rem); }
	.wp-block-group.haarpig-hero > .haarpig-hero__img { position: absolute; inset: 0; margin: 0 !important; }
	.haarpig-hero .haarpig-hero__img img { height: 100%; object-fit: cover; object-position: 72% 28%; }
	.wp-block-group.haarpig-hero::after { content: ""; position: absolute; inset: 0;
		background: linear-gradient(90deg, color-mix(in srgb, var(--hp-text) 94%, transparent) 0%, color-mix(in srgb, var(--hp-text) 74%, transparent) 36%, transparent 66%); }
	.haarpig-hero > .haarpig-hero__in { position: relative; z-index: 1; display: grid; align-content: center; padding-block: var(--hp-6); }
	.haarpig-hero .haarpig-hero__in > * { max-width: 35rem; }
}
@media (max-width: 899px) { .haarpig-hero > .haarpig-hero__in { padding-block: var(--hp-5); } }

/* before / after: two pictures on top of each other, a range input moves the cut */
.wp-block-group.haarpig-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.haarpig-results > .haarpig-ba { --pos: 50%; position: relative; aspect-ratio: 1; margin: 0; overflow: hidden; border-radius: var(--hp-r); background: var(--hp-muted); isolation: isolate; }
.haarpig-ba > .wp-block-image { position: absolute; inset: 0; margin: 0; max-width: none; }
.haarpig-ba > .wp-block-image img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.haarpig-ba > .haarpig-ba__before { z-index: 1; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.haarpig-ba__line { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--hp-surface); pointer-events: none; }
.haarpig-ba__knob { position: absolute; z-index: 2; top: 50%; left: var(--pos); display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin: -1.25rem 0 0 -1.25rem; border-radius: 50%;
	background: var(--hp-surface); color: var(--hp-primary); box-shadow: var(--wp--preset--shadow--soft); pointer-events: none; }
.haarpig-ba__knob svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.haarpig-ba__range { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.haarpig-ba:has(.haarpig-ba__range:focus-visible) { outline: 2px solid var(--hp-surface); outline-offset: 3px; }
.haarpig-ba__tag { position: absolute; z-index: 2; bottom: .5rem; padding: .2rem .5rem; border-radius: var(--wp--custom--radius--small); background: color-mix(in srgb, var(--hp-text) 72%, transparent); color: var(--hp-surface);
	font-size: var(--hp-xs); font-weight: 700; letter-spacing: var(--hp-label); text-transform: uppercase; opacity: 0; transition: opacity var(--hp-fast); pointer-events: none; }
.haarpig-ba__tag--before { left: .5rem; }
.haarpig-ba__tag--after { right: .5rem; }
.haarpig-ba:hover .haarpig-ba__tag, .haarpig-ba:focus-within .haarpig-ba__tag { opacity: 1; }
@media (max-width: 899px) {
	.wp-block-group.haarpig-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.haarpig-ba__knob { width: 2.25rem; height: 2.25rem; margin: -1.125rem 0 0 -1.125rem; }
}

/* six reasons */
.wp-block-group.haarpig-reasons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hp-5) var(--hp-4); }
.haarpig-reasons > .haarpig-reason { margin: 0; }
.haarpig-reasons .haarpig-reason > * { margin-block: 0; }
.haarpig-reason .haarpig-reason__icon { display: block; width: 3.5rem; height: 3.5rem; padding: .85rem; border-radius: var(--hp-r); background: var(--hp-tint-3); color: var(--hp-primary); }
.haarpig-reasons .haarpig-reason h3 { margin-top: var(--hp-3); font-size: var(--hp-l); }
.haarpig-reasons .haarpig-reason__sub { margin-top: .25rem; color: var(--hp-primary); font-size: var(--hp-xs); font-weight: 700; letter-spacing: var(--hp-label); text-transform: uppercase; }
.haarpig-reasons .haarpig-reason__sub + p { margin-top: var(--hp-3); color: var(--hp-soft); }
@media (max-width: 899px) { .wp-block-group.haarpig-reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .wp-block-group.haarpig-reasons { grid-template-columns: minmax(0, 1fr); gap: var(--hp-4); } }

/* needle drawing: white line art, always on the charcoal card */
.haarpig-tech > .haarpig-tech__fig { grid-column: 8 / span 5; padding: var(--hp-4); border-radius: var(--hp-r); background: var(--hp-text); }
.haarpig-tech .haarpig-tech__fig img { border-radius: 0; }
@media (max-width: 899px) { .haarpig-tech > .haarpig-tech__fig { grid-column: 1; max-width: none; } }

/* owner */
.wp-block-group.haarpig-person > * { margin-block: 0; }
.haarpig-person .wp-block-image { margin: 0; }
.haarpig-person .haarpig-person__name { margin-top: var(--hp-3); padding: 0 0 .2rem 1rem; border-left: 3px solid var(--hp-primary); font-size: var(--hp-l); line-height: 1.2; }
.haarpig-person .haarpig-person__role { padding-left: 1rem; border-left: 3px solid var(--hp-primary); color: var(--hp-soft); font-size: var(--hp-s); }

/* contact: the form on a white card, three facts beside it */
.wp-block-group.haarpig-contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--hp-4); align-items: start; }
.haarpig-contact > .haarpig-contact__form { grid-column: 1 / span 7; margin: 0; padding: var(--hp-4); border: var(--hp-bw) solid var(--hp-line); border-radius: var(--hp-r); background: var(--hp-surface); }
.haarpig-contact .haarpig-contact__form > h2 { margin: 0 0 var(--hp-4); }
.haarpig-contact > .haarpig-contact__info { grid-column: 9 / span 4; display: grid; gap: var(--hp-4); margin: 0; }
.haarpig-contact__info > .haarpig-fact { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 1rem; margin: 0; }
.wp-block-group.haarpig-fact > * { margin-block: 0; }
.haarpig-fact .haarpig-fact__icon { grid-row: 1 / span 2; width: 1.5rem; height: 1.5rem; margin-top: .15rem; color: var(--hp-primary); }
.haarpig-contact .haarpig-fact h3 { font-family: var(--hp-body); font-size: var(--hp-m); font-weight: 600; letter-spacing: 0; line-height: var(--wp--custom--typography--line-height--body); }
.haarpig-contact .haarpig-fact p { grid-column: 2; color: var(--hp-soft); }
.haarpig-fact p a { color: inherit; text-decoration: none; }
.haarpig-fact p a:hover { text-decoration: underline; }
@media (max-width: 899px) {
	.wp-block-group.haarpig-contact { grid-template-columns: minmax(0, 1fr); row-gap: var(--hp-5); }
	.haarpig-contact > .haarpig-contact__form, .haarpig-contact > .haarpig-contact__info { grid-column: 1; }
}

/* video dialog: the engine's windowed dialog with a close bar */
dialog.revsults-dialog.haarpig-vdialog:not(.revsults-overlay) { width: min(100vw - 2rem, 26rem); max-height: calc(100dvh - 2rem); margin: auto; padding: 0; overflow: hidden; border-radius: var(--wp--custom--radius--large);
	background: var(--hp-surface); color: var(--hp-text); box-shadow: var(--wp--preset--shadow--raised); }
dialog.revsults-dialog.haarpig-vdialog::backdrop { background: color-mix(in srgb, var(--hp-text) 62%, transparent); }
.revsults-dialog.haarpig-vdialog > * { margin: 0; }
.haarpig-vdialog__bar { display: flex; justify-content: flex-end; min-height: 3.25rem; padding-inline: .5rem; border-bottom: var(--hp-bw) solid var(--hp-line); }
.haarpig-vdialog__close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--hp-text); cursor: pointer; }
.haarpig-vdialog video { display: block; width: 100%; height: auto; max-height: calc(100dvh - 5.5rem); background: var(--hp-text); }

.haarpig-ba__tag::before { content: attr(data-label); }

/* contact form (WPForms): the fields keep the owner's setup (placeholders, hidden labels); only the look is ours */
.haarpig-contact div.wpforms-container-full { margin: 0; }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field { padding: 0 0 1.25rem; }
.haarpig-contact div.wpforms-container-full .wpforms-form input[type=text], .haarpig-contact div.wpforms-container-full .wpforms-form input[type=email],
.haarpig-contact div.wpforms-container-full .wpforms-form input[type=number], .haarpig-contact div.wpforms-container-full .wpforms-form input[type=tel],
.haarpig-contact div.wpforms-container-full .wpforms-form textarea { width: 100%; max-width: 100%; min-height: 3rem; height: auto; padding: .7rem .95rem; border: var(--wp--custom--border--strong) solid var(--hp-line-strong);
	border-radius: var(--hp-r); background: var(--hp-surface); box-shadow: none; color: var(--hp-text); font-family: var(--hp-body); font-size: var(--hp-m); line-height: 1.4; }
.haarpig-contact div.wpforms-container-full .wpforms-form textarea { min-height: 9rem; }
.haarpig-contact div.wpforms-container-full .wpforms-form ::placeholder { color: var(--hp-soft); opacity: 1; }
.haarpig-contact div.wpforms-container-full .wpforms-form input:focus-visible, .haarpig-contact div.wpforms-container-full .wpforms-form textarea:focus-visible { outline: 2px solid var(--hp-secondary); outline-offset: 1px; border-color: var(--hp-text); }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-label { margin: 0 0 .4rem; color: var(--hp-text); font-size: var(--hp-s); font-weight: 600; }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-required-label { color: var(--hp-primary); }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-gdpr-checkbox ul { margin: 0; padding: 0; }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-gdpr-checkbox li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; margin: 0; }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-gdpr-checkbox input[type=checkbox] { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; accent-color: var(--hp-primary); }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-label-inline { margin: 0; color: var(--hp-soft); font-size: var(--hp-s); line-height: 1.6; }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-label-inline a { color: var(--hp-text); text-decoration: underline; }
.haarpig-contact div.wpforms-container-full .wpforms-form label.wpforms-error, .haarpig-contact div.wpforms-container-full .wpforms-form em.wpforms-error { margin-top: .35rem; color: var(--wp--preset--color--error); font-size: var(--hp-xs); font-style: normal; font-weight: 600; }
.haarpig-contact div.wpforms-container-full .wpforms-form input.wpforms-error, .haarpig-contact div.wpforms-container-full .wpforms-form textarea.wpforms-error { border-color: var(--wp--preset--color--error); }
.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-submit-container { margin: 0; padding: 0; }
.haarpig-contact div.wpforms-container-full .wpforms-form button[type=submit] { display: inline-flex; align-items: center; justify-content: center; min-width: 11rem; min-height: 3rem; padding: .7rem 1.6rem; border: 0;
	border-radius: var(--hp-r); background: var(--hp-primary); box-shadow: none; color: var(--hp-on-primary); font-family: var(--hp-heading); font-size: var(--hp-xs); font-weight: 700; letter-spacing: .07em; line-height: 1.2;
	text-transform: uppercase; cursor: pointer; transition: background-color var(--hp-fast); }
.haarpig-contact div.wpforms-container-full .wpforms-form button[type=submit]:hover { background: var(--hp-primary-deep); }
@media (max-width: 479px) {
	.haarpig-contact div.wpforms-container-full .wpforms-form button[type=submit] { width: 100%; }
	.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-row { display: block; }
	.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-row .wpforms-field-row-block { float: none; width: 100%; margin: 0; padding: 0; }
	.haarpig-contact div.wpforms-container-full .wpforms-form .wpforms-field-row .wpforms-field-row-block + .wpforms-field-row-block { margin-top: 2.25rem; }
}
