/* =============================================
   Blog Detail Page — blogdetail.css
   ============================================= */

/* ---- Hero ---- */
.bd-hero {
    position: relative;
    min-height: 360px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding-bottom: 52px;
}

.bd-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(8, 18, 50, 0.55) 0%,
        rgba(4, 12, 38, 0.84) 100%
    );
}

.bd-hero .container {
    position: relative;
    z-index: 1;
}

.bd-breadcrumb {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.bd-breadcrumb a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 0.15s;
}

.bd-breadcrumb a:hover { color: #fff; }

.bd-breadcrumb .bd-sep {
    opacity: 0.5;
    font-size: 11px;
}

.bd-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.bd-tag {
    background: #22c55e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.bd-hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.22;
    margin: 0 0 8px;
    max-width: 720px;
}

.bd-hero-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 18px;
    max-width: 600px;
    line-height: 1.5;
}

.bd-hero-meta {
    display: flex;
    align-items: center;
    gap: 22px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    flex-wrap: wrap;
}

.bd-hero-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bd-hero-meta i { opacity: 0.85; }

.bd-share-bar {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bd-share-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.bd-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.18s;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.bd-share-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    text-decoration: none;
}

/* ---- Content wrapper ---- */
.bd-content-wrap {
    padding-top: 48px;
}

/* ---- Post content (article body) ---- */
.post-content {
    color: #334155;
    font-size: 16px;
    line-height: 1.85;
}

.post-content p  { margin-bottom: 1.1em; }
.post-content a  { color: #1B60C1; text-decoration: underline; }
.post-content a:hover { color: #174a99; }

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5 {
    color: #0f172a; font-weight: 700; line-height: 1.25;
}
.post-content h1 { font-size: 1.875rem; margin: 1.6em 0 0.6em; }
.post-content h2 { font-size: 1.5rem;   margin: 1.4em 0 0.5em; }
.post-content h3 { font-size: 1.25rem;  margin: 1.2em 0 0.45em; }
.post-content h4 { font-size: 1.1rem;   margin: 1.1em 0 0.4em; font-weight: 600; color: #1e293b; }
.post-content h5 { font-size: 0.95rem;  margin: 1em 0 0.35em;  font-weight: 600; color: #475569;
                   text-transform: uppercase; letter-spacing: 0.04em; }

.post-content ul { list-style: disc;    padding-left: 1.6em; margin: 0.8em 0 1em; }
.post-content ol { list-style: decimal; padding-left: 1.6em; margin: 0.8em 0 1em; }
.post-content li { margin-bottom: 0.35em; line-height: 1.7; }

.post-content blockquote {
    border-left: 4px solid #1B60C1; padding: 0.6em 1em; margin: 1.4em 0;
    background: #f1f5f9; color: #475569; font-style: italic; border-radius: 0 8px 8px 0;
}

.post-content img {
    max-width: 100%; height: auto; display: block;
    margin: 1.4em auto; border-radius: 8px;
}

.post-content code {
    background: #f1f5f9; color: #be185d;
    padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em;
}
.post-content pre {
    background: #0f172a; color: #e2e8f0;
    padding: 1em; border-radius: 8px; overflow-x: auto; margin: 1.4em 0;
}
.post-content pre code { background: transparent; color: inherit; padding: 0; }

.post-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; table-layout: fixed; }
.post-content table td, .post-content table th {
    border: 1px solid #cbd5e1; padding: 8px 12px; word-break: break-word; vertical-align: top;
}
.post-content table th { background: #f1f5f9; font-weight: 600; }
.post-content table tr:nth-child(even) td { background: #f8fafc; }

.post-content [style*="text-align: center"] { text-align: center; }
.post-content [style*="text-align: right"]  { text-align: right; }
.post-content [style*="text-align: justify"] { text-align: justify; }

/* ---- Discussion section ---- */
.bd-discussion {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 28px 30px;
    margin-top: 44px;
    margin-bottom: 56px;
}

.bd-discussion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid #e9eef5;
    margin-bottom: 22px;
}

.bd-discussion__header h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.bd-discussion__header h4 .bd-count {
    color: #64748b;
    font-weight: 500;
    font-size: 1rem;
}

.bd-refresh-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 7px;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
}

.bd-refresh-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.bd-refresh-btn i { font-size: 12px; }

/* Login CTA */
.bd-login-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.bd-login-cta__icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 22px;
}

.bd-login-cta__text {
    flex: 1;
    min-width: 0;
}

.bd-login-cta__text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.bd-login-cta__text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bd-login-btn {
    flex-shrink: 0;
    background: #1B60C1;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.18s;
    white-space: nowrap;
    display: inline-block;
}

.bd-login-btn:hover {
    background: #1450a3;
    color: #fff !important;
}

/* Comment form (authenticated) */
.bd-comment-form {
    margin-bottom: 24px;
}

.bd-comment-form textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    color: #334155;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.bd-comment-form textarea:focus { border-color: #1B60C1; }

.bd-submit-btn {
    margin-top: 10px;
    background: #1B60C1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
}

.bd-submit-btn:hover { background: #1450a3; }

/* Comments list */
.bd-comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bd-comment-item {
    padding: 18px 0;
    border-bottom: 1px solid #f1f5f9;
}

.bd-comment-item:last-child { border-bottom: none; }

.bd-comment-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.bd-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #1B60C1;
    text-transform: uppercase;
}

.bd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bd-comment-body { flex: 1; min-width: 0; }

.bd-comment-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.bd-comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.bd-comment-time {
    font-size: 12px;
    color: #94a3b8;
}

.bd-comment-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
    margin: 0;
    word-break: break-word;
}

/* Replies */
.bd-replies {
    margin-top: 14px;
    margin-left: 56px;
    list-style: none;
    padding: 0;
    border-left: 2px solid #e9eef5;
    padding-left: 16px;
}

.bd-reply-item {
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}

.bd-reply-item:last-child { border-bottom: none; }

/* Empty state */
.bd-empty-comments {
    text-align: center;
    padding: 32px 0 16px;
    color: #94a3b8;
    font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .bd-hero { min-height: 280px; padding-bottom: 36px; }
    .bd-hero-title { font-size: 1.45rem; }
    .bd-hero-subtitle { font-size: 14px; }
    .bd-hero-meta { gap: 14px; font-size: 12px; }

    .bd-discussion { padding: 20px 16px; }
    .bd-login-cta { flex-wrap: wrap; gap: 12px; }
    .bd-login-cta__text p { white-space: normal; }
    .bd-login-btn { width: 100%; text-align: center; }

    .bd-replies { margin-left: 28px; }
}

@media (max-width: 480px) {
    .bd-hero-title { font-size: 1.25rem; }
    .post-content { font-size: 15px; }
    .post-content h1 { font-size: 1.5rem; }
    .post-content h2 { font-size: 1.3rem; }
    .post-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}