/* ==========================================================================
   DiskAtlas Blog & Guides - Dedicated CSS Architecture
   ========================================================================== */

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #007aff, #8b5cf6, #34c759);
  width: 0%;
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Blog Hub Layout */
.blog-header {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}

.blog-header .section-title {
  font-size: 2.8rem;
  margin-top: 12px;
  margin-bottom: 16px;
}

.blog-header .section-desc {
  max-width: 680px;
  margin: 0 auto 30px;
  font-size: 1.1rem;
  color: var(--ink-secondary);
}

/* Search & Filter Toolbar */
.blog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.blog-search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 440px;
}

.blog-search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--chrome-border);
  color: var(--ink);
  padding: 12px 18px 12px 42px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.blog-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  background: var(--bg-elevated);
}

.blog-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.blog-categories {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--chrome-border);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.category-pill:hover {
  background: var(--bg-elevated);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.15);
}

.category-pill.active {
  background: rgba(0, 122, 255, 0.15);
  border-color: var(--accent);
  color: #60a5fa;
  font-weight: 600;
}

/* Featured Article Card */
.featured-post-card {
  background: linear-gradient(135deg, rgba(21, 22, 27, 0.95), rgba(34, 36, 44, 0.8));
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 48px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.featured-post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(0, 122, 255, 0.2);
  color: #60a5fa;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.featured-title {
  font-size: 1.85rem;
  line-height: 1.25;
  margin-bottom: 14px;
}

.featured-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.featured-title a:hover {
  color: #60a5fa;
}

.featured-summary {
  color: var(--ink-secondary);
  font-size: 0.96rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.featured-visual {
  background: var(--bg-main);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

/* Blog Articles Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  text-decoration: none;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  background: var(--bg-card-hover);
}

.article-card-header {
  margin-bottom: 14px;
}

.article-card-tag {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 12px;
}

.tag-dev {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.tag-system {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tag-apfs {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.tag-apps {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.tag-docker {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.tag-compare {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.article-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--ink);
}

.article-card-desc {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   Article Detail Page Layout & Typography
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  padding: 40px 0 80px;
  align-items: start;
}

.article-main {
  min-width: 0;
}

/* Breadcrumbs */
.breadcrumbs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 24px;
}

.breadcrumbs-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs-nav a:hover {
  color: var(--accent);
}

/* Post Header */
.post-header {
  margin-bottom: 36px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--chrome-border);
}

.post-title {
  font-size: 2.6rem;
  line-height: 1.2;
  margin-top: 14px;
  margin-bottom: 18px;
}

.post-intro {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.84rem;
}

/* Article Body Typography */
.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #e5e7eb;
}

.article-content h2 {
  font-size: 1.75rem;
  margin-top: 48px;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: #f9fafb;
}

.article-content h3 {
  font-size: 1.35rem;
  margin-top: 32px;
  margin-bottom: 14px;
  color: #f3f4f6;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul, .article-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content strong {
  color: #fff;
  font-weight: 600;
}

.article-content a {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.article-content a:hover {
  color: #93c5fd;
}

/* Code Blocks & Terminal Snippets */
.code-block-wrapper {
  background: #0f1015;
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-md);
  margin: 24px 0;
  overflow: hidden;
  position: relative;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.code-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.code-copy-btn.copied {
  background: rgba(52, 199, 89, 0.2);
  color: #4ade80;
  border-color: rgba(52, 199, 89, 0.4);
}

pre.code-content {
  padding: 18px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #93c5fd;
}

code.inline-code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: #60a5fa;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Callout Alerts */
.callout {
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0;
  display: flex;
  gap: 16px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.callout-tip {
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.25);
  color: #bfdbfe;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.callout-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

/* In-Article Action Banner */
.article-cta-box {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(0, 122, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 40px 0;
  text-align: center;
}

.article-cta-box h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #fff;
}

.article-cta-box p {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 20px;
}

/* Comparison Tables in Articles */
.article-table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--chrome-border);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  background: var(--bg-card);
}

.article-table th {
  background: var(--bg-elevated);
  padding: 14px 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--chrome-border);
  color: var(--ink);
}

.article-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
}

.article-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Table of Contents Sticky Sidebar */
.article-sidebar {
  position: sticky;
  top: 100px;
}

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.toc-link {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.4;
  display: block;
  padding-left: 10px;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-link:hover {
  color: var(--ink);
  border-left-color: var(--border-active);
}

.toc-link.active {
  color: #60a5fa;
  font-weight: 600;
  border-left-color: var(--accent);
}

/* Social Share Bar */
.post-share-bar {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--chrome-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.share-btn:hover {
  background: var(--bg-elevated);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Related Posts */
.related-posts-section {
  padding: 60px 0;
  border-top: 1px solid var(--chrome-border);
  margin-top: 60px;
}

/* Responsive Blog Styles */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    display: none;
  }
  .featured-post-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .featured-post-card {
    padding: 24px;
  }
  .post-title {
    font-size: 2rem;
  }
}
