/* Enhanced News CSS - Redesigned with Custom Root Variables */

/* Using provided root variables */
:root {
    --primary-color: #005792;
    --secondary-color: #00334e;
    --accent-color: rgb(43, 125, 233);
    --light-accent: #3ab6f8;
    --text-color: #000000;
    --light-color: #ffffff;
    --bg-color: #f8f9fc;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), #0077c2);
    --shadow: 0 10px 30px rgba(0, 87, 146, 0.1);
    --shadow-hover: 0 15px 35px rgba(0, 87, 146, 0.2);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --border-radius: 12px;
    
    /* Additional colors for enhanced design */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 87, 146, 0.15);
    --text-muted: rgba(0, 0, 0, 0.6);
    --text-light-muted: rgba(255, 255, 255, 0.8);
    --gradient-accent: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    --card-shadow: 0 8px 25px rgba(0, 87, 146, 0.08);
    --card-shadow-hover: 0 20px 40px rgba(0, 87, 146, 0.15);
}


/* Animated Background */
.news-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(0, 87, 146, 0.02) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(43, 125, 233, 0.02) 50%, transparent 70%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(2%) translateY(-1%); }
    50% { transform: translateX(-1%) translateY(2%); }
    75% { transform: translateX(1%) translateY(-2%); }
}

/* Enhanced News Container with sticky header spacing */
.news-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem;
    margin-top: 6rem; /* Space for sticky header */
    position: relative;
    min-height: 100vh;
}

/* Sophisticated Header */
.news-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.news-header::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(43, 125, 233, 0.3);
}

.news-header h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

.news-header p {
    font-size: 1.1rem;
    color: var(--light-color);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Advanced Category Filter */
.category-filter {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
}

.category-filter::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--gradient-accent);
    border-radius: 1px;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.category-btn:hover::before,
.category-btn.active::before {
    left: 0;
}

.category-btn:hover,
.category-btn.active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
    color: var(--light-color);
}

/* Optimized News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
    justify-items: center;
}

/* Compact News Cards */
.news-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.6s ease-out;
    height: fit-content;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.news-card:hover::before {
    opacity: 1;
}

.news-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent-color);
}

.news-image {
    position: relative;
    height: 200px; /* Reduced from 250px */
    overflow: hidden;
}

.news-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 87, 146, 0.1) 0%,
        rgba(43, 125, 233, 0.05) 100%
    );
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover .news-image::before {
    opacity: 1;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-secondary);
    color: var(--light-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: var(--shadow);
}

.news-content {
    padding: 1.5rem; /* Reduced from 2rem */
    color: var(--text-color);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-date::before {
    content: '📅';
    font-size: 0.75rem;
}

.news-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

 .tag {
    background: rgba(0, 87, 146, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

 .tag:hover {
    background: var(--accent-color);
    color: var(--light-color);
    transform: translateY(-1px);
}

.news-content h3 {
    margin-bottom: 0.75rem; /* Reduced from 1rem */
    font-size: 1.25rem; /* Reduced from 1.4rem */
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-color);
}

.news-content h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.news-content h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width 0.3s ease;
}

.news-content h3 a:hover::after {
    width: 100%;
}

.news-content h3 a:hover {
    color: var(--accent-color);
}

.news-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem; /* Reduced from 2rem */
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    background: var(--gradient-primary);
    color: var(--light-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem; /* Reduced padding */
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

.read-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.read-more:hover::before {
    left: 0;
}

.read-more:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Futuristic Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.75rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    min-width: 45px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.page-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.page-btn:hover::before,
.page-btn.active::before {
    left: 0;
}

.page-btn:hover,
.page-btn.active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
    color: var(--light-color);
}


/* ********************************************************* */
/* *********************** news details ******************** */
/* ********************************************************* */

*
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    z-index: 1000;
}
.progress-bar {
    height: 100%;
    background: var(--gradient-accent);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* --- Animated Background Elements --- */
.bg-decoration {
    position: fixed;
    z-index: -1;
    opacity: 0.1;
    background: var(--gradient-primary);
    animation: float 12s ease-in-out infinite;
}
.bg-decoration:nth-child(1) {
    top: 10%; left: 5%; width: 200px; height: 200px; border-radius: 50%; animation-duration: 15s;
}
.bg-decoration:nth-child(2) {
    bottom: 15%; right: 10%; width: 150px; height: 150px; border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; animation-duration: 10s; animation-direction: reverse;
}
.bg-decoration:nth-child(3) {
    top: 50%; left: 20%; width: 100px; height: 100px; background: var(--gradient-accent); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; animation-duration: 18s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}


.article-hero {
    margin-top: 3em;
    position: relative;
    height: 90vh;
    min-height: 500px; /* Prevent hero from getting too small */
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
    text-align: center;
    color: var(--light-color);
    padding: 0 1rem; /* Add horizontal padding for mobile */
}

.hero-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: #00334f;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 100%;
    padding: 2rem;
    animation: slideUp 1s ease-out;
}

.article-category {
    background: var(--accent-color);
    color: var(--light-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    word-wrap: break-word;
    hyphens: auto;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto 2rem auto;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    white-space: nowrap;
}

.hero-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-content .hero-tags .tag {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: var(--light-color);
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--light-color);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -15px); }
    60% { transform: translate(-50%, -7px); }
}

/* --- 2. Main Article Content (Glassmorphism) --- */
.article-container {
    max-width: 900px;
    margin: -5vh auto 5rem auto; /* Reduced negative margin to prevent overlap */
    padding: 4rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    position: relative;
    z-index: 3;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article-container:hover {
    box-shadow: var(--shadow-hover);
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 3rem 0 1.5rem 0;
    color: var(--primary-color);
    position: relative;
    padding-left: 1.5rem;
    word-wrap: break-word;
}

.article-content h2::before {
    content: '';
    position: absolute;
    left: 0; 
    top: 5px; 
    bottom: 5px;
    width: 5px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.article-content p, .article-content li {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    word-wrap: break-word;
}

.article-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

.article-content ul {
    list-style-type: none;
    padding-left: 1rem;
    margin: 2rem 0;
}

.article-content li {
    padding-left: 1.5rem;
    position: relative;
}

.article-content li::before {
    content: '\f058'; /* Font Awesome check-circle icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent-color);
    position: absolute;
    left: 0;
    top: 5px;
}

.article-content blockquote {
    margin: 3rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--accent-color);
    background: #f0f4f8;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--primary-color);
    word-wrap: break-word;
}

/* --- 3. Action Buttons --- */
.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    gap: 1rem;
}

.back-btn, .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
    min-width: 120px;
    justify-content: center;
}

.back-btn {
    background-color: var(--light-color);
    color: var(--primary-color);
    border: 1px solid var(--glass-border);
}

.share-btn {
    background: var(--gradient-primary);
    color: var(--light-color);
}

.back-btn:hover, .share-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.back-btn::before, .share-btn::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%;
    width: 100%; 
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.share-btn::before {
    background: var(--gradient-accent);
}

.back-btn:hover::before {
    left: 0;
}

.share-btn:hover::before {
    left: 0;
}

.back-btn:hover {
    color: var(--light-color);
}

/* --- Animations & Responsive Design --- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal animation - Fixed to show content by default */
.article-content > *, .article-actions {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Only hide content if using scroll reveal animation */
.article-content.scroll-reveal > *, .article-actions.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
}

.article-content.scroll-reveal > *.active, .article-actions.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger the animation for a nice effect */
.article-content.scroll-reveal > * { 
    transition-delay: calc(var(--order, 0) * 100ms); 
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .article-container {
        margin: -5vh 2rem 3rem 2rem;
        padding: 3rem;
    }
    
    .hero-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .article-hero { 
        height: 80vh; 
        min-height: 400px;
        background-attachment: scroll; /* Fix parallax on mobile */
    }
    
    .hero-content { 
        padding: 1rem; 
    }
    
    .hero-title { 
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        margin-bottom: 1rem;
    }
    
    .hero-description { 
        font-size: clamp(0.9rem, 3vw, 1.1rem);
        margin-bottom: 1.5rem;
    }
    
    .hero-meta { 
        flex-direction: column; 
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .meta-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .hero-tags {
        gap: 0.5rem;
    }
    
    .tag {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .article-container { 
        margin: -5vh 1rem 3rem 1rem; 
        padding: 2rem;
    }
    
    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .article-content h2 {
        margin: 2rem 0 1rem 0;
        padding-left: 1rem;
    }
    
    .article-content blockquote {
        margin: 2rem 0;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .article-actions { 
        flex-direction: column; 
        gap: 1.5rem;
        margin-top: 3rem;
    }
    
    .back-btn, .share-btn {
        width: 100%;
        max-width: 300px;
        padding: 1rem;
    }
    
    .scroll-indicator {
        bottom: 1rem;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .article-hero {
        height: 60vh;
        min-height: 350px;
        margin-top: 2em;
    }
    
    .hero-content {
        padding: 0.5rem;
    }
    
    .article-container {
        /* margin: -5vh 0.5rem 2rem 0.5rem; */
        padding: 1.5rem;
    }
    
    .article-content {
        font-size: 0.95rem;
    }
    
    .article-content h2 {
        padding-left: 0.8rem;
    }
    
    .article-content h2::before {
        width: 3px;
    }
    
    .article-content ul {
        padding-left: 0.5rem;
    }
    
    .article-content li {
        padding-left: 1rem;
    }
    
    .article-content blockquote {
        padding: 0.8rem 1rem;
        margin: 1.5rem 0;
    }
    
    .meta-item {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .tag {
        padding: 0.25rem 0.6rem;
        font-size: 0.65rem;
        
    }
}

/* --- Additional Utility Classes --- */
.no-overflow {
    overflow-x: hidden;
}

/* Ensure images are responsive */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

/* Fix for very long words */
.article-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Hide background decorations on smaller screens */
@media (max-width: 768px) {
    .bg-decoration { 
        display: none; 
    }
}