/* News Page Specific Styles - Mobile First Refactor */

/* BREADCRUMB - Mobile First */
.breadcrumb {
    background: var(--bg-secondary);
    padding: 16px;
    /* Mobile Padding */
    text-align: left;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.breadcrumb a {
    color: var(--brand-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #068935;
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text);
    font-weight: 500;
}

/* NEWS CONTAINER - Mobile First */
.news-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 16px;
    /* Mobile Padding */
}

/* NEWS LAYOUT - Mobile First Default: Stacked */
.news-layout {
    display: grid;
    grid-template-columns: 1fr;
    /* Stacked */
    gap: 40px;
}

.main-content {
    min-width: 0;
    /* Prevent grid blowout */
}

/* FILTER TABS - Mobile First */
.filter-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    /* Horizontal Scroll on mobile */
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

.filter-tab {
    padding: 12px 20px;
    /* Mobile touch target */
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.filter-tab:hover {
    background: var(--brand-green);
    color: #fff;
    border-color: var(--brand-green);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: var(--brand-green);
    color: #fff;
    border-color: var(--brand-green);
    box-shadow: 0 4px 12px rgba(10, 140, 58, 0.3);
}

/* NEWS LIST */
.news-list {
    display: grid;
    gap: 24px;
    /* Mobile gap */
}

/* NEWS CARD - Mobile First Default: Stacked Columns */
.news-card {
    display: grid;
    grid-template-columns: 1fr;
    /* Stacked */
    gap: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 2px solid transparent;
    position: relative;
    margin-bottom: 20px;
    height: 100%;
    /* Fix: Ensure card stretches to full height of grid cell */
    /* Mobile spacing */
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--brand-green);
}

.news-card.featured {
    border: 2px solid var(--brand-gold);
    background: linear-gradient(135deg, #fff 0%, #fffaf0 100%);
}

.news-card.featured:hover {
    border-color: var(--brand-gold);
}

/* NEWS IMAGE - Mobile First */
.news-image {
    position: relative;
    width: 100%;
    /* Full width */
    height: 220px;
    /* Mobile height */
    overflow: hidden;
    background: var(--bg-secondary);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.news-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, var(--brand-gold), #b8941f);
    color: #fff;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    z-index: 2;
}

/* NEWS CONTENT - Mobile First */
.news-content {
    padding: 20px;
    /* Mobile padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    /* Fix: Push footer to bottom */
}

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

.news-date {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-secondary);
    color: var(--brand-blue);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.news-category.event {
    background: rgba(255, 107, 53, 0.1);
    color: var(--brand-orange);
    border-color: var(--brand-orange);
}

.news-category.announcement {
    background: rgba(2, 94, 161, 0.1);
    color: var(--brand-light-blue);
    border-color: var(--brand-light-blue);
}

.news-category.safety {
    background: rgba(10, 140, 58, 0.1);
    color: var(--brand-green);
    border-color: var(--brand-green);
}

.news-content h3 {
    font-size: 20px;
    /* Mobile size */
    color: var(--brand-blue);
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.news-card:hover .news-content h3 {
    color: var(--brand-green);
}

.news-content p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-link {
    color: var(--brand-green);
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.news-card:hover .news-link {
    gap: 12px;
}

/* SIDEBAR - Mobile First (Stacked beneath or above) */
.sidebar {
    position: static;
    margin-top: 40px;
    align-self: start;
}

.sidebar-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    /* Mobile padding */
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    animation: slideIn 0.6s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

.sidebar-card:hover {
    border-color: var(--brand-green);
    box-shadow: var(--shadow-lg);
}

.sidebar-card h3 {
    font-size: 20px;
    color: var(--brand-blue);
    margin-bottom: 24px;
    font-weight: 700;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

/* POPULAR POSTS */
.popular-post {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.3s ease;
}

.popular-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-post:hover {
    transform: translateX(4px);
}

.popular-post-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.popular-post:hover .popular-post-image img {
    transform: scale(1.1);
}

.popular-post-content h4 {
    font-size: 15px;
    color: var(--brand-blue);
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post:hover h4 {
    color: var(--brand-green);
}

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

/* TAG CLOUD */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--brand-green);
    color: #fff;
    border-color: var(--brand-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 140, 58, 0.2);
}

/* NEWSLETTER BOX */
.newsletter-box {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-light-blue) 100%);
    border-radius: 16px;
    padding: 32px;
    color: #fff;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
}

.newsletter-box h4 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 700;
}

.newsletter-box p {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.95;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.newsletter-form button {
    padding: 12px 24px;
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background: #068935;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 140, 58, 0.4);
}

/* PAGINATION - Mobile First */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
    flex-wrap: wrap;
    /* Allow wrapping */
}

.pagination a,
.pagination span {
    padding: 12px 18px;
    /* Larger touch target */
    background: var(--bg-secondary);
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 15px;
}

.pagination a:hover {
    background: var(--brand-green);
    color: #fff;
    transform: translateY(-2px);
}

.pagination .active {
    background: var(--brand-green);
    color: #fff;
    border-color: var(--brand-green);
}

/* ========================================
   DESKTOP ENHANCEMENTS (min-width)
   ======================================== */

/* Tablet & Up */
@media (min-width: 768px) {
    .breadcrumb {
        padding: 16px 24px;
    }

    .news-card {
        grid-template-columns: 240px 1fr;
        /* Image + Content side-by-side */
    }

    .news-image {
        width: 100%;
        height: 100%;
        min-height: 200px;
    }

    .filter-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .filter-tab {
        padding: 12px 24px;
    }
}

/* Desktop & Up */
/* Desktop & Up */
@media (min-width: 1024px) {
    .news-container {
        padding: 60px 24px;
    }

    .news-layout {
        grid-template-columns: 1fr 340px;
        /* Main content + Fixed sidebar */
        gap: 48px;
        align-items: start;
    }

    .sidebar {
        position: sticky;
        top: 100px;
        margin-top: 0;
    }

    .news-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        /* Grid for cards */
        gap: 32px;
    }

    .news-card {
        grid-template-columns: 1fr;
        /* Reset to stacked inside card for grid view */
        display: flex;
        /* Or flex column */
        flex-direction: column;
    }

    .news-image {
        width: 100%;
        height: 220px;
    }

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

/* Large Desktop */
@media (min-width: 1200px) {
    .news-layout {
        grid-template-columns: 1fr 350px;
        gap: 60px;
    }

    .news-card {
        grid-template-columns: 350px 1fr;
        gap: 28px;
    }

    .news-image {
        width: 350px;
        height: 250px;
    }

    .news-content {
        padding: 24px 24px 24px 0;
    }

    .news-content h3 {
        font-size: 24px;
    }

    .sidebar-card {
        padding: 32px;
    }

    .sidebar-card h3 {
        font-size: 22px;
    }
}

/* ===================================
   QUILL CONTENT & DETAIL PAGE (Mobile Optimized)
   =================================== */

.news-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    margin: 30px 0;
    overflow-wrap: break-word;
    /* Prevent long words from breaking layout */
}

.news-detail-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #01316f;
    margin: 32px 0 16px;
}

.news-detail-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #01316f;
    margin: 32px 0 16px;
}

.news-detail-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #01316f;
    margin: 32px 0 16px;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.news-detail-hero {
    height: 40vh;
    min-height: 300px;
}

/* NEWS NAVIGATION - Mobile First */
.news-navigation {
    display: flex;
    flex-direction: column;
    /* Stacked */
    gap: 15px;
    margin-top: 40px;
}

.news-navigation a {
    width: 100%;
    text-align: center;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-back {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-category {
    background: #667eea;
    color: white;
}

/* AUTHOR BIO - Mobile First */
.author-bio {
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.author-bio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 25px;
}

.author-avatar-large img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
}

/* GALLERY - Mobile First */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Stacked */
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* DESKTOP ENHANCEMENTS FOR DETAIL COMPONENTS */
@media (min-width: 768px) {
    .news-detail-content {
        font-size: 17px;
    }

    .news-detail-content h1 {
        font-size: 36px;
    }

    .news-detail-content h2 {
        font-size: 30px;
    }

    .news-detail-content h3 {
        font-size: 24px;
    }

    .news-navigation {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .news-navigation a {
        width: auto;
    }

    .author-bio {
        padding: 30px;
    }

    .author-bio-content {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .news-detail-content img {
        margin: 30px auto;
    }
}/* RELATED NEWS - Mobile First */
.related-news-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
}

.related-news-section .section-header {
    margin-bottom: 24px;
}

.related-news-section h3 {
    font-size: 24px;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-weight: 700;
}

.related-news-section .subtitle {
    font-size: 15px;
    color: var(--text-light);
}

.related-news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.related-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    height: 100%;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-green);
}

.related-card .card-image {
    position: relative;
    width: 100%;
    padding-top: 60%;
    /* Aspect Ratio 5:3 */
    overflow: hidden;
}

.related-card .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-card:hover .card-image img {
    transform: scale(1.1);
}

.related-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-card:hover .overlay {
    opacity: 1;
}

.related-card .read-more {
    color: #fff;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid #fff;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.related-card .card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-card .card-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.related-card h4 {
    font-size: 16px;
    color: var(--brand-blue);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card .excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .related-news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
