/* ============================================================
   AI4EPC Visual Improvements
   ============================================================ */

/* --- A. Hero: dark gradient background ---------------------- */
.hero-improved {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c2340 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
  box-shadow:
    0 0 80px rgba(37, 99, 235, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

/* Inner accent border frame */
.hero-improved::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.25);
  pointer-events: none;
  z-index: 0;
}

/* Keep hero content above the ::after frame */
.hero-improved > * {
  position: relative;
  z-index: 1;
}

/* Hero text: light colors for dark background */
.hero-improved p.text-gray-500 {
  color: rgba(148, 163, 184, 0.9) !important;
}
.hero-improved h1.text-gray-900 {
  color: #f1f5f9 !important;
  font-size: 3.75rem !important;
  letter-spacing: -0.03em !important;
}
.hero-improved p.text-gray-600 {
  color: rgba(203, 213, 225, 0.9) !important;
}

/* Hero outline button: same style as primary button */
.hero-improved .btn-cta-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 1rem;
  padding-block: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent !important;
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32) !important;
  text-decoration: none;
}
.hero-improved .btn-cta-outline:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45) !important;
  transform: translateY(-1px);
}

/* Hide light-colored bottom gradient bleed (looks wrong on dark bg) */
.hero-improved .bg-gradient-to-t {
  display: none !important;
}

/* --- B. Feature & CTA cards: solid background, cleaner border */
.rounded-3xl.border {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.rounded-3xl.border:hover {
  border-color: #bfdbfe !important;
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.08) !important;
}

/* --- C. Primary CTA button ---------------------------------- */
.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 1rem;
  padding-block: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-cta-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-cta-primary:active {
  transform: translateY(0);
}

/* --- C. Presentation card numbered badges ------------------- */
.card-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

/* Hide original gray decorative bars in presentation cards */
.rounded-3xl > .space-y-4 > .h-1 {
  display: none !important;
}

/* --- D. Blog list thumbnails -------------------------------- */
.blog-thumb-row {
  display: flex !important;
  gap: 0.875rem;
  align-items: flex-start;
  text-decoration: none;
}

.blog-thumb-img {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
  background: #f1f5f9;
  margin-top: 0.125rem;
  /* thumb.jpg is 240x150 — 3x retina clarity at 80x50 display */
}

.blog-thumb-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Preserve hover underline for blog titles */
body.ai4epc-letters .letters-index .blog-thumb-row:hover h2 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --- Blog list: full width (override letters.css narrow 46rem column) --- */
body.ai4epc-letters main:has(.letters-index) .max-w-6xl {
  max-width: 72rem !important;
}

/* Fallback for browsers without :has() support */
body.ai4epc-letters .letters-index-wide {
  max-width: 72rem !important;
}

/* --- F. Blog list page color improvements ------------------- */

/* Background: deeper blue gradient for more depth and tech feel */
body.ai4epc-letters {
  background: linear-gradient(160deg, #e2eaff 0%, #d8e4ff 40%, #e0ebff 100%) !important;
}

/* Outer section: transparent container, no visual weight */
body.ai4epc-letters .overflow-hidden.rounded-2xl {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Individual article: wider horizontal padding + hover highlight */
body.ai4epc-letters .overflow-hidden.rounded-2xl article {
  padding-left: 2.5rem !important;
  padding-right: 2.5rem !important;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
body.ai4epc-letters .overflow-hidden.rounded-2xl article:hover {
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1) !important;
}

/* Thumbnail placeholder: blue-tinted instead of gray */
body.ai4epc-letters .blog-thumb-img {
  background: linear-gradient(135deg, #c7d6ff, #d8e4ff) !important;
}

/* Dividers between cards: blue-tinted fade instead of flat gray */
body.ai4epc-letters .h-px {
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.18), transparent) !important;
}

/* Article number badge: blue gradient */
body.ai4epc-letters .rounded-full.border.border-slate-200 {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

/* On small screens, stack vertically */
@media (max-width: 480px) {
  .blog-thumb-row {
    flex-direction: column;
    gap: 0.625rem;
  }
  .blog-thumb-img {
    width: 100%;
    height: 140px;
    border-radius: 8px;
  }
}
