/* ================================================
   BLOG POST — Complete Design System
   Modern editorial layout · Full-width · Large type
   
   NOTE: main.css sets html { font-size: 62.5% }
   so 1rem = 10px. All rem values below are
   calculated accordingly. px used where clarity matters.
   ================================================ */

/* ---------- Variables ---------- */
:root {
  --bp-accent: #4f8fea;
  --bp-accent-soft: rgba(79, 143, 234, 0.12);
  --bp-accent-hover: #3a7bdb;
  --bp-text-width: 860px;
  --bp-wide-width: 1080px;
}

/* ---------- Page Base ---------- */
body.blog-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 20px !important;
  line-height: 1.6 !important;
  background: var(--base);
  color: var(--t-bright);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Reading Progress ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--bp-accent);
  z-index: 9999;
  transition: width 0.12s linear;
  border-radius: 0 2px 2px 0;
}

/* ==============================================
   LAYOUT — wide, generous spacing
   ============================================== */
.blog-container {
  width: 100%;
  max-width: var(--bp-wide-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  box-sizing: border-box;
}

/* ---------- Back Navigation ---------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--t-medium);
  text-decoration: none;
  font-size: 16px !important;
  font-weight: 500;
  line-height: 1.4;
  padding: 28px 0 12px;
  margin-bottom: 0;
  transition: color 0.2s ease;
  border: none;
  background: none;
}

.back-btn:hover {
  color: var(--bp-accent);
  text-decoration: none;
}

/* ==============================================
   HEADER — big, bold, editorial
   ============================================== */
.blog-header {
  text-align: left;
  padding: 48px 0 40px;
  border-bottom: none;
  margin-bottom: 0;
  max-width: var(--bp-text-width);
}

.blog-title {
  font-size: clamp(34px, 5.5vw, 56px) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.035em;
  color: var(--t-bright);
  margin: 0 0 20px 0;
}

.blog-meta {
  color: var(--t-muted);
  font-size: 16px !important;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.blog-meta span {
  color: var(--t-medium);
  font-weight: 500;
}

/* ==============================================
   HERO IMAGE — full bleed, dramatic
   ============================================== */
.blog-container > .blog-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 16px;
  margin: 24px 0 32px;
  border: none;
  display: block;
}

.blog-image {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  border-radius: 14px;
  margin: 32px 0;
  border: none;
  display: block;
}

/* ==============================================
   TABLE OF CONTENTS
   ============================================== */
.table-of-contents {
  max-width: var(--bp-text-width);
  background: var(--bp-accent-soft);
  border: 1px solid color-mix(in srgb, var(--bp-accent) 20%, transparent);
  border-radius: 14px;
  padding: 28px 32px;
  margin: 0 0 40px;
}

.table-of-contents h4 {
  color: var(--bp-accent);
  margin: 0 0 14px 0;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-list li {
  margin: 0;
  padding-left: 0;
}

.toc-list li::before {
  display: none;
}

.toc-list a {
  color: var(--t-bright);
  text-decoration: none;
  font-size: 17px !important;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.2s ease;
  display: inline-block;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}

.toc-list a:hover {
  color: var(--bp-accent);
  border-bottom-color: var(--bp-accent);
  text-decoration: none;
}

/* ==============================================
   ARTICLE CONTENT — BIG, READABLE TYPOGRAPHY
   ============================================== */
.blog-content {
  max-width: var(--bp-text-width);
  line-height: 1.85;
  font-size: 20px;
  color: var(--t-bright);
  font-weight: var(--font-weight-base);
}

.blog-content p {
  margin: 0 0 1.75em 0;
  text-align: left;
  line-height: 1.85 !important;
  font-size: 20px !important;
  color: var(--t-bright) !important;
  font-weight: var(--font-weight-base);
}

/* First paragraph — slightly larger lead */
.blog-content p:first-child {
  font-size: 22px !important;
  line-height: 1.8 !important;
  color: var(--t-bright) !important;
  font-weight: var(--font-weight-medium);
}

/* ---------- Headings ---------- */
.blog-content h2 {
  font-size: 32px !important;
  font-weight: 700 !important;
  color: var(--t-bright) !important;
  margin: 56px 0 20px 0;
  letter-spacing: -0.03em;
  line-height: 1.25 !important;
  padding: 0;
  border: none;
  text-transform: none;
  position: relative;
}

.blog-content h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--bp-accent);
  margin-bottom: 14px;
  border-radius: 2px;
}

.blog-content h3 {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--t-bright) !important;
  margin: 40px 0 12px 0;
  letter-spacing: -0.02em;
  line-height: 1.35 !important;
}

/* ---------- Inline links ---------- */
.blog-content a {
  color: var(--bp-accent);
  font-size: inherit !important;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content a:hover {
  color: var(--bp-accent-hover);
}

/* ---------- In-article images ---------- */
.blog-content img.blog-image {
  width: calc(100% + 80px);
  max-width: calc(100% + 80px);
  margin-left: -40px;
  margin-right: -40px;
  margin-top: 40px;
  margin-bottom: 40px;
  max-height: 480px;
  border-radius: 14px;
}

/* ---------- Inline highlights ---------- */
.highlight {
  background: var(--bp-accent);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.92em;
  white-space: nowrap;
}

.tech-highlight {
  background: var(--bp-accent-soft);
  color: var(--bp-accent);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.92em;
  border: 1px solid color-mix(in srgb, var(--bp-accent) 25%, transparent);
  white-space: nowrap;
}

/* ==============================================
   SOCIAL SHARE
   ============================================== */
.social-share {
  max-width: var(--bp-text-width);
  border-top: 1px solid var(--stroke-elements);
  padding: 40px 0 0;
  margin: 56px 0 0;
  text-align: center;
}

.social-share h3 {
  color: var(--t-bright);
  margin: 0 0 20px 0;
  font-size: 22px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 600 !important;
  font-size: 15px !important;
  line-height: 1.4;
  transition: all 0.2s ease;
  color: #ffffff;
}

.social-btn.twitter  { background: #1da1f2; }
.social-btn.linkedin { background: #0077b5; }
.social-btn.facebook { background: #1877f2; }
.social-btn.reddit   { background: #ff4500; }

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  color: #ffffff;
  text-decoration: none;
}

.social-share > p {
  color: var(--t-muted);
  font-size: 14px !important;
  line-height: 1.5;
  margin: 0;
}

/* ==============================================
   AUTHOR BIO
   ============================================== */
.author-bio {
  max-width: var(--bp-text-width);
  background: var(--base-tint);
  border: 1px solid var(--stroke-elements);
  border-radius: 16px;
  padding: 32px 36px;
  margin: 36px 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

.author-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  background: var(--bp-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px !important;
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}

.author-info h4 {
  color: var(--t-bright);
  margin: 0 0 6px 0;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.author-info p {
  color: var(--t-medium);
  margin: 0 0 10px 0;
  font-size: 15px !important;
  line-height: 1.55 !important;
}

.author-links {
  display: flex;
  gap: 20px;
}

.author-link {
  color: var(--bp-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px !important;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.author-link:hover {
  color: var(--bp-accent-hover);
  text-decoration: underline;
}

/* ==============================================
   CALL TO ACTION
   ============================================== */
.cta-section {
  max-width: var(--bp-text-width);
  background: var(--bp-accent);
  border: none;
  border-radius: 18px;
  padding: 48px 40px;
  margin: 36px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 60%;
  height: 200%;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-section h3 {
  color: #ffffff;
  font-size: 28px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.cta-section p {
  color: rgba(255,255,255,0.85);
  font-size: 17px !important;
  line-height: 1.6 !important;
  margin: 0 auto 28px;
  max-width: 540px;
}

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

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600 !important;
  font-size: 16px !important;
  line-height: 1.4;
  transition: all 0.2s ease;
  color: var(--bp-accent);
  background: #ffffff;
}

.cta-btn.primary {
  background: #ffffff;
  color: var(--bp-accent);
}

.cta-btn.secondary {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.3);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  text-decoration: none;
}

.cta-btn.primary:hover {
  color: var(--bp-accent);
  background: #f0f4ff;
}

.cta-btn.secondary:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.25);
}

/* ==============================================
   RESPONSIVE
   ============================================== */

/* ---- Tablet ---- */
@media (max-width: 900px) {
  .blog-title {
    font-size: clamp(28px, 5vw, 40px) !important;
  }

  .blog-content,
  .blog-content p {
    font-size: 18px !important;
  }

  .blog-content p:first-child {
    font-size: 19px !important;
  }

  .blog-content h2 {
    font-size: 26px !important;
    margin-top: 44px;
  }

  .blog-content img.blog-image {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .cta-section {
    padding: 36px 28px;
  }
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .blog-container {
    padding: 0 16px;
  }

  .blog-header {
    padding: 28px 0 24px;
  }

  .blog-title {
    font-size: 26px !important;
    letter-spacing: -0.02em;
  }

  .blog-content,
  .blog-content p {
    font-size: 17px !important;
    line-height: 1.78 !important;
  }

  .blog-content p:first-child {
    font-size: 18px !important;
  }

  .blog-content h2 {
    font-size: 22px !important;
    margin-top: 36px;
  }

  .blog-content h3 {
    font-size: 19px !important;
  }

  .blog-content img.blog-image {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    max-width: none;
    border-radius: 0;
  }

  .blog-container > .blog-image {
    border-radius: 10px;
    max-height: 260px;
  }

  .table-of-contents {
    padding: 20px;
    border-radius: 10px;
  }

  .toc-list a {
    font-size: 15px !important;
  }

  .author-bio {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
    gap: 16px;
  }

  .author-links {
    justify-content: center;
  }

  .cta-section {
    padding: 32px 20px;
    border-radius: 14px;
    margin-bottom: 32px;
  }

  .cta-section h3 {
    font-size: 22px !important;
  }

  .cta-section p {
    font-size: 15px !important;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-btn {
    justify-content: center;
  }

  .social-share h3 {
    font-size: 18px !important;
  }

  .social-buttons {
    gap: 8px;
  }

  .social-btn {
    padding: 8px 16px;
    font-size: 13px !important;
  }
}
