.blog-detail-page {
    background: #f9fafb;
    min-height: 100vh;
    padding: 140px 24px 80px;
    overflow-x: hidden
}

.blog-detail-inner {
    max-width: 1276px;
    margin: 0 auto;
    width: 100%
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #4f46e5;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 28px;
    transition: opacity .15s;
    font-family: 'Poppins', sans-serif
}

.detail-back:empty {
    display: none
}

.detail-back:hover {
    opacity: .75;
    text-decoration: underline
}

.blog-detail-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 32px;
    align-items: start;
    width: 100%;
    min-width: 0
}

.blog-main {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px #00000012;
    overflow: hidden;
    min-width: 0
}

/* Hero: always full width at a fixed 2:1 ratio. Blog banners should be made at
   1200 x 600 px (or 2400 x 1200 for retina) to show completely; other sizes fill
   the width and are trimmed from the bottom (headings usually sit at the top). */
.detail-hero {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    object-position: top
}

.detail-content {
    padding: 32px 36px 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    overflow: hidden
}

.detail-category {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #4f46e5;
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 4px;
    width: fit-content
}

.detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin: 0
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap
}

.detail-date,
.detail-views {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .85rem;
    color: #9ca3af
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.detail-tag {
    display: inline-block;
    font-size: .8rem;
    background: #f3f4f6;
    color: #374151;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: default;
    transition: background 0.15s, color 0.15s, border-color .15s;
    border: 1px solid transparent
}

.detail-tag:hover {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe
}

.detail-body {
    display: block !important;
    margin-top: 0;
    font-size: 1rem;
    line-height: 1.85;
    color: #000000;
    overflow-wrap: break-word;
    word-break: normal;
    min-width: 0;
    max-width: 100%
}

.detail-body> :first-child {
    margin-top: 0
}

.detail-body h1,
.detail-body h2,
.detail-body h3,
.detail-body h4,
.detail-body h5,
.detail-body h6 {
    display: block !important;
    margin: 32px 0 12px;
    color: #111827;
    font-weight: 700;
    line-height: 1.35
}

.detail-body h1 {
    font-size: 1.8rem
}

.detail-body h2 {
    font-size: 1.5rem
}

.detail-body h3 {
    font-size: 1.25rem
}

.detail-body p {
    display: block !important;
    margin-bottom: 8px;
    margin-top: 0
}

/* Blank line (Enter pressed twice) is saved as an empty <p> — give it one line
   of height, same as in the editor, instead of collapsing to nothing */
.detail-body p:empty {
    min-height: 1.85em
}

.detail-body img {
    display: block !important;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0
}

.detail-body ul,
.detail-body ol {
    display: block !important;
    padding-left: 1.6em !important;
    margin-bottom: 18px;
    margin-top: 8px
}

.detail-body ul {
    list-style-type: disc !important
}

.detail-body ol {
    list-style-type: decimal !important
}

.detail-body li {
    display: list-item !important;
    margin-bottom: 8px;
    padding-left: 0;
    line-height: 1.75
}

.detail-body ul ul,
.detail-body ul ol,
.detail-body ol ul,
.detail-body ol ol {
    margin-top: 6px;
    margin-bottom: 4px
}

.detail-body ul ul {
    list-style-type: circle !important
}

.detail-body ul ul ul {
    list-style-type: square !important
}

.table-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 10px #1b496514
}

.detail-body table {
    table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0
}

.detail-body th {
    background-color: #074b88;
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 13px 14px;
    border: 1px solid #155079 !important;
    outline: none !important;
    box-shadow: none !important;
    vertical-align: middle
}

.detail-body td {
    padding: 11px 14px;
    border: 1px solid #d0e8f5 !important;
    text-align: center;
    vertical-align: middle;
    outline: none !important;
    box-shadow: none !important
}

.detail-body pre,
.detail-body code {
    display: block !important;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all
}

.detail-body blockquote {
    display: block !important;
    border-left: 4px solid #4f46e5;
    padding: 14px 18px;
    color: #6b7280;
    font-style: italic;
    margin: 24px 0;
    background: #f9fafb;
    border-radius: 0 8px 8px 0
}

.detail-body strong,
.detail-body b {
    font-weight: 700
}

.detail-body em,
.detail-body i {
    font-style: italic
}

.detail-body a {
    color: #4f46e5;
    text-decoration: underline
}

.detail-body a:hover {
    color: #3730a3
}

.detail-share-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6
}

.detail-share-label {
    font-size: .8rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px
}

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

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
    font-family: inherit;
    flex-shrink: 0
}

.share-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px #0000002e
}

.share-icon--instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff
}

.share-icon--linkedin {
    background: #0a66c2;
    color: #fff
}

.share-icon--facebook {
    background: #1877f2;
    color: #fff
}

.share-icon--copy {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb
}

.share-icon--copied {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border-color: #bbf7d0 !important
}

.detail-copied-msg {
    font-size: .82rem;
    color: #16a34a;
    margin-top: 10px
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: calc(95px + 24px)
}

.sidebar-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px #0000000f;
    padding: 22px 20px
}

.sidebar-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6
}

.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.recent-post-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    border-radius: 8px;
    padding: 8px 6px;
    transition: background .15s
}

.recent-post-item:hover {
    background: #f9fafb
}

.recent-post-thumb {
    width: 62px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e5e7eb
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.recent-post-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe)
}

.recent-post-info {
    flex: 1;
    min-width: 0;
    padding-top: 2px
}

.recent-post-title {
    font-size: .855rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 5px;
    transition: color .15s
}

.recent-post-item:hover .recent-post-title {
    color: #4f46e5
}

.recent-post-date {
    font-size: .74rem;
    color: #9ca3af
}

.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.sidebar-tag {
    font-size: .79rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 5px 13px;
    cursor: default;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform .15s;
    font-family: 'Poppins', sans-serif
}

.sidebar-tag:hover {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe;
    transform: translateY(-1px)
}

.detail-state {
    text-align: center;
    padding: 80px 0;
    font-size: 1rem;
    color: #6b7280
}

.detail-error {
    color: #dc2626
}

@media (max-width: 960px) {
    .blog-detail-layout {
        grid-template-columns: 1fr
    }

    .blog-sidebar {
        position: static
    }

    .detail-content {
        padding: 24px 24px 32px
    }

    .detail-title {
        font-size: 1.7rem
    }

    .blog-detail-page {
        padding-top: 130px
    }
}

@media (max-width: 600px) {
    .blog-detail-page {
        padding: 110px 12px 60px
    }

    .detail-title {
        font-size: 1.4rem
    }

    .detail-content {
        padding: 20px 16px 28px
    }

    .detail-meta-row {
        gap: 12px
    }
}

#blog-faq-container {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 32px;
    margin-top: 24px;
    width: 100%
}

.blog-faq-section {
    grid-column: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px #1b49651a;
    overflow: hidden
}

.blog-faq-inner {
    padding: 36px 40px 40px
}

.blog-faq-heading {
    font-size: 1.45rem;
    font-weight: 800;
    color: #074b88;
    margin: 0 0 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid #cae9ff;
    font-family: 'Poppins', sans-serif
}

.blog-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.blog-faq-item {
    border: 1.5px solid #d0e8f5;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fbfd;
    transition: border-color 0.2s, box-shadow .2s
}

.blog-faq-item:hover {
    border-color: #5fa8d3;
    box-shadow: 0 2px 10px #5fa8d31f
}

.blog-faq-item--open {
    border-color: #074b88;
    box-shadow: 0 4px 16px #1b49651f
}

.blog-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: .98rem;
    font-weight: 700;
    color: #074b88;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s, color .2s
}

.blog-faq-item--open .blog-faq-question {
    background: #074b88;
    color: #fff
}

.blog-faq-question:hover:not(.blog-faq-item--open .blog-faq-question) {
    background: #e8f4fc
}

.blog-faq-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 400;
    background: #cae9ff;
    color: #074b88;
    transition: background 0.2s, color 0.2s, transform .3s;
    line-height: 1
}

.blog-faq-item--open .blog-faq-icon {
    background: #5fa8d3;
    color: #fff;
    transform: rotate(45deg)
}

.blog-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease
}

.blog-faq-answer-inner {
    padding: 16px 22px 20px;
    font-size: .94rem;
    line-height: 1.8;
    color: #374151;
    border-top: 1px solid #d0e8f5;
    background: #fff
}

@media (max-width: 960px) {
    #blog-faq-container {
        grid-template-columns: 1fr;
        margin-top: 20px
    }

    .blog-faq-section {
        grid-column: 1
    }

    .blog-faq-inner {
        padding: 28px 24px 32px
    }
}

@media (max-width: 600px) {
    #blog-faq-container {
        margin-top: 16px
    }

    .blog-faq-inner {
        padding: 22px 18px 26px
    }

    .blog-faq-heading {
        font-size: 1.15rem;
        margin-bottom: 18px;
        padding-bottom: 14px
    }

    .blog-faq-question {
        padding: 14px 16px;
        font-size: .92rem
    }

    .blog-faq-answer-inner {
        padding: 12px 16px 16px;
        font-size: .88rem
    }
}
