/* Site-wide overrides — loaded after page-<slug>.css */

/* ------------------------------------------------------------------
 * Vanilla cookie consent bar (injected by js/main.js)
 * ------------------------------------------------------------------ */
#cs-cookie-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: #ffffff;
  color: #0a223e;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10, 34, 62, 0.18);
  font-family: 'Mulish', 'Open Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 14px 18px;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 540px;
  margin-left: auto;
}
#cs-cookie-bar.cs-cookie-bar--hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.cs-cookie-bar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cs-cookie-bar__msg {
  margin: 0;
  flex: 1 1 240px;
}
.cs-cookie-bar__link {
  color: #1f8ee8;
  text-decoration: underline;
}
.cs-cookie-bar__actions {
  display: flex;
  gap: 8px;
}
.cs-cookie-bar__btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.cs-cookie-bar__btn--decline {
  background: #eef2f7;
  color: #0a223e;
}
.cs-cookie-bar__btn--decline:hover { background: #dfe6ee; }
.cs-cookie-bar__btn--accept {
  background: #1f8ee8;
  color: #fff;
}
.cs-cookie-bar__btn--accept:hover { background: #1576c9; }
.cs-cookie-bar__btn:active { transform: scale(0.97); }

@media (max-width: 480px) {
  #cs-cookie-bar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 12px;
  }
  .cs-cookie-bar__actions { width: 100%; justify-content: flex-end; }
}

/* ------------------------------------------------------------------
 * Divi blog post grid — deliberately NOT restyled here.
 *
 * This file used to force .et_pb_salvattore_content into a 3-column CSS grid with
 * rounded, shadowed cards, on the theory that Salvattore's masonry JS was missing.
 * Prod doesn't load Salvattore either — and it doesn't lay the blog out in columns
 * at all. Prod's JS UNWRAPS both .et_pb_ajax_pagination_container and
 * .et_pb_salvattore_content, leaving each .et_pb_post as a direct child of
 * .et_pb_blog_grid: full-width (1152px) bordered cards stacked vertically. Divi's
 * own CSS then styles them correctly, including dropping the
 *   .et_pb_salvattore_content[data-columns] .et_pb_post { opacity: 0 }
 * rule, which stops matching once the container is gone.
 *
 * js/main.js:initDiviBlogGrid() does that unwrap. Anything declared here would
 * override Divi's own blog styling, so nothing is.
 * ------------------------------------------------------------------ */

/* One rule DOES have to be neutralised. Our page-blog.css is concatenated from the
 * LiteSpeed-combined bundle, which carries the whole of Divi's CSS including:
 *
 *   .et_pb_blog_grid .et_pb_image_container img { min-width: 100%; ... }
 *
 * a grid-layout rule that stretches the featured image to fill the card. Prod's blog
 * page is served a leaner per-page dynamic stylesheet that never includes it (verified
 * via CDP getMatchedStylesForNode: prod matches 2 rules on that img, we matched 3), so
 * prod's images render at their intrinsic 400x250 -400x250 thumbnail size. With the
 * min-width applied the image blows up to 1152x720 and the card grows 496px -> 906px.
 */
.et_pb_blog_grid .et_pb_image_container img { min-width: 0; }

@keyframes csFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------
 * Blog posts: no sidebar, content full-width and centred.
 *
 * DELIBERATE DEPARTURE FROM PROD — requested by the client 2026-07-16. Prod serves
 * posts with a right sidebar (Search / About us / Categories, all Divi-Pixel demo
 * content), leaving the article at 840px offset left within a 1062px container.
 * Here the sidebar is removed and the article fills the container, so the content is
 * centred. Any future prod-vs-staging diff WILL flag this; it is intentional.
 *
 * Done in CSS rather than by swapping the body class to `et_no_sidebar`: Divi's own
 * no-sidebar rules were stripped from the post CSS bundles by PurgeCSS, because the
 * scraped posts only ever carried `et_right_sidebar`, so that class is inert here.
 * The body keeps et_right_sidebar (harmless) — hence the explicit padding override,
 * which otherwise wins via `.et_pb_gutters2.et_right_sidebar #left-area{padding-right:3%}`.
 * ------------------------------------------------------------------ */
body.single-post #sidebar {
  display: none !important;
}
body.single-post #left-area {
  width: 100% !important;
  float: none !important;
  padding-right: 0 !important;
  margin-left: auto;
  margin-right: auto;
}
/* Divi paints the sidebar divider as a full-height pseudo-element on the container
 * (`.et_right_sidebar #main-content .container:before { right: 22.75% }`). Hiding the
 * sidebar alone leaves that line stranded down the middle of the article. Divi-Pixel's
 * own `dipi-remove-sidebar-line` body class only targets .archive/.blog bodies, not
 * single posts, so kill it directly. */
body.single-post #main-content .container:before {
  display: none !important;
  width: 0 !important;
  background: none !important;
}

/* ------------------------------------------------------------------
 * Sticky navigation.
 *
 * DELIBERATE DEPARTURE FROM PROD — prod's header scrolls away (verified: nothing is
 * fixed/sticky on any prod page). Requested by the client 2026-07-16, so this is the
 * one place the rebuild intentionally behaves differently. Don't "correct" it back to
 * match prod without asking.
 *
 * `position: sticky` rather than `fixed`: the header stays in normal flow, so nothing
 * below it shifts up and no compensating padding is needed on #page-container — the
 * hero still starts at y=96 exactly as prod does. Verified the ancestors are clean
 * (no overflow/transform on header.et-l, #et-boc, #page-container) which would
 * otherwise silently disable sticky.
 *
 * Pages only. Blog posts use the classic Divi header (#main-header), which Divi already
 * fixes via the et_fixed_nav body class we set in functions.php — adding sticky there too
 * would fight it.
 * ------------------------------------------------------------------ */
header.et-l--header {
  position: sticky;
  top: 0;
  z-index: 9999;
}
/* The menu section paints the header's background; without this the page content shows
 * through the sticky bar as it scrolls under. Matches the header's own background. */
header.et-l--header .pixel-header {
  background-color: #f9f8fe;
}

/* ------------------------------------------------------------------
 * Divi-Pixel fancy/rotating text (Morphext) — restore a purged rule.
 *
 * The compiled CSS hides the rotating word by default:
 *     .fancy-text-wrap { visibility: hidden }
 * and only reveals it once the plugin's JS has added `dipi_morphext`:
 *     .fancy-text-wrap.dipi_morphext { visibility: visible }
 *
 * PurgeCSS dropped that second rule from every page that needs it, because
 * `dipi_morphext` is added at runtime and so never appears in the static HTML it
 * scans. (It survives only in page-404-error.css — a page that doesn't use the
 * module.) Result: /our-team/ rendered "HOW WE EXECUTE OURTHE DEADLINES" and
 * /commercial-refrigeration-experts-bristol/ lost the word after its colon.
 *
 * Restored here in custom.css, which is loaded on every page and never purged.
 * The safelist in perf/purge_pages.py now also covers `^dipi_`.
 * ------------------------------------------------------------------ */
.fancy-text-wrap.dipi_morphext { visibility: visible; }

/* ------------------------------------------------------------------
 * Divi-Pixel timeline — fallback reveal animation.
 * Plugin's CSS hides .need_animation; our JS swaps in .animated.fadeIn.
 * Defensive: if JS never fires (eg cache strips it), reveal cards anyway.
 * ------------------------------------------------------------------ */
.dipi_timeline_item_card-wrap.animated.fadeIn,
.dipi_timeline_item_card-wrap:not(.need_animation) {
  opacity: 1 !important;
  transform: none !important;
  animation: csFadeIn 0.6s ease both;
}
@keyframes csFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
/* If page sits with need_animation for >1.5s, reveal anyway */
@media (prefers-reduced-motion: reduce) {
  .dipi_timeline_item_card-wrap { opacity: 1 !important; transform: none !important; }
}

/* ------------------------------------------------------------------
 * Divi-Pixel floating contact button (.dipi_btt_link / .et_pb_scroll_top)
 *
 * Deliberately NOT styled here. An earlier hand-written block in this file made it
 * a blue circle with an up-arrow, bottom-right — that was invented, not prod's.
 * Prod's is a blue half-pill pinned to the right edge with a tools icon, linking to
 * the contact page, and all of those rules already ship: the appearance comes from
 * the inline <style> preserved in imports/page-index.html, and the position/animation
 * from .et_pb_scroll_top rules in inline-<slug>.css. custom.css loads last, so
 * anything declared here would override prod's own styling.
 *
 * The markup is injected by functions.php (the plugin injects it on prod), and
 * main.js toggles .et-visible / .et-hidden on scroll, which is what those rules key off.
 * ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
 * Blog grid (posts listing rendered below /blog/ page content)
 * ------------------------------------------------------------------ */
.cs-blog-grid {
  padding: 60px 24px 80px;
  background: #f9f8fe;
  font-family: 'Mulish', 'Open Sans', sans-serif;
}
.cs-blog-grid__inner { max-width: 1200px; margin: 0 auto; }
.cs-blog-grid__heading {
  font-family: 'Poppins', 'Helvetica', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: #032b4f;
  margin: 0 0 32px;
}
.cs-blog-grid__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
.cs-blog-grid__item {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(10, 34, 62, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cs-blog-grid__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(10, 34, 62, 0.10);
}
.cs-blog-grid__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef2f7;
}
.cs-blog-grid__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.cs-blog-grid__item:hover .cs-blog-grid__thumb img { transform: scale(1.04); }
.cs-blog-grid__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  margin: 18px 20px 8px;
}
.cs-blog-grid__title a { color: #032b4f; text-decoration: none; }
.cs-blog-grid__title a:hover { color: #1f8ee8; }
.cs-blog-grid__date {
  margin: 0 20px 8px;
  color: #6b7280;
  font-size: 13px;
}
.cs-blog-grid__excerpt {
  margin: 0 20px 16px;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.55;
}
.cs-blog-grid__more {
  display: inline-block;
  margin: auto 20px 20px;
  color: #1f8ee8;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}
.cs-blog-grid__more:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .cs-blog-grid { padding: 40px 16px 50px; }
  .cs-blog-grid__heading { font-size: 28px; }
  .cs-blog-grid__items { grid-template-columns: 1fr; gap: 20px; }
}

/* ------------------------------------------------------------------
 * Gravity Forms — match prod (Divi-Pixel styled, placeholder-only)
 * Targets: <form data-cs-styled="1"> (added by gform_form_tag filter)
 * Also targets .gform_wrapper / .gform_legacy_markup for resilience.
 * ------------------------------------------------------------------ */
form[data-cs-styled],
.gform_wrapper form,
.gform_legacy_markup_wrapper form {
  /* Container — placed inside a blue Divi section, content goes white-on-blue */
}

/* Hide labels + (Required) indicators — prod uses placeholders only */
form[data-cs-styled] .gfield_label,
form[data-cs-styled] .gform_required_legend,
form[data-cs-styled] .gfield_required,
.gform_wrapper .gfield_label,
.gform_wrapper .gform_required_legend,
.gform_wrapper .gfield_required {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* Field grid — match prod exactly. Gravity Forms uses a 12-column system and
 * tags each field with `style="grid-column: span N"` (e.g., width-half = span 6,
 * width-full = span 12). Setting up a 12-col grid lets those hints work naturally:
 *  Name (span 6) | Phone (span 6)   ← row 1
 *  Email (span 6) | Services (span 6) ← row 2
 *  Message (span 12)                  ← row 3
 */
form[data-cs-styled] .gform_fields,
.gform_wrapper .gform_fields {
  display: grid !important;
  grid-template-columns: repeat(12, 1fr) !important;
  /* Measured off prod: column-gap 16px, row-gap 40px. The row-gap matters —
   * at 16px the hero form is 45px shorter than prod's and the whole hero
   * section reads as clipped. */
  column-gap: 16px;
  row-gap: 40px;
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
}
/* Default each field to a sensible span if GF didn't emit an inline style */
form[data-cs-styled] .gfield,
.gform_wrapper .gfield {
  grid-column: span 12;
  min-width: 0;             /* allow shrinking to fit grid cell */
  width: auto !important;   /* drop any earlier hard width override */
}
form[data-cs-styled] .gfield--width-half,
.gform_wrapper .gfield--width-half { grid-column: span 6; }
form[data-cs-styled] .gfield--width-third,
.gform_wrapper .gfield--width-third { grid-column: span 4; }
form[data-cs-styled] .gfield--width-two-thirds,
.gform_wrapper .gfield--width-two-thirds { grid-column: span 8; }
form[data-cs-styled] .gfield--width-quarter,
.gform_wrapper .gfield--width-quarter { grid-column: span 3; }
form[data-cs-styled] .gfield--width-full,
form[data-cs-styled] .gfield--type-textarea,
form[data-cs-styled] .gform_footer,
.gform_wrapper .gfield--width-full,
.gform_wrapper .gfield--type-textarea,
.gform_wrapper .gform_footer { grid-column: 1 / -1 !important; }

@media (max-width: 720px) {
  form[data-cs-styled] .gfield,
  .gform_wrapper .gfield { grid-column: 1 / -1 !important; }
}

/* Field INPUT containers fill their grid cell — but NOT .gfield itself, since
 * its width is determined by the parent grid (span 6 / span 12 / etc.) */
form[data-cs-styled] .gfield__input,
.gform_wrapper .gfield__input,
form[data-cs-styled] .ginput_container,
.gform_wrapper .ginput_container,
form[data-cs-styled] .ginput_container_text,
.gform_wrapper .ginput_container_text,
form[data-cs-styled] .ginput_container_email,
.gform_wrapper .ginput_container_email,
form[data-cs-styled] .ginput_container_phone,
.gform_wrapper .ginput_container_phone,
form[data-cs-styled] .ginput_container_select,
.gform_wrapper .ginput_container_select,
form[data-cs-styled] .ginput_container_textarea,
.gform_wrapper .ginput_container_textarea {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Inputs — white rounded boxes, force full width regardless of GF .medium/.small/.large class */
form[data-cs-styled] input[type="text"],
form[data-cs-styled] input[type="email"],
form[data-cs-styled] input[type="tel"],
form[data-cs-styled] input[type="number"],
form[data-cs-styled] input[type="url"],
form[data-cs-styled] input[type="search"],
form[data-cs-styled] select,
form[data-cs-styled] textarea,
form[data-cs-styled] .gfield input.medium,
form[data-cs-styled] .gfield input.large,
form[data-cs-styled] .gfield input.small,
form[data-cs-styled] .gfield select.medium,
form[data-cs-styled] .gfield textarea.medium,
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="search"],
.gform_wrapper select,
.gform_wrapper textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  border-radius: 5px !important;   /* measured off prod's form */
  padding: 14px 18px !important;
  /* Prod sets an explicit 44px height on every control. Without it the <select>
   * grows to 47px and sits 3px taller than the email field beside it. */
  height: 44px !important;
  font-family: 'Mulish','Open Sans',sans-serif !important;
  font-size: 14px !important;
  color: #0a223e !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none !important;
  -webkit-appearance: none !important;
}

/* Native select dropdown arrow (since appearance:none removes it) */
form[data-cs-styled] select,
.gform_wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230a223e' d='M6 8L0 0h12z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 18px center !important;
  padding-right: 44px !important;
}
/* Textarea opts out of the 44px control height above — prod renders it at 192px. */
form[data-cs-styled] textarea,
.gform_wrapper textarea {
  height: auto !important;
  min-height: 192px;
  resize: vertical;
}
form[data-cs-styled] input::placeholder,
form[data-cs-styled] textarea::placeholder,
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
}
form[data-cs-styled] input:focus,
form[data-cs-styled] select:focus,
form[data-cs-styled] textarea:focus,
.gform_wrapper input:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus {
  border-color: #1f8ee8 !important;
  box-shadow: 0 0 0 3px rgba(31, 142, 232, 0.15) !important;
}

/* Submit button — matched to prod's, measured with tools/verify-form.js:
 * 76x38, radius 5px, padding 0 14px, Mulish 500 14px, margin-top 12px.
 * (It is NOT a pill — an earlier 999px radius here was one of the
 * "CTA buttons in differing sizes" the client review picked up on.) */
form[data-cs-styled] .gform_button,
form[data-cs-styled] input[type="submit"],
.gform_wrapper .gform_button,
.gform_wrapper input[type="submit"] {
  background: #ffffff !important;
  color: #0a223e !important;
  border: 0 !important;
  border-radius: 5px !important;
  padding: 0 14px !important;
  height: 38px !important;
  font-family: 'Mulish','Open Sans',sans-serif !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, transform 0.05s ease !important;
  margin-top: 12px !important;
}
form[data-cs-styled] .gform_button:hover,
form[data-cs-styled] input[type="submit"]:hover,
.gform_wrapper .gform_button:hover,
.gform_wrapper input[type="submit"]:hover { background: #eaf2fb !important; }
form[data-cs-styled] .gform_button:active,
.gform_wrapper .gform_button:active { transform: scale(0.98) !important; }
form[data-cs-styled] .gform_footer,
.gform_wrapper .gform_footer {
  padding: 0 !important;
  margin-top: 16px !important;
  grid-column: 1 / -1;
}

/* Validation: red border + small error text */
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important;
}
.gform_wrapper .validation_message,
.gform_wrapper .gfield_description.validation_message {
  color: #fbd5d5 !important;
  font-size: 13px !important;
  margin-top: 4px !important;
}

/* Confirmation message */
.gform_confirmation_message {
  background: #e8f6ef;
  border: 1px solid #b8e0c9;
  color: #126b3a;
  padding: 14px 18px;
  border-radius: 6px;
  font-family: 'Mulish','Open Sans',sans-serif;
  font-size: 15px;
}

/* (Mobile collapse no longer needed — flex column is already single-row) */

/* ------------------------------------------------------------------
 * Form submission success message styling
 * ------------------------------------------------------------------ */
.cs-form-success {
  background: #e8f6ef;
  border: 1px solid #b8e0c9;
  color: #126b3a;
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-family: 'Mulish', 'Open Sans', sans-serif;
  font-size: 15px;
}
