/* ================================================================
   BLOG DETAIL PAGE - Updated Color Theme
   Namespace: bd-*
   ================================================================ */

/* ── Base Container ── */
.bd-wrap {
    max-width: 1400px;
    margin: 80px auto 40px;
    padding: 0 20px;
    width: 100%;
}

@media (min-width: 640px) {
    .bd-wrap {
        padding: 0 24px;
        margin: 100px auto 60px;
    }
}

@media (min-width: 768px) {
    .bd-wrap {
        padding: 0 32px;
    }
}

@media (min-width: 1200px) {
    .bd-wrap {
        padding: 0 40px;
    }
}

/* ── Breadcrumb ── */
.bd-breadcrumb {
    padding: 20px 0 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .bd-breadcrumb {
        padding: 28px 0 0;
        gap: 8px;
        font-size: 0.82rem;
    }
}

.bd-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.18s;
}

.bd-breadcrumb a:hover {
    color: var(--accent);
}

.bd-breadcrumb i {
    font-size: 0.65rem;
    color: var(--border);
}

@media (min-width: 768px) {
    .bd-breadcrumb i {
        font-size: 0.7rem;
    }
}

.bd-breadcrumb span {
    color: var(--text-muted);
}

/* ── Hero Image ── */
.bd-hero-img {
    width: 100%;
    height: clamp(200px, 40vw, 400px);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0 0;
    position: relative;
    background: var(--bg);
}

@media (min-width: 768px) {
    .bd-hero-img {
        height: clamp(260px, 45vw, 500px);
        border-radius: 14px;
        margin: 24px 0 0;
    }
}

.bd-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bd-hero-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
}

.bd-hero-img-placeholder i {
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.3;
}

@media (min-width: 768px) {
    .bd-hero-img-placeholder i {
        font-size: 4rem;
    }
}

.bd-cat-badge-hero {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 4px;
}

@media (min-width: 768px) {
    .bd-cat-badge-hero {
        bottom: 18px;
        left: 18px;
        font-size: 0.76rem;
        padding: 5px 16px;
    }
}

/* ── Article Layout ── */
.bd-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
    padding: 30px 0 40px;
}

@media (min-width: 1024px) {
    .bd-layout {
        grid-template-columns: 1fr 320px;
        gap: 48px;
        padding: 40px 0 60px;
    }
}

@media (min-width: 1280px) {
    .bd-layout {
        grid-template-columns: 1fr 340px;
    }
}

/* ── Article Header ── */
.bd-article-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .bd-article-header {
        margin-bottom: 32px;
        padding-bottom: 28px;
    }
}

.bd-article-cat {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (min-width: 768px) {
    .bd-article-cat {
        font-size: 0.78rem;
        letter-spacing: 0.08em;
        margin-bottom: 14px;
        gap: 6px;
    }
}

.bd-article-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .bd-article-title {
        font-size: clamp(1.6rem, 3.5vw, 2.6rem);
        letter-spacing: -0.02em;
        margin-bottom: 20px;
    }
}

.bd-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

@media (min-width: 768px) {
    .bd-meta-bar {
        gap: 16px;
    }
}

.bd-author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 768px) {
    .bd-author-meta {
        gap: 12px;
    }
}

.bd-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(99,102,241,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    font-family: monospace;
}

@media (min-width: 768px) {
    .bd-author-avatar {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
}

.bd-author-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

@media (min-width: 768px) {
    .bd-author-name {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
}

.bd-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .bd-post-meta {
        gap: 10px;
        font-size: 0.78rem;
    }
}

.bd-post-meta i {
    font-size: 0.65rem;
}

@media (min-width: 768px) {
    .bd-post-meta i {
        font-size: 0.72rem;
    }
}

/* ── Excerpt ── */
.bd-excerpt-intro {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
    border-left: 3px solid var(--accent);
    padding-left: 14px;
    margin-bottom: 28px;
}

@media (min-width: 768px) {
    .bd-excerpt-intro {
        font-size: 1.1rem;
        line-height: 1.65;
        padding-left: 18px;
        margin-bottom: 36px;
    }
}

/* ── Article Body ── */
.bd-article-body {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .bd-article-body {
        line-height: 1.75;
        font-size: 1rem;
    }
}

.bd-article-body h1,
.bd-article-body h2,
.bd-article-body h3,
.bd-article-body h4,
.bd-article-body h5 {
    color: var(--text);
    margin: 1.5em 0 0.75em;
    font-weight: 700;
    line-height: 1.25;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .bd-article-body h1,
    .bd-article-body h2,
    .bd-article-body h3,
    .bd-article-body h4,
    .bd-article-body h5 {
        margin: 2em 0 0.75em;
    }
}

.bd-article-body h2 {
    font-size: 1.4rem;
}

@media (min-width: 768px) {
    .bd-article-body h2 {
        font-size: 1.55rem;
    }
}

.bd-article-body h3 {
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .bd-article-body h3 {
        font-size: 1.3rem;
    }
}

.bd-article-body p {
    margin-bottom: 1.2em;
}

@media (min-width: 768px) {
    .bd-article-body p {
        margin-bottom: 1.4em;
    }
}

.bd-article-body a {
    color: var(--accent);
    text-decoration: underline;
    word-wrap: break-word;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.bd-article-body a:hover {
    color: var(--accent-hover);
}

.bd-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.2em 0;
    border: 1px solid var(--border);
}

@media (min-width: 768px) {
    .bd-article-body img {
        margin: 1.5em 0;
    }
}

.bd-article-body ul,
.bd-article-body ol {
    padding-left: 20px;
    margin-bottom: 1.2em;
}

@media (min-width: 768px) {
    .bd-article-body ul,
    .bd-article-body ol {
        padding-left: 28px;
        margin-bottom: 1.4em;
    }
}

.bd-article-body li {
    margin-bottom: 6px;
}

.bd-article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    background: rgba(99,102,241,0.06);
    border-radius: 0 8px 8px 0;
    margin: 1.2em 0;
    color: var(--text-muted);
    font-style: italic;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .bd-article-body blockquote {
        padding: 16px 20px;
        margin: 1.5em 0;
    }
}

.bd-article-body pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 1.2em 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .bd-article-body pre {
        padding: 16px 20px;
        margin: 1.5em 0;
    }
}

.bd-article-body code {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    word-wrap: break-word;
    color: var(--accent);
    background: rgba(99,102,241,0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

@media (min-width: 768px) {
    .bd-article-body code {
        font-size: 0.9em;
    }
}

.bd-article-body pre code {
    background: none;
    padding: 0;
    color: var(--text-muted);
}

.bd-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.85em;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .bd-article-body table {
        margin: 1.5em 0;
        font-size: 0.9em;
        display: table;
        white-space: normal;
    }
}

.bd-article-body th {
    background: var(--bg);
    color: var(--text);
    padding: 8px 10px;
    text-align: left;
    border: 1px solid var(--border);
    font-weight: 600;
}

@media (min-width: 768px) {
    .bd-article-body th {
        padding: 10px 14px;
    }
}

.bd-article-body td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .bd-article-body td {
        padding: 10px 14px;
    }
}

.bd-article-body hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2em 0;
}

/* ── Tags Section ── */
.bd-tags-section {
    margin: 28px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .bd-tags-section {
        margin: 36px 0;
        padding-top: 28px;
    }
}

.bd-tags-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (min-width: 768px) {
    .bd-tags-section h4 {
        font-size: 0.82rem;
        letter-spacing: 0.08em;
        margin-bottom: 12px;
        gap: 6px;
    }
}

.bd-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

@media (min-width: 768px) {
    .bd-tags-wrap {
        gap: 8px;
    }
}

.bd-tag {
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .bd-tag {
        padding: 5px 14px;
        font-size: 0.8rem;
    }
}

.bd-tag:hover {
    background: rgba(99,102,241,0.10);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Share Section ── */
.bd-share-section {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
    margin: 20px 0;
}

@media (min-width: 768px) {
    .bd-share-section {
        border-radius: 12px;
        padding: 28px;
        margin: 28px 0;
    }
}

.bd-share-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 768px) {
    .bd-share-section h4 {
        font-size: 1rem;
        margin-bottom: 6px;
        gap: 8px;
    }
}

.bd-share-section p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

@media (min-width: 768px) {
    .bd-share-section p {
        font-size: 0.84rem;
        margin-bottom: 16px;
    }
}

.bd-share-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (min-width: 768px) {
    .bd-share-btns {
        gap: 10px;
    }
}

.bd-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s;
    cursor: pointer;
    border: none;
    flex: 1 1 auto;
    justify-content: center;
}

@media (min-width: 480px) {
    .bd-share-btn {
        flex: 0 1 auto;
        padding: 8px 16px;
    }
}

@media (min-width: 768px) {
    .bd-share-btn {
        gap: 8px;
        padding: 9px 18px;
        border-radius: 8px;
        font-size: 0.84rem;
    }
}

.bd-share-btn.twitter {
    background: #1da1f2;
    color: #fff;
}

.bd-share-btn.twitter:hover {
    background: #1a8cd8;
}

.bd-share-btn.linkedin {
    background: #0077b5;
    color: #fff;
}

.bd-share-btn.linkedin:hover {
    background: #005fa3;
}

.bd-share-btn.facebook {
    background: #1877f2;
    color: #fff;
}

.bd-share-btn.facebook:hover {
    background: #1060d0;
}

.bd-share-btn.copy {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.bd-share-btn.copy:hover {
    background: rgba(99,102,241,0.08);
    color: var(--text);
    border-color: var(--accent);
}

/* ── Related Posts ── */
.bd-related-cards-section {
    margin: 32px 0 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .bd-related-cards-section {
        margin: 48px 0 32px;
        padding-top: 32px;
    }
}

.bd-related-cards-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-align: center;
}

@media (min-width: 768px) {
    .bd-related-cards-section h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
}

.bd-related-cards-section .section-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .bd-related-cards-section .section-sub {
        margin-bottom: 36px;
        font-size: 1rem;
    }
}

.bd-related-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 480px) {
    .bd-related-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 768px) {
    .bd-related-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
        margin-bottom: 24px;
    }
}

@media (min-width: 1024px) {
    .bd-related-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bd-related-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s, box-shadow 0.22s;
    border: 1px solid var(--border);
    height: 100%;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .bd-related-card {
        border-radius: 12px;
    }
}

.bd-related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

.bd-related-card .rc-img {
    height: 160px;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

@media (min-width: 768px) {
    .bd-related-card .rc-img {
        height: 180px;
    }
}

.bd-related-card .rc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.bd-related-card:hover .rc-img img {
    transform: scale(1.06);
}

.bd-related-card .rc-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.05));
    color: var(--accent);
    font-size: 2rem;
    opacity: 0.3;
}

.bd-related-card .rc-cat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
}

@media (min-width: 768px) {
    .bd-related-card .rc-cat-badge {
        top: 10px;
        left: 10px;
        font-size: 0.71rem;
        letter-spacing: 0.06em;
        padding: 3px 12px;
        border-radius: 4px;
    }
}

.bd-related-card .rc-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .bd-related-card .rc-body {
        padding: 18px;
    }
}

.bd-related-card .rc-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 6px;
}

@media (min-width: 768px) {
    .bd-related-card .rc-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
}

.bd-related-card .rc-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
    flex: 1;
}

@media (min-width: 768px) {
    .bd-related-card .rc-excerpt {
        font-size: 0.84rem;
        line-height: 1.55;
        margin-bottom: 12px;
    }
}

.bd-related-card .rc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .bd-related-card .rc-footer {
        font-size: 0.78rem;
        padding-top: 12px;
    }
}

.bd-related-card .rc-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bd-related-card .rc-author-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(99,102,241,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
}

@media (min-width: 768px) {
    .bd-related-card .rc-author-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

.bd-related-card .rc-read {
    color: var(--accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

@media (min-width: 768px) {
    .bd-related-card .rc-read {
        gap: 4px;
    }
}

/* ── Comments ── */
.comments-section {
    margin-top: 32px;
    padding-top: 24px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .comments-section {
        margin-top: 48px;
        padding-top: 32px;
        max-width: 950px;
    }
}

.comments-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .comments-section h2 {
        font-size: 1.8rem;
        margin-bottom: 24px;
    }
}

.comment-form {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 28px;
    width: 100%;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .comment-form {
        border-radius: 12px;
        padding: 24px;
        margin-bottom: 32px;
    }
}

.comment-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

@media (min-width: 640px) {
    .comment-fields {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }
}

.comment-fields input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

@media (min-width: 768px) {
    .comment-fields input {
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 0.95rem;
    }
}

.comment-fields input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.06);
}

.comment-fields input::placeholder {
    color: var(--text-muted);
}

.text-area {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    margin-bottom: 14px;
    font-family: inherit;
}

@media (min-width: 768px) {
    .text-area {
        min-height: 120px;
        padding: 16px;
        border-radius: 8px;
        font-size: 0.95rem;
        margin-bottom: 16px;
    }
}

.text-area:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.06);
}

.text-area::placeholder {
    color: var(--text-muted);
}

.submit-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

@media (min-width: 480px) {
    .submit-btn {
        width: auto;
    }
}

@media (min-width: 768px) {
    .submit-btn {
        border-radius: 8px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

.submit-btn:hover {
    background: var(--accent-hover);
}

.comments-list {
    margin-top: 28px;
    width: 100%;
}

@media (min-width: 768px) {
    .comments-list {
        margin-top: 32px;
    }
}

.comment {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .comment {
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 16px;
    }
}

.comment.reply {
    margin-left: 16px;
    background: var(--bg);
    width: calc(100% - 16px);
}

@media (min-width: 640px) {
    .comment.reply {
        margin-left: 40px;
        width: calc(100% - 40px);
    }
}

.comment-author {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .comment-author {
        margin-bottom: 4px;
    }
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .comment-date {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
}

.comment-text {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .comment-text {
        line-height: 1.6;
        font-size: 0.95rem;
    }
}

.reply-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color 0.2s;
}

@media (min-width: 768px) {
    .reply-btn {
        font-size: 0.85rem;
        margin-top: 12px;
        gap: 4px;
    }
}

.reply-btn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.reply-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .reply-form {
        margin-top: 16px;
        padding-top: 16px;
    }
}

.reply-form .comment-fields {
    grid-template-columns: 1fr;
}

.comment-success {
    background: rgba(99,102,241,0.08);
    color: var(--accent);
    border: 1px solid rgba(99,102,241,0.15);
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .comment-success {
        padding: 12px 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
}

/* ── Sidebar ── */
.bd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 1024px) {
    .bd-sidebar {
        display: flex;
        gap: 24px;
    }
}

.sb-widget {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    width: 100%;
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .sb-widget {
        border-radius: 12px;
        padding: 22px;
    }
}

.sb-widget h3 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 768px) {
    .sb-widget h3 {
        font-size: 0.9rem;
        letter-spacing: 0.08em;
        margin-bottom: 16px;
        gap: 8px;
    }
}

.sb-widget h3 i {
    color: var(--accent);
}

.sb-widget p {
    color: var(--text-muted);
}

.sb-popular-post {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.18s;
}

@media (min-width: 768px) {
    .sb-popular-post {
        gap: 12px;
        padding: 10px 0;
    }
}

.sb-popular-post:last-child {
    border-bottom: none;
}

.sb-popular-post:hover {
    opacity: 0.75;
}

.sb-popular-img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}

@media (min-width: 768px) {
    .sb-popular-img {
        width: 52px;
        height: 52px;
        border-radius: 8px;
    }
}

.sb-popular-post h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 3px;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .sb-popular-post h4 {
        font-size: 0.83rem;
        line-height: 1.35;
        margin-bottom: 4px;
    }
}

.sb-popular-post span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .sb-popular-post span {
        font-size: 0.74rem;
    }
}

.sb-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}

@media (min-width: 768px) {
    .sb-cat-list {
        max-height: 300px;
        padding-right: 8px;
    }
}

.sb-cat-list::-webkit-scrollbar {
    width: 4px;
}

.sb-cat-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.sb-cat-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.sb-cat-list li {
    border-bottom: 1px solid var(--border);
}

.sb-cat-list li:last-child {
    border-bottom: none;
}

.sb-cat-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    transition: color 0.18s;
}

@media (min-width: 768px) {
    .sb-cat-list li a {
        padding: 10px 0;
        font-size: 0.86rem;
    }
}

.sb-cat-list li a:hover {
    color: var(--accent);
}

.sb-cat-list li a span {
    background: var(--bg);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    border: 1px solid var(--border);
}

@media (min-width: 768px) {
    .sb-cat-list li a span {
        padding: 2px 8px;
        font-size: 0.74rem;
    }
}

.sb-cat-list li a:hover span {
    background: rgba(99,102,241,0.08);
    border-color: var(--accent);
}

.sb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px 2px 2px 0;
    scrollbar-width: thin;
}

@media (min-width: 768px) {
    .sb-tags {
        gap: 6px;
        max-height: 200px;
        padding: 4px 4px 4px 0;
    }
}

.sb-tags::-webkit-scrollbar {
    width: 4px;
}

.sb-tags::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.sb-tags::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.sb-tag {
    padding: 3px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .sb-tag {
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 0.76rem;
    }
}

.sb-tag:hover {
    background: rgba(99,102,241,0.08);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Newsletter Widget ── */
.sb-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (min-width: 768px) {
    .sb-newsletter-form {
        gap: 8px;
    }
}

.sb-newsletter-form input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

@media (min-width: 768px) {
    .sb-newsletter-form input {
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 0.85rem;
    }
}

.sb-newsletter-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.06);
}

.sb-newsletter-form input::placeholder {
    color: var(--text-muted);
}

.sb-newsletter-form button {
    width: 100%;
    padding: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (min-width: 768px) {
    .sb-newsletter-form button {
        padding: 10px;
        border-radius: 8px;
        font-size: 0.88rem;
        gap: 8px;
    }
}

.sb-newsletter-form button:hover {
    background: var(--accent-hover);
}

.sb-newsletter-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sb-privacy {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

@media (min-width: 768px) {
    .sb-privacy {
        font-size: 0.74rem;
        margin-top: 8px;
    }
}

/* ── Sidebar Ad ── */
.sb-ad {
    margin: 10px 0;
    width: 100%;
    overflow: hidden;
}

@media (min-width: 768px) {
    .sb-ad {
        margin: 15px 0;
    }
}

/* ── Notification Popup ── */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    backdrop-filter: blur(4px);
}

@media (min-width: 768px) {
    .notif-overlay {
        padding: 20px;
    }
}

.notif-overlay.show {
    opacity: 1;
    visibility: visible;
}

.notif-popup {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    margin: 0 auto;
}

@media (min-width: 480px) {
    .notif-popup {
        width: 100%;
        padding: 32px 24px;
    }
}

@media (min-width: 768px) {
    .notif-popup {
        border-radius: 16px;
        padding: 36px 32px;
        max-width: 420px;
    }
}

.notif-overlay.show .notif-popup {
    transform: translateY(0) scale(1);
}

.notif-popup .notif-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.6rem;
}

@media (min-width: 768px) {
    .notif-popup .notif-icon {
        width: 72px;
        height: 72px;
        margin: 0 auto 20px;
        font-size: 2rem;
    }
}

.notif-popup .notif-icon.success {
    background: rgba(99,102,241,0.12);
    color: var(--accent);
    border: 2px solid rgba(99,102,241,0.25);
}

.notif-popup .notif-icon.error {
    background: rgba(239,68,68,0.10);
    color: #ef4444;
    border: 2px solid rgba(239,68,68,0.20);
}

.notif-popup .notif-icon.warning {
    background: rgba(234,179,8,0.10);
    color: #eab308;
    border: 2px solid rgba(234,179,8,0.20);
}

.notif-popup h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .notif-popup h3 {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }
}

.notif-popup p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .notif-popup p {
        font-size: 0.92rem;
        line-height: 1.55;
        margin-bottom: 24px;
    }
}

.notif-popup .notif-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 6px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    width: auto;
    min-width: 140px;
}

@media (min-width: 768px) {
    .notif-popup .notif-close-btn {
        gap: 8px;
        padding: 11px 28px;
        border-radius: 8px;
        font-size: 0.9rem;
    }
}

.notif-popup .notif-close-btn.success {
    background: var(--accent);
    color: #fff;
}

.notif-popup .notif-close-btn.success:hover {
    background: var(--accent-hover);
}

.notif-popup .notif-close-btn.error {
    background: rgba(239,68,68,0.10);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.20);
}

.notif-popup .notif-close-btn.error:hover {
    background: rgba(239,68,68,0.18);
}

.notif-popup .notif-close-btn.warning {
    background: rgba(234,179,8,0.10);
    color: #eab308;
    border: 1px solid rgba(234,179,8,0.20);
}

.notif-popup .notif-dismiss-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.18s;
}

@media (min-width: 768px) {
    .notif-popup .notif-dismiss-x {
        top: 14px;
        right: 14px;
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

.notif-popup .notif-dismiss-x:hover {
    background: var(--border);
    color: var(--text);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.notif-overlay.show .notif-icon {
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

/* ── Reading Progress Bar ── */
.read-progress {
    position: fixed;
    top: 60px;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 99999;
    transition: width 0.1s;
    width: 0%;
    border-radius: 0 3px 3px 0;
}

@media (max-width: 768px) {
    .read-progress {
        top: 50px;
    }
}

/* ── Utility Classes ── */
.hide-on-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hide-on-mobile {
        display: block;
    }
}

.show-on-mobile {
    display: block;
}

@media (min-width: 768px) {
    .show-on-mobile {
        display: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ── Ensure no horizontal scroll ── */
body {
    overflow-x: hidden;
    width: 100%;
}

* {
    box-sizing: border-box;
    max-width: 100%;
}

img,
video,
iframe,
table,
pre {
    max-width: 100%;
    height: auto;
}