/*
 * LK Web theme: base.css, loaded first, before the concept's own CSS.
 *
 * It makes WordPress's block markup behave like the plain HTML of the concepts:
 * - wrappers the converter adds around the concept's own elements take no box of their own (display: contents):
 *   .lkw-a and .lkw-inline (a paragraph holding a link or another inline element that stood where blocks stand),
 *   .lkw-part (the header and footer template parts), .lkw-flow (the post content of a concept page);
 * - core defaults that differ from plain HTML are cancelled, each with the lowest specificity that beats core, so the
 *   concept's CSS (loaded later) always wins.
 *
 * Core rules that only a stronger selector could beat (and that would then beat the concept too) are taken out of
 * core's own block stylesheets by the theme instead (inc/content.php): the image caption's margin, the table cells'
 * borders and padding, the quote's block cite.
 */

.lkw-a,
.lkw-inline,
.lkw-part,
.lkw-flow {
  display: contents;
}

/* WordPress can put a gap between the top-level parts of the page; the concepts have none. */
:where(.wp-site-blocks) > * {
  margin-block: 0;
}

/* Core sets every figure to "0 0 1em"; plain HTML keeps the browser's own figure margin (the concepts reset it). */
:where(figure) {
  margin: revert;
}

/* The button block's link: core makes it a full-height inline block (RULES.md: display and height). */
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

/*
 * Contact Form 7 inside a concept's own section: the plugin's extra wrappers take no box (the block's div, div.wpcf7,
 * span.wpcf7-form-control-wrap), so the <form> and its fields stand in the concept's layout as in the concept's HTML.
 * The editor's placeholder of the block keeps its box. The plugin's helpers take no space: the hidden fields, the
 * screen reader response and the spinner are out of the flow, the answer box is gone while it is empty.
 */
.wp-block-contact-form-7-contact-form-selector:not(.components-placeholder),
.wpcf7,
.wpcf7-form-control-wrap {
  display: contents;
}

.wpcf7 .hidden-fields-container {
  display: none;
}

.wpcf7 .screen-reader-response,
.wpcf7-spinner {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

.wpcf7-response-output:empty,
.wpcf7-form:is(.resetting, .submitting) .wpcf7-response-output {
  display: none;
}

/* The trap field of the forms is never shown. */
.lkw-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
