/**
 * Farrukh Naveed Blog — portfolio-matched overrides v2
 */

/* ── Base: blog uses portfolio header (always scrolled/light) ── */
body.blog-site {
  padding-top: var(--header-h);
  background: var(--color-bg);
}

body.blog-site .site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border);
}

body.blog-site .site-header .logo {
  color: var(--color-heading);
}

body.blog-site .site-header .nav-link {
  color: var(--color-text);
}

body.blog-site .site-header .nav-link:hover,
body.blog-site .site-header .nav-link.is-active {
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
}

body.blog-site .site-header .nav-link--cta {
  color: #fff !important;
}

body.blog-site .site-header .nav-toggle span {
  background: var(--color-heading);
}

/* ── Blog hero (matches main site hero) ── */
.blog-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
}

.blog-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, #1a2744 50%, var(--color-bg-dark-2) 100%);
  z-index: 0;
}

.blog-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
}

.blog-hero-inner {
  position: relative;
  z-index: 1;
}

.blog-hero--home {
  padding: calc(var(--header-h) + 32px) 0 72px;
}

.blog-hero--home .blog-hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.blog-hero--compact {
  padding: 48px 0 40px;
}

.blog-hero-inner--compact {
  max-width: 760px;
}

.blog-hero .hero-eyebrow,
.blog-hero .section-label {
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.blog-hero-title,
.blog-hero-page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 16px;
}

.blog-hero-subtitle {
  font-size: 1.0625rem;
  color: #f1f5f9;
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 24px;
}

.blog-hero-subtitle--compact {
  font-size: 1rem;
  color: #cbd5e1;
}

.blog-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.blog-hero-tags span {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: #f1f5f9;
}

.blog-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.blog-hero-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  text-align: center;
}

.blog-hero-stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
}

.blog-hero-stat-label {
  display: block;
  font-size: 0.875rem;
  color: #cbd5e1;
  margin-top: 8px;
  line-height: 1.5;
}

.blog-breadcrumb {
  font-size: 0.875rem;
  color: #cbd5e1;
  margin-top: 16px;
}

.blog-breadcrumb a {
  color: #f1f5f9;
}

.blog-breadcrumb a:hover {
  color: #fff;
}

.blog-breadcrumb span {
  margin: 0 8px;
  opacity: 0.5;
}

/* ── Content layout ── */
.blog-content-area {
  padding: 72px 0 96px;
}

.blog-content-area.section--alt {
  background: var(--color-bg-alt);
}

.blog-list-header {
  margin-bottom: 48px;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.blog-layout--single {
  grid-template-columns: 1fr 280px;
}

/* ── Post card grid (matches portfolio cards) ── */
.blog-posts-grid {
  display: grid;
  gap: 28px;
}

.blog-posts-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.post-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.2);
}

.post-card-image-wrap {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.03);
}

.post-card-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-bg-alt), var(--color-border));
  color: var(--color-text-light);
  font-size: 2rem;
}

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

.post-categories {
  margin-bottom: 10px;
}

.post-category {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-full);
}

.post-category:hover {
  background: rgba(37, 99, 235, 0.14);
}

.post-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.post-card-title a {
  color: var(--color-heading);
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.post-meta a {
  color: var(--color-text-light);
}

.post-meta a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.post-card-excerpt p {
  margin: 0;
}

.post-card-cta {
  align-self: flex-start;
}

/* ── Single article ── */
.single-article-header {
  margin-bottom: 24px;
}

.post-meta--single {
  margin-bottom: 0;
}

.single-article-featured {
  margin-bottom: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  aspect-ratio: 16 / 9;
  background: var(--color-bg-alt);
}

.single-article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.entry-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text);
  max-width: 720px;
}

.entry-content > * + * {
  margin-top: 1.25em;
}

.entry-content h2 { font-size: 1.5rem; margin-top: 2em; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.75em; }
.entry-content h4 { font-size: 1.125rem; margin-top: 1.5em; }

.entry-content ul,
.entry-content ol {
  list-style: revert;
  padding-left: 1.5em;
}

.entry-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 16px 24px;
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-light);
  font-style: italic;
}

.entry-content pre {
  background: var(--color-bg-dark);
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

.entry-content code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.875em;
}

.entry-content :not(pre) > code {
  background: var(--color-bg-alt);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--color-heading);
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-article-tags {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.single-article-tags-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-right: 8px;
}

.post-tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.post-tag-list a {
  font-size: 0.8125rem;
  padding: 4px 12px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  color: var(--color-text);
}

.single-article-back {
  margin-top: 32px;
}

/* ── Related posts ── */
.related-posts {
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--color-border);
}

/* ── Sidebar ── */
.blog-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.blog-widget {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
}

.blog-widget .widget-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget-list li {
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.widget-list a {
  color: var(--color-text);
}

.widget-list a:hover {
  color: var(--color-primary);
}

.widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.widget-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  color: var(--color-text);
}

.widget-tag:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary);
}

.blog-widget--about p {
  font-size: 0.875rem;
  color: var(--color-text-light);
  line-height: 1.65;
  margin-bottom: 16px;
}

.btn-full {
  width: 100%;
}

/* ── Search form ── */
.blog-search-form {
  display: flex;
  gap: 8px;
}

.blog-search-form input[type="search"] {
  flex: 1;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.blog-search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.blog-search-form button {
  padding: 11px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ── Pagination ── */
.blog-pagination,
.navigation.pagination {
  margin-top: 48px;
}

.blog-pagination .nav-links,
.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.blog-pagination a,
.blog-pagination span,
.navigation.pagination a,
.navigation.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
}

.blog-pagination a:hover,
.navigation.pagination a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.blog-pagination .current,
.navigation.pagination .current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ── Bottom CTA ── */
.blog-cta {
  padding: 0 0 96px;
}

.blog-cta-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.blog-cta-title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  max-width: 640px;
  margin: 0 auto 24px;
  line-height: 1.4;
}

.blog-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ── Comments ── */
.comments-area {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-body {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  margin-bottom: 12px;
}

/* ── Empty / 404 ── */
.blog-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* ── Hide old WP / theme cruft ── */
.blog-site .indepth-news,
.blog-site .slick-slider,
.blog-site .breaking-news {
  display: none !important;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .blog-posts-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-layout,
  .blog-layout--single {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }

  .blog-hero--home .blog-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .blog-hero-subtitle,
  .blog-hero-tags,
  .blog-hero-actions {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .blog-posts-grid--3 {
    grid-template-columns: 1fr;
  }

  .blog-content-area {
    padding: 48px 0 72px;
  }

  .blog-hero--home {
    padding-bottom: 48px;
  }

  .blog-hero-actions .btn {
    width: 100%;
  }

  .blog-cta-card {
    padding: 32px 24px;
  }

  .blog-cta-actions {
    flex-direction: column;
  }

  .blog-cta-actions .btn {
    width: 100%;
  }
}
