/* ========================================================== */
/* INSIGHT SINGLE PAGE: EDITORIAL FLOW & DATA GRIDS           */
/* ========================================================== */

.ab-insight-article { position: relative; width: 100%; z-index: 2; }

/* 0. GLOBAL PAGE BACKGROUND */
body {
  background-color: #020308;
  /* Global Tech Grid from About Page */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  background-attachment: fixed; 
}

/* 1. HERO SECTION */
.ab-insight-hero-split {
  position: relative;
  background: transparent;
  padding: 120px 0 80px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 80px;
  z-index: 2;
}

/* Fixed Background Graphic */
.ab-hero-bg-graphic {
  position: fixed; 
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0; 
  pointer-events: none;
  opacity: 0.4; 
}

.ab-hero-bg-graphic svg {
  width: 100%;
  height: 100%;
  display: block; 
}

.ab-insight-hero-split .ab-page-inner {
  max-width: 1760px; 
  width: 100%;
  padding: 0 40px;
  margin: 0 auto;
  position: relative;
  z-index: 5; 
}

.ab-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); 
  gap: 72px; 
  align-items: center;
  position: relative;
  z-index: 5; 
}

/* Left Column */
.ab-meta-row-left { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; font-family: monospace; font-size: 13px; letter-spacing: 0.1em; }

.ab-tech-tag {
  color: var(--ab-accent);
  background: rgba(27, 138, 255, 0.1);
  padding: 6px 12px;
  border-radius: 2px;
  border: none;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
}
.ab-tech-tag::before { content: none; }

.ab-tech-id-txt { color: var(--ab-text-subtle); opacity: 0.6; padding-left: 16px; border-left: none; }

.ab-hero-title-tech {
  font-size: clamp(44px, 5.2vw, 80px);
  line-height: 1.05;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 30px rgba(27, 138, 255, 0.2);
  margin-bottom: 32px;
  letter-spacing: -0.03em;
}

.ab-hero-sub-left { display: flex; align-items: center; gap: 16px; font-family: monospace; color: rgba(255,255,255,0.7); font-size: 14px; }
.ab-sep { color: var(--ab-accent); opacity: 0.5; }

/* Right Column: Visual */
.ab-hero-visual-right {
  display: flex;
  justify-content: flex-end;
}

.ab-tech-pane {
  position: relative;
  width: min(920px, 140%);
  aspect-ratio: 16 / 9; 
  background: #000;
  border: 1px solid rgba(27, 138, 255, 0.3); 
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(27, 138, 255, 0.1); 
  z-index: 5;
}

.ab-tech-pane img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  opacity: 0.7;
  transition: opacity 0.4s ease; 
  will-change: opacity;
}

.ab-insight-hero-split:hover .ab-tech-pane img { filter: grayscale(0%) contrast(1.1); opacity: 1; }

.ab-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 2px, rgba(0, 0, 0, 0.3) 3px, rgba(0, 0, 0, 0.3) 4px);
  pointer-events: none;
  z-index: 2;
  opacity: 0.5;
}

.ab-corner-tl, .ab-corner-tr, .ab-corner-bl, .ab-corner-br {
  position: absolute; width: 12px; height: 12px; border-color: var(--ab-accent); z-index: 3;
}
.ab-corner-tl { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.ab-corner-tr { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; }
.ab-corner-bl { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; }
.ab-corner-br { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; }

/* 2. CONTENT GRID */
.ab-content-grid {
  display: block;
  max-width: 1400px;
  margin: 0 auto 100px;
  padding: 0 40px;
  position: relative;
  z-index: 5;
}

.ab-article-lead { 
  font-size: 24px; 
  line-height: 1.6; 
  color: #fff; 
  margin-bottom: 60px; 
  font-weight: 300; 
  max-width: 100%;
  padding-left: 0;
}

.ab-article-body { 
  font-size: 18px; 
  line-height: 1.8; 
  color: #b0b0b0; 
}

.ab-article-body h2 { 
  font-family: "Plus Jakarta Sans", sans-serif; 
  color: var(--ab-accent);
  font-size: 26px; 
  font-weight: 600;
  margin-top: 60px; 
  margin-bottom: 24px; 
  padding-bottom: 0; 
  border-bottom: none; 
  text-transform: none; 
  letter-spacing: -0.01em; 
}

.ab-article-body p { margin-bottom: 32px; max-width: 100%; }

/* CENTERED EDITORIAL QUOTES */
.ab-insight-quote {
  margin: 64px 0; 
  padding: 0 40px;
  border-left: none; 
  text-align: center; 
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
  font-style: italic;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto; 
  position: relative;
}

.ab-insight-quote::before {
  content: "“";
  display: block;
  position: static;
  margin: 0 auto 16px auto;
  font-family: serif;
  font-size: 60px;
  color: var(--ab-accent);
  opacity: 0.6;
  line-height: 1;
}

.ab-insight-quote::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--ab-accent);
  margin: 32px auto 0 auto;
  opacity: 0.3;
}

/* 3. SIDEBAR STYLES (Unused but kept safe) */
.ab-sidebar-sticky { position: sticky; top: 120px; }

.ab-glass-card { background: transparent; border: none; padding: 0; backdrop-filter: none; }

.ab-glass-header { 
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ab-accent); 
  font-size: 11px; 
  letter-spacing: 0.2em; 
  text-transform: uppercase; 
  margin-bottom: 32px; 
  font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.ab-glass-header::after { content: ""; height: 1px; flex-grow: 1; background: rgba(255,255,255,0.1); }

.ab-stat-row { display: grid; grid-template-columns: 100px 1fr; align-items: baseline; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.ab-stat-label { font-family: monospace; font-size: 11px; color: var(--ab-text-subtle); text-transform: uppercase; }
.ab-stat-val { font-family: monospace; font-size: 13px; color: #fff; font-weight: 400; text-align: right; }

/* 4. DATA TABLES */
.ab-table-responsive {
  overflow-x: auto;
  margin: 40px 0;
  border: 1px solid rgba(255, 255, 255, 0.2); 
  background: rgba(0, 0, 0, 0.2);
}

.ab-insight-table {
  width: 100%;
  border-collapse: collapse; 
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  color: #b0b0b0;
  min-width: 600px;
}

.ab-insight-table th,
.ab-insight-table td {
  padding: 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15); 
  line-height: 1.6;
  vertical-align: top;
}

.ab-insight-table th {
  text-align: left;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.ab-insight-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* 5. RELATED INSIGHTS */
.ab-related-header { 
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 16px; font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ab-accent); margin: 60px 0 40px; display: flex; align-items: center; gap: 16px; position: relative; z-index: 5;
}
.ab-section .ab-page-inner { max-width: 1600px; width: 100%; margin: 0 auto; padding: 0 40px; }
.ab-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; position: relative; z-index: 5; }

.ab-related-card { display: block; text-decoration: none; background: #080c14; border: 1px solid rgba(255,255,255,0.08); overflow: hidden; transition: border-color 0.2s ease; position: relative; }
.ab-related-card:hover { border-color: var(--ab-accent); }

.ab-related-visual { height: 240px; position: relative; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ab-related-visual img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: filter 0.3s ease; }
.ab-related-card:hover .ab-related-visual img { filter: grayscale(0%); }

.ab-card-tech-id { position: absolute; top: 12px; right: 12px; background: #000; border: 1px solid rgba(255,255,255,0.2); color: #fff; font-family: monospace; font-size: 10px; padding: 4px 8px; z-index: 5; letter-spacing: 0.1em; }
.ab-related-content { padding: 32px; display: flex; flex-direction: column; height: calc(100% - 240px); }

.ab-related-meta { display: inline-flex; align-items: center; font-family: monospace; font-size: 11px; font-weight: 700; color: var(--ab-accent); background: rgba(27, 138, 255, 0.1); padding: 4px 10px; border-radius: 2px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; align-self: flex-start; }

.ab-related-title { color: #fff; font-family: "Plus Jakarta Sans", sans-serif; font-size: 18px; font-weight: 500; line-height: 1.4; margin: 0 0 24px; flex-grow: 1; }
.ab-related-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: #fff; margin-top: auto; font-family: "Plus Jakarta Sans", sans-serif; }
.ab-related-cta { opacity: 0.7; transition: opacity 0.2s; text-transform: uppercase; letter-spacing: 0.05em; }
.ab-related-card:hover .ab-related-cta { opacity: 1; }
.ab-related-card:hover .ab-related-arrow { transform: translateX(4px); transition: transform 0.2s; color: var(--ab-accent); }

/* ========================================================== */
/* INTELLIGENCE TERMINAL BOX                                  */
/* ========================================================== */

.ab-intel-box {
  width: 100%;
  margin: 60px 0;
  font-family: monospace; 
  font-size: 16px; 
  position: relative;
  z-index: 5;
}

.ab-intel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.ab-intel-slashes { font-weight: 700; }
.ab-intel-type { letter-spacing: 0.2em; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.ab-intel-line { flex-grow: 1; height: 1px; background-color: rgba(255, 255, 255, 0.15); }

.ab-intel-body {
  position: relative;
  background-color: rgba(10, 10, 10, 0.95);
  padding: 40px; 
  border-left: 2px solid; 
  color: #d1d5db;
  line-height: 1.6;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.ab-intel-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.ab-cursor-blink {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: currentColor;
  vertical-align: middle;
  margin-left: 6px;
  animation: ab-blink 1s step-end infinite;
}

@keyframes ab-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* THEME COLORS */
.theme-danger   { color: #ef4444; border-color: #ef4444; }
.theme-warning  { color: #facc15; border-color: #facc15; }
.theme-positive { color: #10b981; border-color: #10b981; }
.theme-neutral  { color: #60a5fa; border-color: #60a5fa; }
.theme-bg-danger   { background-color: #ef4444; }
.theme-bg-warning  { background-color: #facc15; }
.theme-bg-positive { background-color: #10b981; }
.theme-bg-neutral  { background-color: #60a5fa; }

/* ========================================================== */
/* RESPONSIVE & MOBILE OPTIMIZATIONS                          */
/* ========================================================== */

@media (max-width: 1200px) {
  .ab-hero-grid { grid-template-columns: 1fr; gap: 60px; }
  .ab-hero-visual-right { justify-content: flex-start; }
  .ab-tech-pane { width: 100%; aspect-ratio: 16/9; order: -1; margin-bottom: 20px; }
  .ab-hero-title-tech { font-size: 48px; }
  .ab-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Layout & Padding */
  .ab-insight-hero-split { padding-top: 100px; padding-bottom: 40px; }
  
  /* Shared Mobile Padding */
  .ab-insight-hero-split .ab-page-inner, 
  .ab-content-grid, 
  .ab-section .ab-page-inner { 
    padding: 0 20px; 
  }
  
  /* Hero Typography */
  .ab-hero-title-tech { font-size: 32px; word-wrap: break-word; }
  .ab-hero-sub-left { flex-wrap: wrap; gap: 12px; }
  
  /* Article Content */
  .ab-article-lead { font-size: 20px; margin-bottom: 40px; }
  .ab-article-body { font-size: 16px; }
  .ab-insight-quote { font-size: 20px; padding: 0 10px; margin: 40px 0; }
  
  /* Terminal Box Mobile Adjustments */
  .ab-intel-box { margin: 40px 0; font-size: 14px; }
  .ab-intel-body { padding: 24px; }
  
  /* TABLE MOBILE OPTIMIZATION */
  /* Scroll wrapper */
  .ab-table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; 
    margin: 40px 0;
  }
  
  /* Flexible table width, respect content */
  .ab-insight-table {
    width: 100%;
    min-width: auto; 
  }

  /* Compact Cells & Sticky First Column */
  .ab-insight-table th, 
  .ab-insight-table td {
    padding: 8px 12px; /* REDUCED HEIGHT */
    font-size: 13px;
    white-space: normal; 
    word-wrap: break-word; 
    min-width: 140px; 
  }

  /* Sticky First Column */
  .ab-insight-table th:first-child,
  .ab-insight-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    border-right: 1px solid rgba(255,255,255,0.2); 
  }

  /* SOLID BACKGROUNDS FOR STICKY CELLS */
  .ab-insight-table th:first-child { background: #0d1119; }
  .ab-insight-table tr:nth-child(odd) td:first-child { background: #020308; }
  .ab-insight-table tr:nth-child(even) td:first-child { background: #0a0c11; }
  
  /* Related Grid: Horizontal Scroll */
  .ab-related-grid { 
    display: flex; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    gap: 16px; 
    padding-bottom: 24px; 
    margin-left: -20px; 
    margin-right: -20px; 
    padding-left: 20px; 
    padding-right: 20px;
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
  }
  .ab-related-grid::-webkit-scrollbar { display: none; }
  
  .ab-related-card { 
    flex: 0 0 85vw; 
    width: 85vw; 
    min-width: 85vw; 
    scroll-snap-align: center; 
    margin: 0; 
  }
  
  .ab-scroll-dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
  .ab-scroll-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); transition: background 0.3s ease, transform 0.3s ease; }
  .ab-scroll-dot.is-active { background: var(--ab-accent); transform: scale(1.5); }
}

@media (min-width: 769px) { .ab-scroll-dots { display: none; } }

/* ========================================================== */
/* [FIX] FOOTER ALIGNMENT (MATCHING RETAIL-PROMO EXACTLY)     */
/* ========================================================== */

/* 1. Reset the Footer to behave like a block container */
#site-footer {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box; /* Critical: keeps padding inside width */
  display: block;
}

/* 2. DESKTOP: Match Case Study (40px) */
@media (min-width: 1025px) {
  .ab-insight-hero-split .ab-page-inner,
  .ab-content-grid,
  .ab-section .ab-page-inner,
  #site-footer {
    max-width: 1400px; /* Matches case study max-width */
    padding-left: 40px;
    padding-right: 40px;
  }
  
  #site-footer { padding-bottom: 80px; }
}

/* 3. MOBILE: Match Case Study Exactly (24px) */
/* Note: Case Studies trigger mobile layout at 1024px, not 768px */
@media (max-width: 1024px) {
  .ab-insight-hero-split .ab-page-inner,
  .ab-content-grid,
  .ab-section .ab-page-inner,
  #site-footer { 
    padding-left: 24px; 
    padding-right: 24px; 
  }

  #site-footer {
    padding-bottom: 60px; /* Matches case study bottom spacing */
  }
}

/* =========================================
   MOBILE OVERRIDES: RELATED INSIGHTS
   Force "Hover State" (Color) & Equal Heights
   ========================================= */

/* 1. Color & Visibility (Tablets & Mobile) */
@media screen and (max-width: 1024px) {
  /* Force Image to Color & Zoom */
  .ab-related-card .ab-related-visual img {
    filter: grayscale(0%) contrast(1.1) !important;
    opacity: 1 !important;
    transform: scale(1.05) !important;
  }

  /* Show the "Read Insight" CTA arrow */
  .ab-related-card .ab-related-footer {
    opacity: 1 !important;
    transform: translateX(5px) !important;
  }
}

/* 2. Layout & Equal Heights (Mobile Only) */
@media (max-width: 768px) {
    /* Force Grid to Horizontal Scroll */
    #related-insights-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 16px;
        scroll-snap-type: x mandatory;
        
        /* [CRITICAL] Forces all cards to match the height of the tallest one */
        align-items: stretch; 
        
        padding-bottom: 24px;
        margin-left: -24px; 
        margin-right: -24px;
        padding-left: 24px;
        padding-right: 24px;
        
        /* Hide Scrollbar */
        scrollbar-width: none; 
        -ms-overflow-style: none; 
    }
    
    #related-insights-grid::-webkit-scrollbar {
        display: none; 
    }

    /* Card Sizing */
    .ab-related-card {
        flex: 0 0 85vw; /* 85% width */
        width: 85vw;
        scroll-snap-align: center;
        margin-bottom: 0;
        
        /* Allow card to grow to full container height */
        height: auto; 
        display: flex;
        flex-direction: column;
    }

    /* Content Expansion */
    .ab-related-card .ab-related-content {
        flex-grow: 1; /* Fills the empty space */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    /* Ensure Dots are visible */
    .ab-scroll-dots {
        display: flex; 
        justify-content: center;
        margin-top: 10px;
    }
}
