/* Blog and Article Styles */
/* News / Blog Card */
.news-card {
    background-color: var(--color-surface);
    border: 1px solid rgba(22, 61, 70, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.blog-posts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: stretch;
}

.news-card:hover {
    border-color: rgba(22, 61, 70, 0.24);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.news-card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: var(--color-bg-alt);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-meta {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    display: flex;
    gap: var(--space-md);
}

.news-card-meta span i {
    color: var(--color-secondary);
    margin-right: var(--space-xxs);
}

.news-card-title {
    font-size: var(--fs-base);
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    min-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-wrap: pretty;
}

.news-card-title a {
    color: var(--color-primary);
}

.news-card-title a:hover {
    color: var(--color-primary-dark);
}

.news-card-excerpt {
    font-size: var(--fs-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
    line-height: 1.6;
    height: 4.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-card-more {
    margin-top: auto;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--color-primary);
    text-transform: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.news-card-more i {
    transition: transform var(--transition-fast);
}

.news-card:hover .news-card-more i {
    transform: translateX(3px);
}

/* Homepage News Carousel */
.news-carousel {
    position: relative;
    margin-top: var(--space-2xl);
}

.news-carousel-viewport {
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px 2px var(--space-sm);
}

.news-carousel-viewport::-webkit-scrollbar {
    display: none;
}

.news-carousel-track.grid {
    display: flex;
    gap: var(--space-lg);
}

.news-carousel-track .news-card {
    flex: 0 0 calc((100% - (var(--space-lg) * 2)) / 3);
    min-width: 0;
    scroll-snap-align: start;
}

.news-carousel-btn {
    position: absolute;
    top: 44%;
    z-index: 6;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(22, 61, 70, 0.16);
    border-radius: 50%;
    background-color: rgba(255, 254, 250, 0.94);
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.news-carousel-btn:hover,
.news-carousel-btn:focus-visible {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(13, 38, 44, 0.18);
    transform: translateY(-50%) scale(1.06);
}

.news-carousel-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.news-carousel-btn-prev {
    left: -21px;
}

.news-carousel-btn-next {
    right: -21px;
}

.news-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-lg);
}

.news-carousel-dot {
    width: 28px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background-color: rgba(22, 61, 70, 0.18);
    cursor: pointer;
    transition: width var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.news-carousel-dot:hover,
.news-carousel-dot:focus-visible {
    background-color: rgba(255, 158, 11, 0.55);
    transform: translateY(-1px);
}

.news-carousel-dot.active {
    width: 42px;
    background-color: var(--color-secondary);
}

@media (max-width: 900px) {
    .news-carousel-track.grid {
        gap: var(--space-md);
    }

    .news-carousel-track .news-card {
        flex-basis: calc((100% - var(--space-md)) / 2);
    }
}

@media (max-width: 640px) {
    .news-carousel {
        margin-top: var(--space-xl);
    }

    .news-carousel-track.grid {
        gap: 10px;
    }

    .news-carousel-track .news-card {
        flex-basis: calc((100% - 10px) / 2);
    }

    .news-carousel-btn {
        display: none;
    }

    .news-carousel .news-card-image {
        aspect-ratio: 4 / 3;
    }

    .news-carousel .news-card-content {
        padding: 0.72rem;
    }

    .news-carousel .news-card-meta {
        gap: 0;
        margin-bottom: 0.42rem;
        font-size: 0.66rem;
        line-height: 1.25;
    }

    .news-carousel .news-card-meta span:nth-child(2) {
        display: none;
    }

    .news-carousel .news-card-title {
        min-height: auto;
        margin-bottom: 0;
        font-size: 0.82rem;
        line-height: 1.35;
        -webkit-line-clamp: 3;
    }

    .news-carousel .news-card-excerpt {
        display: none;
    }

    .news-carousel .news-card-more {
        margin-top: var(--space-sm);
        font-size: 0.72rem;
    }

    .news-carousel-dots {
        margin-top: var(--space-md);
    }
}

/* Blog layouts */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.3fr);
    gap: var(--space-xl);
    align-items: start;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    position: sticky;
    top: 104px;
}

.blog-widget {
    background-color: var(--color-surface);
    border: 1px solid rgba(22, 61, 70, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.blog-widget-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--color-primary);
    text-transform: none;
    margin-bottom: var(--space-md);
    border-bottom: 1px solid rgba(22, 61, 70, 0.12);
    padding-bottom: var(--space-xs);
}

/* Post list in widget */
.widget-posts {
    display: grid;
    gap: var(--space-md);
}

.widget-posts li {
    display: flex;
    gap: var(--space-sm);
    border-bottom: 1px solid rgba(22, 61, 70, 0.1);
    padding-bottom: var(--space-sm);
}

.widget-posts li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.widget-post-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.widget-post-info {
    flex: 1;
}

.widget-post-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: var(--space-xxs);
    text-wrap: wrap;
}

.widget-post-date {
    font-size: 10px;
    color: var(--color-text-muted);
}

/* Single Post Content */
.post-detail {
    min-width: 0;
    background-color: var(--color-surface);
    border: 1px solid rgba(22, 61, 70, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
}

.post-header {
    margin-bottom: var(--space-xl);
}

.post-meta {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background:
        linear-gradient(135deg, rgba(255, 254, 250, 0.92), rgba(246, 249, 245, 0.76));
    border: 1px solid rgba(22, 61, 70, 0.1);
    border-radius: var(--radius-lg);
}

.post-meta i {
    color: var(--color-secondary);
    width: 18px;
    margin-top: 0;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1;
}

.post-meta span {
    display: inline-flex;
    flex: 0 0 auto;
    max-width: 100%;
    gap: var(--space-xs);
    align-items: center;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-md);
    color: var(--color-text-light);
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
    background-color: rgba(255, 254, 250, 0.62);
    white-space: nowrap;
}

.post-title {
    font-size: var(--fs-3xl);
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.3;
}

.post-lead {
    max-width: 74ch;
    margin-top: var(--space-sm);
    margin-bottom: 0;
    font-size: var(--fs-lg);
    color: var(--color-text-light);
}

.post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-lg);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-body {
    font-size: var(--fs-base);
    color: var(--color-text-light);
    line-height: 1.8;
}

.post-body p {
    margin-bottom: var(--space-lg);
}

.post-body blockquote {
    border-left: 4px solid var(--color-secondary);
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-lg) 0;
    font-style: italic;
    background-color: var(--color-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.post-body h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
    font-size: var(--fs-xl);
}

.post-body ul {
    margin: 0 0 var(--space-lg);
    padding-left: 1.25rem;
}

.post-body li {
    margin-bottom: var(--space-sm);
}

.article-related-section {
    min-width: 0;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(22, 61, 70, 0.1);
}

.article-related-head {
    display: flex;
    align-items: flex-end;
    margin-bottom: var(--space-lg);
}

.section-heading.compact {
    margin-bottom: 0;
}

.section-heading.compact h2 {
    margin-bottom: var(--space-xs);
    font-size: var(--fs-2xl);
}

.section-heading.compact p {
    margin-bottom: 0;
}

.article-related-carousel-shell {
    position: relative;
    min-width: 0;
}

.article-related-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(22, 61, 70, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 18px 36px rgba(22, 61, 70, 0.16);
    transform: translateY(-50%);
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.article-related-nav i {
    font-size: 1.05rem;
}

.article-related-nav:hover {
    transform: translateY(-50%) scale(1.06);
    background-color: #fff;
    color: var(--color-secondary);
    box-shadow: 0 22px 42px rgba(22, 61, 70, 0.22);
}

.article-related-nav-prev {
    left: -28px;
}

.article-related-nav-next {
    right: -28px;
}

.article-related-viewport {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.article-related-viewport::-webkit-scrollbar {
    display: none;
}

.article-related-track {
    min-width: 0;
    width: 100%;
    display: flex;
    gap: var(--space-md);
}

.article-related-card {
    flex: 0 0 calc((100% - (var(--space-md) * 2)) / 3);
    overflow: hidden;
    background-color: var(--color-surface);
    border: 1px solid rgba(22, 61, 70, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    scroll-snap-align: start;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.article-related-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 159, 10, 0.42);
    box-shadow: var(--shadow-md);
}

.article-related-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.article-related-card > div {
    padding: var(--space-md);
}

.related-card-date {
    display: inline-flex;
    margin-bottom: var(--space-xs);
    font-size: var(--fs-xs);
    color: var(--color-secondary);
    font-weight: 700;
}

.article-related-card h3 {
    margin-bottom: var(--space-xs);
    font-size: var(--fs-base);
    line-height: 1.35;
}

.article-related-card h3 a {
    color: var(--color-primary);
}

.article-related-card h3 a:hover {
    color: var(--color-secondary);
}

.article-related-card p {
    margin-bottom: 0;
    font-size: var(--fs-sm);
}

.article-related-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-md);
}

.article-related-dot {
    width: 20px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background-color: rgba(22, 61, 70, 0.18);
    cursor: pointer;
    transition: width 180ms ease, background-color 180ms ease;
}

.article-related-dot.active {
    width: 42px;
    background-color: var(--color-secondary);
}

.article-related-section.is-static .article-related-nav,
.article-related-section.is-static .article-related-dots {
    display: none;
}

/* Comments */
.comments-section {
    margin-top: var(--space-2xl);
    border-top: 1px solid rgba(22, 61, 70, 0.1);
    padding-top: var(--space-xl);
}

.comments-collapsible {
    background:
        linear-gradient(135deg, rgba(255, 250, 238, 0.64), rgba(255, 255, 250, 0.94)),
        var(--color-surface);
    border: 1px solid rgba(22, 61, 70, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.comments-collapsible-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.comments-collapsible-head h3 {
    margin-bottom: 0;
    font-size: var(--fs-xl);
}

.comments-eyebrow {
    display: inline-flex;
    margin-bottom: var(--space-xxs);
    color: var(--color-secondary);
    font-size: var(--fs-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comments-toggle-btn {
    min-height: 44px;
    border: 1px solid rgba(22, 61, 70, 0.16);
    border-radius: var(--radius-md);
    padding: 0 var(--space-md);
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.comments-toggle-btn:hover {
    transform: translateY(-2px);
    background-color: var(--color-secondary);
    color: var(--color-primary);
    box-shadow: 0 14px 28px rgba(255, 159, 10, 0.18);
}

.comments-collapsible-body {
    margin-top: var(--space-lg);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.comment-item {
    display: flex;
    gap: var(--space-md);
    background-color: var(--color-surface);
    border: 1px solid rgba(22, 61, 70, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.comment-info {
    flex: 1;
    min-width: 0;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-lg);
    color: var(--color-primary);
    flex-shrink: 0;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.comment-author {
    font-weight: 700;
    font-size: var(--fs-sm);
    color: var(--color-primary);
}

.comment-date {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.comment-text {
    font-size: var(--fs-sm);
    color: var(--color-text-light);
    margin-bottom: 0;
}

@media (max-width: 992px) {
    .article-related-card {
        flex-basis: calc((100% - var(--space-md)) / 2);
    }
}

@media (max-width: 640px) {
    .post-detail {
        padding: var(--space-lg);
    }

    .post-meta {
        gap: var(--space-xs);
    }

    .post-title {
        font-size: clamp(1.85rem, 8vw, 2.35rem);
    }

    .post-lead {
        font-size: var(--fs-base);
    }

    .article-related-head {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-md);
    }

    .article-related-nav {
        width: 44px;
        height: 44px;
        box-shadow: 0 14px 26px rgba(22, 61, 70, 0.18);
    }

    .article-related-nav-prev {
        left: -14px;
    }

    .article-related-nav-next {
        right: -14px;
    }

    .article-related-track {
        gap: var(--space-sm);
    }

    .article-related-card {
        flex-basis: calc((100% - var(--space-sm)) / 2);
        border-radius: var(--radius-md);
    }

    .article-related-card img {
        aspect-ratio: 1 / 0.82;
    }

    .article-related-card > div {
        padding: var(--space-sm);
    }

    .article-related-card h3 {
        font-size: 0.78rem;
        line-height: 1.35;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .article-related-card p {
        display: none;
    }

    .related-card-date {
        font-size: 0.68rem;
    }

    .article-related-dot {
        width: 16px;
    }

    .article-related-dot.active {
        width: 32px;
    }

    .comments-collapsible {
        padding: var(--space-md);
    }

    .comments-collapsible-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .comments-toggle-btn {
        width: 100%;
    }

    .comment-item {
        gap: var(--space-sm);
    }

    .comment-meta {
        flex-direction: column;
        gap: 2px;
    }
}
