/* ============================================================
   blog.css — Scoped styles for the Insights / Blog page
   ============================================================ */

/* Override body background */
body {
  background: var(--slate-50);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.blog-hero {
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  padding: 56px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(59,130,246,.07) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(20,184,166,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Eyebrow */
.blog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 16px;
}

.blog-hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-600);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  flex-shrink: 0;
}

/* H1 */
.blog-hero h1 {
  font-size: clamp(2rem, 4vw, 2.875rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 14px;
}

.accent-blue    { color: var(--blue-600); }
.accent-emerald { color: var(--emerald-500); }

/* Subtitle */
.blog-hero-subtitle {
  font-size: 1.05rem;
  color: var(--slate-500);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 28px;
}

/* ── Search bar ── */
.blog-search-wrapper {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.blog-search-icon {
  position: absolute;
  left: 14px;
  color: var(--slate-400);
  pointer-events: none;
  display: flex;
  align-items: center;
}

#blog-search-input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-size: 14px;
  background: var(--slate-50);
  color: var(--slate-900);
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

#blog-search-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
  background: #fff;
}

#blog-search-input::placeholder {
  color: var(--slate-400);
}

#blog-search-clear {
  position: absolute;
  right: 12px;
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--slate-300);
  color: #fff;
  font-size: 12px;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}

#blog-search-clear.visible {
  display: flex;
}

#blog-search-clear:hover {
  background: var(--slate-400);
}

#search-label {
  display: none;
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 10px;
  text-align: center;
}

#search-label.visible {
  display: block;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.blog-filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--slate-200);
  background: transparent;
  color: var(--slate-500);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  font-family: inherit;
}

.filter-btn:hover:not(:disabled):not(.active) {
  border-color: var(--blue-500);
  color: var(--blue-600);
}

.filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.filter-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ============================================================
   BLOG MAIN
   ============================================================ */
.blog-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* Section head */
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}

.section-head-line {
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}

/* Featured wrapper */
#featured-section {
  margin-bottom: 48px;
}

/* ============================================================
   FEATURED CARD
   ============================================================ */
.featured-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .25s, transform .25s;
}

.featured-card:hover {
  box-shadow: 0 16px 48px rgba(7,19,61,.12);
  transform: translateY(-2px);
}

.featured-card:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.featured-cover {
  min-height: 260px;
  position: relative;
  overflow: hidden;
}

.featured-cover-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(255,255,255,.1) 0%, transparent 65%);
}

.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.featured-body {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  margin: 12px 0 14px;
}

.featured-excerpt {
  font-size: .95rem;
  color: var(--slate-500);
  line-height: 1.75;
  margin-bottom: 20px;
  flex: 1;
}

.featured-meta {
  font-size: 12.5px;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue-500);
  flex-shrink: 0;
}

.meta-sep {
  opacity: .4;
}

.featured-read-btn {
  background: var(--navy);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  width: fit-content;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: background .15s;
}

.featured-read-btn:hover {
  background: var(--blue-600);
}

/* Category pill */
.cat-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
  background: rgba(37,99,235,.08);
  color: var(--blue-600);
  border: 1px solid rgba(37,99,235,.15);
}

@media (max-width: 768px) {
  .featured-card        { grid-template-columns: 1fr; }
  .featured-cover       { min-height: 180px; }
  .featured-body        { padding: 24px 20px; }
}

/* 3-card featured grid */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.featured-grid-card {
  grid-template-columns: 1fr;
  grid-template-rows: 200px 1fr;
}

.featured-grid-card .featured-cover {
  min-height: 200px;
}

.featured-grid-card .featured-body {
  padding: 24px;
  justify-content: flex-start;
}

.featured-grid-card .featured-title {
  font-size: 1.1rem;
}

.featured-grid-card .featured-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 900px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .featured-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BLOG CARD GRID
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  min-height: 200px;
}

@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  animation: fadeInUp .3s ease both;
}

.blog-card:hover {
  box-shadow: 0 8px 32px rgba(7,19,61,.1);
  transform: translateY(-3px);
}

.blog-card:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.card-cover {
  height: 148px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.card-cover-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(255,255,255,.1) 0%, transparent 65%);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: .94rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.45;
  margin: 10px 0 8px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: .82rem;
  color: var(--slate-500);
  line-height: 1.65;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 11.5px;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ============================================================
   LOADING / EMPTY / ERROR STATES
   ============================================================ */
.state-box {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  gap: 16px;
  color: var(--slate-500);
  text-align: center;
}

.state-box p {
  font-size: .95rem;
  color: var(--slate-500);
  max-width: 400px;
}

.state-box code {
  font-family: 'Courier New', monospace;
  background: var(--slate-100);
  color: var(--red-500);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid var(--slate-200);
  background: #fff;
  color: var(--slate-600);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}

.pg-btn:hover:not(:disabled):not(.active) {
  border-color: var(--blue-500);
  color: var(--blue-600);
}

.pg-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.pg-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.pg-ellipsis {
  color: var(--slate-400);
  font-size: 13.5px;
  padding: 0 4px;
  user-select: none;
}

/* ============================================================
   DETAIL VIEW
   ============================================================ */
#blog-detail {
  display: none;
}

.detail-back-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 0;
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-500);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s;
}

.detail-back-btn:hover {
  color: var(--navy);
}

/* Hero banner */
.detail-hero {
  padding: 56px 24px 48px;
  position: relative;
  overflow: hidden;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.1) 0%, transparent 60%);
  pointer-events: none;
}

.detail-hero-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.detail-hero-cat-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  margin-bottom: 14px;
}

.detail-hero-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 18px;
}

.detail-hero-meta {
  color: rgba(255,255,255,.72);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-hero-meta .meta-dot {
  background: rgba(255,255,255,.6);
}

/* Two-column layout */
.detail-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 296px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .detail-layout          { grid-template-columns: 1fr; }
  .detail-sidebar         { position: static !important; }
}

/* Article */
.detail-article {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  padding: 40px;
}

.detail-lead {
  font-size: 1.08rem;
  color: var(--slate-600);
  line-height: 1.8;
  border-left: 3px solid var(--blue-500);
  padding-left: 18px;
  margin-bottom: 32px;
}

/* Prose */
.detail-article-body h2         { font-size: 1.2rem;  font-weight: 800; color: var(--navy);      margin: 32px 0 12px; }
.detail-article-body h3         { font-size: 1.05rem; font-weight: 700; color: var(--navy);      margin: 24px 0 10px; }
.detail-article-body p          { font-size: .97rem;  line-height: 1.85; color: var(--slate-700); margin-bottom: 16px; }
.detail-article-body ul         { list-style: disc;    padding-left: 22px; margin-bottom: 16px; }
.detail-article-body ol         { list-style: decimal; padding-left: 22px; margin-bottom: 16px; }
.detail-article-body li         { font-size: .97rem;  line-height: 1.8;  color: var(--slate-700); margin-bottom: 6px; }
.detail-article-body a          { color: var(--blue-600); text-decoration: underline; }
.detail-article-body blockquote { border-left: 3px solid var(--navy); padding-left: 18px; margin: 24px 0; font-style: italic; color: var(--slate-600); }
.detail-article-body code       { font-family: 'Courier New', monospace; background: var(--slate-100); color: var(--slate-800); padding: 2px 6px; border-radius: 4px; font-size: .87rem; }

/* Sidebar */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 24px;
}

.sidebar-accent-bar {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--blue-500), var(--teal-500));
  margin-bottom: 16px;
}

.sidebar-card h4 {
  font-size: .9rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.sidebar-card > p {
  font-size: .83rem;
  color: var(--slate-500);
  line-height: 1.65;
  margin-bottom: 16px;
}

.sidebar-cta-btn {
  background: var(--navy);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  transition: background .15s;
}

.sidebar-cta-btn:hover {
  background: var(--blue-600);
}

/* Related items */
.related-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
}

.related-item:last-child  { border-bottom: none; padding-bottom: 0; }
.related-item:first-child { padding-top: 0; }

.related-item .cat-pill {
  font-size: 9px;
  padding: 2px 8px;
}

.related-item-title {
  font-size: .83rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin: 6px 0 4px;
  transition: color .15s;
}

.related-item:hover .related-item-title {
  color: var(--blue-600);
}

.related-item-read {
  font-size: .76rem;
  color: var(--blue-600);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .blog-hero      { padding: 40px 16px 32px; }
  .blog-main      { padding: 24px 16px 48px; }
  .detail-article { padding: 24px 20px; }
  .detail-hero    { padding: 40px 16px 36px; }
}
