/* DUDI Software - blog-detail page */

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }

/* ─── Page wrapper ─── */
.detail-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 80px;
}

/* ─── Breadcrumb ─── */
.detail-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Manrope', sans-serif;
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.detail-back-btn:hover { color: #fbfbfb; border-color: rgba(255,255,255,0.15); }
.detail-back-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

[data-theme="light"] .detail-back-btn {
  color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.04);
}
[data-theme="light"] .detail-back-btn:hover { color: #14141c; }

.detail-breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Manrope', sans-serif;
}
.detail-breadcrumb-trail a { color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: color .2s; }
.detail-breadcrumb-trail a:hover { color: #fbfbfb; }
.detail-breadcrumb-trail .current { color: rgba(255, 255, 255, 0.9); }

[data-theme="light"] .detail-breadcrumb-trail { color: rgba(20, 20, 28, 0.5); }
[data-theme="light"] .detail-breadcrumb-trail a { color: rgba(20, 20, 28, 0.7); }
[data-theme="light"] .detail-breadcrumb-trail a:hover { color: #14141c; }
[data-theme="light"] .detail-breadcrumb-trail .current { color: rgba(20, 20, 28, 0.9); }

/* ─── Layout ─── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 1024px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .detail-sidebar { grid-template-columns: 1fr; }
  .detail-page { padding: 80px 16px 60px; }
}

/* ─── Article ─── */
.detail-article {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 24px;
  overflow: hidden;
}

[data-theme="light"] .detail-article {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* Loading */
.detail-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 400px;
}
.detail-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #ED1C24;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hero image */
.article-hero { width: 100%; height: 320px; overflow: hidden; }
.article-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-hero-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(106,13,173,.15), rgba(30,144,255,.1));
}
.article-hero-placeholder svg { width: 56px; height: 56px; color: rgba(255,255,255,.15); }

[data-theme="light"] .article-hero-placeholder {
  background: linear-gradient(135deg, rgba(106,13,173,.06), rgba(30,144,255,.05));
}
[data-theme="light"] .article-hero-placeholder svg { color: rgba(0,0,0,.1); }

/* Article body */
.article-body { padding: 32px; }
@media (max-width: 640px) { .article-body { padding: 20px; } }

.article-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.article-date, .article-read-time {
  font-size: 0.72rem; color: rgba(255,255,255,0.35);
  font-family: 'Manrope', sans-serif;
}
[data-theme="light"] .article-date, [data-theme="light"] .article-read-time { color: rgba(0,0,0,0.4); }

.article-title {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fbfbfb;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
[data-theme="light"] .article-title { color: #14141c; }

/* Article content typography */
.article-content { color: rgba(255,255,255,0.75); line-height: 1.8; font-size: 0.95rem; }
[data-theme="light"] .article-content { color: rgba(0,0,0,0.7); }

.article-content h2 {
  font-size: 1.4rem; font-weight: 700; color: #fbfbfb;
  font-family: 'Space Grotesk', sans-serif;
  margin: 32px 0 12px; line-height: 1.3;
}
[data-theme="light"] .article-content h2 { color: #14141c; }

.article-content h3 {
  font-size: 1.1rem; font-weight: 600; color: rgba(255,255,255,0.9);
  font-family: 'Space Grotesk', sans-serif;
  margin: 24px 0 10px;
}
[data-theme="light"] .article-content h3 { color: rgba(0,0,0,0.8); }

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

.article-content a { color: #60a5fa; text-decoration: underline; }
[data-theme="light"] .article-content a { color: #1E90FF; }

.article-content ul, .article-content ol {
  padding-left: 20px; margin-bottom: 16px;
}
.article-content li { margin-bottom: 6px; }

.article-content blockquote {
  border-left: 3px solid rgba(30,144,255,0.5);
  padding: 12px 20px; margin: 20px 0;
  background: rgba(30,144,255,0.06); border-radius: 0 12px 12px 0;
  color: rgba(255,255,255,0.6); font-style: italic;
}
[data-theme="light"] .article-content blockquote {
  background: rgba(30,144,255,0.04); color: rgba(0,0,0,0.55);
}

.article-content code {
  font-family: 'Courier New', monospace; font-size: 0.85em;
  background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px;
  color: #f472b6;
}
[data-theme="light"] .article-content code { background: rgba(0,0,0,0.06); color: #db2777; }

/* Article footer */
.article-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.07); }
[data-theme="light"] .article-footer { border-top-color: rgba(0,0,0,0.07); }

.article-back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.5); font-size: 0.82rem; font-weight: 500;
  font-family: 'Manrope', sans-serif; text-decoration: none;
  padding: 8px 16px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  transition: all 0.2s ease;
}
.article-back-link:hover {
  color: #fbfbfb; border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07);
}
[data-theme="light"] .article-back-link {
  color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.04);
}
[data-theme="light"] .article-back-link:hover { color: #14141c; }

/* ─── Sidebar ─── */
.detail-sidebar { position: sticky; top: 100px; }
@media (max-width: 1024px) { .detail-sidebar { position: static; } }

.sidebar-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 20px;
}
[data-theme="light"] .sidebar-section {
  background: #fff; border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.sidebar-title {
  font-size: 0.85rem; font-weight: 700; color: #fbfbfb;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em;
}
[data-theme="light"] .sidebar-title { color: #14141c; }

/* Related posts */
.related-list { display: flex; flex-direction: column; gap: 12px; }

.related-item {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; padding: 8px; border-radius: 12px;
  transition: background 0.2s ease;
}
.related-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .related-item:hover { background: rgba(0,0,0,0.04); }

.related-img-wrap {
  width: 60px; height: 50px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}
.related-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
}
.related-img-placeholder svg { width: 20px; height: 20px; color: rgba(255,255,255,0.2); }

[data-theme="light"] .related-img-wrap { background: rgba(0,0,0,0.05); }
[data-theme="light"] .related-img-placeholder { background: rgba(0,0,0,0.04); }
[data-theme="light"] .related-img-placeholder svg { color: rgba(0,0,0,0.2); }

.related-info { flex: 1; min-width: 0; }
.related-title {
  font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.8);
  font-family: 'Manrope', sans-serif; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-theme="light"] .related-title { color: rgba(0,0,0,0.75); }

.related-date { font-size: 0.65rem; color: rgba(255,255,255,0.3); margin-top: 3px; }
[data-theme="light"] .related-date { color: rgba(0,0,0,0.35); }

.no-related { font-size: 0.78rem; color: rgba(255,255,255,0.3); font-family: 'Manrope',sans-serif; }
[data-theme="light"] .no-related { color: rgba(0,0,0,0.35); }

/* Category list */
.cat-list { display: flex; flex-direction: column; gap: 8px; }

.cat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  text-decoration: none; transition: all 0.2s ease;
  font-size: 0.8rem; font-weight: 500;
  color: rgba(255,255,255,0.6); font-family: 'Manrope', sans-serif;
}
.cat-item:hover { border-color: rgba(255,255,255,0.15); color: #fbfbfb; background: rgba(255,255,255,0.05); }

[data-theme="light"] .cat-item { color: rgba(0,0,0,0.6); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .cat-item:hover { color: #14141c; background: rgba(0,0,0,0.04); }

.cat-count {
  font-size: 0.68rem; font-weight: 600;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5);
  padding: 1px 7px; border-radius: 20px;
}
[data-theme="light"] .cat-count { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.45); }

/* Category chip (shared with blog.css) */
.blog-cat-chip {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(30,144,255,0.12); color: #60a5fa;
  border: 1px solid rgba(30,144,255,0.2);
  white-space: nowrap; font-family: 'Manrope', sans-serif;
}
.blog-cat-chip.cat-tech     { background:rgba(30,144,255,.12); color:#60a5fa; border-color:rgba(30,144,255,.2); }
.blog-cat-chip.cat-design   { background:rgba(255,77,158,.12); color:#f472b6; border-color:rgba(255,77,158,.2); }
.blog-cat-chip.cat-business { background:rgba(106,13,173,.15); color:#c084fc; border-color:rgba(106,13,173,.25); }
.blog-cat-chip.cat-news     { background:rgba(237,28,36,.12);  color:#f87171; border-color:rgba(237,28,36,.2); }
.blog-cat-chip.cat-tutorial { background:rgba(74,222,128,.12); color:#4ade80; border-color:rgba(74,222,128,.2); }

[data-theme="light"] .blog-cat-chip.cat-tech     { background:rgba(30,144,255,.08); color:#1E90FF; }
[data-theme="light"] .blog-cat-chip.cat-design   { background:rgba(255,77,158,.08); color:#ec4899; }
[data-theme="light"] .blog-cat-chip.cat-business { background:rgba(106,13,173,.08); color:#7c3aed; }
[data-theme="light"] .blog-cat-chip.cat-news     { background:rgba(237,28,36,.08);  color:#ED1C24; }
[data-theme="light"] .blog-cat-chip.cat-tutorial { background:rgba(22,163,74,.08);  color:#16a34a; }
