/**
 * Contact Form 7 6.x compatibility / restyle for the Kontakt form.
 *
 * Why this file exists:
 * The site was updated to Contact Form 7 6.x and the
 * "jquery-validation-for-contact-form-7-pro" plugin was removed. CF7 6.x generates
 * different markup than the 5.x version the theme's build/app.css was built against:
 *
 *   1. Each <div class="row"> now wraps its field(s) in <p> … <br> … </p>. That extra
 *      <p> sits between .row (a flexbox) and the .wpcf7-form-control-wrap items, so the
 *      theme's two-column layout (which expects the wraps to be direct flex children of
 *      .row) collapses and every field stacks at a fixed/narrow width.
 *   2. The field name moved from a CSS class (e.g. .contacttype) to a data-name attribute,
 *      so the few name-based rules in app.css no longer match.
 *   3. Native CF7 validation uses .wpcf7-not-valid / .wpcf7-not-valid-tip instead of the
 *      .error / .valid classes the removed plugin added.
 *
 * This file re-aligns the new markup with the theme's existing form design (build/app.css)
 * rather than restyling from scratch, so it keeps matching the original look.
 */

/* 1. Make the CF7-injected <p> fall out of the layout (display:contents) so the
 *    .wpcf7-form-control-wrap items become flex children of .row again. That re-activates
 *    app.css's existing two-column / full-width column rules. Only collapse <p>s that
 *    actually contain a field, so legal-text paragraphs keep their normal block flow. */
.wpcf7-form .row > p:has(.wpcf7-form-control-wrap) {
	display: contents;
}

/* The <br> that separated the two paired fields is no longer needed once they are columns. */
.wpcf7-form .row > p:has(.wpcf7-form-control-wrap) > br {
	display: none;
}

/* 2. The "Ich bin*" radio group lost its .contacttype class (now data-name); keep it
 *    full width instead of being treated as a 50% column by the :last-child rule. */
.wpcf7-form .wpcf7-form-control-wrap[data-name="contacttype"] {
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

/* 3. Native CF7 validation styling (previously supplied by the removed pro plugin),
 *    matched to the theme's error colour. */
.wpcf7-form .wpcf7-not-valid {
	border-color: #cc0032 !important;
}

.wpcf7-not-valid-tip {
	color: #cc0032;
	font-size: 16px;
	margin-top: 4px;
}

.wpcf7 form .wpcf7-response-output {
	margin: 15px 0 0;
	padding: 12px 15px;
	border-radius: 5px;
	font-size: 18px;
}
