html, body {
    overflow-x: hidden;
}
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f0f2f5; 
    color: #1f2937; 
    transition: background-color 0.3s, color 0.3s; 
}
html.dark body { 
    background-color: #111827; 
    color: #f3f4f6; 
}
.native-ad-card { 
    border: 2px solid #facc15; 
}
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 1rem; 
}
.news-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
}
.dark .news-card:hover { 
    box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05); 
}
.line-clamp-2 { 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
.line-clamp-3 { 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
.ad-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    color: #a0aec0; 
    font-size: 0.875rem; 
    border-radius: 0.5rem; 
    padding: 1rem; 
    text-align: center; 
}
.single-article-section .article-content h1,
.single-article-section .article-content h2,
.single-article-section .article-content h3,
.single-article-section .article-content h4,
.single-article-section .article-content h5,
.single-article-section .article-content h6 {
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #1f2937;
}
html.dark .single-article-section .article-content h1,
html.dark .single-article-section .article-content h2,
html.dark .single-article-section .article-content h3,
html.dark .single-article-section .article-content h4,
html.dark .single-article-section .article-content h5,
html.dark .single-article-section .article-content h6 {
    color: #f3f4f6;
}
.single-article-section .article-content h1 { font-size: 2.25rem; }
.single-article-section .article-content h2 { font-size: 1.875rem; }
.single-article-section .article-content h3 { font-size: 1.5rem; }
.single-article-section .article-content p {
    margin-bottom: 1em;
}
.single-article-section .article-content ul,
.single-article-section .article-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
    list-style-position: outside;
}
.single-article-section .article-content ul {
    list-style-type: disc;
}
.single-article-section .article-content ol {
    list-style-type: decimal;
}
.single-article-section .article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 0.5rem;
}
.single-article-section .article-content a {
    color: #06b6d4;
    text-decoration: underline;
}
.dark .single-article-section .article-content a {
    color: #22d3ee;
}

/* --- Custom styles for Category Navigation (CNN-like) --- */
.category-button {
    position: relative;
    white-space: nowrap;
}
.category-button:hover, .category-button.active {
    /* Styles are applied via Tailwind classes in JS */
}
.category-button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 3px;
    background-color: #06b6d4;
    transition: width 0.3s ease-in-out;
}
.category-button:hover::after, .category-button.active::after {
    width: 100%;
}
.more-dropdown-content.show {
    display: block;
}

/* --- Mobile-specific styles --- */
@media (max-width: 767px) {
    #category-display-area {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    #category-display-area::-webkit-scrollbar {
        display: none;
    }
    .more-dropdown {
        display: block !important;
    }
}
.news-marquee-container {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
html.dark .news-marquee-container {
    border-top: 1px solid #374151;
    border-bottom: 1px solid #374151;
}
#marquee-content {
    display: inline-block;
    position: absolute;
    right: 0;
    white-space: nowrap;
    animation: none;
}
@keyframes slideInFromRight {
    0% { transform: translateX(100vw); opacity: 0; }
    10% { transform: translateX(0); opacity: 1; }
    90% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}
.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 40; 
  background-color: #f0f2f5; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #e5e7eb;
}
html.dark .sticky-nav {
  background-color: #111827; 
  border-bottom: 1px solid #374151;
}
.content-padding-top {
    padding-top: 70px; 
}
/* ស្តាយសម្រាប់ Featured Article Slider */
.featured-article-slider {
    position: relative;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.featured-slide {
    display: none;
    transition: transform 0.5s ease;
}

.featured-slide.active {
    display: block;
}

.slider-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 10;
}

.slider-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 1rem;
    transition: background-color 0.3s;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.slider-dot.active {
    background-color: white;
}

/* Dark mode styles */
html.dark .slider-btn {
    background-color: rgba(255, 255, 255, 0.5);
    color: black;
}

html.dark .slider-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
}
 .marquee-container {
            overflow: hidden;
            white-space: nowrap;
            box-sizing: border-box;
            border-top: 1px solid #e5e7eb;
            border-bottom: 1px solid #e5e7eb;
        }
        html.dark .marquee-container {
            border-top: 1px solid #374151;
            border-bottom: 1px solid #374151;
        }

        .marquee-content {
            display: inline-block; /* Essential for horizontal scrolling */
            padding-left: 100%; /* Starts the text off-screen to the right */
            position: relative; /* Needed for transform */
        }

        @keyframes marquee {
            0% { transform: translateX(0); }
            100% { transform: translateX(-50%); } /* Scrolls exactly one full set of duplicated content */
        }

        /* Sticky navigation styles */
        .sticky-nav {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 40; 
            background-color: #f0f2f5; 
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            border-bottom: 1px solid #e5e7eb;
        }
        html.dark .sticky-nav {
            background-color: #111827; 
            border-bottom: 1px solid #374151;
        }
        .content-padding-top {
            /* This class will be added to main-content-grid when nav is sticky */
            padding-top: 70px; /* Adjust based on your nav bar's height */
        }
        /* --- Pagination Styles --- */
#pagination-container {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; /* Space between buttons */
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db; /* gray-300 */
    background-color: white;
    color: #374151; /* gray-700 */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 600;
    border-radius: 0.375rem; /* rounded-md */
}

html.dark .pagination-btn {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
    color: #f3f4f6; /* gray-100 */
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f3f4f6; /* gray-100 */
    border-color: #06b6d4; /* cyan-500 */
    color: #06b6d4;
}

html.dark .pagination-btn:hover:not(:disabled) {
    background-color: #4b5563; /* gray-600 */
    color: #22d3ee; /* cyan-400 */
}

.pagination-btn.active {
    background-color: #06b6d4; /* cyan-500 */
    border-color: #06b6d4;
    color: white;
    z-index: 10;
}

html.dark .pagination-btn.active {
    background-color: #0891b2; /* cyan-600 */
    border-color: #0891b2;
}


.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* On smaller screens, hide number pages to save space */
@media (max-width: 480px) {
    .pagination-btn.page-number {
        display: none;
    }
}