/* public/web/css/blog.css - GenieLeads Blog Design System */

:root {
  --font-primary: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

body.blog-page-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-primary);
  line-height: 1.6;
}

/* Header & Nav */
.blog-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.blog-nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.blog-brand img {
  height: 36px;
  width: auto;
}

.blog-brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.blog-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.blog-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s ease;
}

.blog-nav-link:hover, .blog-nav-link.active {
  color: var(--primary);
}

.btn-blog-action {
  background: var(--text-main);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-blog-action:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* Container */
.blog-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(var(--header-height, 72px) + 32px) 24px 80px 24px;
}

/* Page Intro Hero */
.blog-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px auto;
}

.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.blog-hero-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 16px 0;
}

.blog-hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0;
}

/* Featured Article Box */
.featured-article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 48px;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.featured-article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.featured-img-wrap {
  width: 100%;
  height: 100%;
  min-height: 340px;
  position: relative;
  overflow: hidden;
}

.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-article-card:hover .featured-img-wrap img {
  transform: scale(1.03);
}

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

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.category-pill {
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.read-time-pill {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.featured-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px 0;
  color: var(--text-main);
}

.featured-excerpt {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.author-info-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filter & Search Bar */
.filter-search-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  width: 100%;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 11px 18px 11px 44px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 15px;
  color: var(--text-main);
  outline: none;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  transition: color 0.2s ease;
}

.search-box input:focus + svg,
.search-box:focus-within svg {
  color: var(--primary);
}

.category-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}

.category-tab {
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
}

.category-tab:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.category-tab.active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 48px;
}

@media (max-width: 992px) {
  .featured-article-card {
    grid-template-columns: 1fr;
  }
  .featured-img-wrap {
    min-height: 240px;
    max-height: 320px;
  }
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .single-article-title {
    font-size: 30px;
  }
}

@media (max-width: 640px) {
  .blog-nav-container {
    padding: 12px 16px;
    gap: 12px;
  }
  .blog-nav-links {
    gap: 12px;
  }
  .blog-brand img {
    height: 28px;
  }
  .blog-brand-text {
    font-size: 17px;
  }
  .btn-blog-action {
    padding: 6px 14px;
    font-size: 13px;
  }
  .blog-container {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 48px;
  }
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .blog-hero-title {
    font-size: 26px;
  }
  .blog-hero-sub {
    font-size: 15px;
  }
  .blog-hero {
    margin-bottom: 24px;
  }
  .featured-article-card {
    margin-bottom: 32px;
    border-radius: 14px;
  }
  .featured-content {
    padding: 20px 16px;
  }
  .featured-title {
    font-size: 20px;
    margin-bottom: 10px;
  }
  .featured-excerpt {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .featured-img-wrap {
    min-height: 190px;
    max-height: 220px;
  }
  .filter-search-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 28px;
    width: 100%;
  }
  .search-box {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
  }
  .category-tabs {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    padding: 2px 0 8px 0;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .category-tabs::-webkit-scrollbar {
    display: none;
  }
  .category-tab {
    font-size: 13px;
    padding: 7px 14px;
    flex-shrink: 0;
  }
  .single-article-title {
    font-size: 22px;
    line-height: 1.3;
  }
  .single-article-lead {
    font-size: 15px;
    margin-bottom: 18px;
  }
  .single-article-hero-img {
    border-radius: 12px;
    margin-bottom: 28px;
  }
  .single-author-card {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 14px;
    margin: 40px auto;
  }
  .article-quote {
    padding: 16px 18px;
    font-size: 15px;
    margin: 24px 0;
  }
  .related-section {
    margin-top: 48px;
    padding-top: 32px;
  }
  .related-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .pagination-nav {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .pagination-nav .page-link {
    width: 36px;
    height: 36px;
    font-size: 13px;
    border-radius: 8px;
  }
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

.article-card-img {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .article-card-img img {
  transform: scale(1.04);
}

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

.article-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 20px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-top: auto;
}

/* Custom Pagination Bar */
.custom-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding: 16px 0;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
}

.pagination-info .fw-bold {
  font-weight: 700;
  color: var(--text-main);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination-nav .page-item {
  margin: 0;
  padding: 0;
}

.pagination-nav .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pagination-nav a.page-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.pagination-nav .page-item.active .page-link {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.pagination-nav .page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Single Article Detail Styling */
.single-article-header {
  max-width: 820px;
  margin: 0 auto 36px auto;
  text-align: center;
}

.single-article-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 16px 0;
  color: var(--text-main);
}

.single-article-lead {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.single-article-hero-img {
  max-width: 1000px;
  margin: 0 auto 48px auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.single-article-hero-img img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.single-article-body {
  max-width: 760px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.8;
  color: #334155;
  word-break: break-word;
  overflow-wrap: break-word;
}

.single-article-body img,
.single-article-body iframe,
.single-article-body video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.single-article-body pre,
.single-article-body code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}

.single-article-body table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

.single-article-body h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin: 40px 0 16px 0;
  letter-spacing: -0.02em;
}

.single-article-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 32px 0 12px 0;
}

.single-article-body p {
  margin-bottom: 24px;
}

.single-article-body ul, .single-article-body ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.single-article-body li {
  margin-bottom: 8px;
}

.article-quote {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  margin: 32px 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 18px;
  color: #1e293b;
}

.single-author-card {
  max-width: 760px;
  margin: 60px auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.single-author-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.related-section {
  max-width: 1240px;
  margin: 80px auto 0 auto;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
}

.related-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 28px;
}
