/* Porch Creative Solutions: WPBakery layer (MIG-WO-11, from the Keith Jenkins MIG-WO-9 file; same flow rules as the approved Christmas MIG-WO-2e and Malaga MIG-WO-4 themes).
   Tokens only (tokens.css). Pages are built with STOCK WPBakery elements. WPBakery's own front-end CSS loads unchanged;
   this file (our code) sets the site's flow on top of it. The markup this file relies on is listed in inc/wpbakery.php
   (pcs_wpb_markup_contract) and checked in wp-admin after a WPBakery update.
   Selectors start with .entry-content (and one more class where WPBakery's own rule has two), so they never depend
   on which stylesheet loads last. */

/* ---- Rows: the page widths and rhythm of the 2d block flow (os-refresh "Block content flow").
   WPBakery puts the page content in one wrapper (div.wpb-content-wrapper), so the os-refresh flow rules for
   .entry-content > * are repeated here one level down, with the same values. The "Section" dropdown prints WordPress's
   own alignfull / alignwide classes. A plain row is the 760 px reading width. */
.entry-content > .wpb-content-wrapper:not(.alignfull) { width: 100%; margin: 0; }
.entry-content .vc_row { margin-inline: 0; }
.wpb-content-wrapper > :where(:not(.alignfull):not(.alignwide)) {
  width: min(100% - 2 * var(--gutter), var(--text-width));
}
.wpb-content-wrapper > .alignwide { width: var(--porch-page-width, min(100% - 2 * var(--gutter), var(--content-width))); }
.wpb-content-wrapper > .alignfull { width: 100%; }
.entry-content .wpb-content-wrapper > .vc_row:not(.alignfull) { margin-inline: auto; }
.wpb-content-wrapper > * + * { margin-top: 1em; }
.wpb-content-wrapper > * + .alignfull,
.wpb-content-wrapper > .alignfull + * { margin-top: 0; }
.wpb-content-wrapper > .alignfull + :not(.alignfull),
.wpb-content-wrapper > :first-child:not(.alignfull) { margin-top: var(--section-pad); }
.wpb-content-wrapper > :last-child:not(.alignfull) { margin-bottom: var(--section-pad); }
.entry-content .vc_row::before,
.entry-content .vc_row::after,
.entry-content .vc_column-inner::before,
.entry-content .vc_column-inner::after { content: none; }

/* A row with one column is plain block flow, so margins meet and collapse as they did between 2d blocks (a heading
   after a columns row keeps its 1.6 em, a form's last margin is not added twice). Rows with two or more columns sit
   side by side, with the same gap and stacking as the 2d Columns block (os-refresh .wp-block-columns).
   :where() keeps these at one class, so a section's own layout (hero, letter, Don't Wait) always wins. */
.entry-content :where(.vc_row) { display: block; }
.entry-content :where(.vc_row:has(> .wpb_column + .wpb_column)) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg) var(--space-xl);
}
.entry-content .vc_row > .wpb_column {
  float: none;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding-inline: 0;
}
.entry-content .vc_column_container > .vc_column-inner { padding-inline: 0; }
/* A column with a width keeps it as its flex basis, as the 2d Columns block did (style="flex-basis: 50%"), so a
   column with padding (Tinted box) shares the row the same way. */
.entry-content .vc_row > .vc_col-sm-3 { flex-basis: 25%; }
.entry-content .vc_row > .vc_col-sm-4 { flex-basis: 33.33%; }
.entry-content .vc_row > .vc_col-sm-5 { flex-basis: 41.66%; }
.entry-content .vc_row > .vc_col-sm-6 { flex-basis: 50%; }
.entry-content .vc_row > .vc_col-sm-7 { flex-basis: 58.33%; }
.entry-content .vc_row > .vc_col-sm-8 { flex-basis: 66.66%; }
.entry-content .vc_row > .vc_col-sm-9 { flex-basis: 75%; }
@media (max-width: 781px) {
  .entry-content .vc_row > .wpb_column { flex-basis: 100%; }
}
@media (min-width: 782px) {
  .entry-content :where(.vc_row) { flex-wrap: nowrap; } /* as the 2d Columns block from 782 px (WordPress block CSS) */
}

/* Headings in a reading-width row keep the 2d position: a box of the heading's own max width (h1 480 px, h2 680 px),
   centred in the 760 px column (2d: .entry-content > * had margin-inline auto). Kept as approved. */
.wpb-content-wrapper > .vc_row:not(.alignfull):not(.alignwide) > .wpb_column > .vc_column-inner > .wpb_wrapper > :is(h1, h2, h3) { margin-inline: auto; }

/* ---- Element flow: 1 em between parts, 1.6 em before a heading (as .wp-block-group > * + *). */
.entry-content .wpb_wrapper > *,
.entry-content .wpb_content_element { margin-top: 0; margin-bottom: 0; }
.entry-content .wpb_wrapper > * + * { margin-top: 1em; }
.entry-content .wpb_wrapper > * + :is(h2, h3, h4) { margin-top: 1.6em; }
.entry-content .wpb_text_column > .wpb_wrapper > :first-child { margin-top: 0; }
/* A heading that opens a row right after another row keeps the 2d gap before a heading (1.6 em; it meets the row's
   1 em and the larger one counts, as between 2d blocks). */
.wpb-content-wrapper > * + .vc_row:not(.alignfull) > .wpb_column:only-child > .vc_column-inner > .wpb_wrapper > :is(h2, h3, h4):first-child { margin-top: 1.6em; }

/* ---- Single Image: a block, as the 2d image block (WPBakery shows it inline-block). */
.entry-content .wpb_single_image .vc_figure,
.entry-content .wpb_single_image .vc_single_image-wrapper { display: block; }
.entry-content .wpb_single_image img { display: block; }
/* A photo floated in a Text Block (the editor's Add Media): the same size cap as the 2d floated image block, and it
   stays floated on phones too, as in 2d (text wraps round a 40% wide photo). */
.entry-content .wpb_text_column :is(.alignleft, .alignright) { max-width: min(40vw, 22rem); height: auto; }
.entry-content .wpb_text_column .alignright { float: right; margin: 0.35em 0 var(--space-sm) var(--space-md); }
.entry-content .wpb_text_column .alignleft { float: left; margin: 0.35em var(--space-md) var(--space-sm) 0; }
.entry-content .wpb_text_column p:has(> img:is(.alignleft, .alignright):only-child) { margin-top: 0; }
/* After a heading, a floated photo starts 0.35 em under it and the text 1 em under it, as in 2d. */
.entry-content .wpb_wrapper > * + .wpb_text_column > .wpb_wrapper > p:first-child > img:is(.alignleft, .alignright):only-child { margin-top: -0.65em; }

/* ---- Button element: the site's button (one primary and the live variants; audit section 5: 46 px, the live pill radius,
   Inter 600 15 px). WPBakery's Style, Shape, Size and colour settings are not used: the "Button
   look" dropdown sets the look (inc/wpbakery.php). Hover changes the fill in 160 ms; press moves 1 px (kit pm-btn) and
   darkens the fill. Every state uses brand tokens and wins by specificity (PORCH_RULES structural rules). */
.entry-content .wpb_btn-container .wpb_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: var(--btn-height);
  padding: 0 var(--btn-pad-x);
  border: 1px solid var(--color-accent);
  border-radius: var(--btn-radius);
  background: var(--color-accent);
  background-image: none;
  box-shadow: none;
  color: var(--color-on-accent);
  font-family: var(--font-ui);
  font-size: var(--fs-ui);
  font-weight: 600;
  line-height: var(--lh-ui);
  letter-spacing: var(--ui-tracking);
  text-transform: var(--ui-transform);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--pm-dur-micro) var(--pm-ease-micro),
    border-color var(--pm-dur-micro) var(--pm-ease-micro),
    color var(--pm-dur-micro) var(--pm-ease-micro),
    box-shadow var(--pm-dur-micro) var(--pm-ease-micro),
    transform var(--pm-dur-micro) var(--pm-ease-micro);
}
.entry-content .wpb_btn-container .wpb_btn:visited { color: var(--color-on-accent); }
.entry-content .wpb_btn-container .wpb_btn:hover,
.entry-content .wpb_btn-container .wpb_btn:focus-visible {
  border-color: var(--color-accent-hover);
  background: var(--color-accent-hover);
  color: var(--color-on-accent);
}
.entry-content .wpb_btn-container .wpb_btn:focus-visible { outline: var(--pm-focus-ring); outline-offset: var(--pm-focus-offset); }
.entry-content .wpb_btn-container .wpb_btn:active { border-color: var(--color-accent-active); background: var(--color-accent-active); }

/* Light blue pill (live accent, "view website"): ink text for contrast (6.96:1). */
.entry-content .pcs-btn--pill .wpb_btn,
.entry-content .pcs-btn--pill .wpb_btn:visited { border-color: var(--color-pill); background: var(--color-pill); color: var(--color-on-pill); }
.entry-content .pcs-btn--pill .wpb_btn:hover,
.entry-content .pcs-btn--pill .wpb_btn:focus-visible { border-color: var(--color-pill-hover); background: var(--color-pill-hover); color: var(--color-on-pill); }
.entry-content .pcs-btn--pill .wpb_btn:active { background: var(--c-paper); border-color: var(--c-paper); color: var(--color-on-pill); }

/* White on the teal band ("Our Services", live white flat): hover turns ink (live hover black). */
.entry-content .pcs-btn--light .wpb_btn,
.entry-content .pcs-btn--light .wpb_btn:visited { border-color: var(--c-paper); background: var(--c-paper); color: var(--color-text-1); }
.entry-content .pcs-btn--light .wpb_btn:hover,
.entry-content .pcs-btn--light .wpb_btn:focus-visible { border-color: var(--c-ink); background: var(--c-ink); color: var(--c-paper); }
.entry-content .pcs-btn--light .wpb_btn:active { background: var(--c-black); color: var(--c-paper); }

/* White outline on the teal band ("Why the Porch", live outline): hover fills ink. */
.entry-content .pcs-btn--outline .wpb_btn,
.entry-content .pcs-btn--outline .wpb_btn:visited { border: 2px solid var(--c-paper); background: transparent; color: var(--c-paper); }
.entry-content .pcs-btn--outline .wpb_btn:hover,
.entry-content .pcs-btn--outline .wpb_btn:focus-visible { border-color: var(--c-ink); background: var(--c-ink); color: var(--c-paper); }
.entry-content .pcs-btn--outline .wpb_btn:active { background: var(--c-black); }

/* Yellow ("Statistics you need to know", live #ffdd6f). */
.entry-content .pcs-btn--yellow .wpb_btn,
.entry-content .pcs-btn--yellow .wpb_btn:visited { border-color: var(--color-statistics); background: var(--color-statistics); color: var(--color-text-1); }
.entry-content .pcs-btn--yellow .wpb_btn:hover,
.entry-content .pcs-btn--yellow .wpb_btn:focus-visible { border-color: var(--color-statistics-hover); background: var(--color-statistics-hover); color: var(--color-text-1); }
.entry-content .pcs-btn--yellow .wpb_btn:active { background: var(--c-paper); }

/* The button box is as tall as the button (no text line under it). The Button's own Alignment setting still works
   (WPBakery prints it as a custom property). */
.entry-content .wpb_btn-container { display: flex; align-items: flex-start; justify-content: var(--wpb-btn-container-text-align, flex-start); }
/* A column that ends with two or more buttons shows them in one row with one gap. */
.entry-content .wpb_wrapper:has(> .wpb_btn-container + .wpb_btn-container) { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: var(--space-sm); }
.entry-content .wpb_wrapper:has(> .wpb_btn-container + .wpb_btn-container) > :not(.wpb_btn-container) { flex: 0 0 100%; }
.entry-content .wpb_wrapper > :not(.wpb_btn-container) + .wpb_btn-container,
.entry-content .wpb_wrapper:has(> .wpb_btn-container + .wpb_btn-container) > .wpb_btn-container { margin-top: var(--space-lg); }
@media (max-width: 599px) {
  .entry-content .wpb_wrapper:has(> .wpb_btn-container + .wpb_btn-container) > .wpb_btn-container + .wpb_btn-container { margin-top: var(--space-sm); }
  .entry-content .wpb_wrapper:has(> .wpb_btn-container + .wpb_btn-container) > .wpb_btn-container,
  .entry-content .wpb_wrapper:has(> .wpb_btn-container + .wpb_btn-container) > .wpb_btn-container .wpb_btn { flex: 1 1 100%; width: 100%; }
}

/* Icon (dropdown "Icon"): the live double arrow or speech bubbles as one SVG line icon (1.75 px stroke), drawn as a
   mask in the text colour, so the button text stays the editor's own. The arrows move 3 px on hover and focus (kit
   token, E2). Reduced motion: no move. */
.entry-content .pcs-arrow .wpb_btn::after {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: var(--pcs-arrow-mask) center / contain no-repeat;
  mask: var(--pcs-arrow-mask) center / contain no-repeat;
  transition: transform var(--pm-dur-micro) var(--pm-ease-micro);
}
.entry-content .pcs-arrow--chat .wpb_btn::after { width: 1.125rem; height: 1.125rem; -webkit-mask-image: var(--pcs-chat-mask); mask-image: var(--pcs-chat-mask); }
@media (prefers-reduced-motion: no-preference) {
  .entry-content .pcs-arrow .wpb_btn:hover::after,
  .entry-content .pcs-arrow .wpb_btn:focus-visible::after { transform: translate3d(var(--pm-btn-icon-shift), 0, 0); }
}

/* ---- WPBakery frontend editor preview only (body.vc_editor, set by WPBakery in its editing frame).
   There WPBakery wraps every row, column and element in a div.vc_element for its controls. These rules let those
   wrappers take no part in the layout, so the preview follows the page. The public page never has the wrappers, so
   nothing here applies to visitors. Our CSS only; WPBakery's editor files are not touched. */
.vc_editor .wpb-content-wrapper > .vc_element { width: 100%; margin: 0; }
.vc_editor .wpb-content-wrapper > .vc_element > .vc_row:not(.alignfull):not(.alignwide) { width: min(100% - 2 * var(--gutter), var(--text-width)); margin-inline: auto; }
.vc_editor .wpb-content-wrapper > .vc_element > .vc_row.alignwide { width: var(--porch-page-width, min(100% - 2 * var(--gutter), var(--content-width))); margin-inline: auto; }
.vc_editor .wpb-content-wrapper > .vc_element > .vc_row.alignfull { width: 100%; }
.vc_editor .wpb-content-wrapper > .vc_element + .vc_element > .vc_row:not(.alignfull) { margin-top: 1em; }
.vc_editor .wpb-content-wrapper > .vc_element:first-child > .vc_row:not(.alignfull) { margin-top: var(--section-pad); }
.vc_editor .entry-content .vc_row > .vc_element,
.vc_editor .entry-content .wpb_wrapper > .vc_element { display: contents; }
.vc_editor .entry-content :where(.vc_row:has(> .vc_element + .vc_element)) { display: flex; flex-wrap: wrap; gap: var(--space-lg) var(--space-xl); }
.vc_editor .entry-content :where(.vc_row > .vc_element > .wpb_column) { float: none; flex: 1 1 0; width: auto; min-width: 0; padding-inline: 0; }
.vc_editor .entry-content :where(.vc_row > .vc_col-sm-4 > .wpb_column) { flex-basis: 33.33%; }
.vc_editor .entry-content :where(.vc_row > .vc_col-sm-6 > .wpb_column) { flex-basis: 50%; }
.vc_editor .entry-content :where(.vc_row > .vc_col-sm-8 > .wpb_column) { flex-basis: 66.66%; }
@media (max-width: 781px) { .vc_editor .entry-content :where(.vc_row > .vc_element > .wpb_column) { flex-basis: 100%; } }
@media (min-width: 782px) { .vc_editor .entry-content :where(.vc_row) { flex-wrap: nowrap; } }
.vc_editor .entry-content .wpb_wrapper > .vc_element + .vc_element > * { margin-top: 1em; }
.vc_editor .entry-content .wpb_wrapper > .vc_element + .vc_element > :is(h2, h3, h4) { margin-top: 1.6em; }
