/* Page specific styles: articles */

.blog-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.blog-detail-main {
    margin: 0;
}

.blog-main-thumb {
    width: 100%;
    max-width: 100%;
    margin: 0 0 14px;
}

.blog-main-thumb img {
    width: 100%;
    max-width: 100%;
    height: auto; /* override global .article-thumb img { height: 100% } */
    max-height: none;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.blog-detail-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-side-card {
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 16px;
    padding: 16px;
}

.blog-side-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: #111;
}

.most-viewed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.most-viewed-head h3 {
    margin: 0;
}

.most-viewed-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.most-viewed-arrow {
    width: 32px;
    height: 32px;
    border: 1px solid #d7c5d5;
    border-radius: 999px;
    background: #fff;
    color: #4f034b;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.most-viewed-arrow:hover:not(:disabled) {
    background: #4f034b;
    color: #fff;
    border-color: #4f034b;
}

.most-viewed-arrow:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.most-viewed-slider {
    min-height: 88px;
}

.blog-side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: #f7f7f7;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    color: #111;
}

.blog-side-link:last-child {
    margin-bottom: 0;
}

.blog-side-link:hover {
    border-color: #4f034b55;
    background: #fff;
}

.side-label {
    display: block;
    font-size: 12px;
    line-height: 18px;
    color: #4f034b;
    font-weight: 600;
    margin-bottom: 4px;
}

.blog-nav-arrows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-decoration: none;
    background: #f7f7f7;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px;
    color: #111;
}

.blog-nav-btn:hover {
    border-color: #4f034b55;
    background: #fff;
}

.blog-nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #4f034b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    flex: 0 0 28px;
}

.blog-nav-text {
    display: block;
    min-width: 0;
}

.side-post-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 64px;
}

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

.side-post-content {
    display: block;
    min-width: 0;
}

.side-post-content strong {
    display: block;
}

.side-meta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 18px;
    color: #666;
}

.side-empty {
    margin: 0;
    font-size: 14px;
    line-height: 21px;
    color: #666;
}

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

    .blog-detail-sidebar {
        position: static;
    }

    .blog-main-thumb {
        max-width: 100%;
    }
}

/* AI blog body formatting (front-side + live preview iframe) */
.articles-page .blog-detail-text {
    color: #414141;
    font-size: 16px;
    line-height: 1.85;
}

.articles-page .blog-detail-text > *:first-child {
    margin-top: 0;
}

.articles-page .blog-detail-text p {
    margin: 0 0 16px;
}

.articles-page .blog-detail-text a {
    color: var(--primary, #4F034B) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.articles-page .blog-detail-text a:hover {
    opacity: 0.9;
}

.articles-page .blog-detail-text h2,
.articles-page .blog-detail-text h3 {
    margin: 26px 0 12px;
    color: #111;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.articles-page .blog-detail-text h2 {
    font-size: 24px;
    font-weight: 700;
    padding-left: 12px;
    border-left: 4px solid var(--primary, #4F034B);
}

.articles-page .blog-detail-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary, #4F034B);
}

.articles-page .blog-detail-text ul,
.articles-page .blog-detail-text ol {
    margin: 0 0 16px 18px;
    padding: 0;
}

.articles-page .blog-detail-text li {
    margin: 8px 0;
}

.articles-page .blog-detail-text li::marker {
    color: var(--primary, #4F034B);
}

.articles-page .blog-detail-text strong {
    color: #111;
}

.articles-page .blog-detail-text hr {
    border: 0;
    height: 1px;
    margin: 18px 0;
    background: linear-gradient(90deg, transparent, rgba(79, 3, 75, 0.35), transparent);
}

.articles-page .blog-detail-text blockquote {
    margin: 16px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--primary, #4F034B);
    background: rgba(79, 3, 75, 0.06);
    border-radius: 12px;
    color: #111;
}

.articles-page .blog-detail-text blockquote p:last-child {
    margin-bottom: 0;
}

.articles-page .blog-detail-text code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(79, 3, 75, 0.08);
    color: #111;
    font-size: 0.95em;
}

.articles-page .blog-detail-text pre {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: #0b0b0f;
    color: #f7f7f7;
    overflow-x: auto;
}

.articles-page .blog-detail-text pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.articles-page .blog-detail-text img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.articles-page .blog-detail-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
}

.articles-page .blog-detail-text th,
.articles-page .blog-detail-text td {
    padding: 12px 10px;
    border-bottom: 1px solid #ececec;
    text-align: left;
    vertical-align: top;
}

.articles-page .blog-detail-text th {
    background: rgba(79, 3, 75, 0.06);
    color: #111;
    font-weight: 700;
}

.articles-page .blog-detail-text tr:last-child td {
    border-bottom: 0;
}

/* Optional “callout” blocks if AI outputs them */
.articles-page .blog-detail-text .callout,
.articles-page .blog-detail-text .note,
.articles-page .blog-detail-text .ai-callout,
.articles-page .blog-detail-text .takeaways {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid rgba(79, 3, 75, 0.18);
    background: rgba(79, 3, 75, 0.04);
    border-radius: 14px;
}

.articles-page .blog-detail-text .ai-takeaways {
    margin: 16px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--primary, #4F034B);
    background: rgba(79, 3, 75, 0.04);
    border-radius: 14px;
}
