/* =========================================
   PIPE.CSS - Master Stylesheet (FINAL)
   ========================================= */

/* --- 1. DESIGN VARIABLES --- */

:root {
  --primary-dark: #0a1a2a;
  --primary-steel: #3a4b5c;
  --accent: #ff6b00;
  --accent-hover: #e65100;
  --bg-light: #f4f6f8;
  --white: #ffffff;
  --text-main: #333333;
  --text-light: #666666;
  --border-radius: 4px;
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
  --max-width: 1200px;
}

/* --- 2. RESET & BASE --- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 15px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- 3. COMPONENTS --- */

.btn-outline {
  display: inline-block;
  padding: 12px 30px;
  border: 2px solid var(--primary-dark);
  color: var(--primary-dark);
  font-weight: 700;
  text-transform: uppercase;
  font-family: 'Oswald', sans-serif;
  border-radius: var(--border-radius);
}

.btn-outline:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.tag, .spec-tag {
  display: inline-block;
  background: #eee;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-right: 5px;
  margin-bottom: 10px;
}

/* =========================================
   4. HEADER & MENU SYSTEM (FINAL FIX)
   ========================================= */

/* A. MAIN HEADER LAYOUT */

.header-inner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* B. LOGO & COMPANY NAME */

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 10px;
  z-index: 10;
}

.logo-img {
  height: 45px;
  width: auto;
  display: block;
}

.company-name {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  color: var(--primary-dark);
  line-height: 1;
  white-space: nowrap;
}

/* --- MOBILE SPECIFIC LOGO FIXES (< 992px) --- */

/* Force Logo to Absolute Center on Mobile */

@media (max-width: 991px) {
  .logo-link {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    justify-content: center;
  }
}

@media (max-width: 991px) {
  .company-name {
    font-size: 20px;
  }
}

@media (max-width: 991px) {
  .logo-img {
    height: 35px;
  }
}

.nav-links a {
  font-size: 15px;
  text-transform: uppercase;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent);
}

/* D. SEARCH & HAMBURGER ICONS */

.desktop-search-btn {
  border: none;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--accent);
  position: relative;
  z-index: 20;
}

#open-menu-btn {
  position: relative;
  z-index: 20;
}

/* E. MOBILE SIDEBAR (Slide Out Animation) */

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 9999;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.mobile-sidebar.active {
  transform: translateX(0);
}

/* Sidebar Header */

.sidebar-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

/* Dark Overlay */

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  display: none;
}

.menu-overlay.active {
  display: block;
}

/* =========================================
   5. HERO & HOME SECTIONS
   ========================================= */

/* Homepage Hero */

.home-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
  overflow: hidden;
  background-color: #0a1a2a;
}

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

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(10, 26, 42, 0.7), rgba(10, 26, 42, 0.4));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 850px;
  color: white;
}

/* Responsive Search Box (Home) */

.hero-search-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.hero-search-input {
  padding: 15px;
  border-radius: 4px;
  border: none;
  flex-grow: 1;
  font-size: 16px;
  color: #333;
}

.hero-search-btn {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .hero-search-container {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }
}

@media (max-width: 576px) {
  .hero-search-input {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .hero-search-btn {
    width: 100%;
    padding: 15px;
  }
}

/* --- 6. TRIAD & CARDS --- */

.triad-section {
  margin-top: -60px;
  padding-bottom: 60px;
  position: relative;
  z-index: 10;
}

.triad-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 0 20px;
}

.triad-card {
  background: var(--white);
  padding: 40px 30px;
  border-bottom: 4px solid var(--primary-steel);
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.triad-card:hover {
  transform: translateY(-5px);
  border-bottom-color: var(--accent);
}

.triad-icon {
  font-size: 40px;
  margin-bottom: 20px;
  color: var(--accent);
}

.card-link {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--primary-dark);
  border-bottom: 2px solid #ddd;
  padding-bottom: 2px;
}

/* --- 7. CONTENT & ADS --- */

.content-section {
  padding: 80px 20px;
  background-color: var(--white);
}

.section-header {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid #eee;
  padding-bottom: 20px;
}

.section-title h2 {
  font-size: 36px;
}

.section-title span {
  color: var(--accent);
}

/* Ads */

.ad-container {
  position: relative;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  overflow: hidden;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  max-width: 100%;
}

.ad-label {
  position: absolute;
  top: 0;
  left: 0;
  background: #e0e0e0;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  text-transform: uppercase;
  z-index: 10;
}

/* Supplier Section */

.supplier-highlight {
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 60px 20px;
  text-align: center;
}

.supplier-container {
  max-width: 800px;
  margin: 0 auto;
}

.supplier-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 30px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  transition: 0.3s;
}

.supplier-btn:hover {
  background: var(--accent);
  color: var(--white);
}

/* --- 8. FOOTER --- */

footer {
  background-color: #111;
  color: #777;
  padding: 80px 0 40px;
  font-size: 14px;
}

.copyright {
  text-align: center;
  border-top: 1px solid #222;
  padding-top: 30px;
  margin: 0 40px;
  color: #555;
  font-size: 13px;
}

/* --- 9. TECHNICAL PAGES --- */

.page-hero {
  background-color: #0a1a2a;
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.page-hero h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  margin-top: 20px;
  text-transform: uppercase;
  font-weight: 700;
}

.page-hero p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 18px;
  color: #ccc;
}

.hero-back-link {
  color: var(--accent);
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 14px;
}

.article-section-title {
  color: var(--primary-dark);
  font-family: 'Oswald', sans-serif;
  margin-top: 40px;
  margin-bottom: 20px;
  border-left: 5px solid var(--accent);
  padding-left: 15px;
}

.callout-box {
  border: 1px solid #dee2e6;
  background-color: #fdfdfd;
  padding: 1.5rem;
  border-radius: 4px;
  margin-top: 3rem;
}

.callout-box h5, .callout-box h4 {
  color: var(--accent);
  font-weight: bold;
}

/* --- 10. TABLES & CHARTS --- */

.table-spec {
  border: 1px solid #dee2e6;
  margin-bottom: 40px;
}

.table-spec th {
  background-color: #f8f9fa;
  width: 40%;
  font-weight: 700;
}

/* Sticky Charts */

.dim-table {
  min-width: 1800px;
}

.dim-table th, .dim-table td {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #dee2e6;
}

.dim-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #0a1a2a;
  color: white;
}

.dim-table th:nth-child(1), .dim-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 25;
  background-color: #fff;
  width: 60px;
}

.dim-table th:nth-child(2), .dim-table td:nth-child(2) {
  position: sticky;
  left: 60px;
  z-index: 25;
  background-color: #fff;
  width: 70px;
}

/* --- 11. BREADCRUMBS --- */

nav[aria-label="breadcrumb"] .breadcrumb {
  background-color: transparent !important;
  padding: 0;
  margin: 0;
}

nav[aria-label="breadcrumb"] .breadcrumb-item a {
  color: #ff6b00 !important;
  font-weight: 400 !important;
  text-decoration: none;
}

nav[aria-label="breadcrumb"] .breadcrumb-item a:hover {
  color: #0a1a2a !important;
  text-decoration: underline;
}

nav[aria-label="breadcrumb"] .breadcrumb-item.active {
  color: #999999 !important;
  font-weight: 400 !important;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #cccccc !important;
}

/* --- 12. CATEGORY LINKS --- */

.product-link-item {
  display: block;
  padding: 15px;
  background: #f8f9fa;
  border-left: 4px solid var(--primary-dark);
  text-decoration: none;
  color: #333;
  font-weight: 600;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.product-link-item:hover {
  background: white;
  border-left-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding-left: 20px;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
}

.border-dashed {
  border: 2px dashed #ccc !important;
}

/* =========================================
   13. MOBILE TEXT SIZING (The Fix)
   ========================================= */

/* Shrink the big headings on phones */

@media (max-width: 768px) {
  h1, .page-hero h1 {
    font-size: 32px !important;
    line-height: 1.3;
    word-wrap: break-word;
  }
}

/* Shrink the secondary headings */

@media (max-width: 768px) {
  h2, .section-title h2 {
    font-size: 26px !important;
  }
}

/* Ensure the container has breathing room */

@media (max-width: 768px) {
  .page-hero {
    padding: 40px 15px;
  }
}

/* =========================================
   13. GLOBAL HERO TYPOGRAPHY (Responsive Fix)
   ========================================= */

.hero-title {
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  color: white;
  text-align: center;
  width: 100%;
}

/* Mobile Adjustments for Phones */

@media (max-width: 768px) {
  .hero-title {
    font-size: 32px !important;
    line-height: 1.3 !important;
    word-wrap: break-word;
  }
}

/* =========================================
   13. RESPONSIVE HERO TITLE (The "Manufacturers" Fix)
   ========================================= */

.hero-title-responsive {
  color: white;
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  text-align: center;
  width: 100%;
}

/* Mobile: Force long words to break */

@media (max-width: 768px) {
  .hero-title-responsive {
    font-size: 28px !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
  }
}

/* =========================================
   LIBRARY CARD STYLES
   ========================================= */

.library-card .tech-article {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.library-card:hover .tech-article {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  border-color: #ff6b00;
}

.article-img {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
}

.article-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-body .tag {
  font-size: 11px;
  text-transform: uppercase;
  color: #ff6b00;
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
}

.article-body h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  margin-bottom: 10px;
  color: #0a1a2a;
}

.article-body p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-body .card-link {
  font-weight: bold;
  text-decoration: none;
  color: #0a1a2a;
  font-size: 14px;
  text-transform: uppercase;
  border-bottom: 2px solid #eee;
  align-self: flex-start;
  transition: 0.2s;
}

.library-card:hover .article-body .card-link {
  border-bottom-color: #ff6b00;
  color: #ff6b00;
}

/* =========================================
   LIBRARY CARD STYLES
   ========================================= */

.library-card .tech-article {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.library-card:hover .tech-article {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  border-color: #ff6b00;
}

.article-img {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
}

.article-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-body .tag {
  font-size: 11px;
  text-transform: uppercase;
  color: #ff6b00;
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
}

.article-body h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  margin-bottom: 10px;
  color: #0a1a2a;
}

.article-body p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-body .card-link {
  font-weight: bold;
  text-decoration: none;
  color: #0a1a2a;
  font-size: 14px;
  text-transform: uppercase;
  border-bottom: 2px solid #eee;
  align-self: flex-start;
  transition: 0.2s;
}

.library-card:hover .article-body .card-link {
  border-bottom-color: #ff6b00;
  color: #ff6b00;
}

/* =========================================
   MOBILE SPACING FIX (AGGRESSIVE)
   ========================================= */

/* 1. Crush the gap on the Divider Line */

@media (max-width: 768px) {
  body hr, body .my-5, body .mb-5 {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }
}

/* 2. Remove the top margin on the "Need Processing" Title */

@media (max-width: 768px) {
  body .article-section-title {
    margin-top: 0px !important;
    margin-bottom: 10px !important;
  }
}

/* 3. Shrink the padding inside the gray box */

@media (max-width: 768px) {
  body .p-4, body .p-5 {
    padding: 15px !important;
  }
}

/* 4. Tighten the gap between Grid columns */

@media (max-width: 768px) {
  .row.g-3, .row.g-4 {
    --bs-gutter-y: 10px !important;
  }
}

/* Force Logo Margin ONLY on Mobile Devices */

@media (max-width: 991px) {
  .logo-link {
    margin-left: 7px !important;
  }
}

/* Prevent horizontal scrolling and right-side gaps on mobile */

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Force all images to be responsive so they never break the screen width */

img {
  max-width: 100%;
  height: auto;
}

/* 14. FOOTER MOBILE GLITCH FIX */

footer.mt-auto {
  border: none !important;
  outline: none !important;
  box-shadow: -4px 0 0 #0a1a2a, 4px 0 0 #0a1a2a !important;
}

/* Cover up mobile sub-pixel white lines */

footer {
  box-shadow: -3px 0 0 #0a1a2a, 3px 0 0 #0a1a2a !important;
}

