/**
 * Viewix Factory - Main Stylesheet
 * Responsive layout, components, typography & visual polish.
 */

:root {
  --vx-header-height: 80px;
  /* One shell for the header, section headings, cards and footer. */
  --vx-container-width: 1416px;
  --vx-container-gutter: 32px;
  --vx-container-wide: 1440px;
}

/* Container Utilities */
.vx-container {
  width: 100%;
  max-width: var(--vx-container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--vx-container-gutter);
  padding-right: var(--vx-container-gutter);
}

.vx-container-wide {
  width: 100%;
  max-width: var(--vx-container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.vx-container-narrow {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Section Spacing */
.vx-section {
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative;
}

.vx-section-sm {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.vx-section-lg {
  padding-top: 6.5rem;
  padding-bottom: 6.5rem;
}

/* Backgrounds */
.vx-bg-white {
  background-color: #ffffff;
}

.vx-bg-surface {
  background-color: var(--vx-color-surface);
}

.vx-bg-subtle {
  background-color: var(--vx-color-surface-subtle);
}

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

.vx-bg-dark {
  background-color: var(--vx-color-dark);
  color: #ffffff;
}

.vx-bg-dark-alt {
  background-color: var(--vx-color-dark-alt);
  color: #ffffff;
}

/* Typography Enhancements */
.vx-eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vx-color-primary);
  margin-bottom: 0.75rem;
}

.vx-eyebrow-light {
  color: var(--vx-color-accent);
}

.vx-heading-display {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.vx-heading-section {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-top: 0;
  margin-bottom: 1rem;
}

.vx-subheading {
  font-size: 1.125rem;
  color: var(--vx-color-text-muted);
  line-height: 1.6;
  max-width: 680px;
  margin-top: 0;
  margin-bottom: 2rem;
}

.vx-bg-dark .vx-subheading {
  color: #a0aec0;
}

/* Buttons & CTAs */
.vx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.8125rem 1.75rem;
  border-radius: var(--vx-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--vx-transition);
  text-align: center;
  white-space: nowrap;
}

.vx-btn-primary {
  background-color: var(--vx-color-primary);
  color: #ffffff;
  border-color: var(--vx-color-primary);
  box-shadow: 0 4px 14px rgba(0, 74, 198, 0.25);
}

.vx-btn-primary:hover {
  background-color: var(--vx-color-primary-hover);
  border-color: var(--vx-color-primary-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 74, 198, 0.35);
}

.vx-btn-secondary {
  background-color: transparent;
  color: var(--vx-color-primary);
  border-color: var(--vx-color-primary);
}

.vx-btn-secondary:hover {
  background-color: var(--vx-color-tint);
  color: var(--vx-color-primary-hover);
}

.vx-btn-white {
  background-color: #ffffff;
  color: var(--vx-color-dark);
  border-color: #ffffff;
}

.vx-btn-white:hover {
  background-color: var(--vx-color-tint);
  color: var(--vx-color-primary);
}

.vx-btn-outline-white {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.vx-btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

/* Cards & Grid Utilities */
.vx-card {
  background: #ffffff;
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-lg);
  padding: 2rem;
  transition: var(--vx-transition);
  display: flex;
  flex-direction: column;
}

.vx-card:hover {
  border-color: #b0c4de;
  box-shadow: var(--vx-shadow-hover);
  transform: translateY(-4px);
}

.vx-card-dark {
  background: var(--vx-color-dark-card);
  border: 1px solid var(--vx-color-border-dark);
  color: #ffffff;
}

.vx-card-dark:hover {
  border-color: var(--vx-color-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Metrics & Stats Grid */
.vx-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.vx-stat-item {
  border-left: 2px solid var(--vx-color-primary);
  padding-left: 1.25rem;
}

.vx-stat-number {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  color: var(--vx-color-primary);
  margin-bottom: 0.5rem;
}

.vx-bg-dark .vx-stat-number {
  color: var(--vx-color-accent);
}

.vx-stat-label {
  font-size: 0.875rem;
  color: var(--vx-color-text-muted);
  line-height: 1.4;
}

.vx-bg-dark .vx-stat-label {
  color: #cbd5e0;
}

/* Badges & Tags */
.vx-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--vx-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vx-badge-blue {
  background: var(--vx-color-tint);
  color: var(--vx-color-primary);
}

.vx-badge-dark {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Hero Section Styles */
.vx-hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--vx-color-dark);
}

.vx-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  z-index: 1;
}

.vx-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(11, 16, 21, 0.96) 0%, rgba(11, 16, 21, 0.82) 50%, rgba(11, 16, 21, 0.4) 100%);
  z-index: 2;
}

.vx-hero-content {
  position: relative;
  z-index: 3;
  color: #ffffff;
  padding: 4rem 0 8rem;
}

/* Manufacturing Steps Grid (6 steps) */
.vx-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.vx-step-card {
  background: #ffffff;
  border-radius: var(--vx-radius-lg);
  overflow: hidden;
  border: 1px solid var(--vx-color-border);
  transition: var(--vx-transition);
}

.vx-step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--vx-shadow-hover);
}

.vx-step-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.vx-step-body {
  padding: 1.5rem;
}

.vx-step-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--vx-color-primary);
  margin-bottom: 0.5rem;
}

.vx-step-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--vx-color-dark);
}

.vx-step-desc {
  font-size: 0.875rem;
  color: var(--vx-color-text-muted);
  line-height: 1.5;
}

/* Product Archive Filter Bar & Grid */
.vx-products-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--vx-color-border);
}

.vx-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.vx-filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 0;`r`n  border: 1px solid var(--vx-color-border);
  background: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--vx-color-text-main);
  cursor: pointer;
  transition: var(--vx-transition);
}

.vx-filter-btn:hover, .vx-filter-btn.active {
  background: var(--vx-color-primary);
  border-color: var(--vx-color-primary);
  color: #ffffff;
}

.vx-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.vx-product-card {
  background: #ffffff;
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--vx-transition);
}

.vx-product-card:hover {
  transform: translateY(-4px);
  border-color: #b0c4de;
  box-shadow: var(--vx-shadow-hover);
}

.vx-product-card-img-wrap {
  position: relative;
  background: var(--vx-color-surface);
  border-radius: var(--vx-radius-md);
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  margin-bottom: 1.5rem;
}

.vx-product-card-media-link {
  display: block;
  color: inherit;
  position: relative;
  z-index: 2;
}

.vx-product-card-media-link:hover,
.vx-product-card-media-link:focus-visible {
  color: inherit;
}

.vx-product-card-img {
  max-height: 220px;
  width: auto;
  object-fit: contain;
}

.vx-product-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--vx-color-dark);
}

.vx-product-card-title-link {
  display: block;
  position: static;
}

/* Extend the product title link across the card while keeping the explicit
 * action buttons and media link above it in the stacking order. */
.vx-product-card-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.vx-product-card-title-link:hover .vx-product-card-title,
.vx-product-card-title-link:focus-visible .vx-product-card-title {
  color: var(--vx-color-primary);
}

.vx-product-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.vx-spec-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  background: var(--vx-color-surface-subtle);
  color: var(--vx-color-text-main);
  border-radius: var(--vx-radius-sm);
}

.vx-product-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  position: relative;
  z-index: 3;
}

.vx-product-card-actions .vx-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

.vx-product-highlights-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.vx-product-related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Blog & Article Styles */
.vx-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.vx-blog-card {
  background: #ffffff;
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--vx-transition);
}

.vx-blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--vx-shadow-hover);
}

.vx-blog-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.vx-blog-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vx-blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--vx-color-text-muted);
  margin-bottom: 0.75rem;
}

.vx-blog-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 0.75rem 0;
  color: var(--vx-color-dark);
}

.vx-blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--vx-color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vx-blog-card-link {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--vx-color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Article Detail Content & TOC */
.vx-article-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
  position: relative;
}

.vx-article-sidebar {
  position: sticky;
  top: calc(var(--vx-header-height) + 2rem);
  height: fit-content;
}

.vx-toc-box {
  background: var(--vx-color-surface);
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-md);
  padding: 1.5rem;
}

.vx-toc-title {
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vx-color-dark);
  margin: 0 0 1rem 0;
}

.vx-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.vx-toc-link {
  font-size: 0.875rem;
  color: var(--vx-color-text-muted);
  line-height: 1.4;
  display: block;
}

.vx-toc-link:hover, .vx-toc-link.active {
  color: var(--vx-color-primary);
  font-weight: 600;
}

.vx-article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #2d3748;
}

.vx-article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--vx-color-dark);
}

.vx-article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--vx-color-dark);
}

.vx-quote-box {
  border-left: 4px solid var(--vx-color-primary);
  background: var(--vx-color-tint);
  padding: 1.5rem 2rem;
  border-radius: 0 var(--vx-radius-md) var(--vx-radius-md) 0;
  margin: 2.5rem 0;
  font-style: italic;
  font-size: 1.125rem;
  color: var(--vx-color-dark);
}

.vx-takeaways-box {
  background: var(--vx-color-surface);
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-lg);
  padding: 2rem;
  margin: 3rem 0;
}

/* Catalogue / Resources Grid */
.vx-catalogue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.vx-resource-card {
  background: #ffffff;
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: var(--vx-transition);
}

.vx-resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--vx-shadow-hover);
  border-color: #b0c4de;
}

.vx-resource-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--vx-radius-md);
  background: var(--vx-color-tint);
  color: var(--vx-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .vx-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vx-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vx-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vx-product-highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .vx-product-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .vx-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vx-catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vx-article-layout {
    grid-template-columns: 1fr;
  }
  .vx-article-sidebar {
    position: static;
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 768px) {
  .vx-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .vx-stats-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .vx-steps-grid {
    grid-template-columns: 1fr;
  }
  .vx-products-grid {
    grid-template-columns: 1fr;
  }
  .vx-product-highlights-grid,
  .vx-product-related-grid {
    grid-template-columns: 1fr !important;
  }
  .vx-blog-grid {
    grid-template-columns: 1fr;
  }
  .vx-catalogue-grid {
    grid-template-columns: 1fr;
  }
  .vx-products-filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile 390px Acceptance Optimization */
@media (max-width: 480px) {
  .vx-container, .vx-container-wide, .vx-container-narrow {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .vx-heading-display {
    font-size: 2.25rem;
  }
  .vx-heading-section {
    font-size: 1.65rem;
  }
  .vx-btn {
    width: 100%;
  }
  .vx-product-card-actions {
    flex-direction: column;
  }
}

/* The page-specific designs use a 20px mobile gutter. Match the shared
 * containers so headings, footer columns and form content share the same
 * left and right edges on compact screens too. */
@media (max-width: 760px) {
  .vx-container, .vx-container-wide, .vx-container-narrow {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Products page Figma alignment */
.archive.post-type-archive-product .vx-section { padding-top: 60px; padding-bottom: 60px; }
.archive.post-type-archive-product .vx-products-filter-bar { margin-bottom: 32px; }
.archive.post-type-archive-product .vx-filter-tabs { gap: 8px; }
