/* News pages (list & single) */

/* Shared */
.news-date {
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.news-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.news-icon-circle i {
    font-size: 24px;
}

/* Single news */
.page-header {
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 15px;
}

.news-show .page-header .breadcrumb-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.news-show .page-header .breadcrumb-icon i {
    font-size: 20px;
}

.news-show .page-header .news-date {
    align-self: start;
}

.page-header-left .page-title-container {
    margin-bottom: 0;
}

/* Prevent icon from shrinking next to long titles */
.page-header-left .breadcrumb-icon,
.page-header-left .news-icon-circle {
    flex: 0 0 auto;
}

.page-header-left .page-title-container,
.page-header-left .page-title {
    flex: 1 1 auto;
    min-width: 0;
}

/* News list */
.news-list {
    display: block;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.news-item .news-icon-circle {
    width: 50px;
    height: 50px;
}

.news-item .news-icon-circle i {
    font-size: 20px;
}

.news-item-content {
    flex: 1;
    min-width: 0;
}

.news-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.news-item-date {
    margin-left: 16px;
    white-space: nowrap;
}

.news-item .news-title {
    margin: 0;
}

.news-item .news-description {
    margin: 4px 0 0 0;
}

/* Hover accent for news lists */
.home-news-item,
.news-item {
    --news-accent: var(--primary-color);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.home-news-item::after,
.news-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--news-accent) 12%, transparent), transparent 55%),
        radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--news-accent) 9%, transparent), transparent 45%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.home-news-item:hover,
.news-item:hover {
    background: var(--surface-color);
}

.home-news-item:hover::after,
.news-item:hover::after {
    opacity: 1;
}

.home-news-item .home-news-icon,
.home-news-item .home-news-content,
.home-news-item .home-news-row,
.home-news-item .home-news-title,
.home-news-item .home-news-date,
.home-news-item .home-news-description,
.news-item .news-icon-circle,
.news-item .news-item-content,
.news-item .news-item-row,
.news-item .news-title,
.news-item .news-description,
.news-item .news-item-date {
    position: relative;
    z-index: 1;
}

/* Dark mode tweaks */
[data-theme="dark"] .news-item {
    background: var(--surface-color);
    border-color: var(--border-color);
}

/* News Detail Page */
.news-detail-page {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-detail-header {
    background: var(--surface-color);
    border-radius: 18px;
    padding: 28px 30px;
    margin-bottom: 24px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.05), 0 4px 10px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.news-detail-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--news-accent, var(--primary-color)) 12%, transparent), transparent 45%),
        radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--news-accent, var(--primary-color)) 10%, transparent), transparent 35%);
    pointer-events: none;
}

.news-detail-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.news-detail-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.news-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 10px 0;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.news-detail-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--background-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.news-detail-date i {
    color: var(--primary-color);
    font-size: 13px;
}

.news-detail-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary-color), #8bc34a);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
    min-height: 36px;
}

.news-detail-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 179, 66, 0.4);
    color: white;
}

.news-detail-link-btn i {
    font-size: 14px;
}

.news-detail-content {
    background: var(--surface-color);
    border-radius: 18px;
    padding: 28px;
    box-shadow: none;
}

.news-detail-body {
    color: var(--text-secondary);
    font-size: 16.5px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.news-detail-body h1,
.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4 {
    color: var(--text-primary);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
}

.news-detail-body h1 {
    font-size: 24px;
}

.news-detail-body h2 {
    font-size: 22px;
}

.news-detail-body h3 {
    font-size: 20px;
}

.news-detail-body h4 {
    font-size: 18px;
}

.news-detail-body p {
    margin: 0 0 1.15em 0;
}

.news-detail-body ul,
.news-detail-body ol {
    margin: 1em 0;
    padding-left: 1.8em;
}

.news-detail-body li {
    margin-bottom: 0.5em;
}

.news-detail-body a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.news-detail-body a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.news-detail-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.news-detail-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 12px 20px;
    margin: 1.5em 0;
    background: var(--background-color);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.news-detail-body code {
    background: var(--background-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-color);
}

.news-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}

/* News detail dark mode */
[data-theme="dark"] .news-detail-header,
[data-theme="dark"] .news-detail-content {
    background: var(--surface-color);
    box-shadow: none;
}

[data-theme="dark"] .news-detail-date {
    background: rgba(124, 179, 66, 0.1);
    border-color: var(--border-color);
}

[data-theme="dark"] .news-detail-body blockquote {
    background: rgba(124, 179, 66, 0.05);
}

/* News detail responsive */
@media (max-width: 768px) {
    .news-detail-header {
        padding: 20px;
    }

    .news-detail-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-detail-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .news-detail-title {
        font-size: 22px;
    }

    .news-detail-content {
        padding: 20px;
    }

    .news-detail-body {
        font-size: 15px;
    }
}