/* ── Blog Detail Layout ── */
.bd-content-section {
    padding: 0 0 2rem;
}
.bd-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 0 5rem;
}

/* ── Back Link ── */
.bd-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
    margin-bottom: 2rem;
}
.bd-back:hover { color: var(--color-primary); }
.bd-back svg { transition: transform 0.2s ease; }
.bd-back:hover svg { transform: translateX(-3px); }

/* ── Category Badge ── */
.bd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 100px;
    border: 1px solid rgba(79, 70, 229, 0.12);
    margin-bottom: 1.25rem;
}

/* ── Title ── */
.bd-title {
    font-size: 2.625rem;
    font-weight: 800;
    color: var(--color-heading);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

/* ── Subtitle / Excerpt ── */
.bd-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

/* ── Meta Row ── */
.bd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.bd-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.bd-meta-item svg { opacity: 0.6; }
.bd-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
    opacity: 0.5;
}

/* ── Featured Image ── */
.bd-featured {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 3rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ── Article Body ── */
.bd-body {
    color: var(--color-text);
    font-size: 1.0625rem;
    line-height: 1.9;
}
.bd-body h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 2.75rem 0 1rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.bd-body h3 {
    font-size: 1.3125rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 2rem 0 0.75rem;
    line-height: 1.3;
}
.bd-body p {
    margin: 0 0 1.25rem;
    color: var(--color-text-secondary);
}
.bd-body ul, .bd-body ol {
    margin: 1.25rem 0 1.5rem 0.5rem;
    padding-left: 1.5rem;
    color: var(--color-text-secondary);
}
.bd-body li {
    margin-bottom: 0.625rem;
    line-height: 1.75;
}
.bd-body a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 70, 229, 0.25);
    transition: border-color 0.2s ease;
}
.bd-body a:hover { border-bottom-color: var(--color-primary); }
.bd-body strong { color: var(--color-heading); font-weight: 600; }
.bd-body blockquote {
    position: relative;
    border-left: 3px solid var(--color-primary);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03), rgba(124, 58, 237, 0.03));
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
}
.bd-body code {
    background: var(--color-bg-secondary, #f1f5f9);
    color: #e11d48;
    padding: 0.125rem 0.4rem;
    border-radius: var(--radius-sm, 4px);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}
.bd-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-md, 8px);
    overflow-x: auto;
    margin: 1.75rem 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}
.bd-body pre code { background: none; color: inherit; padding: 0; }
.bd-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md, 8px);
    margin: 1.5rem 0;
}

/* ── Tags ── */
.bd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}
.bd-tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--color-bg-secondary, #f8fafc);
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: all 0.2s ease;
}
.bd-tag:hover {
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.2);
    color: var(--color-primary);
}

/* ── Share ── */
.bd-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}
.bd-share-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.bd-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-secondary);
    text-decoration: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bd-share-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(79, 70, 229, 0.04);
    transform: translateY(-2px);
}

/* ── Related Articles ── */
.bd-related {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}
.bd-related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}
.bd-related-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0;
}
.bd-related-all {
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: gap 0.2s ease;
}
.bd-related-all:hover { gap: 0.625rem; }

.bd-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.bd-related-card {
    background: var(--color-card, #fff);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
}
.bd-related-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
}
.bd-related-img-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-bg-secondary, #f1f5f9);
}
.bd-related-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.bd-related-card:hover .bd-related-img-wrap img {
    transform: scale(1.05);
}
.bd-related-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-text-tertiary);
    opacity: 0.4;
}
.bd-related-body {
    padding: 1.125rem;
}
.bd-related-date {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin-bottom: 0.5rem;
}
.bd-related-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-heading);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bd-related-card:hover .bd-related-name {
    color: var(--color-primary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .bd-title { font-size: 1.875rem; }
    .bd-subtitle { font-size: 1rem; }
    .bd-body { font-size: 1rem; }
    .bd-featured { aspect-ratio: 16 / 10; }
    .bd-related-grid { grid-template-columns: 1fr; }
    .bd-meta { gap: 0.75rem; }
}
@media (max-width: 480px) {
    .bd-title { font-size: 1.5rem; }
    .bd-related-grid { gap: 1rem; }
}

/* ── Dark Mode ── */
[data-theme="dark"] .bd-body blockquote {
    background: rgba(79, 70, 229, 0.06);
}
[data-theme="dark"] .bd-body code {
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .bd-tag {
    background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .bd-featured {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .bd-related-card {
    background: var(--color-bg-secondary, #18181B) !important;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .bd-related-card:hover {
    background: var(--color-bg-tertiary, #27272A) !important;
    border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .bd-related-name {
    color: var(--color-text, #F8FAFC);
}
[data-theme="dark"] .bd-related-body {
    background: transparent;
}
[data-theme="dark"] .bd-related-date {
    color: var(--color-text-tertiary, #71717A);
}
[data-theme="dark"] .bd-body table {
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .bd-body table th,
[data-theme="dark"] .bd-body table td {
    border-color: rgba(255, 255, 255, 0.08);
}
