/* =================================================================
   CASE STUDY SINGLE: "STATIC & INSTANT"
   ================================================================= */

/* --- 1. BASE PAGE SETUP --- */
.ab-case-wrapper {
  background-color: #020308;
  color: #e0e0e0;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Hide global gradient */
.ab-page::after { display: none !important; }

/* Static Background Grid */
.ab-case-wrapper::before {
  content: "";
  position: absolute; 
  inset: 0;
  height: 100%; 
  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: 40px 40px;
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

/* --- 2. HERO SECTION --- */
.ab-single-hero {
  position: relative;
  height: 50vh; 
  min-height: 400px; 
  display: flex;
  align-items: flex-end;
  padding-bottom: 40px; 
  border-bottom: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  margin-top: 0; 
}

.ab-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.ab-hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%) brightness(0.6) contrast(1.1);
  transform: scale(1.05);
}

.ab-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #020308 10%, rgba(2,3,8,0.8) 50%, transparent 100%);
  z-index: 0;
}

.ab-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

.ab-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.ab-tag {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ab-accent);
  padding: 6px 12px;
  border: 1px solid rgba(27, 138, 255, 0.3);
  background: rgba(27, 138, 255, 0.05);
}

.ab-hero-title {
  font-size: clamp(40px, 5vw, 80px); 
  line-height: 1.05;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  max-width: 1100px;
  margin: 0;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- 3. GRID LAYOUT --- */
.ab-content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 80px;
  max-width: 1400px;
  margin: 60px auto 80px; 
  padding: 0 40px;
  position: relative;
}

/* --- 4. MAIN ARTICLE --- */
.ab-article {
  font-size: 18px;
  line-height: 1.7;
  color: #b0b0b0;
}

.ab-article-lead {
  font-size: 24px; 
  line-height: 1.5;
  color: #fff;
  margin-bottom: 60px;
  font-weight: 300;
  padding-left: 24px;
  border-left: 2px solid var(--ab-accent);
}

.ab-article h2 {
  font-size: 32px;
  color: #fff;
  margin: 60px 0 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ab-article h3 {
  font-size: 22px;
  color: #fff;
  margin: 36px 0 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ab-article h4 {
  font-size: 18px;
  color: #fff;
  margin: 28px 0 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0.95;
}

.ab-article p { margin-bottom: 24px; }
.ab-article ul { margin-bottom: 40px; padding-left: 0; list-style: none; }
.ab-article li { position: relative; padding-left: 24px; margin-bottom: 16px; color: #e0e0e0; }
.ab-article li::before { content: "—"; position: absolute; left: 0; color: var(--ab-accent); }

/* --- 5. SIDEBAR (STATIC) --- */
.ab-sidebar { position: relative; }

.ab-glass-card {
  position: sticky;
  top: 120px;
  padding: 32px;
  background: rgba(20, 20, 25, 1); 
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ab-glass-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #fff;
  opacity: 0.6;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ab-spec-row { margin-bottom: 24px; }
.ab-spec-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ab-accent); margin-bottom: 8px; font-weight: 700; }
.ab-spec-value { font-size: 15px; line-height: 1.5; color: #fff; }

/* --- 6. MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
  .ab-single-hero { height: 50vh; padding-bottom: 30px; }
  .ab-hero-title { font-size: 36px; }
  .ab-content-grid { grid-template-columns: 1fr; gap: 60px; margin-top: 40px; padding: 0 24px; }
  .ab-sidebar { order: -1; }
  .ab-glass-card { position: static; background: transparent; border: none; padding: 0; }
  .ab-hero-content { padding: 0 24px; }
}

/* --- 7. GLOBAL ALIGNMENT --- */
.ab-case-wrapper #site-header {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding-left: 40px; padding-right: 40px; box-sizing: border-box;
}

.ab-case-wrapper #site-footer {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding-left: 40px; padding-right: 40px; box-sizing: border-box;
  padding-top: 60px; padding-bottom: 80px; 
}

@media (max-width: 1024px) {
  .ab-case-wrapper #site-header,
  .ab-case-wrapper #site-footer { padding-left: 24px; padding-right: 24px; }
  .ab-case-wrapper #site-footer { padding-bottom: 60px; }
}

/* --- 8. RELATED POSTS SECTION (ENHANCED) --- */
.ab-related-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 120px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 120px;
  position: relative;
}

/* Decorative "Tech Tag" */
.ab-related-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 40px;
  width: 100px;
  height: 1px;
  background: var(--ab-accent);
  box-shadow: 0 0 10px var(--ab-accent);
}

.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;
}

.ab-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* --- THE CARD --- */
.ab-related-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent; 
  transition: transform 0.4s ease;
  height: 100%; /* Ensure uniform height */
}

.ab-related-card:hover {
  transform: translateY(-5px);
}

/* --- VISUALS --- */
.ab-related-visual {
  width: 100%;
  height: 200px; /* Adjusted height */
  overflow: hidden;
  position: relative;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  transition: border-color 0.3s ease;
}

.ab-related-card:hover .ab-related-visual {
  border-color: var(--ab-accent);
}

.ab-related-visual img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%) contrast(1.2); 
  opacity: 0.6;
  transform: scale(1.0);
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ab-related-card:hover .ab-related-visual img {
  filter: grayscale(0%) contrast(1.1);
  opacity: 1;
  transform: scale(1.05);
}

.ab-visual-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.3) 3px
  );
  pointer-events: none;
  z-index: 2;
}

/* --- CONTENT --- */
.ab-related-content {
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Stretch to fill height */
  transition: background 0.3s ease, border-color 0.3s ease;
}

.ab-related-card:hover .ab-related-content {
  background: rgba(255,255,255,0.05);
  border-color: var(--ab-accent);
}

.ab-related-meta {
  font-size: 9px; 
  text-transform: uppercase;
  letter-spacing: 0.15em; 
  color: var(--ab-accent); 
  margin-bottom: 12px; 
  display: block;
  font-weight: 700;
}

.ab-related-title {
  font-size: 18px; 
  line-height: 1.3; 
  color: #fff;
  margin: 0 0 12px 0;
  text-transform: uppercase; 
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* --- NEW: SUMMARY & STATS --- */
.ab-related-summary {
  font-size: 13px;
  line-height: 1.5;
  color: #a0a0a0;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ab-related-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.ab-related-stats span {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ab-accent);
  background: rgba(27, 138, 255, 0.1);
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid rgba(27, 138, 255, 0.2);
}

/* --- FOOTER CTA --- */
.ab-related-footer {
  margin-top: auto; 
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transform: translateX(0);
  transition: all 0.3s ease;
}

.ab-related-card:hover .ab-related-footer {
  opacity: 1;
  transform: translateX(5px);
}

.ab-related-cta {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: #fff;
}

.ab-related-arrow {
  color: var(--ab-accent);
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .ab-related-section { padding: 0 24px 80px; }
  .ab-related-section::before { left: 24px; }
  .ab-related-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================
   Mobile Horizontal Scroll & Pagination
   ========================================= */

/* Pagination Dots Container - Matching Insight Page */
.ab-scroll-dots {
    display: none; /* Hidden on desktop */
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-bottom: 20px;
}

/* Individual Dot - Matching Insight Page */
.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);
}

/* Mobile Specifics */
@media (max-width: 768px) {
    .ab-scroll-dots {
        display: flex; 
    }

    /* Force horizontal scroll on the grid */
    .ab-related-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 16px;
        scroll-snap-type: x mandatory;
        padding-bottom: 24px;
        margin-left: -24px; 
        margin-right: -24px;
        padding-left: 24px;
        padding-right: 24px;
        
        /* [FIX] Force all items to stretch to the height of the tallest one */
        align-items: stretch; 
        
        /* Hide Scrollbar */
        scrollbar-width: none; 
        -ms-overflow-style: none; 
    }
    
    .ab-related-grid::-webkit-scrollbar {
        display: none; 
    }

    .ab-related-card {
        flex: 0 0 85vw; /* Card takes 85% of screen width */
        width: 85vw;
        scroll-snap-align: center;
        margin-bottom: 0;
        
        /* [FIX] Ensure card consumes the full stretched height */
        height: auto; 
        display: flex;
        flex-direction: column;
    }
    
    /* [FIX] Ensure content area grows to fill the card */
    .ab-related-card .ab-related-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* ========================================================== */
/* NEW: EXECUTIVE HUD VISUALIZATION ENGINE                    */
/* ========================================================== */

.ab-infographic-wrapper {
  position: relative;
  padding: 60px 40px;
  background-color: #030409;
  /* Technical Grid Background */
  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: 40px 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  
  /* [FIX] Use Brand Fonts */
  font-family: 'Plus Jakarta Sans', sans-serif; 
  
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* SCANLINE ANIMATION */
.ab-infographic-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.2) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.ab-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 20px;
}

.ab-hud-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-hud-label {
  font-family: 'Inter', sans-serif; /* Subtitle font */
  font-size: 11px;
  color: var(--ab-accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

.ab-hud-metric-name {
  font-family: 'Plus Jakarta Sans', sans-serif; /* Primary Headings */
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
}

/* THE "DELTA" BADGE */
.ab-hud-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  color: #10b981;
  padding: 6px 12px;
  border-radius: 2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
  text-transform: uppercase;
  animation: pulse-green 3s infinite;
}

/* --- COMPARISON TRACKS (Horizontal Bars) --- */
.ab-hud-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
  z-index: 2;
}

.ab-hud-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px; /* Label | Bar | Value */
  align-items: center;
  gap: 24px;
}

.ab-hud-row-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--ab-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
  font-weight: 500;
}

/* The Track Container */
.ab-hud-track {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 2px;
}

/* The Filled Bar */
.ab-hud-bar {
  height: 100%;
  background: #333;
  width: 0%; 
  position: relative;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  border-right: 2px solid rgba(255,255,255,0.5);
}

.ab-hud-bar.legacy {
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.15));
  border-right-color: rgba(255,255,255,0.3);
}

.ab-hud-bar.nexus {
  background: linear-gradient(90deg, rgba(27, 138, 255, 0.2), var(--ab-accent));
  border-right-color: #fff;
  box-shadow: 0 0 20px rgba(27, 138, 255, 0.4);
}

.ab-hud-bar.success {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), #10b981);
  border-right-color: #fff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Value Text */
.ab-hud-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-align: right;
  
  /* [CRITICAL] Aligns numbers perfectly like a financial dashboard */
  font-variant-numeric: tabular-nums; 
}

.ab-hud-value.highlight { color: var(--ab-accent); text-shadow: 0 0 10px rgba(27, 138, 255, 0.4); }
.ab-hud-value.success { color: #10b981; text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }

/* --- ANIMATIONS --- */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.6); }
  50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.4); border-color: #10b981; }
}

/* --- MOBILE --- */
@media (max-width: 600px) {
  .ab-infographic-wrapper { padding: 30px 20px; }
  .ab-hud-row {
    grid-template-columns: 1fr; 
    gap: 8px;
    margin-bottom: 24px;
  }
  .ab-hud-row-label { text-align: left; }
  .ab-hud-value { text-align: left; font-size: 20px; margin-top: -4px; }
  .ab-hud-track { margin-bottom: 8px; }
  .ab-hud-badge { position: relative; display: inline-block; margin-top: 10px; }
}

/* =========================================
   MOBILE OVERRIDES: RELATED INTELLIGENCE
   Force "Hover State" (Color) on Touch Devices
   ========================================= */
@media screen and (max-width: 1024px) {
  
  /* 1. 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; 
  }

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

  /* Note: The blue border (var(--ab-accent)) overrides have been removed 
     so the cards will retain their subtle grey borders. */
}
