/*
 * 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;
}

/*
 * A concept form's choice and consent boxes: Contact Form 7 puts each <label> into a group span and an item span of
 * its own; in a form of the concept's own markup those take no box either, so the labels (with the concept's classes,
 * inc/forms.php lkweb_form_label_classes) stand where the concept's labels stood (Ompi 19.11.2026).
 */
.lkw-lead-form :is(.wpcf7-radio, .wpcf7-checkbox, .wpcf7-acceptance, .wpcf7-list-item) {
  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;
}

/*
 * Lists WordPress fills (Query Loops made from a concept's lkw-query section; docs/plans/mst-build.md Contract 6):
 * the li WordPress's Post Template puts around each card takes no box, so the card stands in the list as in the
 * concept; a template whose cards stood directly in the section (lkw-query__contents) takes no box either. A featured
 * image made from an element that was not a figure (lkw-fig0) has no figure margin. The read-more link's text for
 * screen readers stays out of sight (core's own rule for it is not loaded with the block's styles).
 */
.lkw-query__list > .wp-block-post,
.lkw-query__contents {
  display: contents;
}

:where(.lkw-fig0) {
  margin: 0;
}

.lkw-query .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  word-wrap: normal;
}

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