/* ==========================================================================
   BTI AI-OS Programmatic Blog & Machinery Knowledge Base Styles
   Optimized for High Readability, Search Engines, Mobile & Technical Data
   ========================================================================== */

:root {
  --bti-navy: #0b192c;
  --bti-navy-light: #1e3e62;
  --bti-blue: #008be3;
  --bti-blue-dark: #006eb8;
  --bti-amber: #ff6500;
  --bti-dark: #121820;
  --bti-gray-bg: #f8fafc;
  --bti-card-bg: #ffffff;
  --bti-border: #e2e8f0;
  --bti-text-main: #1e293b;
  --bti-text-muted: #64748b;
  --bti-text-light: #94a3b8;
  --bti-green: #10b981;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.12);
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.blog-article-page {
  font-family: var(--font-body);
  background-color: var(--bti-gray-bg);
  color: var(--bti-text-main);
  line-height: 1.7;
  margin: 0;
  padding: 0;
}

/* Breadcrumb Bar */
.blog-breadcrumb-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--bti-border);
  padding: 12px 0;
  font-size: 0.88rem;
  color: var(--bti-text-muted);
}
.blog-breadcrumb-bar a {
  color: var(--bti-blue);
  text-decoration: none;
  transition: color 0.2s;
}
.blog-breadcrumb-bar a:hover {
  color: var(--bti-blue-dark);
  text-decoration: underline;
}
.blog-breadcrumb-bar .sep {
  margin: 0 8px;
  color: var(--bti-text-light);
}

/* Article Hero Header */
.article-hero {
  background: linear-gradient(135deg, #0b192c 0%, #1e3e62 100%);
  color: #ffffff;
  padding: 48px 0 40px;
  position: relative;
  overflow: hidden;
}
.article-hero::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 80% 20%, rgba(0, 139, 227, 0.15), transparent 60%);
  pointer-events: none;
}
.article-hero .badge-category {
  display: inline-block;
  background: rgba(0, 139, 227, 0.2);
  border: 1px solid rgba(0, 139, 227, 0.4);
  color: #38bdf8;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.article-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 16px;
  max-width: 950px;
}
.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  color: #94a3b8;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Layout Grid */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  margin-top: 36px;
  margin-bottom: 60px;
}
@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

/* Main Article Content Container */
.article-main-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bti-border);
}
@media (max-width: 640px) {
  .article-main-card {
    padding: 24px;
  }
  .article-hero h1 {
    font-size: 1.65rem;
  }
}

/* Quick Specs Card */
.quick-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0 32px;
  border-left: 4px solid var(--bti-blue);
}
.quick-spec-item {
  display: flex;
  flex-direction: column;
}
.quick-spec-item .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--bti-text-muted);
  letter-spacing: 0.5px;
}
.quick-spec-item .value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--bti-navy);
  margin-top: 4px;
}

/* Table of Contents */
.toc-box {
  background: #f8fafc;
  border: 1px solid var(--bti-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc-box h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--bti-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
@media (max-width: 640px) {
  .toc-list {
    grid-template-columns: 1fr;
  }
}
.toc-list li a {
  color: var(--bti-navy-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: inline-block;
}
.toc-list li a:hover {
  color: var(--bti-blue);
  text-decoration: underline;
}

/* Article Typography */
.article-main-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bti-navy);
  margin-top: 44px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
  scroll-margin-top: 90px;
}
.article-main-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bti-navy-light);
  margin-top: 28px;
  margin-bottom: 12px;
  scroll-margin-top: 90px;
}
.article-main-card p {
  margin-bottom: 18px;
  font-size: 1rem;
  color: #334155;
}
.article-main-card ul, .article-main-card ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: #334155;
}
.article-main-card li {
  margin-bottom: 8px;
}

/* Equipment Featured Image */
.article-featured-image {
  margin: 24px 0 32px;
  text-align: center;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--bti-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.article-featured-image img {
  max-width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.article-featured-image .caption {
  padding: 10px 16px;
  background: #f8fafc;
  font-size: 0.85rem;
  color: var(--bti-text-muted);
  border-top: 1px solid var(--bti-border);
}

/* Data & Specs Table */
.specs-table-wrapper {
  overflow-x: auto;
  margin: 24px 0 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bti-border);
}
.specs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}
.specs-table th {
  background: var(--bti-navy);
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 600;
  font-family: var(--font-heading);
}
.specs-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--bti-border);
  color: #334155;
}
.specs-table tr:nth-child(even) {
  background: #f8fafc;
}
.specs-table tr:hover {
  background: #f1f5f9;
}
.specs-table td.spec-name {
  font-weight: 600;
  color: var(--bti-navy);
  width: 35%;
}

/* High-Impact Engineering Callout Box */
.engineering-callout {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-left: 5px solid var(--bti-green);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0;
  color: #14532d;
}
.engineering-callout h4 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: #14532d;
}
.engineering-callout p {
  margin: 0;
  color: #166534;
  font-size: 0.95rem;
}

/* FAQ Section Styling */
.faq-accordion {
  margin: 28px 0;
}
.faq-item {
  border: 1px solid var(--bti-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.faq-item:hover {
  box-shadow: var(--shadow-sm);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: none;
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bti-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.faq-question .icon {
  font-size: 1.2rem;
  transition: transform 0.2s;
}
.faq-item.active .faq-question .icon {
  transform: rotate(45deg);
}
.faq-answer {
  padding: 0 20px 16px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Sticky Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-sticky-card {
  position: sticky;
  top: 90px;
}
.sidebar-widget {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bti-border);
  margin-bottom: 24px;
}
.sidebar-widget h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--bti-navy);
}

/* Indent & RFQ Action Card */
.rfq-action-card {
  background: linear-gradient(135deg, #0b192c 0%, #1e3e62 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
}
.rfq-action-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 0 0 10px;
  color: #ffffff;
}
.rfq-action-card p {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.btn-rfq-primary {
  display: block;
  width: 100%;
  background: var(--bti-amber);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 101, 0, 0.4);
  transition: transform 0.2s, background 0.2s;
  box-sizing: border-box;
  margin-bottom: 12px;
}
.btn-rfq-primary:hover {
  background: #e65a00;
  transform: translateY(-2px);
}
.btn-whatsapp-direct {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  transition: transform 0.2s, background 0.2s;
  box-sizing: border-box;
}
.btn-whatsapp-direct:hover {
  background: #20ba5a;
  transform: translateY(-2px);
}

/* Related Equipment Grid */
.related-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.related-item-card {
  background: #ffffff;
  border: 1px solid var(--bti-border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.related-item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--bti-blue);
}
.related-item-card h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin: 0 0 8px;
  color: var(--bti-navy);
}
.related-item-card p {
  font-size: 0.82rem;
  color: var(--bti-text-muted);
  margin-bottom: 12px;
  flex-grow: 1;
}
.related-item-card a {
  color: var(--bti-blue);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

/* Floating Consultation Chatbot */
.bti-article-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}
.chatbot-toggle-btn {
  background: linear-gradient(135deg, #0b192c 0%, #008be3 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  box-shadow: 0 8px 24px rgba(0, 139, 227, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.2s;
}
.chatbot-toggle-btn:hover {
  transform: translateY(-2px);
}
.chatbot-toggle-btn .pulse-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}
.chatbot-window {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--bti-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
}
.chatbot-window.hidden {
  display: none;
}
.chatbot-header {
  background: var(--bti-navy);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chatbot-header h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}
.chatbot-header .close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
}
.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.5;
}
.chat-bubble.bot {
  background: #ffffff;
  color: var(--bti-text-main);
  border: 1px solid var(--bti-border);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.chat-bubble.user {
  background: var(--bti-blue);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.chatbot-quick-chips {
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid var(--bti-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.76rem;
  color: var(--bti-navy);
  cursor: pointer;
  transition: background 0.2s;
}
.quick-chip-btn:hover {
  background: #e2e8f0;
}
.chatbot-input-area {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid var(--bti-border);
  display: flex;
  gap: 8px;
}
.chatbot-input-area input {
  flex: 1;
  border: 1px solid var(--bti-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
  outline: none;
}
.chatbot-input-area input:focus {
  border-color: var(--bti-blue);
}
.chatbot-input-area button {
  background: var(--bti-navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}
