/* Post detail - unified with blog v2 + frontend-v2 tokens */

.post-shell {
    background:
        radial-gradient(760px 320px at 2% 0%, rgba(62, 122, 186, 0.14) 0%, rgba(62, 122, 186, 0) 58%),
        var(--c-bg);
    min-height: 100vh;
    padding: var(--space-6) 0 var(--space-8);
}

.post-shell .breadcrumb {
    margin-bottom: 0;
}

.post-shell .breadcrumb-item,
.post-shell .breadcrumb-item a {
    font-size: 13px;
    color: var(--c-muted);
    text-decoration: none;
}

.post-shell .breadcrumb-item a:hover {
    color: var(--c-primary);
}

.post-card {
    background: var(--c-panel);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.post-card:hover {
    border-color: var(--c-line-strong);
    box-shadow: var(--shadow-sm);
}

.post-hero {
    display: grid;
    gap: 10px;
}

.post-title {
    color: var(--c-accent);
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.12;
    font-weight: 700;
    margin: 0;
}

.post-meta {
    color: var(--c-muted);
    font-size: 13px;
}

.post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 10px;
}

.post-meta-chip i {
    color: var(--c-primary);
    font-size: 12px;
}

.post-hero-media {
    margin: 0;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f1f5f9;
}

.post-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.post-content {
    color: var(--c-text);
    line-height: 1.8;
    font-size: 16px;
}

.post-content > * + * {
    margin-top: var(--space-3);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: var(--space-5) 0 var(--space-3);
    color: var(--c-accent);
    font-weight: 700;
    line-height: 1.32;
}

.post-content p {
    margin-bottom: 0;
}

.post-content img,
.post-content video,
.post-content iframe {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    margin: var(--space-4) auto;
    border: 1px solid var(--c-line);
}

.post-content ul,
.post-content ol {
    padding-left: 1.1rem;
    margin-bottom: 0;
}

.post-content li + li {
    margin-top: 6px;
}

.post-content blockquote {
    margin: var(--space-4) 0;
    padding: 10px 12px;
    border-left: 3px solid var(--c-primary);
    background: #f8fbff;
    color: #334155;
    border-radius: 8px;
}

.post-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.post-content table td,
.post-content table th {
    border: 1px solid var(--c-line);
    padding: 8px 10px;
    font-size: 14px;
}

.post-content a {
    color: var(--c-primary);
    text-decoration: underline;
}

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

.post-tags a {
    border: 1px solid var(--c-line);
    border-radius: 999px;
    color: var(--c-text);
    font-size: 12px;
    text-decoration: none;
    padding: 4px 10px;
    background: #fff;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.post-tags a:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: #f8fbff;
}

.post-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.post-section-head h5 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--c-accent);
}

.post-section-head h5 i {
    color: var(--c-primary);
    font-size: 16px;
}

.post-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    background: #f5f9ff;
    color: var(--c-primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 0 9px;
}

.related-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-related-link {
    display: block;
    text-decoration: none;
}

.post-related-card {
    overflow: hidden;
    border-radius: var(--radius-md);
    height: 100%;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.post-related-link:hover .post-related-card {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--c-line-strong);
}

.post-related-card .ratio img {
    transition: transform .3s ease;
}

.post-related-link:hover .post-related-card .ratio img {
    transform: scale(1.03);
}

.post-related-card h6 {
    color: var(--c-accent);
    line-height: 1.4;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-card.p-4 {
        padding: var(--space-4) !important;
    }
}

@media (max-width: 640px) {
    .post-shell {
        padding-top: var(--space-4);
    }

    .post-shell .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .post-shell .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        white-space: nowrap;
    }

    .post-shell .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .post-card {
        border-radius: var(--radius-md);
    }

    .post-card.p-4 {
        padding: 12px !important;
    }

    .post-title {
        font-size: clamp(24px, 7vw, 34px);
    }

    .post-meta-row {
        gap: 6px;
    }

    .post-meta-chip {
        font-size: 11px;
        padding: 5px 8px;
    }

    .post-content {
        font-size: 15px;
        line-height: 1.75;
    }

    .post-content table td,
    .post-content table th {
        font-size: 13px;
        padding: 7px 8px;
    }

    .post-section-head h5 {
        font-size: 16px;
    }

    .post-section-count {
        min-width: 26px;
        height: 26px;
        font-size: 11px;
        padding: 0 7px;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
