/**
 * CerdasWeb Modern Technology - Single Post & Editorial Reading
 */

.cw-single-post-wrapper {
    padding-top: clamp(2rem, 4vw, 3.5rem);
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

.cw-post-header {
    max-width: 820px;
    margin: 0 auto 2.5rem;
}

.cw-post-category-badge {
    margin-bottom: 1rem;
}

.cw-post-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.cw-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--cw-muted);
    font-size: 0.9375rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--cw-border);
}

.cw-post-featured-image {
    margin: 2rem auto;
    max-width: 1000px;
    border-radius: var(--cw-radius-lg);
    overflow: hidden;
    box-shadow: var(--cw-shadow-md);
}

.cw-post-featured-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* 70% Content / 30% Sidebar */
.cw-single-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3.5rem;
    margin-top: 2rem;
}

@media (min-width: 1024px) {
    .cw-single-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

/* Article Body Typography (65-78ch width, 1.7-1.85 line height) */
.cw-article-body {
    max-width: 74ch;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--cw-text);
}

.cw-article-body h2 {
    font-size: 1.875rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--cw-border);
    scroll-margin-top: 100px;
}

.cw-article-body h3 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 100px;
}

.cw-article-body p {
    margin-bottom: 1.5rem;
}

.cw-article-body blockquote {
    border-left: 4px solid var(--cw-primary);
    background: var(--cw-soft-blue);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--cw-radius-md) var(--cw-radius-md) 0;
    font-style: italic;
    color: var(--cw-text);
}

.cw-article-body pre {
    background: #0F172A;
    color: #F8FAFC;
    padding: 1.25rem;
    border-radius: var(--cw-radius-md);
    overflow-x: auto;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 2rem 0;
}

.cw-article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    background: rgba(15, 23, 42, 0.06);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.cw-article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.cw-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9375rem;
}

.cw-article-body th,
.cw-article-body td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--cw-border);
    text-align: left;
}

.cw-article-body th {
    background: var(--cw-soft-blue);
    font-weight: 600;
}

/* Sidebar & Sticky TOC */
.cw-single-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cw-toc-box {
    position: sticky;
    top: 6.5rem;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--cw-shadow-sm);
}

.cw-toc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cw-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 380px;
    overflow-y: auto;
}

.cw-toc-item {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.cw-toc-item.cw-toc-h3 {
    padding-left: 1rem;
    font-size: 0.8125rem;
}

.cw-toc-link {
    color: var(--cw-muted);
    text-decoration: none;
    display: block;
    line-height: 1.4;
    transition: var(--cw-transition);
}

.cw-toc-link:hover,
.cw-toc-link.is-active {
    color: var(--cw-primary);
    font-weight: 600;
    transform: translateX(3px);
}

/* Social Share Bar */
.cw-share-bar {
    margin: 2.5rem 0;
    padding: 1.25rem;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.cw-share-label {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--cw-text);
}

.cw-share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cw-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: var(--cw-radius-pill);
    text-decoration: none;
    border: 1px solid var(--cw-border);
    color: var(--cw-text);
    background: var(--cw-surface);
    transition: var(--cw-transition);
}

.cw-share-btn:hover {
    transform: translateY(-2px);
}

.cw-share-wa:hover { background: #25D366; color: #FFF; border-color: #25D366; }
.cw-share-fb:hover { background: #1877F2; color: #FFF; border-color: #1877F2; }
.cw-share-x:hover { background: #000000; color: #FFF; border-color: #000000; }
.cw-share-li:hover { background: #0A66C2; color: #FFF; border-color: #0A66C2; }
.cw-share-tg:hover { background: #229ED9; color: #FFF; border-color: #229ED9; }
