/* ===== SELF-HOSTED INTER FONT ===== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/inter-800.woff2') format('woff2'); }

/* ===== VARIABLES ===== */
:root {
  --accent: #4f6ef7;
  --accent-hover: #3b5de7;
  --accent-glow: rgba(79, 110, 247, 0.15);
  --green: #0cce6b;
  --green-hover: #0ab85f;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --navy: #0f172a;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ===== BLOG HEADER ===== */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.blog-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-header__logo img {
  height: 30px;
  width: auto;
}

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

.blog-header__link {
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.blog-header__link:hover {
  color: var(--navy);
}

.blog-header__link--cta {
  background: var(--accent);
  color: var(--white);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.blog-header__link--cta:hover {
  background: var(--accent-hover);
  color: var(--white);
}

/* ===== LAYOUT ===== */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.blog-container--full {
  max-width: 1100px;
}

/* ===== BLOG HERO ===== */
.blog-hero {
  background: var(--navy);
  padding: 80px 24px 60px;
  text-align: center;
}

.blog-hero__inner {
  max-width: 700px;
  margin: 0 auto;
}

.blog-hero__title {
  font-size: 48px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.blog-hero__desc {
  color: rgba(255,255,255,0.6);
  font-size: 18px;
}

/* ===== BLOG LISTING ===== */
.blog-page-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.blog-page-desc {
  color: var(--gray-500);
  font-size: 16px;
  margin-bottom: 40px;
}

.archive-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 8px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* CTA Banner inline between posts */
.blog-cta-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy);
  border-radius: var(--radius);
  padding: 32px 40px;
}

.blog-cta-banner__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
}

.blog-cta-banner__text {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  max-width: 500px;
}

.blog-cta-banner__btn {
  flex-shrink: 0;
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background var(--transition);
}

.blog-cta-banner__btn:hover {
  background: var(--accent-hover);
}

/* ===== POST CARD ===== */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.post-card__image {
  aspect-ratio: 1200/630;
  overflow: hidden;
  background: var(--gray-100);
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--gray-50);
}

.post-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1e293b 100%);
  color: var(--accent);
  font-size: 48px;
}

.post-card__body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--gray-500);
}

.post-card__category {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
}

.post-card__title a {
  color: inherit;
}

.post-card__title a:hover {
  color: var(--accent);
}

.post-card__excerpt {
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__read-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-card__read-more::after {
  content: '\2192';
  transition: transform var(--transition);
}

.post-card__read-more:hover::after {
  transform: translateX(4px);
}

/* ===== PAGINATION ===== */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-200);
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--white);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}

.blog-pagination .page-numbers:hover {
  background: var(--gray-50);
  border-color: var(--accent);
  color: var(--accent);
}

.blog-pagination .page-numbers.current {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* ===== SIDEBAR ===== */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
}

.sidebar-widget__title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

/* Search widget */
.sidebar-search {
  display: flex;
  gap: 8px;
}

.sidebar-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.sidebar-search input:focus {
  border-color: var(--accent);
}

.sidebar-search button {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-search button:hover {
  background: var(--accent-hover);
}

/* Categories widget */
.sidebar-categories {
  list-style: none;
}

.sidebar-categories li {
  margin-bottom: 8px;
}

.sidebar-categories li:last-child {
  margin-bottom: 0;
}

.sidebar-categories a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-700);
  transition: all var(--transition);
}

.sidebar-categories a:hover {
  background: var(--gray-50);
  color: var(--accent);
}

.sidebar-categories .count {
  font-size: 12px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Recent posts widget */
.sidebar-recent-post {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-recent-post:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-recent-post__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gray-800);
}

.sidebar-recent-post__title:hover {
  color: var(--accent);
}

.sidebar-recent-post__date {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* CTA widget */
.sidebar-cta {
  background: linear-gradient(135deg, var(--navy) 0%, #1e293b 100%);
  border-color: transparent;
  text-align: center;
}

.sidebar-cta__title {
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  border-bottom: none;
  padding-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar-cta__text {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.sidebar-cta__btn {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  transition: background var(--transition);
}

.sidebar-cta__btn:hover {
  background: var(--green-hover);
  color: var(--white);
}

/* ===== SINGLE POST ===== */
.single-post-layout {
  padding: 48px 0 80px;
}

.single-post-header {
  max-width: 720px;
  margin: 0 auto 40px;
}

.single-post-header__category {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.single-post-header__title {
  font-size: 40px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 16px;
}

.single-post-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--gray-500);
}

.single-post-header__meta svg {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  margin-right: 4px;
}

/* Table of contents */
.toc {
  max-width: 720px;
  margin: 0 auto 40px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.toc__title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 12px;
}

.toc__list {
  list-style: none;
}

.toc__list li {
  margin-bottom: 6px;
}

.toc__list li:last-child {
  margin-bottom: 0;
}

.toc__list a {
  font-size: 14px;
  color: var(--gray-600);
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all var(--transition);
}

.toc__list a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc__list .toc__h3 {
  padding-left: 28px;
  font-size: 13px;
}

/* Post content */
.single-post-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.8;
  color: var(--gray-800);
}

.single-post-content h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.single-post-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 36px;
  margin-bottom: 12px;
  line-height: 1.35;
}

.single-post-content p {
  margin-bottom: 20px;
}

.single-post-content ul, .single-post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.single-post-content li {
  margin-bottom: 8px;
}

.single-post-content strong {
  font-weight: 700;
  color: var(--gray-900);
}

.single-post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-post-content a:hover {
  color: var(--accent-hover);
}

.single-post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--gray-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--gray-700);
}

.single-post-content code {
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.single-post-content pre {
  background: var(--navy);
  color: var(--gray-300);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}

.single-post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.single-post-content img {
  border-radius: var(--radius-sm);
  margin: 24px 0;
}

/* Author box */
.author-box {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 32px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  display: flex;
  gap: 20px;
  align-items: center;
}

.author-box__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #7c8cf7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 24px;
  flex-shrink: 0;
}

.author-box__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.author-box__bio {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Share buttons */
.share-buttons {
  max-width: 720px;
  margin: 32px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-buttons__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

/* Related posts */
.related-posts {
  max-width: 720px;
  margin: 56px auto 0;
}

.related-posts__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 24px;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-card__image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--navy) 0%, #1e293b 100%);
  overflow: hidden;
}

.related-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card__body {
  padding: 16px;
}

.related-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
}

.related-card__title a {
  color: inherit;
}

.related-card__title a:hover {
  color: var(--accent);
}

.related-card__meta {
  font-size: 12px;
  color: var(--gray-400);
}

/* Bottom CTA banner */
.blog-cta-banner {
  max-width: 720px;
  margin: 56px auto 0;
  background: linear-gradient(135deg, var(--navy) 0%, #1e293b 100%);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
}

.blog-cta-banner__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.blog-cta-banner__text {
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.blog-cta-banner__btn {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  transition: background var(--transition);
}

.blog-cta-banner__btn:hover {
  background: var(--green-hover);
  color: var(--white);
}

/* ===== BLOG FOOTER ===== */
.blog-footer {
  background: var(--navy);
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.08);
}

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

.blog-footer__copy {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

.blog-footer__link {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

.blog-footer__link:hover {
  color: var(--white);
}

/* ===== NO POSTS ===== */
.no-posts {
  text-align: center;
  padding: 80px 0;
}

.no-posts__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.no-posts__text {
  color: var(--gray-500);
  margin-bottom: 24px;
}

.no-posts__btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.no-posts__btn:hover {
  background: var(--accent-hover);
  color: var(--white);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .post-card__body {
    padding: 16px 20px 20px;
  }

  .blog-cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }

  .blog-cta-banner__text {
    max-width: 100%;
  }

  .single-post-header__title {
    font-size: 28px;
  }

  .single-post-content {
    font-size: 16px;
  }

  .single-post-content h2 {
    font-size: 24px;
  }

  .single-post-content h3 {
    font-size: 20px;
  }

  .related-posts__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .blog-cta-banner__title {
    font-size: 22px;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }

  .share-buttons {
    flex-wrap: wrap;
  }

  .blog-footer__inner {
    flex-direction: column;
    gap: 8px;
  }

  .blog-header__nav {
    gap: 16px;
  }

  .blog-header__link:not(.blog-header__link--cta) {
    display: none;
  }

  .toc {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .single-post-header__title {
    font-size: 24px;
  }

  .blog-page-title {
    font-size: 26px;
  }

  .blog-cta-banner__title {
    font-size: 20px;
  }
}
