/* ===============================
   BASE LAYOUT
================================ */

body {
  /* background:
    radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(118, 75, 162, 0.1), transparent 22%),
    #0a0a0f; */
  background: #0a0a0f; /* stable base */
  color: #e5e7eb;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.7;
}

/* Main article shell */
.blog-post {
  max-width: 860px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
}


/* ===============================
   BLOG HERO
================================ */

.blog-hero {
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  width: 100%;
  padding: 6rem 0 4rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(111, 102, 234, 0.18), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(81, 67, 95, 0.22), transparent 35%);
}

.blog-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.blog-hero-top {
  position: relative;
  z-index: 2;

  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 0.8rem;
}

.blog-home-link {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;

  color: #9ca3af;
  text-decoration: none;
}

.blog-home-link:hover {
  color: #c7d2fe;
}


.blog-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;

  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  /* align-items: center; */

  align-items: stretch;
}

.blog-hero-title {
  font-size: 2.6rem;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 1.2rem;

  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #c7d2fe 45%,
    #a5b4fc 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #9ca3af;
  font-size: 0.95rem;
  margin-bottom: 1.6rem;
}

.blog-hero-meta .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b5563;
}

.blog-author-link {
  color: #9ca3af;
  text-decoration: none;
}

.blog-author-link:hover {
  color: #c7d2fe;
}


.blog-hero-summary {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #d1d5db;
  max-width: 520px;
}

/* ===============================
   BLOG TAGS
================================ */

.blog-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.blog-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;

  padding: 0.3rem 0.6rem;
  border-radius: 999px;

  color: #c7d2fe;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.35);

  user-select: none;
}


.blog-hero-right {
  height: 100%;
  width: 100%;
  display: flex;
}

/* Right image */

.blog-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.blog-hero-right .blog-hero-image {
  border-radius: 18px;
}


/* ===============================
   SCROLL PROGRESS BAR
================================ */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;

  width: 0%;
  height: 3px;

  background: linear-gradient(
    90deg,
    #667eea,
    #764ba2
  );

  z-index: 9999;
}



/* ===============================
   ARTICLE CONTENT
================================ */

.blog-content {
  color: #d1d5db;
  font-size: 1.05rem;
  line-height: 1.75;
  margin-left: auto;
  margin-right: auto;
}

.blog-content p {
  margin-bottom: 2rem;
}

/* Links */
.blog-content a {
  color: #a5b4fc;
  text-decoration: none;
  border-bottom: 1px solid rgba(165, 180, 252, 0.6);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-content a:hover {
  color: #c7d2fe;
  border-color: rgba(199, 210, 254, 0.9);
}

/* Headings */
.blog-content h2 {
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  font-weight: 800;
  color: #f9fafb;
  position: relative;
}

.blog-content h2::before {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 999px;
}

.blog-content h3 {
  margin-top: 3rem;
  margin-bottom: 1.2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #e5e7eb;
}

/* Lists */
.blog-content ul,
.blog-content ol {
  margin: 0 0 2rem 1.6rem;
}

.blog-content li {
  margin-bottom: 0.9rem;
}

.blog-content pre {
  background: #0f172a ;
  border-radius: 14px;
  padding: 1.8rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;

  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-content pre,
.blog-content code {
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.blog-content pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.blog-content pre::-webkit-scrollbar-track {
  background: transparent;
}

.blog-content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  font-size: 0.9em;
  color: #c7d2fe;
}

/* ===============================
   Copy Code Button
================================ */

.blog-content pre {
  position: relative; /* anchor for button */
}

.copy-code-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;

  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;

  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;

  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.blog-content pre:hover .copy-code-btn {
  opacity: 1;
}

.copy-code-btn:hover {
  background: rgba(102, 126, 234, 0.25);
}

.copy-code-btn.copied {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}


/* ===============================
   MEDIA
================================ */

.blog-content img {
  max-width: min(100%, 800px);
  display: block;
  margin: 2.5rem auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

.blog-content .image-caption {
  font-size: 0.9rem;
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  margin-top: -1.2rem;
  margin-bottom: 2.5rem;
}

/* ===============================
   QUOTES & CODE
================================ */

.blog-content blockquote {
  margin: 3rem 0;
  padding: 1.8rem 2rem;
  border-radius: 16px;
  background:
    linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.15),
      rgba(118, 75, 162, 0.12)
    );
  color: #e5e7eb;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.blog-content code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: "Courier Prime", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.9rem;
  color: #c7d2fe;
}

.blog-content pre {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.8rem;
  overflow-x: auto;
  margin: 2.5rem 0;
  font-size: 0.875rem;
  line-height: 1.65;
}

.blog-content pre code {
  background: transparent;
  padding: 0;
  color: #e5e7eb;
}

/* ===============================
   TABLES
================================ */

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: 1rem;
}

.blog-content th,
.blog-content td {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-content th {
  background: rgba(102, 126, 234, 0.15);
  color: #f3f4f6;
  text-align: left;
}

.blog-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ===============================
   LIKE SECTION (MINIMAL, RED HEART)
================================ */

.blog-like-section {
  margin: 5rem 0 4rem;

  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;

  text-align: center;
}

/* Button */

.blog-like-btn {
  background: none;
  border: none;
  cursor: pointer;

  width: 60px;
  height: 60px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  /* transition: transform 0.2s ease; */
}

.blog-like-btn:hover {
  transform: translateY(-2px);
}

/* Heart icon */

.heart-icon {
  font-size: 2.4rem;
  line-height: 1;

  color: #6b7280; /* neutral gray by default */

  /* transition:
    color 0.2s ease,
    transform 0.2s ease,
    text-shadow 0.2s ease; */
}

/* Hover (preview) */

.blog-like-btn:hover .heart-icon {
  color: #e45252; /* soft red */
  /* transform: scale(1.08); */
}

/* Liked state */

.blog-like-btn.liked .heart-icon {
  color: #d62929;

  text-shadow:
    0 0 12px rgba(239, 68, 68, 0.45),
    0 0 28px rgba(239, 68, 68, 0.25);

  transform: scale(1.15);
}

.like-count-text {
  font-size: 0.95rem;
  color: #9ca3af;
}

/* ===============================
   ARTICLE FOOTER
================================ */

.blog-footer {
  position: relative;
  overflow: hidden;
  margin-top: 3rem;
  padding-top: 3rem;
  text-align: center;
  background:
    linear-gradient(
      to bottom,
      #0a0a0f 0%,
      transparent 120px
    ),
    radial-gradient(circle at 20% 20%, rgba(111, 102, 234, 0.10), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(81, 67, 95, 0.14), transparent 40%);
}


.blog-end-note {
  margin-bottom: 1.6rem;
  font-size: 0.95rem;
  color: #9ca3af;
}

.blog-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.35);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.14),
    rgba(118, 75, 162, 0.12)
  );
  transition: all 0.25s ease;
}

.blog-footer-link:hover {
  color: #c7d2fe;
  border-color: rgba(102, 126, 234, 0.55);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

/* ===============================
   SUBSCRIBE SECTION
================================ */

.blog-subscribe {
  margin: 6rem auto 5rem;
  max-width: 560px;
  text-align: center;
  padding: 0 1.5rem;
}

.subscribe-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.6rem;

  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #c7d2fe 50%,
    #a5b4fc 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subscribe-description {
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 1.4rem;
  line-height: 1.5;
}

.subscribe-form {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.subscribe-input {
  flex: 1;
  min-width: 0;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;

  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  color: #e5e7eb;

  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.subscribe-input::placeholder {
  color: #6b7280;
}

.subscribe-input:focus {
  border-color: rgba(165, 180, 252, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

.subscribe-btn {
  padding: 0.6rem 1.1rem;

  border-radius: 10px;
  border: 1px solid rgba(102, 126, 234, 0.35);

  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.18),
    rgba(118, 75, 162, 0.16)
  );

  color: #c7d2fe;
  font-weight: 600;
  font-size: 0.95rem;

  cursor: pointer;
  transition: all 0.2s ease;
}

.subscribe-btn:hover {
  color: #e5e7eb;
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}

.subscribe-message {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #9ca3af;
  min-height: 1.2em;
}

.subscribe-message.success {
  color: #86efac; /* soft green */
}

.subscribe-message.error {
  color: #fca5a5; /* soft red */
}

.subscribe-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* ===============================
   BLOG NEXT / PREV NAV
================================ */

.blog-nav {
  align-self: stretch;
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.blog-nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;

  max-width: 420px;
  width: 100%;

  padding: 0.8rem 1rem;

  text-decoration: none;
  color: #e5e7eb;

  transition: background 0.2s ease, transform 0.2s ease;
}

.blog-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}
.blog-nav-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.blog-nav-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.blog-nav-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.blog-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: #f9fafb;
}

/* Desktop direction cues */

.blog-nav-newer {
  text-align: left;
  justify-content: flex-start;
}

.blog-nav-older {
  justify-content: space-between;
  text-align: right;
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 640px) {
  .blog-nav {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }

  .blog-nav-item {
    background: none;
    border: none;
    box-shadow: none;

    padding: 0.6rem 0.8rem;
    margin: 0 1rem;

    flex-direction: row;
    align-items: center;
  }

   .blog-nav-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-bottom: 0;
  }

    .blog-nav-title {
    font-size: 0.9rem;
    font-weight: 500;
  }

  .blog-nav-label {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }

  /* Remove desktop mirroring on mobile */
  .blog-nav-older {
    justify-content: flex-start;
    text-align: left;
  }
}




/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 900px) {
  .blog-hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .blog-hero-right {
    height: auto;
  }

  .blog-hero-image {
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 18px;
  }
}


@media (max-width: 480px) {
  .blog-post {
    padding-left: 0;
    padding-right: 0;
  }

  .blog-title {
    font-size: 1.6rem;
  }

  .blog-meta {
    flex-direction: column;
    gap: 0.4rem;
  }

  .blog-content {
    font-size: 0.95rem;
    max-width: none;
  }
}
