/* ── ServicePal Blog Shared Stylesheet ── */

/* ── Article Body Typography ── */
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #374151;
}

.article-body h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy, #1A1A2E);
  margin: 48px 0 16px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-body h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy, #1A1A2E);
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

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

.article-body ul,
.article-body ol {
  margin: 0 0 20px 24px;
}

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

.article-body strong {
  color: var(--text, #1c1c1e);
  font-weight: 700;
}

.article-body a {
  color: var(--accent, #e63946);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.article-body a:hover {
  color: var(--red, #8B1A1A);
}

.article-body blockquote {
  border-left: 4px solid var(--accent, #e63946);
  background: var(--bg, #f5f5f0);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #4b5563;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 40px 0;
}

/* ── Code Blocks ── */
.article-body pre {
  background: var(--dark, #0e1116);
  color: #e5e7eb;
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-body code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}

.article-body :not(pre) > code {
  background: var(--bg, #f5f5f0);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--red2, #c62828);
}

/* ── Tables ── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.article-body thead {
  background: var(--navy, #1A1A2E);
  color: white;
}

.article-body thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.article-body thead th:first-child {
  border-radius: 10px 0 0 0;
}

.article-body thead th:last-child {
  border-radius: 0 10px 0 0;
}

.article-body tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.article-body tbody tr:hover {
  background: rgba(230, 57, 70, 0.04);
}

.article-body tbody tr:last-child td:first-child {
  border-radius: 0 0 0 10px;
}

.article-body tbody tr:last-child td:last-child {
  border-radius: 0 0 10px 0;
}

/* ── Responsive Grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

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

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

/* ── Category Tags / Badges ── */
.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
}

.category-tag.pricing {
  background: rgba(139, 26, 26, 0.1);
  color: var(--red2, #c62828);
  border: 1px solid rgba(139, 26, 26, 0.2);
}

.category-tag.industry {
  background: rgba(26, 26, 46, 0.08);
  color: var(--navy, #1A1A2E);
  border: 1px solid rgba(26, 26, 46, 0.15);
}

.category-tag.data {
  background: rgba(230, 57, 70, 0.08);
  color: var(--accent, #e63946);
  border: 1px solid rgba(230, 57, 70, 0.2);
}

.category-tag.comparison {
  background: rgba(107, 114, 128, 0.1);
  color: #4b5563;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.category-tag.case-study {
  background: rgba(139, 26, 26, 0.1);
  color: var(--red, #8B1A1A);
  border: 1px solid rgba(139, 26, 26, 0.2);
}

/* ── Author / Date Styling ── */
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--muted, #6b7280);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.article-meta .author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text, #1c1c1e);
}

.article-meta .author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red, #8B1A1A), var(--accent, #e63946));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.article-meta .date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-meta .reading-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Article Hero / Header ── */
.article-hero {
  padding: 80px 24px 40px;
  text-align: center;
  background: linear-gradient(160deg, var(--dark, #0e1116) 0%, var(--navy, #1A1A2E) 60%, #3d2e4e 100%);
  position: relative;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(230,57,70,0.15) 0%, transparent 70%);
}

.article-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.article-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: white;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

/* ── Blog Card Styles ── */
.blog-card {
  background: var(--white, #ffffff);
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(139, 26, 26, 0.1);
}

.blog-card-thumb {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--dark, #0e1116) 0%, var(--navy, #1A1A2E) 50%, #3d2e4e 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card-thumb .thumb-icon {
  width: 56px;
  height: 56px;
  background: rgba(230, 57, 70, 0.2);
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff6b7a;
}

.blog-card-thumb .thumb-placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.blog-card-body .category-tag {
  margin-bottom: 12px;
  align-self: flex-start;
}

.blog-card-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy, #1A1A2E);
  line-height: 1.35;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.blog-card-body p {
  font-size: 0.95rem;
  color: var(--muted, #6b7280);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.blog-card-body .read-more {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent, #e63946);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.blog-card-body .read-more:hover {
  color: var(--red, #8B1A1A);
}

.blog-card-body .read-more svg {
  transition: transform 0.2s;
}

.blog-card-body .read-more:hover svg {
  transform: translateX(4px);
}

/* ── Blog Card Date ── */
.blog-card-date {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 12px;
}

/* ── Blog Article Content Wrapper ── */
.article-content-wrapper {
  padding: 60px 0;
  background: var(--white, #ffffff);
}

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 24px;
  font-size: 0.85rem;
  color: var(--muted, #6b7280);
}

.breadcrumb a {
  color: var(--accent, #e63946);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .separator {
  margin: 0 8px;
  color: #d1d5db;
}

/* ── Skip to Content ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent, #e63946);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 200;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

/* ── Print Styles ── */
@media print {
  .article-hero,
  nav,
  footer,
  .cta-section,
  .breadcrumb {
    display: none;
  }

  .article-content-wrapper {
    padding: 0;
  }

  .article-body {
    max-width: 100%;
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
  }

  .article-body a {
    color: #000;
    text-decoration: underline;
  }
}
