/* ==========================================================================
   SogaWorks UI Design System & Brand Kit (Master Guide v1.0)
   All base component defaults wrapped in :where() (0,0,0 specificity) so
   Gutenberg right-sidebar controls & page overrides always win without !important
   ========================================================================== */

:root {
  /* Brand & Accent Palette */
  --sw-brand-blue: #2040BB;
  --sw-brand-blue-hover: #18339A;
  --sw-accent-yellow: #F5C800;
  --sw-accent-yellow-hover: #E2B800;
  --sw-highlight-yellow: #FFC300;
  --sw-status-green: #24F03E;

  /* Surfaces */
  --sw-surface-white: #FFFFFF;
  --sw-surface-grey: #F7F7F7;
  --sw-surface-subtle: #FCFCFC;
  --sw-surface-ice: #F3F7FB;
  --sw-surface-muted: #E6E6E6;
  --sw-surface-dark: #383B46;

  /* Typography & Ink */
  --sw-ink-black: #000000;
  --sw-ink-primary: #222222;
  --sw-ink-charcoal: #444444;
  --sw-ink-muted: #66686F;
  --sw-ink-disclaimer: #808080;
  --sw-ink-inverse: #FFFFFF;

  /* Borders & Radii */
  --sw-border-card: #E8E8E8;
  --sw-border-line: #E6E8EB;
  --sw-border-accordion: #D6D1D1;
  --sw-radius-2xs: 2px;
  --sw-radius-xs: 4px;
  --sw-radius-s: 6px;
  --sw-radius-m: 8px;
  --sw-radius-l: 10px;

  /* Layout Widths (5-Tier System) */
  --sw-max-mega: 1600px;
  --sw-max-primary: 1440px;
  --sw-max-medium: 1280px;
  --sw-max-narrow: 1140px;
  --sw-max-reading: 760px;

  /* Font Stacks */
  --sw-font-bold: "Nevermind-Bold", "Nevermind", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sw-font-medium: "Nevermind-medium", "Nevermind", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Kadence & WP 6.x Gutenberg Full-Width & Margin Resets ---------- */
:where(body.sw-clean-canvas) .site-container,
:where(body.sw-clean-canvas) .content-container,
:where(body.sw-clean-canvas) .entry-content-wrap,
:where(body.sw-clean-canvas) .content-bg {
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

:where(body.sw-clean-canvas) .entry-hero,
:where(body.sw-clean-canvas) .entry-header {
  display: none;
}

:where(.sw-page),
:where(.sw-page) *,
:where(.sw-page) *::before,
:where(.sw-page) *::after {
  box-sizing: border-box;
}

:where(.sw-page) {
  width: 100%;
  font-family: var(--sw-font-medium);
  color: var(--sw-ink-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Neutralize WP 6.x block-gap / is-layout-flow unexpected vertical margins */
:where(.sw-page .is-layout-flow > *),
:where(.sw-page .is-layout-constrained > *),
:where(.sw-page .wp-block-group),
:where(.sw-page .wp-block-image),
:where(.sw-page .wp-block-buttons),
:where(.sw-page .wp-block-button),
:where(.sw-page .wp-block-heading),
:where(.sw-page p),
:where(.sw-page .wp-block-post-template > li) {
  margin-block-start: 0;
  margin-block-end: 0;
}

:where(.sw-page .wp-block-image img) {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(.sw-page .wp-block-buttons) {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

:where(.sw-page .wp-block-button__link) {
  box-shadow: none;
  text-decoration: none;
}

:where(.sw-defer-paint) {
  content-visibility: auto;
  contain-intrinsic-size: 1px 700px;
}

/* ---------- Native Icon-List Checkmarks (Zero FontAwesome Dependency) ---------- */
:where(.sw-icon-list) {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

:where(.sw-icon-list > li) {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sw-il-gap, 10px);
  margin: 0;
  padding: 0;
}

:where(.sw-icon-list > li)::before {
  content: "";
  flex-shrink: 0;
  width: var(--sw-il-size, 18px);
  height: var(--sw-il-size, 18px);
  margin-top: 2px;
  background-color: var(--sw-il-color, var(--sw-status-green));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm-1.2 14.5-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm-1.2 14.5-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E");
}

:where(.sw-icon-list.sw-il-clipboard > li)::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-4.18A3 3 0 0 0 12 1a3 3 0 0 0-2.82 2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-7 0a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm-1.3 14-3.2-3.2 1.4-1.4 1.8 1.8 4.4-4.4 1.4 1.4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-4.18A3 3 0 0 0 12 1a3 3 0 0 0-2.82 2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-7 0a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm-1.3 14-3.2-3.2 1.4-1.4 1.8 1.8 4.4-4.4 1.4 1.4z'/%3E%3C/svg%3E");
}

/* ---------- Native Button SVG Icons (Zero FontAwesome, 100% Valid core/button) ---------- */
:where(.sw-btn-ico-right .wp-block-button__link)::after,
:where(.sw-btn-ico-down .wp-block-button__link)::after,
:where(.sw-btn-ico-download .wp-block-button__link)::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:where(.sw-btn-ico-right .wp-block-button__link)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14m-6-6 6 6-6 6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14m-6-6 6 6-6 6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:where(.sw-btn-ico-down .wp-block-button__link)::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14m-6-6 6 6 6-6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14m-6-6 6 6 6-6' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:where(.sw-btn-ico-download .wp-block-button__link)::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0-4-4m4 4 4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0-4-4m4 4 4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Reusable UI Design System v1.0 Primitives (Used by Gutenberg Patterns & New Pages)
   ========================================================================== */

:where(.sw-ds-sec) {
  width: 100%;
  padding: 72px 24px;
  background-color: var(--sw-surface-white);
  scroll-margin-top: 80px;
}
:where(.sw-ds-sec.sw-bg-grey)  { background-color: var(--sw-surface-grey); }
:where(.sw-ds-sec.sw-bg-ice)   { background-color: var(--sw-surface-ice); }
:where(.sw-ds-sec.sw-bg-dark)  { background-color: var(--sw-surface-dark); color: var(--sw-ink-inverse); }

:where(.sw-ds-inner)           { width: 100%; max-width: var(--sw-max-primary); margin: 0 auto; }
:where(.sw-ds-inner--1280)     { max-width: var(--sw-max-medium); }
:where(.sw-ds-inner--1140)     { max-width: var(--sw-max-narrow); }

:where(.sw-ds-eyebrow) {
  font-family: var(--sw-font-bold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-brand-blue);
  margin-bottom: 10px;
}

:where(.sw-ds-h1) {
  font-family: var(--sw-font-bold);
  font-size: clamp(32px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--sw-ink-primary);
  margin-bottom: 16px;
}

:where(.sw-ds-h2) {
  font-family: var(--sw-font-bold);
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 700;
  line-height: 1.22;
  color: var(--sw-ink-primary);
  margin-bottom: 14px;
}

:where(.sw-ds-lead) {
  font-family: var(--sw-font-medium);
  font-size: 16px;
  line-height: 1.65;
  color: var(--sw-ink-muted);
  max-width: 720px;
}

:where(.sw-ds-rule) {
  border: 0;
  width: 36px;
  height: 3px;
  background-color: var(--sw-highlight-yellow);
  margin: 0 0 18px 0;
}

/* Buttons */
:where(.sw-ds-btn-primary .wp-block-button__link),
:where(.sw-ds-btn-primary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  background-color: var(--sw-brand-blue);
  color: var(--sw-ink-inverse);
  border: 1px solid var(--sw-brand-blue);
  border-radius: var(--sw-radius-xs);
  font-family: var(--sw-font-bold);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
:where(.sw-ds-btn-primary .wp-block-button__link:hover),
:where(.sw-ds-btn-primary:hover) {
  background-color: var(--sw-brand-blue-hover);
  border-color: var(--sw-brand-blue-hover);
}

:where(.sw-ds-btn-yellow .wp-block-button__link),
:where(.sw-ds-btn-yellow) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background-color: var(--sw-accent-yellow);
  color: var(--sw-ink-primary);
  border: 1px solid var(--sw-accent-yellow);
  border-radius: var(--sw-radius-xs);
  font-family: var(--sw-font-bold);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
:where(.sw-ds-btn-yellow .wp-block-button__link:hover),
:where(.sw-ds-btn-yellow:hover) {
  background-color: var(--sw-accent-yellow-hover);
}

:where(.sw-ds-btn-outline .wp-block-button__link),
:where(.sw-ds-btn-outline) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  background-color: var(--sw-surface-white);
  color: var(--sw-ink-primary);
  border: 1px solid var(--sw-border-accordion);
  border-radius: var(--sw-radius-xs);
  font-family: var(--sw-font-bold);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}
:where(.sw-ds-btn-outline .wp-block-button__link:hover),
:where(.sw-ds-btn-outline:hover) {
  border-color: var(--sw-brand-blue);
  color: var(--sw-brand-blue);
}

/* Grids & Cards */
:where(.sw-ds-grid-2) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
:where(.sw-ds-grid-3) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
:where(.sw-ds-grid-4) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

:where(.sw-ds-card) {
  background-color: var(--sw-surface-white);
  border: 1px solid var(--sw-border-card);
  border-radius: var(--sw-radius-m);
  padding: 26px 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
:where(.sw-ds-card:hover) {
  border-color: var(--sw-brand-blue);
  box-shadow: 0 8px 24px rgba(32, 64, 187, 0.08);
}

/* Sticky 6-Item In-Page Anchor Sub-Nav (1140px) */
:where(.sw-ds-subnav) {
  position: sticky;
  top: 73px;
  z-index: 40;
  background-color: var(--sw-surface-white);
  border-bottom: 1px solid var(--sw-border-line);
  padding: 0 24px;
}
:where(.sw-ds-subnav-inner) {
  max-width: var(--sw-max-narrow);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
:where(.sw-ds-subnav-inner a) {
  padding: 15px 4px;
  font-family: var(--sw-font-medium);
  font-size: 14.5px;
  color: var(--sw-ink-muted);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
:where(.sw-ds-subnav-inner a:hover),
:where(.sw-ds-subnav-inner a.is-active) {
  color: var(--sw-brand-blue);
  border-bottom-color: var(--sw-brand-blue);
}

/* Engineering Spec Table / M-Table */
:where(.sw-ds-table) {
  width: 100%;
  overflow-x: auto;
}
:where(.sw-ds-table table) {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--sw-surface-white);
  border: 1px solid var(--sw-border-card);
  border-radius: var(--sw-radius-s);
  font-size: 14.5px;
}
:where(.sw-ds-table th) {
  background-color: var(--sw-surface-ice);
  color: var(--sw-ink-primary);
  font-family: var(--sw-font-bold);
  font-weight: 700;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--sw-border-line);
}
:where(.sw-ds-table td) {
  padding: 13px 16px;
  border-bottom: 1px solid var(--sw-border-line);
  color: var(--sw-ink-charcoal);
  vertical-align: top;
}
:where(.sw-ds-table tr:last-child td) {
  border-bottom: none;
}

/* Native core/details FAQ Accordion (Auto-powers Dynamic FAQPage Schema!) */
:where(.sw-ds-faq-list) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:where(.sw-ds-faq-list .wp-block-details) {
  background-color: var(--sw-surface-white);
  border: 1px solid var(--sw-border-card);
  border-radius: var(--sw-radius-s);
  padding: 0;
  transition: border-color 0.2s ease;
}
:where(.sw-ds-faq-list .wp-block-details[open]) {
  border-color: var(--sw-brand-blue);
}
:where(.sw-ds-faq-list .wp-block-details > summary) {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-family: var(--sw-font-bold);
  font-size: 16px;
  font-weight: 700;
  color: var(--sw-ink-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
:where(.sw-ds-faq-list .wp-block-details > summary::-webkit-details-marker) {
  display: none;
}
:where(.sw-ds-faq-list .wp-block-details > summary)::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  color: var(--sw-brand-blue);
  flex-shrink: 0;
}
:where(.sw-ds-faq-list .wp-block-details[open] > summary)::after {
  content: "−";
}
:where(.sw-ds-faq-list .wp-block-details > p),
:where(.sw-ds-faq-list .wp-block-details > div),
:where(.sw-ds-faq-list .wp-block-details > ul) {
  padding: 0 22px 18px 22px;
  color: var(--sw-ink-muted);
  font-size: 15px;
  line-height: 1.65;
}

/* Dark Slate Pre-Footer CTA (#383B46 + #F5C800) */
:where(.sw-ds-dark-cta) {
  background-color: var(--sw-surface-dark);
  color: var(--sw-ink-inverse);
  padding: 72px 24px;
  text-align: center;
}
:where(.sw-ds-dark-cta .sw-ds-h2) {
  color: var(--sw-ink-inverse);
}
:where(.sw-ds-dark-cta .sw-ds-lead) {
  color: rgba(255, 255, 255, 0.82);
  margin: 0 auto 28px auto;
}

@media (max-width: 960px) {
  :where(.sw-ds-sec) { padding: 56px 20px; }
  :where(.sw-ds-grid-4) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :where(.sw-ds-grid-3) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  :where(.sw-ds-sec) { padding: 44px 16px; }
  :where(.sw-ds-grid-2),
  :where(.sw-ds-grid-3),
  :where(.sw-ds-grid-4) { grid-template-columns: 1fr; }
}

/* Forminator Contact Form Shell (Preserves Forminator file upload, email & Google Ads submit button class!) */
:where(.sw-forminator-shell .forminator-ui.forminator-custom-form) {
  font-family: var(--sw-font-medium);
}
:where(.sw-forminator-shell .forminator-input),
:where(.sw-forminator-shell .forminator-textarea),
:where(.sw-forminator-shell .forminator-select--field) {
  border-radius: var(--sw-radius-xs);
  border-color: var(--sw-border-accordion);
  font-family: var(--sw-font-medium);
}
:where(.sw-forminator-shell .forminator-input:focus),
:where(.sw-forminator-shell .forminator-textarea:focus) {
  border-color: var(--sw-brand-blue);
  box-shadow: 0 0 0 2px rgba(32, 64, 187, 0.12);
}
:where(.sw-forminator-shell .forminator-button-submit) {
  background-color: var(--sw-brand-blue);
  color: var(--sw-ink-inverse);
  border-radius: var(--sw-radius-xs);
  font-family: var(--sw-font-bold);
  font-weight: 700;
  padding: 13px 28px;
}
:where(.sw-forminator-shell .forminator-button-submit:hover) {
  background-color: var(--sw-brand-blue-hover);
}
