.article-detail-page {
    background: var(--bg-page);
    min-height: 60vh;
}

.article-detail-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.article-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 28px;
    align-items: start;
}

.article-detail-main,
.article-sidebar-stack {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.article-detail-sidebar {
    min-width: 0;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 4px;
}

.article-detail-heading {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.article-detail-heading .ch-caption {
    color: var(--clevr-blue-600);
}

.article-detail-heading .ch-h1 {
    margin: 8px 0 12px;
}

.article-detail-heading p {
    color: var(--fg-3);
    font: 600 14px var(--font-body);
    margin: 0;
}

.article-detail-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.article-detail-card h3 {
    color: var(--fg-1);
    border-bottom: 1px solid var(--border-subtle);
    font: 700 20px/1.25 var(--font-body);
    margin: 0 0 14px;
    padding-bottom: 12px;
}

.article-hero-image {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0;
    overflow: hidden;
}

.article-hero-image img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.article-content {
    color: var(--fg-2);
    font: 400 16px/1.7 var(--font-body);
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content > *:last-child {
    margin-bottom: 0;
}

.article-content p {
    margin: 0 0 16px;
}

.article-content ul,
.article-content ol {
    color: var(--fg-2);
    margin: 0 0 16px;
    padding-left: 24px;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    margin: 6px 0;
    padding-left: 2px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--fg-1);
    line-height: 1.25;
}

.article-inline-image {
    margin: 28px 0;
    display: block;
}

.article-inline-image a {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--motion-base) var(--ease-standard), transform var(--motion-base) var(--ease-standard);
}

.article-inline-image a:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-inline-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.article-carousel {
    margin: 28px 0 32px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.carousel-main {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--neutral-100);
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--neutral-100);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    padding: 0 0 4px;
    z-index: 2;
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(15, 23, 42, 0.92);
}

.carousel-counter {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font: 700 11px var(--font-mono);
    padding: 4px 10px;
    border-radius: 999px;
    z-index: 2;
}

.carousel-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: var(--neutral-50);
    border-top: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: thin;
}

.carousel-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 56px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}

.carousel-thumb:hover,
.carousel-thumb.active {
    border-color: var(--clevr-blue-500);
}

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

.article-bom-list,
.article-related-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-bom-item {
    display: grid;
    grid-template-columns: auto 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    cursor: pointer;
    padding: 10px;
}

.article-bom-item:hover {
    background: var(--bg-brand-soft);
    border-color: var(--clevr-blue-300);
}

.article-bom-item input {
    width: 18px;
    height: 18px;
}

.article-bom-item img,
.article-related-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
}

.article-bom-item p {
    color: var(--fg-1);
    font: 700 13px/1.35 var(--font-body);
    margin: 0 0 3px;
}

.article-bom-item span {
    color: var(--fg-2);
    font: 700 12px var(--font-mono);
}

.article-bom-actions {
    border-top: 1px solid var(--border-subtle);
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
}

.article-bom-actions > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.article-bom-actions button[type="button"] {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--neutral-100);
    color: var(--fg-2);
    cursor: pointer;
    font: 700 12px var(--font-body);
    padding: 7px 10px;
}

.article-primary-btn,
.article-kit-summary a {
    border: 0;
    border-radius: var(--radius-md);
    background: var(--clevr-blue-500);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    min-height: 42px;
    padding: 11px 15px;
    text-decoration: none;
    font: 700 14px var(--font-body);
}

.article-primary-btn:hover,
.article-kit-summary a:hover {
    background: var(--clevr-blue-600);
}

.article-feedback {
    color: var(--fg-2);
    font: 600 13px var(--font-body);
    min-height: 20px;
    text-align: center;
}

.article-feedback.text-green-500 {
    color: #15803d;
}

.article-feedback.text-red-500 {
    color: var(--danger);
}

.article-related-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    color: var(--fg-1);
    font: 700 13px/1.35 var(--font-body);
    padding: 10px;
    text-decoration: none;
}

.article-related-item:hover {
    background: var(--bg-brand-soft);
    border-color: var(--clevr-blue-300);
}

.article-related-item span {
    min-width: 0;
}

.article-related-item svg {
    color: var(--fg-link);
    width: 16px;
    height: 16px;
}

.article-kit-summary {
    display: grid;
    gap: 10px;
    text-align: center;
}

.article-kit-summary + .article-kit-summary {
    border-top: 1px solid var(--border-subtle);
    margin-top: 18px;
    padding-top: 18px;
}

.article-kit-summary img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 8px;
}

.article-kit-summary h4 {
    color: var(--fg-1);
    font: 700 16px/1.35 var(--font-body);
    margin: 0;
}

.article-kit-summary p {
    color: var(--fg-2);
    font: 700 13px var(--font-body);
    margin: 0;
}

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

    .article-detail-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 640px) {
    .article-detail-shell {
        padding: 36px 16px 48px;
    }

    .article-detail-heading .ch-h1 {
        font-size: 36px;
    }

    .article-detail-card,
    .article-detail-heading {
        padding: 18px;
    }

    .carousel-prev,
    .carousel-next {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .carousel-thumb {
        width: 60px;
        height: 44px;
    }
}
