/* =============================================
   NEWS PAGE STYLES - Enhanced Modern Design
   ============================================= */

/* =================
   CSS CUSTOM PROPERTIES
   ================= */
:root {
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --card-border-radius: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-color));
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.18);
}

/* =================
   LAYOUT & STRUCTURE
   ================= */
.news {
    margin-bottom: 40px;
}

.news-content {
    min-height: 100vh;
}

.news-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 50px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-main {
    min-width: 0;
}

.news-posts {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* =================
   BREADCRUMB & CATEGORY HEADER - Enhanced
   ================= */
.category-header {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--card-border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.category-title {
    font-size: 2.6rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 15px 0;
}

.category-count {
    font-size: 1.4rem;
    color: var(--badge-color);
    margin: 0;
}

.no-posts {
    text-align: center;
    padding: 80px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--card-border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}

.no-posts h3 {
    font-size: 2.2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.no-posts a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.no-posts a:hover {
    text-decoration: underline;
}

/* =================
   SHARED COMPONENTS - Enhanced
   ================= */
.news-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

.news-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.news-badge:hover::before {
    left: 100%;
}

/* Common image placeholder styles */
.news-card__placeholder,
.news-popular__placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--placeholder-color);
    font-weight: 600;
}

.news-card__placeholder {
    width: 150px;
    height: 150px;
    border: 1px solid var(--bg-color-2);
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    
}

.news-popular__placeholder {
    font-size: 1.2rem;
}

/* Hide placeholder when real image is present */
.news-card__image img[src]:not([src=""]):not([src*="placeholder.jpg"])+.news-card__placeholder,
.news-popular__image img[src]:not([src=""]):not([src*="placeholder.jpg"])+.news-popular__placeholder {
    display: none;
}

/* =================
   NEWS CARDS - Enhanced Design
   ================= */
.news-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border-radius: var(--card-border-radius);
}

.news-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-card__link {
    display: flex;
    gap: 25px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    height: 100%;
    border-radius: var(--card-border-radius);
}

.news-card__image {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    overflow: hidden;
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 5px 0;
}

.news-card__meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-card__date {
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 600;
}

.news-card__categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.news-card__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.news-card:hover .news-card__title {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-card__excerpt {
    font-size: 1.4rem;
    color: var(--badge-color);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-width: 100%;
}

/* =================
   SIDEBAR - Enhanced Design
   ================= */
.news-sidebar {
    position: sticky;
    top: 30px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-widget {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.news-widget__title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    position: relative;
}

/* Categories widget */
.news-categories {
    list-style: none;
    margin: 20px 0 0 0;
    padding: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.news-categories__item {
    border-bottom: none;
    margin-bottom: 4px;
}

.news-categories__item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.news-categories__link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 600;
    background: var(--white-color);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.news-categories__link:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.news-categories__link:hover svg {
    color: var(--white-color);
}

.news-categories__link svg {
    width: 10px;
    height: 16px;
    color: var(--primary-color);
}

.news-categories__link.active {
    background: var(--primary-color);
    color: var(--white-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.news-categories__link.active svg {
    color: var(--white-color);
}

/* Popular posts widget */
.news-popular {
    list-style: none;
    margin: 20px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-popular__item {
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
}

.news-popular__link {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
    overflow: hidden;
}

.news-popular__image {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
}

.news-popular__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-popular__content {
    flex: 1;
    position: relative;
}

.news-popular__title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-weight: 700;
}

.news-popular__link:hover .news-popular__title {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-popular__text {
    font-size: 1.3rem;
    color: var(--badge-color);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-width: 100%;
}

/* =================
   POST DETAIL PAGE
   ================= */
.post-detail {
    background-color: var(--white-color);
    border-radius: 8px;
    padding: 40px;
}

.post-detail__header {
    margin-bottom: 30px;
}

.post-detail__meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.post-detail__date {
    font-size: 1.4rem;
    color: var(--text-color);
}

.post-detail__categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-detail__title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.post-detail__image {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    max-height: 300px;
}

.post-detail__image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

/* Content styling */
.post-detail__content {
    font-size: 1.6rem;
    line-height: 1.8;
    color: var(--text-color);
    text-indent: 0;
    text-align: justify;
    word-break: break-word;
}

.post-detail__content h2,
.post-detail__content h3,
.post-detail__content h4 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.post-detail__content h2 {
    font-size: 2.4rem;
}

.post-detail__content h3 {
    font-size: 2rem;
}

.post-detail__content h4 {
    font-size: 1.8rem;
}

.post-detail__content p,
.post-detail__content li {
    margin-bottom: 20px;
    text-indent: 0;
    text-align: justify;
    word-break: break-word;
}

.post-detail__content li {
    margin-bottom: 10px;
}

.post-detail__content ul,
.post-detail__content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
}

.post-detail__content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-detail__content a:hover {
    text-decoration: none;
}

.post-detail__content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--badge-color);
    text-indent: 0;
    text-align: justify;
    word-break: break-word;
}

/* Post navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.post-navigation__prev,
.post-navigation__next {
    min-height: 80px;
}

.post-navigation__next {
    text-align: right;
}

.post-navigation__link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.post-navigation__link:hover {
    background-color: var(--border-color);
}

.post-navigation__label {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
}

.post-navigation__title {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =================
   RESPONSIVE DESIGN
   ================= */
@media screen and (max-width: 768px) {

    /* Layout adjustments */
    .news-content {
        padding: 0;
    }

    .news-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0;
    }

    .news-posts {
        gap: 16px;
        width: 90%;
        margin: 0 auto;
    }

    /* Category header responsive */
    .category-header {
        margin: 20px 12px 20px 12px;
        padding: 16px;
    }

    .category-title {
        font-size: 2rem;
    }

    .category-count {
        font-size: 1.3rem;
    }

    .no-posts {
        margin: 0 12px;
        padding: 40px 20px;
    }

    .no-posts h3 {
        font-size: 1.8rem;
    }

    /* News cards responsive */
    .news-card {
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
        border-radius: 0;
    }

    .news-card__link {
        flex-direction: column;
        padding: 0;
        gap: 12px;
    }

    .news-card__image {
        width: 90%;
        margin: 0 auto;
        height: 120px;
        border-radius: 0;
    }

    .news-card__content {
        padding: 0 12px 12px 12px;
    }

    .news-card__title {
        font-size: 1.6rem;
    }

    .news-card__excerpt {
        font-size: 1.4rem;
    }

    /* Sidebar responsive */
    .news-sidebar {
        position: static;
        background-color: var(--bg-color-2);
        padding: 20px 0;
        gap: 0;
    }

    .news-widget {
        padding: 16px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background-color: var(--bg-color-2);
    }

    .news-widget__title {
        font-size: 1.6rem;
        margin-bottom: 0;
        padding-bottom: 10px;
        border-bottom: none;
    }

    .news-categories__link {
        border: 1px solid transparent;
        border-radius: var(--card-border-radius);
    }

    .news-categories,
    .news-popular__item {
        border: 1px solid var(--border-color);
        border-radius: var(--card-border-radius);
        background-color: var(--white-color);
        margin: 0;
    }

    .news-popular {
        margin: 0;
    } 

    .news-popular__link {
        gap: 10px;
    }

    .news-popular__image {
        width: 70px;
        height: 70px;
    }

    .news-popular__text {
        font-size: 1.2rem;
    }

    /* Post detail responsive */
    .post-detail {
        padding: 20px;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .post-detail__header {
        margin-bottom: 0;
        display: contents;
    }

    .post-detail__meta {
        order: 1;
        margin-bottom: 20px;
    }

    .post-detail__image {
        order: 2;
        margin-top: 0;
        margin-bottom: 20px;
        max-height: 200px;
    }

    .post-detail__image img {
        max-height: 200px;
    }

    .post-detail__title {
        order: 3;
        margin-top: 0;
        margin-bottom: 30px;
        font-size: 2.2rem;
    }

    .post-detail__content {
        order: 4;
        font-size: 1.5rem;
    }

    .post-detail__content h2 {
        font-size: 2rem;
    }

    .post-detail__content h3 {
        font-size: 1.8rem;
    }

    .post-detail__content h4 {
        font-size: 1.6rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .post-navigation__next {
        text-align: left;
    }

    .post-navigation__link {
        padding: 15px;
    }
}