/* ============================================================
   Blog & Article Layout — Ramin Khaligh (blog-post.css)
   Works for both blog index page and single blog posts
   ============================================================ */

/* ===== General Container ===== */
main.container {
  padding-top: 4rem;
  display: flex;
  justify-content: center;
}

/* ===== Article Card ===== */
article.card {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 3rem;
  padding: 1.5rem 1.8rem;
  background: transparent;
}

/* ===== Article Image ===== */
article.card img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  display: block;
}

/* ===== Breadcrumb Navigation ===== */
.breadcrumb {
  max-width: 680px;
  margin: 1rem auto;
  padding: 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

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

.breadcrumb span {
  margin: 0 0.4rem;
  color: var(--muted);
}

/* ===== Call To Action Buttons ===== */
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.cta .btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ===== Related Posts Section ===== */
.related-posts {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.related-posts h3 {
  margin-bottom: 0.5rem;
}

.related-posts ul {
  list-style: none;
  padding-left: 0;
  line-height: 1.8;
}

.related-posts a {
  color: var(--accent);
  text-decoration: none;
}

.related-posts a:hover {
  text-decoration: underline;
}

/* ===== Blog Grid (for index page) ===== */
#blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

#blog-grid article.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  background: rgba(255,255,255,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#blog-grid article.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

/* ===== Blockquotes ===== */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: italic;
}

/* ===== Blog Header ===== */
#blog-header {
  text-align: center;
  max-width: 720px;
  margin: 2rem auto 2rem;
}

#blog-header h1 {
  margin-bottom: 0.5rem;
}

#blog-header p {
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ===== Smooth Lazy Image Load ===== */
img[loading="lazy"] {
  transition: opacity 0.3s ease;
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* ===== Reading Progress Bar ===== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s ease-out, opacity 0.3s ease;
  opacity: 0;
}

#reading-progress.active {
  opacity: 1;
}

/* ===== Table of Contents ===== */
#table-of-contents {
  position: sticky;
  top: 6rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 2rem 0;
  font-size: 0.9rem;
  box-shadow: var(--shadow-1);
}

#table-of-contents strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-weight: 600;
}

#table-of-contents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#table-of-contents li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

#table-of-contents a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

#table-of-contents a:hover,
#table-of-contents a.active {
  color: var(--accent);
  text-decoration: underline;
}

/* Hide TOC on mobile */
@media (max-width: 768px) {
  #table-of-contents {
    display: none;
  }
}

/* ===== Two-Column Layout (optional) ===== */
@media (min-width: 1100px) {
  main.container.two-column {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 6rem;
    height: fit-content;
  }
}

/* ===== Responsive Adjustments ===== */
@media (min-width: 700px) {
  #blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (min-width: 1000px) {
  article.card,
  .breadcrumb {
    max-width: 640px;
  }

  article.card img {
    max-height: 320px;
  }
}

/* ===== Smooth Scrolling ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Utility: Selection ===== */
::selection {
  background: var(--accent);
  color: #fff;
}
/* =====================================================
   BLOG POST EXTENSIONS — Compatible with main style.css
   ===================================================== */

/* ===== General article layout ===== */
article.card {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow-1);
}

article.card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin-bottom: 2rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  max-width: 760px;
  margin: 1.2rem auto 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

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

/* ===== Reading time ===== */
#reading-time {
  color: var(--accent);
}

/* ===== Related Topics ===== */
.related-topics {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.related-topics strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--accent);
}

.related-topics ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-topics li {
  margin: 0;
}

.related-topics a {
  color: var(--accent);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-topics a:hover {
  background: var(--accent);
  color: #fff;
}

/* ===== Share Section ===== */
.share-post {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.share-post strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.share-icons {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.share-icons a,
.share-icons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-icons a:hover,
.share-icons button:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.share-icons svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  transition: stroke 0.2s ease;
}

.share-icons a:hover svg,
.share-icons button:hover svg {
  stroke: #fff;
}

/* ===== Author Bio ===== */
.author-bio {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow-1);
}

.author-bio img {
  border-radius: 50%;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.author-bio h3 {
  margin: 0 0 0.2rem;
  color: var(--accent);
}

.author-bio p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.author-bio .btn.small {
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* ===== CTA Section ===== */
.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 600px) {
  .cta {
    flex-direction: column;
    gap: 0.6rem;
  }
}

/* ===== Typography adjustments ===== */
article.card h2 {
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
}

article.card p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

article.card blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: italic;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
  article.card {
    padding: 1.5rem;
  }

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

  .author-bio img {
    width: 64px;
    height: 64px;
  }

  .related-topics ul,
  .share-icons {
    justify-content: center;
  }
}
