/*
   n8nu.online - Premium Blog Article Stylesheet
   Designed for ultimate readability, responsive code blocks, and immersive reading experience.
*/

/* ===== READING PROGRESS INDICATOR ===== */
.reading-progress-container {
  position: fixed;
  top: 70px; /* Right under the sticky navigation header */
  left: 0;
  width: 100%;
  height: 4px;
  background-color: transparent;
  z-index: 1001;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transition: width 0.1s ease-out;
}

/* ===== ARTICLE LAYOUT ===== */
.article-container {
  max-width: 820px;
  margin: 3.5rem auto;
  padding: 0 1.5rem;
  padding-bottom: 5rem;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.article-header h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ===== ARTICLE BODY & TYPOGRAPHY ===== */
.article-body {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.article-body p {
  margin-bottom: 1.6rem;
}

.article-body h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 3.5rem 0 1.25rem;
  padding-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.015em;
  border-bottom: 2px solid var(--accent-light);
}

.article-body h3 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin: 2.25rem 0 1rem;
  color: var(--text-primary);
  font-weight: 650;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.8rem;
  padding-left: 1.8rem;
}

.article-body li {
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

.article-body ul li {
  list-style-type: none;
  position: relative;
}

.article-body ul li::before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
  position: absolute;
}

.article-body ol li {
  list-style-type: decimal;
}

/* ===== IN-LINE CODE & PRE CODE ===== */
.article-body code {
  background-color: var(--bg-tertiary);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
  font-size: 0.88em;
  color: var(--accent);
  word-break: break-all;
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-speed);
}

.article-body pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 2rem 0;
  font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
  font-size: 0.925rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.75;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: none;
  word-break: normal;
}

.article-body a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-light);
  transition: all var(--transition-speed);
  font-weight: 600;
}

.article-body a:hover {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
  background-color: var(--accent-light);
  border-radius: 2px;
  padding: 0 2px;
}

/* ===== PREMIUM TABLES ===== */
.article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.5rem 0;
  background: var(--bg-secondary);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.article-body th {
  background-color: var(--bg-tertiary);
  padding: 1rem 1.25rem;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.article-body td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body tr:hover td {
  background-color: var(--bg-primary);
}

/* ===== NOTE & INFO BOXES ===== */
.note-box {
  background: linear-gradient(135deg, var(--accent-light) 0%, rgba(255, 107, 74, 0.03) 100%);
  border-left: 5px solid var(--accent);
  padding: 1.5rem;
  border-radius: 0 16px 16px 0;
  margin: 2.5rem 0;
  box-shadow: 0 4px 20px rgba(255, 107, 74, 0.05);
}

.note-box p {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.info-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.01) 100%);
  border-left: 5px solid var(--primary);
  padding: 1.5rem;
  border-radius: 0 16px 16px 0;
  margin: 2.5rem 0;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.05);
}

.info-box p {
  margin-bottom: 0;
  color: var(--text-primary);
  font-size: 1rem;
}

/* ===== AUTHOR & BIO BOX ===== */
.author-box {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  margin: 4rem 0 3rem;
  box-shadow: var(--card-shadow);
}

.author-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

.author-info h4 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  font-weight: 700;
}

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

/* ===== RELATED & NAVIGATION ===== */
.related-articles {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
}

.related-articles h3 {
  font-size: 1.5rem;
  margin-bottom: 1.75rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.related-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  box-shadow: var(--card-shadow);
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}

.related-card .badge {
  font-size: 0.725rem;
  padding: 0.3rem 0.7rem;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.related-card h4 {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 700;
  flex-grow: 1;
}

.related-card span {
  font-size: 0.825rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.75rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 2rem auto 0;
  max-width: 820px;
  padding: 0 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-speed);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: var(--border-color);
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* ===== RESPONSIVE MEDIA QUERIES ===== */
@media (max-width: 768px) {
  .reading-progress-container {
    top: 65px; /* Offset adjusted for smaller headers */
  }

  .article-container {
    padding: 0 1.25rem;
    margin: 2rem auto;
  }

  .article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .article-header h1 {
    font-size: 1.85rem;
  }

  .article-meta {
    gap: 0.85rem;
    font-size: 0.8rem;
  }

  .article-body {
    font-size: 1.05rem;
  }

  .article-body h2 {
    font-size: 1.45rem;
    margin: 2.75rem 0 1rem;
  }

  .article-body h3 {
    font-size: 1.2rem;
  }

  .article-body pre {
    font-size: 0.85rem;
    padding: 1.2rem;
    margin: 1.5rem 0;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1rem;
  }

  .breadcrumb-current {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .article-header h1 {
    font-size: 1.6rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .article-body pre {
    font-size: 0.8rem;
    padding: 1rem;
  }

  .breadcrumb-current {
    max-width: 140px;
  }
}
