/* ==========================================================================
   Apex Knit Solution — Hand-written extras
   Tailwind (compiled, assets/css/tailwind.css) handles utilities; this file
   covers what utilities can't: custom fonts, scrollbars, keyframes, and a
   few bespoke effects re-used across templates.
   ========================================================================== */

:root {
  --color-navy: #1C2B4A;
  --color-navy-dark: #131e35;
  --color-red: #C21F2C;
  --color-red-dark: #9c1822;
  --color-charcoal: #3B3D40;
  --color-steel: #8A8D91;
  --color-offwhite: #F7F8FA;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  color: var(--color-charcoal);
}

h1, h2, h3, h4, h5, h6,
.font-heading {
  font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
}

/* Skip link for keyboard/screen-reader users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--color-navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  left: 0;
}

/* Diagonal accent divider used between sections */
.section-divider {
  height: 4px;
  background: linear-gradient(90deg, var(--color-red) 0%, var(--color-red) 60px, var(--color-navy) 60px, var(--color-navy) 100%);
}

/* Hero background pattern */
.hero-pattern {
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.06) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(194,31,44,0.15) 0, transparent 45%);
}

/* Gear-tooth watermark, purely decorative */
.gear-watermark {
  background-image: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.035) 0deg 15deg, transparent 15deg 30deg);
  border-radius: 9999px;
}
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-slow { animation: spin-slow 40s linear infinite; }

/* Sticky header shadow state (toggled via JS) */
header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Mobile nav panel */
#mobile-nav {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
#mobile-nav.open {
  transform: translateX(0);
}
#mobile-nav-overlay,
#filter-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#mobile-nav-overlay.open,
#filter-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile product-filter drawer (products/taxonomy archive) */
#filter-panel {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
#filter-panel.open {
  transform: translateX(0);
}

/* Product / news image placeholder pattern (shown until a featured image is set) */
.img-placeholder {
  background-color: #EDEFF2;
  background-image:
    linear-gradient(135deg, #E4E7EB 25%, transparent 25%),
    linear-gradient(225deg, #E4E7EB 25%, transparent 25%),
    linear-gradient(45deg, #E4E7EB 25%, transparent 25%),
    linear-gradient(315deg, #E4E7EB 25%, transparent 25%);
  background-position: 10px 0, 10px 0, 0 0, 0 0;
  background-size: 20px 20px;
  background-repeat: repeat;
}

/* Fade/slide-up utility for scroll-reveal (toggled via JS + IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Custom scrollbar for spec tables / sidebars on small screens */
.thin-scroll::-webkit-scrollbar { height: 6px; width: 6px; }
.thin-scroll::-webkit-scrollbar-thumb { background: var(--color-steel); border-radius: 9999px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* WordPress core alignment/caption classes kept sane inside the_content() */
.wp-caption, .alignleft, .alignright, .aligncenter { max-width: 100%; }
.wp-caption-text { font-size: 0.8rem; color: var(--color-steel); margin-top: 0.25rem; }
