/* =============================================
   SNAKEBITE CONSULTING — COMPLETE DARK THEME
   WordPress Additional CSS (Twenty Twenty-Four)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --sb-bg: #0a0a0a;
  --sb-bg2: #111111;
  --sb-card: #1a1a1a;
  --sb-text: #f0f0f0;
  --sb-muted: #a0a0a0;
  --sb-dim: #666666;
  --sb-red: #dc2626;
  --sb-border: #2a2a2a;
}

/* === GLOBAL DARK === */
body, html {
  --wp--preset--color--base: var(--sb-bg) !important;
  --wp--preset--color--contrast: var(--sb-text) !important;
}
body {
  background: var(--sb-bg) !important;
  color: var(--sb-text) !important;
  font-family: 'Inter', sans-serif !important;
  -webkit-font-smoothing: antialiased;
}
.wp-site-blocks, .wp-block-template-part, .wp-block-group,
.has-base-background-color, .has-background,
main, article, footer, .entry-content {
  background-color: var(--sb-bg) !important;
}

/* === FULL-WIDTH HOMEPAGE SECTIONS === */
body.home .entry-content,
body.home .wp-block-post-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}
body.home .entry-content > *,
body.home .wp-block-post-content > * {
  max-width: 100% !important;
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
}

/* Hide page title on homepage */
body.home .wp-block-post-title {
  display: none !important;
}

/* === HOMEPAGE: Override WP theme color cascade === */
/* The WP block theme sets color via --wp--preset--color--contrast on .wp-site-blocks.
   This cascades into our custom HTML sections. We need to break that chain. */

body.home .wp-site-blocks,
body.home .wp-block-post-content,
body.home .entry-content {
  color: inherit !important;
}

/* Force all homepage section children to inherit from their inline-styled parent, not WP */
body.home .entry-content section,
body.home .entry-content section * {
  color: inherit !important;
}

/* Now re-enable specific inline colors via attribute selectors */
body.home .entry-content [style*="color:#dc2626"],
body.home .entry-content [style*="color: #dc2626"] {
  color: #dc2626 !important;
}
body.home .entry-content [style*="color:#f0f0f0"],
body.home .entry-content [style*="color: #f0f0f0"] {
  color: #f0f0f0 !important;
}
body.home .entry-content [style*="color:#a0a0a0"],
body.home .entry-content [style*="color: #a0a0a0"] {
  color: #a0a0a0 !important;
}
body.home .entry-content [style*="color:#fff"],
body.home .entry-content [style*="color: #fff"],
body.home .entry-content [style*="color:#ffffff"],
body.home .entry-content [style*="color: #ffffff"] {
  color: #ffffff !important;
}
body.home .entry-content [style*="color:#22c55e"],
body.home .entry-content [style*="color: #22c55e"] {
  color: #22c55e !important;
}
body.home .entry-content [style*="color:#666"],
body.home .entry-content [style*="color: #666"],
body.home .entry-content [style*="color:#666666"] {
  color: #666666 !important;
}

/* Fix backgrounds */
body.home .entry-content [style*="background:#dc2626"],
body.home .entry-content [style*="background: #dc2626"] {
  background: #dc2626 !important;
  color: #ffffff !important;
}
body.home .entry-content [style*="background:#1a1a1a"],
body.home .entry-content [style*="background: #1a1a1a"] {
  background-color: #1a1a1a !important;
}
body.home .entry-content [style*="background:#111"],
body.home .entry-content [style*="background: #111"] {
  background-color: #111111 !important;
}
body.home .entry-content [style*="background:#0a0a0a"],
body.home .entry-content [style*="background: #0a0a0a"] {
  background-color: #0a0a0a !important;
}
body.home .entry-content [style*="background:transparent"],
body.home .entry-content [style*="background: transparent"] {
  background: transparent !important;
}

/* Fix borders */
body.home .entry-content [style*="border:1px solid #dc2626"],
body.home .entry-content [style*="border: 1px solid #dc2626"] {
  border: 1px solid #dc2626 !important;
}
body.home .entry-content [style*="border:1px solid #2a2a2a"],
body.home .entry-content [style*="border: 1px solid #2a2a2a"] {
  border: 1px solid #2a2a2a !important;
}
body.home .entry-content [style*="border:2px dashed #2a2a2a"],
body.home .entry-content [style*="border: 2px dashed #2a2a2a"] {
  border: 2px dashed #2a2a2a !important;
}
body.home .entry-content [style*="border:2px solid #dc2626"] {
  border: 2px solid #dc2626 !important;
}
body.home .entry-content [style*="border:2px solid #2a2a2a"] {
  border: 2px solid #2a2a2a !important;
}
body.home .entry-content [style*="border-top:3px solid #dc2626"],
body.home .entry-content [style*="border-top: 3px solid #dc2626"] {
  border-top: 3px solid #dc2626 !important;
}

/* Fix border-radius */
body.home .entry-content [style*="border-radius:8px"],
body.home .entry-content [style*="border-radius: 8px"] {
  border-radius: 8px !important;
}
body.home .entry-content [style*="border-radius:6px"],
body.home .entry-content [style*="border-radius: 6px"] {
  border-radius: 6px !important;
}
body.home .entry-content [style*="border-radius:4px"],
body.home .entry-content [style*="border-radius: 4px"] {
  border-radius: 4px !important;
}
body.home .entry-content [style*="border-radius:20px"] {
  border-radius: 20px !important;
}
body.home .entry-content [style*="border-radius:50%"] {
  border-radius: 50% !important;
}

/* Fix paddings on key elements */
body.home .entry-content section[style*="padding"] {
  padding: revert !important;
}
body.home .entry-content section > div[style*="padding"] {
  padding: revert !important;
}

/* === TYPOGRAPHY — NON-HOMEPAGE PAGES === */
body:not(.home) h1, h2, h3, h4, h5, h6, .wp-block-heading, .wp-block-post-title {
  font-family: 'Inter', sans-serif !important;
  color: var(--sb-text) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
body:not(.home) h1 { font-size: clamp(2.2rem, 5vw, 3.5rem) !important; font-weight: 800 !important; }
body:not(.home) h2 { font-size: clamp(1.8rem, 4vw, 2.8rem) !important; }
body:not(.home) h3 { font-size: clamp(1.3rem, 3vw, 1.8rem) !important; }

body:not(.home) p, li, td, th, .wp-block-paragraph, .wp-block-list {
  color: var(--sb-muted) !important;
  font-family: 'Inter', sans-serif !important;
  line-height: 1.7;
}
/* Headings override the catch-all */
body:not(.home) h1, h1 *, h2, h2 *, h3, h3 *, h4, h4 *,
.wp-block-heading, .wp-block-heading * {
  color: var(--sb-text) !important;
}
body:not(.home) strong, b, p strong, p b {
  color: var(--sb-text) !important;
  font-weight: 600;
}

/* === LINKS — NON-HOMEPAGE === */
body:not(.home) a { color: var(--sb-red) !important; text-decoration: none; }
body:not(.home) a:hover { color: #ef4444 !important; }

/* === NAVIGATION === */
.wp-block-navigation, .wp-block-navigation-item,
.wp-block-navigation-item a, .wp-block-navigation a, nav a {
  color: var(--sb-muted) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.wp-block-navigation-item a:hover, nav a:hover {
  color: var(--sb-text) !important;
}
.wp-block-navigation__responsive-container,
.wp-block-navigation__responsive-container.is-menu-open {
  background-color: var(--sb-bg) !important;
}

/* === HEADER === */
header, .wp-block-template-part:first-child {
  background-color: var(--sb-bg) !important;
  border-bottom: 1px solid var(--sb-border) !important;
}

/* === BUTTONS — NON-HOMEPAGE === */
body:not(.home) .wp-block-button__link, .wp-element-button, a.wp-block-button__link {
  background-color: var(--sb-red) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  text-transform: uppercase;
  padding: 14px 32px !important;
}
body:not(.home) .wp-block-button__link:hover, a.wp-block-button__link:hover {
  background-color: #ef4444 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
}
body:not(.home) .wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent !important;
  border: 2px solid var(--sb-red) !important;
  color: var(--sb-red) !important;
}

/* === COLUMNS/CARDS — NON-HOMEPAGE ONLY === */
body:not(.home) .wp-block-column {
  background-color: var(--sb-card) !important;
  border: 1px solid var(--sb-border) !important;
  border-radius: 12px !important;
  padding: 32px !important;
}
body:not(.home) .wp-block-column:hover {
  border-color: var(--sb-red) !important;
  background-color: #222 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
body:not(.home) .wp-block-column::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--sb-red);
  margin-bottom: 20px;
  border-radius: 2px;
}
/* Kill card styles on homepage */
body.home .wp-block-column {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
body.home .wp-block-column::before { display: none !important; }
body.home .wp-block-column:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* === SEPARATORS === */
.wp-block-separator, hr { border-color: var(--sb-border) !important; }

/* === QUOTES === */
.wp-block-quote, .wp-block-pullquote {
  border-left: 3px solid var(--sb-red) !important;
  background: var(--sb-card) !important;
  padding: 24px 32px !important;
  border-radius: 0 8px 8px 0 !important;
}
.wp-block-quote p { color: var(--sb-text) !important; font-style: italic; }

/* === FOOTER === */
footer, .wp-block-template-part:last-child, footer .wp-block-group {
  background-color: var(--sb-bg2) !important;
  border-top: 1px solid var(--sb-border) !important;
}
footer p, footer span, footer a { color: var(--sb-dim) !important; }
footer h2, footer h3, footer h4, footer .wp-block-heading {
  color: var(--sb-text) !important;
  font-size: 0.8rem !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
footer a:hover { color: var(--sb-red) !important; }

/* === IMAGES === */
.wp-block-image img { border-radius: 8px; }

/* === CODE === */
code, pre, .wp-block-code {
  font-family: 'JetBrains Mono', monospace !important;
  background: var(--sb-card) !important;
  color: var(--sb-red) !important;
  border: 1px solid var(--sb-border);
  border-radius: 6px;
}

/* === FORMS === */
input[type="text"], input[type="email"], input[type="tel"],
input[type="url"], input[type="search"], textarea, select {
  background: var(--sb-card) !important;
  border: 1px solid var(--sb-border) !important;
  color: var(--sb-text) !important;
  border-radius: 6px !important;
  padding: 12px 16px !important;
  font-family: 'Inter', sans-serif !important;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--sb-red) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(220,38,38,0.15) !important;
}
input::placeholder, textarea::placeholder { color: var(--sb-dim) !important; }

/* === TABLES === */
.wp-block-table td, .wp-block-table th {
  border-color: var(--sb-border) !important;
  padding: 12px 16px !important;
}
.wp-block-table thead { background: var(--sb-card) !important; }
.wp-block-table th { color: var(--sb-text) !important; font-weight: 600; text-transform: uppercase; font-size: 0.8rem; }

/* === BLOG POSTS === */
.wp-block-post-title a { color: var(--sb-text) !important; }
.wp-block-post-title a:hover { color: var(--sb-red) !important; }
.wp-block-post-date, .wp-block-post-author, .wp-block-post-terms {
  color: var(--sb-dim) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
}

/* === MISC === */
html { scroll-behavior: smooth; }
::selection { background: var(--sb-red); color: #fff; }
.wp-block-site-generator, .powered-by-wordpress { display: none !important; }

/* === MOBILE NAV === */
@media (max-width: 768px) {
  .wp-block-navigation__responsive-container.is-menu-open {
    background: var(--sb-bg) !important;
    padding: 20px !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open a {
    color: var(--sb-muted) !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid var(--sb-border);
  }
  body.home .entry-content > * {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* === FOOTER FIXES === */
/* Restore footer logo image (don't apply text replacement) */
body.home footer .wp-block-site-logo img {
  display: block !important;
}
body.home footer .wp-block-site-logo a::before,
body.home footer .wp-block-site-logo a::after {
  content: none !important;
}
/* Keep footer nav items visible */
body.home footer .wp-block-navigation-item {
  display: list-item !important;
}
body.home footer .wp-block-navigation-item a {
  background: transparent !important;
  border: none !important;
  padding: 4px 0 !important;
  font-size: 0.875rem !important;
  text-transform: none !important;
  color: var(--sb-dim) !important;
}
body.home footer .wp-block-navigation-item a:hover {
  color: var(--sb-red) !important;
  background: transparent !important;
}
/* Hide Designed with WordPress */
.wp-block-site-generator,
.powered-by-wordpress,
footer a[href*="wordpress.org"],
footer a[href*="wordpress.com"] {
  display: none !important;
}

/* =============================================
   FINAL POLISH — Footer, Mobile, Nav Anchors
   ============================================= */

/* === HIDE "Designed with WordPress" === */
footer p.has-contrast-2-color,
footer p[class*="has-contrast-2-color"] {
  display: none !important;
}

/* === NAV: Redirect links to homepage anchors on homepage === */
/* Use JS-free approach: override link text to match target nav labels */
/* About → Services (scrolls to #services), Services → Process (scrolls to #how) */
body.home header .wp-block-navigation-item:nth-child(1) a .wp-block-navigation-item__label {
  font-size: 0 !important;
  line-height: 0 !important;
}
body.home header .wp-block-navigation-item:nth-child(1) a::after {
  content: "Services" !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}
body.home header .wp-block-navigation-item:nth-child(2) a .wp-block-navigation-item__label {
  font-size: 0 !important;
  line-height: 0 !important;
}
body.home header .wp-block-navigation-item:nth-child(2) a::after {
  content: "Process" !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 900px) {
  /* Stack two-column grid sections */
  body.home .entry-content section [style*="grid-template-columns: 1fr 1fr"],
  body.home .entry-content section [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  
  /* Service cards single column on small screens */
  body.home .entry-content section [style*="minmax(340px"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Process cards 2-col on tablet, 1-col on phone */
  body.home .entry-content section [style*="minmax(260px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* Why Snakebite features single column */
  body.home .entry-content section [style*="minmax(360px"] {
    grid-template-columns: 1fr !important;
  }

  /* Reduce hero padding */
  body.home .entry-content section[style*="padding:120px"] {
    padding: 80px 20px !important;
  }
  
  /* Reduce section paddings */
  body.home .entry-content section[style*="padding:80px"] {
    padding: 60px 16px !important;
  }
  
  /* Scale down hero headline */
  body.home .entry-content section h1 {
    font-size: clamp(32px, 7vw, 56px) !important;
  }
  
  /* Scale section headings */
  body.home .entry-content section h2 {
    font-size: clamp(28px, 5vw, 48px) !important;
  }
}

@media (max-width: 600px) {
  /* Process cards single column on phone */
  body.home .entry-content section [style*="minmax(260px"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Stats bar stack vertically */
  body.home .entry-content section [style*="minmax(250px"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }
  
  /* Smaller CTA buttons */
  body.home .entry-content section a[style*="padding:16px 32px"],
  body.home .entry-content section a[style*="padding: 16px 32px"] {
    padding: 12px 24px !important;
    font-size: 14px !important;
  }
  
  /* Nav: hide text logo on mobile, just show hamburger */
  body.home header .wp-block-site-logo a::before,
  body.home header .wp-block-site-logo a::after {
    font-size: 14px !important;
  }
  
  /* Full-width fix for mobile */
  body.home .entry-content > * {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Terminal mockup scroll */
  body.home .entry-content [style*="font-family:'JetBrains Mono'"][style*="overflow"] {
    font-size: 11px !important;
    padding: 16px !important;
  }
}

/* === HEADER STICKY + BORDER === */
body.home header,
body.home .wp-block-template-part:first-child {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  background-color: rgba(10, 10, 10, 0.9) !important;
}
/* Offset for WP admin bar */
body.home.admin-bar header,
body.home.admin-bar .wp-block-template-part:first-child {
  top: 32px !important;
}
@media (max-width: 782px) {
  body.home.admin-bar header,
  body.home.admin-bar .wp-block-template-part:first-child {
    top: 46px !important;
  }
}

/* =============================================
   FIX: Inner page specificity overrides
   body:not(.home) a has specificity (0,1,2) which
   overrides nav/blog/footer link rules at (0,1,1).
   Prefix those rules with body:not(.home) to match.
   ============================================= */

/* Nav links: muted gray, not red */
body:not(.home) .wp-block-navigation-item a,
body:not(.home) .wp-block-navigation a,
body:not(.home) header nav a {
    color: var(--sb-muted) !important;
}
body:not(.home) .wp-block-navigation-item a:hover,
body:not(.home) .wp-block-navigation a:hover,
body:not(.home) header nav a:hover {
    color: var(--sb-text) !important;
}

/* Blog post titles: light text, not red */
body:not(.home) .wp-block-post-title a {
    color: var(--sb-text) !important;
}
body:not(.home) .wp-block-post-title a:hover {
    color: var(--sb-red) !important;
}

/* Footer links: muted, not red */
body:not(.home) footer a,
body:not(.home) footer .wp-block-navigation-item a {
    color: var(--sb-muted) !important;
}
body:not(.home) footer a:hover {
    color: var(--sb-text) !important;
}

/* FIX: Classic theme blog selectors (entry-title, entry-meta, etc.) */
body:not(.home) .entry-title a {
    color: var(--sb-text) !important;
}
body:not(.home) .entry-title a:hover {
    color: var(--sb-red) !important;
}
body:not(.home) .entry-meta a,
body:not(.home) .byline a,
body:not(.home) .author.vcard a {
    color: var(--sb-dim) !important;
}
body:not(.home) .entry-meta a:hover,
body:not(.home) .byline a:hover {
    color: var(--sb-text) !important;
}

/* =============================================
   SLIM HEADER — reduce vertical padding
   ============================================= */
header .wp-block-group,
header .wp-block-columns,
header .wp-block-template-part > .wp-block-group {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
}

/* Tighten the row containing logo + nav */
header .wp-block-group.is-layout-flex,
header .wp-block-columns.is-layout-flex {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    gap: 16px !important;
    align-items: center !important;
}

/* Remove any extra spacing from inner containers */
header .wp-block-group .wp-block-group,
header .wp-block-group .wp-block-row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Keep logo compact */
header .wp-block-site-logo img {
    max-height: 85px !important;
    width: auto !important;
}

/* Tighten hero section — remove dead space below nav */
body.home .wp-block-cover,
body.home .entry-content > .wp-block-cover:first-child,
body.home .entry-content > .wp-block-group:first-child {
    margin-top: 0 !important;
    padding-top: 60px !important;
}

/* Remove gap between header and hero */
body.home .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.home header + *,
body.home .wp-site-blocks > * + * {
    margin-top: 0 !important;
}

/* =============================================
   PROCESS CARDS — fix number overlay on text
   ============================================= */
#how div[style*="position:relative"] > div[style*="position:absolute"] {
    z-index: 0 !important;
    opacity: 0.15 !important;
}

#how div[style*="position:relative"] > h3,
#how div[style*="position:relative"] > p {
    position: relative !important;
    z-index: 1 !important;
}