/* ==========================================================================
   PUBLIC BLOG PAGES v3 — listing + single post
   ========================================================================== */

/* ==========================================================================
   BLOG HERO
   ========================================================================== */

.blog-hero {
  padding: 56px 0 22px;
  text-align: center;
}

.blog-hero .eyebrow-pill {
  margin-bottom: 16px;
}

.blog-hero h1 {
  font-size: 2.4rem;
  margin: 0 0 10px;
  font-weight: 700;
}

.blog-hero p {
  color: var(--text-dim);
  font-size: 1.02rem;
}

/* ==========================================================================
   BLOG CATEGORY FILTERS
   ========================================================================== */

.blog-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 4px 0 28px;
}

.category-pill {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s ease;
}

.category-pill:hover {
  border-color: var(--accent-1);
  color: var(--text);
}

.category-pill.active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

/* Category label inside a blog card — clickable to filter the listing
   without following the card's own link to the post. */
.meta-category {
  cursor: pointer;
}

.meta-category:hover {
  color: var(--accent-1);
  text-decoration: underline;
}

/* ==========================================================================
   BLOG LISTING
   ========================================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding: 34px 0 60px;
}

.blog-card {
  overflow: hidden;
  transition: 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(99, 102, 241, 0.25);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card .body {
  padding: 20px;
}

.blog-card .meta {
  font-size: 0.78rem;
  color: var(--accent-3);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.4;
}

.blog-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 12px;
}

/* ==========================================================================
   SINGLE POST LAYOUT
   ========================================================================== */

.post-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;

  margin: 34px 0 70px;

  align-items: start;
}

/* ==========================================================================
   ARTICLE SCROLL BOX
   ========================================================================== */

.post-layout article {
  order: 2;
  min-width: 0;

  /*
     Main article scrolling area
  */
  height: 720px;

  overflow-y: auto;
  overflow-x: hidden;

  /*
     Internal spacing
  */
  padding: 35px 45px;

  /*
     Ephraix design
  */
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  /*
     Smooth anchor scrolling
  */
  scroll-behavior: smooth;

  /*
     Prevent content from touching scrollbar
  */
  scrollbar-gutter: stable;
}

/* ==========================================================================
   ARTICLE SCROLLBAR
   ========================================================================== */

.post-layout article::-webkit-scrollbar {
  width: 8px;
}

.post-layout article::-webkit-scrollbar-track {
  background: transparent;
}

.post-layout article::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 20px;
}

.post-layout article::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

/* Firefox scrollbar */

.post-layout article {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ==========================================================================
   ARTICLE ORDER
   ========================================================================== */

.post-layout aside {
  order: 1;
  align-self: start;
}

/* ==========================================================================
   POST HEADER
   ========================================================================== */

.post-header {
  margin-bottom: 22px;
}

.post-header .cat {
  color: var(--accent-3);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
}

.post-header .cat:hover {
  text-decoration: underline;
}

.post-header h1 {
  font-size: 2.2rem;
  margin: 12px 0 16px;
  line-height: 1.25;
  font-weight: 700;
}

.post-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;

  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ==========================================================================
   FEATURED IMAGE
   ========================================================================== */

.post-featured {
  width: 100%;

  border-radius: var(--radius-sm);

  margin: 22px 0 10px;

  max-height: 420px;

  object-fit: cover;

  box-shadow: var(--shadow);
}

/* ==========================================================================
   POST CONTENT
   ========================================================================== */

.post-content {
  font-size: 1.04rem;

  line-height: 1.85;

  color: var(--text);

  max-width: 820px;

  /*
     Keeps article content nicely centered
     inside the scrolling container
  */
  margin: 0 auto;
}

/* ==========================================================================
   H2
   ========================================================================== */

.post-content h2 {
  margin: 48px 0 14px;

  font-size: 1.75rem;

  line-height: 1.3;

  font-weight: 700;

  color: var(--text);

  scroll-margin-top: 105px;
}

/* ==========================================================================
   H3
   ========================================================================== */

.post-content h3 {
  margin: 34px 0 10px;

  font-size: 1.28rem;

  line-height: 1.4;

  font-weight: 600;

  color: var(--text);

  scroll-margin-top: 105px;
}

/* ==========================================================================
   PARAGRAPHS
   ========================================================================== */

.post-content p {
  color: var(--text-muted);

  margin: 0 0 20px;

  line-height: 1.85;
}

/* First paragraph emphasis */

.post-content > p:first-of-type {
  font-size: 1.14rem;

  color: var(--text);
}

/* ==========================================================================
   LISTS
   ========================================================================== */

.post-content ul,
.post-content ol {
  color: var(--text-muted);

  margin: 0 0 22px;

  padding-left: 24px;

  line-height: 1.8;
}

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

/* ==========================================================================
   STRONG / BOLD TEXT
   ========================================================================== */

.post-content strong {
  color: var(--text);

  font-weight: 600;
}

/* ==========================================================================
   BLOCKQUOTE
   ========================================================================== */

.post-content blockquote {
  position: relative;

  border-left: 3px solid var(--accent-1);

  margin: 26px 0;

  padding: 14px 24px 14px 46px;

  color: var(--text);

  background: var(--surface);

  border-radius: 0 12px 12px 0;

  font-style: italic;
}

.post-content blockquote::before {
  content: "\201C";

  position: absolute;

  left: 14px;

  top: 2px;

  font-size: 1.8rem;

  line-height: 1;

  font-style: normal;

  color: var(--accent-1);

  opacity: 0.7;

  font-family: Georgia, serif;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.post-content table {
  border-collapse: collapse;

  width: 100%;

  margin: 22px 0;

  border-radius: var(--radius-sm);

  overflow: hidden;

  box-shadow: var(--shadow);
}

.post-content td,
.post-content th {
  border: 1px solid var(--border);

  padding: 11px 14px;

  text-align: left;
}

.post-content th {
  background: var(--surface-2);

  color: var(--text);

  font-weight: 600;
}

.post-content tr:nth-child(even) td {
  background: var(--surface);
}

/* ==========================================================================
   IMAGES INSIDE ARTICLE
   ========================================================================== */

.post-content img {
  border-radius: 12px;

  margin: 20px 0;

  box-shadow: var(--shadow);

  max-width: 100%;

  height: auto;
}

/* ==========================================================================
   LINKS
   ========================================================================== */

.post-content a {
  color: var(--accent-3);

  text-decoration: underline;

  text-underline-offset: 3px;

  transition: color 0.15s;
}

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

/* ==========================================================================
   HORIZONTAL RULE
   ========================================================================== */

.post-content hr {
  border: none;

  border-top: 1px solid var(--border);

  margin: 36px 0;
}

/* ==========================================================================
   READING TIME
   ========================================================================== */

.post-meta .dot {
  opacity: 0.5;
}

/* ==========================================================================
   SHARE ROW
   ========================================================================== */

.post-share {
  display: flex;

  align-items: center;

  gap: 12px;

  flex-wrap: wrap;

  margin-top: 36px;

  padding-top: 24px;

  border-top: 1px solid var(--border);
}

.post-share .share-label {
  font-size: 0.85rem;

  font-weight: 600;

  color: var(--text-muted);

  margin-right: 2px;
}

.post-share button,
.post-share a {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 38px;

  height: 38px;

  border-radius: 50%;

  background: var(--surface);

  border: 1px solid var(--border);

  color: var(--text-muted);

  cursor: pointer;

  transition: 0.2s ease;

  padding: 0;
}

.post-share button:hover,
.post-share a:hover {
  border-color: var(--accent-1);

  color: var(--accent-1);

  transform: translateY(-2px);
}

.post-share svg {
  width: 17px;

  height: 17px;
}

.post-share .copy-status {
  font-size: 0.8rem;

  color: var(--accent-3);

  opacity: 0;

  transition: opacity 0.2s;
}

.post-share .copy-status.show {
  opacity: 1;
}

/* ==========================================================================
   TAGS
   ========================================================================== */

.post-tags {
  display: flex;

  gap: 8px;

  flex-wrap: wrap;

  margin-top: 32px;
}

.post-tags .pill {
  background: var(--surface-2);

  color: var(--text-muted);

  border: 1px solid var(--border);
}

/* ==========================================================================
   POST DISCLAIMER
   ========================================================================== */

.post-disclaimer {
  margin-top: 32px;

  padding: 16px 20px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-left: 3px solid var(--accent-1);

  border-radius: var(--radius);

  font-size: 0.85rem;

  line-height: 1.7;

  color: var(--text-muted);
}

.post-disclaimer strong {
  color: var(--text);
}

/* ==========================================================================
   FAQ SECTION
   ========================================================================== */

.faq-section {
  margin-top: 36px;

  padding-top: 8px;

  border-top: 1px solid var(--border);
}

.faq-section h3 {
  margin: 24px 0 16px;

  font-size: 1.3rem;
}

.faq-list {
  display: flex;

  flex-direction: column;

  gap: 12px;
}

.faq-item {
  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  padding: 4px 20px;

  transition: border-color 0.15s;
}

.faq-item[open] {
  border-color: var(--accent-1);
}

.faq-question {
  list-style: none;

  cursor: pointer;

  padding: 16px 34px 16px 0;

  font-weight: 600;

  font-size: 0.98rem;

  color: var(--text);

  position: relative;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';

  position: absolute;

  right: 2px;

  top: 50%;

  transform: translateY(-50%);

  font-size: 1.3rem;

  color: var(--accent-1);

  transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
  padding: 0 0 18px;

  color: var(--text-muted);

  font-size: 0.92rem;

  line-height: 1.7;
}

/* ==========================================================================
   PREVIOUS / NEXT ARTICLE NAVIGATION
   ========================================================================== */

.post-nav {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 18px;

  margin-top: 44px;

  padding-top: 8px;
}

.post-nav-link {
  display: flex;

  flex-direction: column;

  gap: 8px;

  padding: 20px 22px;

  border-radius: var(--radius);

  border: 1px solid var(--border);

  background: var(--surface);

  transition: 0.2s ease;

  min-width: 0;
}

.post-nav-link:hover {
  border-color: var(--accent-1);

  transform: translateY(-3px);

  box-shadow: var(--shadow);
}

.post-nav-link.next {
  align-items: flex-end;

  text-align: right;
}

.post-nav-direction {
  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 0.76rem;

  font-weight: 700;

  text-transform: uppercase;

  letter-spacing: 0.06em;

  color: var(--accent-3);
}

.post-nav-link.next .post-nav-direction {
  flex-direction: row-reverse;
}

.post-nav-title {
  font-size: 1rem;

  font-weight: 600;

  color: var(--text);

  line-height: 1.4;

  display: -webkit-box;

  -webkit-line-clamp: 2;

  -webkit-box-orient: vertical;

  overflow: hidden;
}

.post-nav-empty {
  padding: 20px 22px;

  border-radius: var(--radius);

  border: 1px dashed var(--border);

  color: var(--text-dim);

  font-size: 0.88rem;

  display: flex;

  align-items: center;
}

.post-nav-empty.next {
  justify-content: flex-end;

  text-align: right;
}

/* ==========================================================================
   TABLE OF CONTENTS
   ========================================================================== */

.toc-box {
  position: sticky;

  top: 100px;

  height: 720px;

  max-height: calc(100vh - 120px);

  overflow-y: auto;

  overflow-x: hidden;

  padding: 25px 20px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  scrollbar-gutter: stable;
}

/* ==========================================================================
   TOC SCROLLBAR
   ========================================================================== */

.toc-box::-webkit-scrollbar {
  width: 7px;
}

.toc-box::-webkit-scrollbar-track {
  background: transparent;
}

.toc-box::-webkit-scrollbar-thumb {
  background: var(--border);

  border-radius: 20px;
}

.toc-box::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

/* Firefox */

.toc-box {
  scrollbar-width: thin;

  scrollbar-color: var(--border) transparent;
}

/* ==========================================================================
   TOC HEADING
   ========================================================================== */

.toc-box h4 {
  margin: 0 0 18px;

  font-size: 1.08rem;

  font-weight: 700;

  text-transform: none;

  letter-spacing: normal;

  color: var(--text);

  display: flex;

  justify-content: space-between;

  align-items: center;

  cursor: pointer;
}

/* ==========================================================================
   TOC LIST
   ========================================================================== */

.toc-box ul {
  list-style: none;

  margin: 0;

  padding: 0;
}

.toc-box li {
  margin-bottom: 16px;
}

.toc-box li.toc-sub {
  padding-left: 14px;
}

/* ==========================================================================
   TOC LINKS
   ========================================================================== */

.toc-box a {
  display: block;

  font-size: 0.92rem;

  line-height: 1.5;

  color: var(--text-muted);

  transition: color 0.15s;
}

.toc-box a:hover,
.toc-box a.active {
  color: var(--accent-1);
}

/* ==========================================================================
   TOC TOGGLE
   ========================================================================== */

.toc-toggle-icon {
  display: none;

  font-size: 0.8rem;
}

/* ==========================================================================
   RELATED POSTS
   ========================================================================== */

.related-section {
  padding: 30px 0 60px;

  border-top: 1px solid var(--border);

  margin-top: 30px;
}

.related-section h3 {
  margin-bottom: 18px;

  font-size: 1.3rem;
}

/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1100px) {
  .post-layout {
    grid-template-columns: 220px minmax(0, 1fr);

    gap: 28px;
  }

  .post-layout article {
    padding: 30px 32px;
  }

  .toc-box {
    padding: 22px 16px;
  }
}

/* ==========================================================================
   MOBILE / TABLET
   ========================================================================== */

@media (max-width: 920px) {
  .post-layout {
    grid-template-columns: 1fr;

    gap: 20px;

    margin-top: 25px;
  }

  /* TOC becomes a normal box above article */

  .post-layout aside {
    order: 1;

    margin-bottom: 0;
  }

  .toc-box {
    position: static;

    height: auto;

    max-height: 320px;

    padding: 20px;
  }

  /* Article remains scrollable */

  .post-layout article {
    order: 2;

    height: 650px;

    padding: 28px 24px;
  }

  .toc-toggle-icon {
    display: inline;
  }

  .toc-box ul {
    display: none;

    max-height: none;
  }

  .toc-box.open ul {
    display: block;
  }
}

/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 640px) {
  .blog-hero {
    padding: 40px 0 18px;
  }

  .blog-hero h1 {
    font-size: 2rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;

    padding: 25px 0 45px;
  }

  /* Article box */

  .post-layout article {
    height: 600px;

    padding: 24px 20px;

    border-radius: 16px;
  }

  /* TOC box */

  .toc-box {
    max-height: 280px;

    padding: 18px;
  }

  /* Article heading */

  .post-header h1 {
    font-size: 1.8rem;
  }

  .post-content {
    font-size: 1rem;

    line-height: 1.8;
  }

  .post-content h2 {
    font-size: 1.5rem;

    margin-top: 38px;
  }

  .post-content h3 {
    font-size: 1.18rem;

    margin-top: 28px;
  }

  .post-content p {
    line-height: 1.8;
  }

  /* Previous / Next */

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-link.next {
    align-items: flex-start;

    text-align: left;
  }

  .post-nav-link.next .post-nav-direction {
    flex-direction: row;
  }

  .post-nav-empty.next {
    justify-content: flex-start;

    text-align: left;
  }
}

/* ==========================================================================
   VERY SMALL PHONES
   ========================================================================== */

@media (max-width: 420px) {
  .post-layout article {
    height: 560px;

    padding: 20px 16px;
  }

  .toc-box {
    max-height: 250px;

    padding: 16px;
  }

  .post-header h1 {
    font-size: 1.6rem;
  }

  .post-content h2 {
    font-size: 1.4rem;
  }

  .post-content p {
    font-size: 0.96rem;
  }
}




