/* =========================================
   XINHARNESS.COM - MAIN DESIGN SYSTEM CSS
   ========================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Color Palette */
  --color-bg-primary: #071228;
  --color-bg-secondary: #121c3f;
  --color-bg-card: #182158;
  --color-bg-surface: #1a2436;
  --color-bg-elevated: #232f52;
  
  --color-blue-600: #0066FF;
  --color-blue-500: #1a7fff;
  --color-blue-400: #3d94ff;
  --color-blue-300: #6db3ff;
  --color-blue-700: #0052cc;
  --color-blue-800: #003d99;
  
  --color-cyan-400: #00d4ff;
  --color-cyan-300: #33ddff;
  --color-cyan-500: #00b8e0;
  
  --color-text-primary: #ffffff;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-link: #3d94ff;
  
  --color-border: rgba(0, 102, 255, 0.2);
  --color-border-bright: rgba(0, 102, 255, 0.5);
  --color-border-subtle: rgba(255, 255, 255, 0.08);

  /* Light section palette — used to break up the all-dark layout */
  --color-bg-light: #ffffff;
  --color-bg-light-tint: #f0f5ff;
  --color-text-onlight-primary: #0b1330;
  --color-text-onlight-secondary: #48536b;
  --color-border-onlight: rgba(0, 82, 204, 0.15);

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0066FF 0%, #00d4ff 100%);
  --gradient-dark: linear-gradient(135deg, #071228 0%, #121c3f 100%);
  --gradient-card: linear-gradient(135deg, rgba(26,34,92,0.9) 0%, rgba(20,28,66,0.95) 100%);
  --gradient-hero: linear-gradient(135deg, rgba(7,18,40,0.9) 0%, rgba(0,35,90,0.83) 50%, rgba(0,100,190,0.68) 100%);
  --gradient-text: linear-gradient(135deg, #3d94ff 0%, #00d4ff 100%);
  --gradient-border: linear-gradient(135deg, rgba(0,102,255,0.6) 0%, rgba(0,212,255,0.6) 100%);
  
  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: 3.75rem;   /* 60px */
  --text-7xl: 4.5rem;    /* 72px */
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.6), 0 4px 10px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.7), 0 8px 20px rgba(0,0,0,0.5);
  --shadow-blue: 0 0 20px rgba(0,102,255,0.3), 0 0 40px rgba(0,102,255,0.1);
  --shadow-blue-lg: 0 0 40px rgba(0,102,255,0.4), 0 0 80px rgba(0,102,255,0.2);
  --shadow-cyan: 0 0 20px rgba(0,212,255,0.3);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-index layers */
  --z-base: 1;
  --z-elevated: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-overlay: 400;
  --z-toast: 500;
  
  /* Container widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;
  --container-padding: 1.5rem;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-cyan-400);
}

ul, ol {
  list-style: none;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-blue-700);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-blue-600);
}

/* --- Text Selection --- */
::selection {
  background-color: rgba(0, 102, 255, 0.4);
  color: #ffffff;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 3.5vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 2.5vw, var(--text-3xl)); }
h4 { font-size: clamp(var(--text-xl), 2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

em {
  font-style: italic;
}

blockquote {
  border-left: 3px solid var(--color-blue-600);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  background: rgba(0,102,255,0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

blockquote p {
  color: var(--color-text-primary);
  font-size: var(--text-lg);
  font-style: italic;
}

code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: rgba(0,102,255,0.1);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-cyan-400);
}

pre {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow-x: auto;
  margin: var(--space-6) 0;
}

pre code {
  background: none;
  padding: 0;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container--lg {
  max-width: var(--container-2xl);
}

.container--md {
  max-width: var(--container-lg);
}

.container--sm {
  max-width: var(--container-md);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Two-column "media + content" / "content + content" split sections used
   across About/Home/Industry/Quality templates. These used to be raw
   inline `grid-template-columns:1fr 1fr`, which — because inline style
   specificity always beats an external stylesheet, media query or not —
   could never be collapsed responsively. Collapses at the same 1024px
   breakpoint as the other major split layouts (.contact-grid,
   .article-layout, .product-single-layout, etc.) so it never stays
   cramped on tablets/phones. */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --- Spacing Utilities --- */
.section {
  padding: var(--space-20) 0;
}

.section--sm {
  padding: var(--space-12) 0;
}

.section--lg {
  padding: var(--space-32) 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-16);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-cyan-400);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}

/* --- Light Section Variant ────────────────────────────────────────────
   Applied to alternate homepage sections so the page reads as a mix of
   light and dark bands instead of one long dark surface. Cards inside
   (.feature-card, .product-cat-card, .blog-card, etc.) keep their own
   dark glass background, so they read as elevated panels on a light page.
   ─────────────────────────────────────────────────────────────────────── */
.section--light {
  background: var(--color-bg-light);
}

.section--light.section--tint {
  background: var(--color-bg-light-tint);
}

.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4 {
  color: var(--color-text-onlight-primary);
}

.section--light p,
.section--light .section-subtitle {
  color: var(--color-text-onlight-secondary);
}

/* Self-contained dark "glass" cards keep their own dark background inside
   .section--light sections (see note above), so their text must stay
   light regardless of the light-section color overrides above.
   NOTE: .product-cat-card, .blog-card, .sidebar-widget and .author-bio were
   removed from this exemption list — they now use a light/white background
   of their own (see components.css / pages.css), so their headings and
   paragraphs should follow the normal .section--light onlight-* colors. */
.section--light .feature-card h3,
.section--light .feature-card h4,
.section--light .inquiry-widget h3,
.section--light .inquiry-widget h4,
.section--light .comment-item h3,
.section--light .comment-item h4 {
  color: var(--color-text-primary);
}

.section--light .feature-card p,
.section--light .inquiry-widget p,
.section--light .comment-item p {
  color: var(--color-text-secondary);
}

.section--light .section-label {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.25);
  color: var(--color-blue-600);
}

.section--light .btn--filter {
  color: var(--color-text-onlight-secondary);
  background: rgba(0, 82, 204, 0.05);
  border-color: var(--color-border-onlight);
}

.section--light .btn--filter:hover {
  color: var(--color-blue-600);
  border-color: var(--color-border-bright);
  background: rgba(0, 102, 255, 0.08);
}

/* --- Text Gradient Utility --- */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Visibility Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Scroll Animation Classes --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

.animate-left {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-left.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-right {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-right.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* --- Back To Top Button --- */
#back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: var(--z-elevated);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  box-shadow: var(--shadow-blue);
  border: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue-lg);
}

/* --- Breadcrumbs --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-blue-400);
}

.breadcrumb-separator {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.breadcrumb-current {
  color: var(--color-blue-400);
}

/* --- Dividers --- */
.divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: var(--space-8) 0;
}

.divider--gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-blue-600), var(--color-cyan-400), var(--color-blue-600), transparent);
}

/* --- Page Hero Base --- */
.page-hero {
  padding: calc(100px + var(--space-16)) 0 var(--space-16);
  background: var(--gradient-dark);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0,102,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(0,212,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  margin-bottom: var(--space-4);
}

.page-hero p {
  font-size: var(--text-lg);
  max-width: 600px;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }
  
  .section {
    padding: var(--space-12) 0;
  }
  
  .section--lg {
    padding: var(--space-20) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-10);
  }
  
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }

  .page-hero {
    padding: calc(80px + var(--space-10)) 0 var(--space-10);
  }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

/* ── WordPress default style overrides ──────────────────────────────────
   Force dark background across all WP-generated wrappers so our dark
   theme is never overridden by Gutenberg or Classic editor defaults.
   ─────────────────────────────────────────────────────────────────────── */
html,
body,
.wp-site-blocks,
.site,
.site-main,
.entry-content,
.post-content {
  background-color: var(--color-bg-primary) !important;
  color: var(--color-text-primary);
}

/* WordPress block editor resets */
.wp-block-group,
.wp-block-cover,
.wp-block-columns {
  color: var(--color-text-primary);
}

/* Remove WordPress default blue link colour from nav */
.main-nav a,
.mobile-nav a,
.footer-links a {
  color: inherit;
}

/* Gutenberg image alignment helpers */
.alignleft  { float: left;  margin: 0 var(--space-6) var(--space-4) 0; }
.alignright { float: right; margin: 0 0 var(--space-4) var(--space-6); }
.aligncenter { display: block; margin: 0 auto var(--space-4); }
.alignfull  { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }

