/* 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 — cards rendered by Divi's "blog" module.
 *
 * Two problems we have to fix in CSS alone:
 *  (1) Cards have opacity:0 waiting for Divi animation JS that never fires.
 *  (2) Layout depends on the Salvattore JS Masonry library which we don't run,
 *      so .et_pb_salvattore_content defaults to flex-row, squashing the cards.
 *
 * Fix: turn the container into a proper CSS grid (3 cols desktop, 2 tablet,
 * 1 mobile), force each card to vertical column layout, force opacity:1.
 * ------------------------------------------------------------------ */
/* Only the inner salvattore_content is the grid — the outer pagination
 * container just wraps salvattore + pagination links and must NOT be a grid
 * (otherwise we get nested 3x3 = 9 narrow columns). */
.et_pb_salvattore_content {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  column-gap: 28px;
  row-gap: 32px;
  width: 100% !important;
  max-width: 100% !important;
}
.et_pb_ajax_pagination_container {
  display: block !important;
  width: 100% !important;
}
.et_pb_post {
  display: flex !important;
  flex-direction: column !important;
  opacity: 1 !important;
  animation: csFadeInUp 0.5s ease both;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(10, 34, 62, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}
.et_pb_post:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(10, 34, 62, 0.10);
}
.et_pb_post .entry-featured-image-url,
.et_pb_post .entry-featured-image,
.et_pb_post > a:first-child {
  display: block;
  aspect-ratio: 16 / 9;
  background: #eef2f7;
  overflow: hidden;
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
}
.et_pb_post .entry-featured-image-url img,
.et_pb_post .entry-featured-image img,
.et_pb_post > a:first-child img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.4s ease;
  margin: 0 !important;
}
.et_pb_post:hover .entry-featured-image-url img,
.et_pb_post:hover .entry-featured-image img,
.et_pb_post:hover > a:first-child img { transform: scale(1.04); }
.et_pb_post .entry-title,
.et_pb_post h2.entry-title {
  font-family: 'Poppins','Mulish',sans-serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  margin: 18px 22px 8px !important;
  padding: 0 !important;
}
.et_pb_post .entry-title a { color: #032b4f; text-decoration: none; }
.et_pb_post .entry-title a:hover { color: #1f8ee8; }
.et_pb_post .post-meta {
  margin: 0 22px 12px !important;
  padding: 0 !important;
  color: #6b7280;
  font-size: 13px;
  border: 0;
}
.et_pb_post .post-meta a { color: #6b7280; text-decoration: none; }
.et_pb_post .post-content,
.et_pb_post .post-content p {
  margin: 0 22px 14px !important;
  padding: 0 !important;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.55;
}
.et_pb_post .more-link {
  display: inline-block;
  margin: auto 22px 22px !important;
  padding: 0 !important;
  color: #1f8ee8;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  align-self: flex-start;
}
.et_pb_post .more-link:hover { text-decoration: underline; }

@keyframes csFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 980px) {
  .et_pb_salvattore_content { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  .et_pb_salvattore_content { grid-template-columns: 1fr !important; }
}

/* ------------------------------------------------------------------
 * 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 back-to-top button
 * ------------------------------------------------------------------ */
.dipi_btt_wrapper {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: #1f8ee8;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(10, 34, 62, 0.18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
  z-index: 1500;
}
.dipi_btt_wrapper.show,
.dipi_btt_wrapper.dipi_btt_show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.dipi_btt_wrapper:hover { background: #1576c9; }
.dipi_btt_wrapper::before {
  content: '';
  width: 12px; height: 12px;
  border-left: 3px solid #fff;
  border-top: 3px solid #fff;
  transform: rotate(45deg);
  margin-top: 4px;
}

/* Hide any stray Complianz residuals in case build-time strip missed them */
#cmplz-cookiebanner-container,
.cmplz-cookiebanner,
#cmplz-manage-consent { display: none !important; }

/* ------------------------------------------------------------------
 * 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;
  column-gap: 16px;
  row-gap: 16px;
  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: 8px !important;
  padding: 14px 18px !important;
  font-family: 'Mulish','Open Sans',sans-serif !important;
  font-size: 15px !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;
}
form[data-cs-styled] textarea,
.gform_wrapper textarea { min-height: 140px; 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 — match prod's blue pill */
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: 999px !important;
  padding: 12px 32px !important;
  font-family: 'Poppins','Mulish',sans-serif !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, transform 0.05s ease !important;
  margin-top: 8px !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;
}
