/* ========================================================== */
/* INTELLIGENCE & RESEARCH - MAIN LISTING                     */
/* ========================================================== */

.ab-insights-page {
  padding-top: 0;
  position: relative;
  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; 
  min-height: 100vh;
}

/* ========================================================== */
/* HERO SECTION (The "Untouched" Top Area)                    */
/* ========================================================== */

.ab-insights-hero {
  position: relative;
  padding: 140px 0 60px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr; /* Asymmetric layout */
  gap: 60px;
  align-items: center;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
}

/* --- Hero Typography --- */
.ab-hero-meta { display: flex; gap: 16px; align-items: center; font-family: monospace; font-size: 13px; margin-bottom: 24px; }
.ab-meta-tag { color: var(--ab-accent); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.ab-meta-date { color: var(--ab-text-subtle); }
.ab-hero-title { font-size: clamp(36px, 4vw, 52px); line-height: 1.1; color: #fff; margin-bottom: 24px; letter-spacing: -0.01em; transition: color 0.3s ease; }
.ab-hero-excerpt { font-size: 18px; line-height: 1.6; color: var(--ab-text-subtle); margin-bottom: 32px; max-width: 95%; transition: color 0.3s ease; }
.ab-hero-actions { display: flex; align-items: center; gap: 24px; }
.ab-read-time { font-family: monospace; font-size: 12px; color: var(--ab-text-subtle); display: flex; align-items: center; gap: 6px; }

/* --- Hero Visual --- */
.ab-insights-hero-visual {
  position: relative;
  height: 400px;
  border-radius: 4px;
  overflow: hidden;
  
  /* [MOD] HIGHLIGHTED BY DEFAULT */
  /* Replaced faint border with Accent Color */
  border: 1px solid var(--ab-accent); 
  /* Added Glow Effect permanently */
  box-shadow: 0 0 30px rgba(27, 138, 255, 0.1); 
  
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.ab-insights-hero-visual img { 
  width: 100%; height: 100%; object-fit: cover; 
  filter: contrast(1.1); 
  transition: filter 0.5s ease, transform 0.6s ease; 
}

/* --- HOVER EFFECTS --- */
.ab-insights-hero:hover .ab-insights-hero-visual {
  /* Kept interaction: Lift slightly on hover */
  transform: translateY(-2px);
  /* Optional: Make glow slightly stronger on hover */
  box-shadow: 0 0 40px rgba(27, 138, 255, 0.2); 
}

.ab-insights-hero:hover .ab-insights-hero-visual img { 
  filter: contrast(1.05); 
  transform: scale(1.03); 
}

.ab-insights-hero:hover .ab-hero-title {
  text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

/* ========================================================== */
/* CONTROL BAR                                                */
/* ========================================================== */
.ab-control-bar { margin-bottom: 40px; position: relative; z-index: 5; }
.ab-control-wrapper { display: flex; justify-content: space-between; align-items: center; background: var(--ab-bg-elevated); border: 1px solid var(--ab-border-soft); padding: 12px 20px; border-radius: 4px; }
.ab-control-group { display: flex; align-items: center; }
.ab-search-group { flex: 1; max-width: 400px; }
.ab-control-right { display: flex; gap: 32px; align-items: center; }

.ab-search-input-wrap { position: relative; width: 100%; display: flex; align-items: center; }
.ab-search-icon { width: 16px; height: 16px; stroke: var(--ab-text-subtle); margin-right: 12px; }
.ab-search-input { width: 100%; background: transparent; border: none; color: #fff; font-family: inherit; font-size: 14px; padding: 4px 0; }
.ab-search-input:focus { outline: none; }
.ab-search-input::placeholder { color: rgba(255,255,255,0.3); }

.ab-select-wrapper { display: flex; align-items: center; gap: 12px; }
.ab-select-label { font-family: monospace; font-size: 11px; color: var(--ab-accent); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.ab-select { background: transparent; border: none; color: #fff; font-family: inherit; font-size: 14px; cursor: pointer; appearance: none; padding-right: 16px; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right center; background-size: 12px; }
.ab-select:focus { outline: none; }
.ab-select option { background: #000; color: #fff; }

/* ========================================================== */
/* RESEARCH FEED (THE LIST)                                   */
/* ========================================================== */

.ab-research-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
  margin-bottom: 120px;
}

/* [FIX] SAFARI LAYOUT FIX: Switched from Grid to Flexbox */
.ab-dossier-card {
  display: flex; /* Flexbox ensures reliable height stretching in Safari */
  flex-direction: row;
  align-items: stretch; /* Forces both sides to equal height */
  background: rgba(10, 12, 20, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08); 
  transition: all 0.2s ease;
  overflow: hidden;
  width: 100%;
  min-height: 220px; 
}

.ab-research-feed .ab-dossier-card:first-child {
  /* No special grid override needed for Flexbox */
}

.ab-dossier-card:hover {
  border-color: var(--ab-accent);
  background: rgba(27, 138, 255, 0.04);
}

.ab-dossier-visual {
  /* [FIX] Explicit width + no shrink prevents collapse */
  width: 260px;
  flex-shrink: 0;
  position: relative; /* Anchor for absolute image */
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  /* Height is automatic via flex stretch */
}

.ab-dossier-visual img {
  /* [FIX] Absolute positioning ensures fill */
  position: absolute; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none; 
  transition: transform 0.5s ease;
}

.ab-dossier-card:hover .ab-dossier-visual img { transform: scale(1.05); }

.ab-dossier-content { 
  padding: 32px; 
  display: flex; 
  flex-direction: column; 
  flex-grow: 1; /* Fills remaining width */
}

/* HEADER & READ TIME */
.ab-dossier-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-family: monospace; font-size: 11px; }

.ab-dossier-meta { display: flex; gap: 12px; align-items: center; }
.ab-tag { color: var(--ab-accent); background: rgba(27, 138, 255, 0.1); padding: 2px 6px; border-radius: 2px; text-transform: uppercase; font-weight: 600; }
.ab-id { color: var(--ab-text-subtle); opacity: 0.7; }

/* New Right Meta for Read Time */
.ab-dossier-right-meta { display: flex; align-items: center; gap: 8px; color: var(--ab-text-subtle); }
.ab-sep { opacity: 0.3; }
.ab-read-time-badge { color: var(--ab-accent); font-weight: 600; }

.ab-dossier-title { margin: 0 0 12px; font-size: 20px; font-weight: 500; line-height: 1.3; }
.ab-dossier-title a { color: #fff; text-decoration: none; transition: color 0.2s; }
.ab-dossier-title a:hover { color: var(--ab-accent); }
.ab-dossier-excerpt { color: var(--ab-text-subtle); font-size: 15px; line-height: 1.6; margin-bottom: 24px; flex-grow: 1; }
.ab-link-arrow { font-size: 13px; font-weight: 600; color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; }
.ab-link-arrow span { color: var(--ab-accent); transition: transform 0.2s; }
.ab-dossier-card:hover .ab-link-arrow span { transform: translateX(4px); }

/* ========================================================== */
/* PAGINATION                                                 */
/* ========================================================== */

.ab-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0 80px;
}

.ab-page-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 20, 0.4);
  color: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  min-width: 44px;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.ab-page-btn:hover {
  border-color: var(--ab-accent);
  background: rgba(27, 138, 255, 0.06);
  transform: translateY(-1px);
}

.ab-page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.ab-page-btn.is-active {
  border-color: var(--ab-accent);
  background: rgba(27, 138, 255, 0.14);
  color: #fff;
}

.ab-page-ellipsis {
  color: rgba(255, 255, 255, 0.4);
  font-family: monospace;
  font-size: 12px;
  padding: 0 6px;
}


/* ========================================================== */
/* RESPONSIVE & MOBILE ENGINE                                 */
/* ========================================================== */

@media (max-width: 900px) {
  /* --- HERO --- */
  .ab-insights-hero { 
    grid-template-columns: 1fr; 
    /* [MOD] Reduced Gap and Padding for cleaner Mobile Header */
    gap: 10px; /* Reduced from 40px */
    padding-top: 40px; /* Reduced from 120px */
    padding-bottom: 40px;
  }
  
  .ab-insights-hero-visual { 
    height: 300px; 
    order: -1; 
  }

  .ab-hero-title {
    font-size: 36px;
  }

  /* --- CONTROLS --- */
  .ab-control-wrapper { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 0; 
    padding: 16px;
    height: auto;
  }
  
  /* SEARCH BAR (Fixed Zoom Issue) */
  .ab-search-group { 
    width: 100%; 
    max-width: 100%; 
    margin-bottom: 20px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
  }

  .ab-search-input-wrap {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    overflow: hidden; 
  }

  .ab-search-icon {
    flex-shrink: 0; 
    width: 16px; 
    height: 16px;
    margin-right: 10px; 
    opacity: 0.7;
  }
  
  .ab-search-input {
    font-size: 16px; 
    transform: scale(0.8125); /* ~13px */
    transform-origin: left center;
    width: 123%; 
    height: 100%;
    margin: 0;
    border: none;
    background: transparent;
    color: #fff;
    letter-spacing: -0.01em;
  }
  
  /* FILTER/SORT GROUP */
  .ab-control-right { 
    width: 100%; 
    flex-direction: row; 
    justify-content: space-between; 
    gap: 12px; 
    padding-top: 0; 
    border-top: none;
  }
  
  .ab-select-wrapper {
    flex: 1; 
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
  }

  .ab-select-label {
    font-size: 10px;
    opacity: 0.6;
  }

  .ab-select {
    width: 100%;
    font-size: 13px; 
    background-position: right 0 center; 
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 0;
  }

  /* --- CARDS (Mobile Stack) --- */
  .ab-dossier-card { 
    flex-direction: column; /* Stack Vertically */
    min-height: auto;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    position: relative; 
  }
  
  .ab-research-feed .ab-dossier-card:first-child {
    flex-direction: column;
  }

  .ab-dossier-visual { 
    height: 220px; 
    width: 100%; /* Fill width */
    border-right: none; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); 
  }
  
  .ab-dossier-content { 
    padding: 24px; 
  }

  /* --- NEW: ID TAG ON IMAGE (Mobile) --- */
  .ab-id {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 8px;
    border-radius: 2px;
    
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    font-weight: 700;
    opacity: 1;
  }
  
  .ab-dossier-excerpt {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Extra small screens adjustments */
@media (max-width: 480px) {
  .ab-hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
