/* News Page Specific Styles */

/* Sticky Sidebar with proper navbar positioning */
.sticky-sidebar {
    position: sticky;
    top: 100px; /* Adjusted to navbar height (approximately 80px) + small margin */
    z-index: 50; /* Well below navbar (1000) to avoid overlap */
    transition: top 0.3s ease;
}

/* Optimize sidebar card spacing */
.sticky-sidebar .card {
    margin-bottom: 1.5rem !important;
}

.sticky-sidebar .card:last-child {
    margin-bottom: 0 !important;
}

/* Responsive behavior for sticky sidebar */
@media (max-width: 991.98px) {
    .sticky-sidebar {
        position: static; /* Disable sticky on mobile/tablet */
        top: auto;
    }
}

/* Ensure sidebar stays within viewport */
@media (min-width: 992px) {
    .sticky-sidebar {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-bottom: 2rem; /* Add bottom padding for better spacing */
    }
    
    /* Hide scrollbar but keep functionality */
    .sticky-sidebar {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    .sticky-sidebar::-webkit-scrollbar {
        width: 0px;
        background: transparent; /* Chrome/Safari */
    }
}



/* Navbar scroll behavior */
.navbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

/* Ensure content doesn't hide behind fixed navbar */
.content-with-fixed-navbar {
    padding-top: 100px; /* Adjust based on navbar height */
}

/* Article content styling */
.article-content {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #444;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--siphic-green);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.article-content blockquote {
    border-left: 4px solid var(--siphic-gold);
    background: rgba(146, 142, 115, 0.05);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

/* Hero Section */
.news-hero {
    background: linear-gradient(135deg, rgba(48, 59, 63, 0.05), rgba(146, 142, 115, 0.05));
    border-bottom: 1px solid rgba(48, 59, 63, 0.1);
    position: relative;
    overflow: hidden;
}

.news-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(48, 59, 63, 0.02), rgba(146, 142, 115, 0.02));
    z-index: 1;
}

.news-hero .container {
    position: relative;
    z-index: 2;
}

.news-hero h1 {
    color: var(--siphic-green);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-hero .lead {
    color: var(--siphic-brown);
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Categories Section */
.news-categories {
    background: linear-gradient(135deg, rgba(48, 59, 63, 0.03), rgba(146, 142, 115, 0.03));
    padding: 2rem 0;
    position: relative;
}

.news-categories::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(48,59,63,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.news-categories .container {
    position: relative;
    z-index: 2;
}

.news-categories .btn {
    margin: 0.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid var(--siphic-brown);
    color: var(--siphic-brown);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-categories .btn:hover,
.news-categories .btn.active {
    background: var(--siphic-brown);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

/* Featured News Section */
.news-featured {
    padding: 4rem 0;
    position: relative;
}

.news-featured .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.news-featured .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--siphic-green), var(--siphic-brown));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.news-featured .card:hover::before {
    transform: translateX(0);
}

.news-featured .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.news-featured .card-title {
    color: var(--siphic-green);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.news-featured .card-text {
    color: var(--siphic-dark);
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1.6;
}

/* News Grid Section */
.news-grid {
    background: linear-gradient(135deg, rgba(48, 59, 63, 0.03), rgba(146, 142, 115, 0.03));
    padding: 4rem 0;
    position: relative;
}

.news-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(48,59,63,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 1;
}

.news-grid .container {
    position: relative;
    z-index: 2;
}

.news-grid h2 {
    color: var(--siphic-green);
    font-weight: 600;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.news-grid h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--siphic-brown);
    border-radius: 3px;
}

.news-grid .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.news-grid .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--siphic-green), var(--siphic-brown));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.news-grid .card:hover::before {
    transform: translateX(0);
}

.news-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.news-grid .card-title {
    color: var(--siphic-green);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.news-grid .card-text {
    color: var(--siphic-dark);
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1.6;
}

.news-grid .badge {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.news-grid .badge.bg-success {
    background-color: var(--siphic-green) !important;
}

.news-grid .badge.bg-info {
    background-color: var(--siphic-brown) !important;
}

.news-grid .badge.bg-warning {
    background-color: #f0ad4e !important;
}

/* Sidebar */
.news-sidebar .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    background: white;
    position: relative;
    overflow: hidden;
}

.news-sidebar .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--siphic-green), var(--siphic-brown));
}

.news-sidebar .card-title {
    color: var(--siphic-green);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.news-sidebar .border-bottom {
    border-color: rgba(48, 59, 63, 0.1) !important;
}

.news-sidebar .border-bottom:last-child {
    border-bottom: none !important;
}

.news-sidebar a {
    color: var(--siphic-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem 0;
}

.news-sidebar a:hover {
    color: var(--siphic-brown);
    transform: translateX(5px);
}

/* Newsletter Section */
.news-newsletter {
    background: var(--siphic-green);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.news-newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(146, 142, 115, 0.1), rgba(0, 0, 0, 0.1));
    z-index: 1;
}

.news-newsletter .container {
    position: relative;
    z-index: 2;
}

.news-newsletter h2 {
    color: var(--siphic-brown);
    font-weight: 600;
    margin-bottom: 1rem;
}

.news-newsletter .lead {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
}

.news-newsletter .form-control {
    border-radius: 25px;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

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

.news-newsletter .form-control:focus {
    border-color: var(--siphic-brown);
    box-shadow: 0 0 0 0.2rem rgba(146, 142, 115, 0.25);
    background: rgba(255, 255, 255, 0.2);
}

.news-newsletter .btn {
    border-radius: 25px;
    padding: 1rem 2rem;
    background: var(--siphic-brown);
    border: 2px solid var(--siphic-brown);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.news-newsletter .btn:hover {
    background: rgba(146, 142, 115, 0.1);
    border-color: var(--siphic-brown);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Pagination */
.news-pagination .pagination {
    margin: 0;
}

.news-pagination .page-link {
    color: var(--siphic-brown);
    border: 2px solid var(--siphic-brown);
    margin: 0 0.25rem;
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    background: white;
}

.news-pagination .page-link:hover,
.news-pagination .page-item.active .page-link {
    background: var(--siphic-brown);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.news-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    transform: none;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-hero h1 {
        font-size: 2.5rem;
    }
    
    .news-hero .lead {
        font-size: 1.2rem;
    }
    
    .news-featured,
    .news-grid {
        padding: 3rem 0;
    }
    
    .news-categories .btn {
        margin: 0.25rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .news-newsletter h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .news-hero h1 {
        font-size: 2rem;
    }
    
    .news-hero .lead {
        font-size: 1.1rem;
    }
    
    .news-grid h2 {
        font-size: 1.5rem;
    }
    
    .news-categories .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .news-newsletter .lead {
        font-size: 1rem;
    }
}
