/**
 * ========================================
 * NEWS WEBSITE STYLESHEET
 * ========================================
 * 
 * TABLE OF CONTENTS:
 * 
 * 1. RESET & BASE STYLES ................ Line 30
 * 2. LAYOUT & STRUCTURE ................. Line 80
 * 3. NAVIGATION ......................... Line 130
 * 4. HERO & SLIDER ...................... Line 280
 * 5. POST GRID & CARDS .................. Line 380
 * 6. SINGLE POST PAGE ................... Line 550
 * 7. MEDIA (GALLERY, VIDEO) ............. Line 700
 * 8. ADSENSE INTEGRATION ................ Line 850
 * 9. RELATED POSTS ...................... Line 1050
 * 10. PAGINATION ......................... Line 1150
 * 11. ABOUT & STATIC PAGES ............... Line 1250
 * 12. FOOTER ............................. Line 1450
 * 13. RESPONSIVE (MOBILE) ................ Line 1550
 * 14. UTILITIES .......................... Line 1800
 * 
 */

/* ========================================
   1. RESET & BASE STYLES
   ======================================== */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

/* CSS Variables */
:root {
    /* Brand Colors */
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    
    /* Text Colors */
    --text-color: #374151;
    --text-light: #6b7280;
    
    /* UI Colors */
    --border-color: #e5e7eb;
    
    /* Effects */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    /* Z-index Layers */
    --z-sticky: 1000;
    --z-sticky-close: 1001;
    --z-modal: 9999;
}

/* ========================================
   2. LAYOUT & STRUCTURE
   ======================================== */

/* Base Body Styles */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: rgb(255, 255, 255);
    overflow-x: hidden;
    max-width: 100vw;
    position: relative; /* Create stacking context */
}

/* Emergency overflow prevention - hide anything beyond viewport */
body > * {
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%; /* Ensure container doesn't exceed viewport */
}

/* Prevent any child from causing horizontal overflow */
.container > * {
    max-width: 100%;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ========================================
   3. NAVIGATION
   ======================================== */

/* Header Styles */
.header {
    background: #ffffff;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 999; /* Lower than ads modal (9999) but high enough for dropdown menus */
}

.navbar {
    padding: 0.5rem 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand .brand-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}

.brand-logo {
    height: 40px;
    width: auto;
    max-width: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    white-space: nowrap;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-link {
    background-color: var(--secondary-color);
    color: white;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    list-style: none;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-link:hover {
    background-color: rgb(255, 255, 255);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: black;
    margin: 3px 0;
    transition: var(--transition);
}

/* ========================================
   4. HERO & SLIDER
   ======================================== */

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========================================
   5. POST GRID & CARDS
   ======================================== */

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.post-image-wrapper a {
    display: block;
    color: inherit;
    text-decoration: none;
}

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

.post-card:hover .post-image {
    transform: scale(1.05);
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.video-play-overlay:hover,
.post-card:hover .video-play-overlay {
    background: rgba(220, 53, 69, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
}

.video-play-overlay i {
    margin-left: 3px; /* Slight offset to center play icon visually */
}

.video-play-overlay-small {
    width: clamp(35px, 8vw, 40px) !important;
    height: clamp(35px, 8vw, 40px) !important;
    font-size: 0.9rem !important;
}

/* Related post image wrapper */
.related-post-image-wrapper {
    position: relative;
    overflow: hidden;
}

.related-post-image-wrapper a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.post-content {
    padding: 1.5rem;
    transition: var(--transition);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-content:hover {
    background: rgba(0, 123, 186, 0.05);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.7rem;
    color: var(--text-light);
    min-height: 24px;
    flex-wrap: wrap;
}

.post-category {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
    white-space: nowrap;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    min-height: 48px;
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* ========================================
   6. SINGLE POST PAGE
   ======================================== */

/* Single Post */
.single-post {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-header .post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Post meta when inside post header (for other pages) */
.post-header .post-meta {
    justify-content: center;
    font-size: 0.7rem;
}

/* Post meta when below featured image in single post */
.single-post .post-meta {
    justify-content: center;
    font-size: 0.7rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.post-featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    /* Performance optimizations */
    contain: layout style paint;
    content-visibility: auto;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 2rem auto;
    max-width: 800px;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Support for text alignment in content - Consolidated */
.post-body p[style*="text-align"],
.post-body div[style*="text-align"] {
    text-align: inherit;
}

.post-body .text-center,
.post-body .align-center {
    text-align: center;
}

.post-body .text-right,
.post-body .align-right {
    text-align: right;
}

.post-body .text-left,
.post-body .align-left {
    text-align: left;
}

.post-body .text-justify,
.post-body .align-justify {
    text-align: justify;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin: 2rem 0 1rem 0;
    color: var(--dark-color);
}

.post-body p {
    margin-bottom: 1.5rem;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 2fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    display: block;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* YouTube Embed */
.youtube-container {
    margin: 2rem 0;
}

lite-youtube {
    background-color: #000;
    position: relative;
    display: block;
    contain: content;
    background-position: center center;
    background-size: cover;
    cursor: pointer;
    max-width: 720px;
    margin: 0 auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    transition: var(--transition);
    min-width: 45px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.page-link:hover,
.page-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-ellipsis {
    padding: 0.75rem 0.5rem;
    color: var(--text-light);
    user-select: none;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .pagination {
        gap: 0.25rem;
        margin: 2rem 0;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        min-width: 40px;
        font-size: 0.9rem;
    }
    
    .page-link i {
        font-size: 0.8rem;
    }
    
    /* Hide "Previous" and "Next" text on mobile, show only icons */
    .page-link i + * {
        display: none;
    }
    
    .page-link * + i {
        display: none;
    }
    
    .page-ellipsis {
        padding: 0.5rem 0.25rem;
    }
}

/* Post Page Specific Styles */
.related-posts {
    max-width: 100%;
    overflow: hidden;
}

.post-gallery h3,
.post-videos h3,
.related-posts h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem 1rem 1rem 1rem;
    font-size: 0.875rem;
}

.video-description {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-light);
}

/* Title Image Styling */
.post-title-image-container {
    margin: 1.5rem 0 2rem 0;
    text-align: center;
}

.post-title-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.post-title-image:hover {
    transform: scale(1.02);
}

/* Combined Title and Title Image Sections */
.post-title-container {
    text-align: center;
    margin-bottom: 2rem;
}

.related-post-title-section {
    margin-bottom: 0.5rem;
}

.related-post-title-image {
    margin-top: 0.5rem;
    text-align: center;
}

.title-image-tiny {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

/* Ad Placement Styling */
.ad-post-above-title,
.ad-post-above-content,
.ad-post-below-content {
    margin: 2rem 0;
    padding: 0 1rem;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
}

.ad-post-above-title {
    margin-top: 1rem;
    margin-bottom: 2.5rem; /* More space before title */
    padding: 1rem 0; /* Add padding for better separation */
}

.ad-post-above-content {
    margin-top: 2.5rem; /* More space after share buttons */
    margin-bottom: 2.5rem; /* More space before content */
    padding: 1rem 0;
}

.ad-post-below-content {
    margin-top: 2.5rem; /* More space after content */
    margin-bottom: 2.5rem; /* More space before related posts */
    padding: 1rem 0;
}

.ad-post-above-title .ad-container,
.ad-post-above-content .ad-container,
.ad-post-below-content .ad-container {
    max-width: 100%;
    margin: 0 auto;
    /* Remove background to prevent visible empty boxes */
    /* Remove min-height to prevent blank spaces when ads don't load */
}

@media (max-width: 768px) {
    .ad-post-above-title .ad-container,
    .ad-post-above-content .ad-container,
    .ad-post-below-content .ad-container {
        /* No min-height to prevent blank spaces */
        width: 100%;
        max-width: 100%;
    }
    
    .ad-post-above-title,
    .ad-post-above-content,
    .ad-post-below-content {
        /* Remove min-height completely */
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

/* Ad Loading State - Reserve proper space to prevent layout shift */
.ad-container.ad-loading {
    min-height: 280px;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile ad sizes - smaller min-height */
@media (max-width: 768px) {
    .ad-container.ad-loading {
        min-height: 250px;
    }
}

.ad-container.ad-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ad-spin 0.8s linear infinite;
}

@keyframes ad-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   8. ADSENSE INTEGRATION
   ======================================== */

/* Ad Placement Styling */
.ad-placement {
    padding: 1rem;
    position: relative;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
}

/* Ad Label - Google Policy Requirement */
.ad-placement::before {
    content: 'Advertisement';
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem; /* More space between label and ad */
    margin-top: 0.5rem; /* Space above label */
    font-weight: 500;
    text-align: center;
}

/* Ad Container - Prevent overflow */
.ad-container {
    max-width: 100%;
    overflow: hidden; /* Changed from visible to hidden to prevent mobile overflow */
    box-sizing: border-box;
    position: relative;
}

.ad-container > * {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* AdSense specific styles - Allow responsive ads to work */
.ad-container ins.adsbygoogle,
.ad-placement ins.adsbygoogle {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important; /* Prevent mobile overflow */
    box-sizing: border-box !important;
    width: 100% !important; /* Force full width containment */
    min-width: 0 !important;
}

/* Force override inline width styles from AdSense (e.g., width: 412px) */
.ad-container ins[style*="width"],
.ad-placement ins[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Prevent iframes from overflowing - force override inline styles */
.ad-container iframe,
.ad-placement iframe {
    max-width: 100% !important;
    width: 100% !important; /* Override inline width */
    box-sizing: border-box !important;
}

/* Target iframes with inline width styles specifically */
.ad-container iframe[style*="width"],
.ad-placement iframe[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Mobile specific ad containment */
@media (max-width: 768px) {
    .ad-placement {
        padding: 0.5rem;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100vw; /* Viewport width limit */
        overflow: hidden; /* Prevent any overflow */
        box-sizing: border-box;
    }
    
    .ad-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important; /* Force containment */
        padding: 0; /* Remove any padding that might cause overflow */
        box-sizing: border-box;
    }
    
    /* Ensure all ad elements respect mobile width */
    .ad-container *,
    .ad-placement * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Force AdSense iframes to stay within bounds - override inline styles */
    .ad-container iframe,
    .ad-placement iframe,
    .ad-container iframe[style],
    .ad-placement iframe[style] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Prevent ins element from expanding beyond container - override inline styles */
    .ad-container ins,
    .ad-placement ins,
    .ad-container ins[style],
    .ad-placement ins[style] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Force override any fixed width inline styles (e.g., width: 412px) */
    .ad-container ins.adsbygoogle[style*="width"],
    .ad-placement ins.adsbygoogle[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Related posts article overflow prevention */
    article.related-post-card,
    .related-post-card article,
    .related-post-card {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Force all ads inside articles to respect width */
    article.related-post-card ins,
    article.related-post-card iframe,
    article.related-post-card ins[style],
    article.related-post-card iframe[style],
    .related-post-card article ins,
    .related-post-card article iframe,
    .related-post-card article ins[style],
    .related-post-card article iframe[style] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    /* Override any inline width in article context */
    article.related-post-card ins.adsbygoogle[style*="width"],
    article.related-post-card iframe[style*="width"],
    .related-post-card article ins.adsbygoogle[style*="width"],
    .related-post-card article iframe[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Gallery Ad Slots - Prevent overlap with images */
.gallery-ad-slot {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
    margin: 2rem 0; /* Increased from 1rem */
    padding: 1rem 0.5rem; /* Add vertical padding */
}

.gallery-ad-slot * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Content Ad Slots - Prevent overlap with paragraphs */
.content-ad-slot {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
    margin: 2.5rem 0; /* Increased from 1.5rem */
    padding: 1rem 0.5rem; /* Add vertical padding */
    clear: both;
}

.content-ad-slot * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile specific for gallery and content ads */
@media (max-width: 768px) {
    .gallery-ad-slot,
    .content-ad-slot {
        padding: 1.5rem 0; /* More vertical spacing on mobile */
        width: 100%;
        margin: 2rem 0; /* Larger margins on mobile */
    }
    
    /* Extra spacing for better content-ad separation */
    .ad-post-above-title {
        margin-bottom: 3rem;
    }
    
    .ad-post-above-content,
    .ad-post-below-content {
        margin-top: 3rem;
        margin-bottom: 3rem;
    }
}


/* ========================================
   9. RELATED POSTS
   ======================================== */

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 100%;
    overflow: hidden;
    margin-top: 2rem; /* Space from ads above */
}

.related-post-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    max-width: 100%;
    width: 100%; /* Force full width */
    position: relative;
    box-sizing: border-box;
}

/* Prevent Auto Ads overflow in related posts */
.related-posts-grid ins,
.related-posts-grid iframe,
.related-post-card ins,
.related-post-card iframe {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
}

/* Target article elements specifically */
.related-post-card article,
.related-posts-grid article,
article.related-post-card {
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Force override inline width styles in articles */
article.related-post-card ins[style*="width"],
article.related-post-card iframe[style*="width"],
.related-post-card article ins[style*="width"],
.related-post-card article iframe[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* All descendants of article in related posts */
article.related-post-card *,
.related-post-card article * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Related posts section spacing */
.related-posts {
    margin-top: 3rem; /* Large gap from content above */
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Ensure AdSense container elements are also constrained */
.related-posts ins.adsbygoogle,
.related-post-card ins.adsbygoogle,
article.related-post-card ins.adsbygoogle,
.related-post-card article ins.adsbygoogle {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.related-post-image {
    width: 100%;
    height: 220px;
    object-fit: fill;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image {
    transform: scale(1.05);
}

/* ========================================
   10. PAGINATION
   ======================================== */

/* Pagination */
.empty-category {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin: 2rem 0;
    border: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.empty-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.empty-category i {
    font-size: 4.5rem;
}

.empty-category h2 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
}

.empty-category p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.empty-category .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.empty-category .btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

/* Admin Edit Corner */
.admin-edit-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.admin-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: rgba(0, 123, 186, 0.9);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 123, 186, 0.3);
}

.admin-edit-link:hover {
    background: rgba(0, 123, 186, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 186, 0.5);
    color: white;
}

.admin-edit-link:focus {
    outline: 2px solid rgba(0, 123, 186, 0.5);
    outline-offset: 2px;
}

/* ========================================
   11. ABOUT & STATIC PAGES
   ======================================== */

/* Hero Slider Styles */
.hero-slider {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 630px;
    overflow: hidden;
    margin: 0 auto;
    padding: 1.5em;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slider-prev {
    left: 2rem;
}

.slider-next {
    right: 2rem;
}

.slider-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

.post-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* About Page Styles */
.about-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.about-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--primary-color);
}

.about-header h1 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.about-header i {
    color: var(--primary-color);
}

.about-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    font-style: italic;
}

.about-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.about-section {
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.about-section:last-child {
    border-bottom: none;
}

.about-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.about-intro {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.intro-text .lead {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.intro-text p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.placeholder-image {
    background: var(--light-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.placeholder-image i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.mission-item {
    text-align: center;
    padding: 2rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.mission-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.mission-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.mission-item h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.mission-item p {
    color: var(--text-color);
    line-height: 1.6;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.service-card h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.credentials {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.credentials h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.credentials p {
    line-height: 1.8;
    color: var(--text-color);
    margin: 0;
}

.quality-content {
    display: block;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.quality-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.quality-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.quality-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
}

.quality-item h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.quality-item p {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.transparency-note {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.transparency-note h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transparency-note p {
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.transparency-note p:last-child {
    margin-bottom: 0;
}

.transparency-note a {
    color: var(--primary-color);
    text-decoration: underline;
}

.transparency-note a:hover {
    color: var(--secondary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Prevent horizontal scroll caused by ads */
    body {
        overflow-x: hidden;
    }
    
    .ad-post-above-title,
    .ad-post-above-content,
    .ad-post-below-content {
        margin: 1.5rem 0;
        padding: 0.5rem;
    }
    
    .ad-placement {
        padding: 0.5rem;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
        box-sizing: border-box;
    }
    
    .ad-container {
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Ensure ad labels are visible on mobile */
    .ad-placement::before {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }
    
    .hero-slider {
        display: none;
    }
    
    .ad-below-slider {
        display: none;
    }
    
    /* Ensure home page ads don't overflow on mobile */
    .ad-home_below_slider,
    .ad-placement.ad-home_below_slider {
        width: 100%;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        overflow: hidden;
    }
    
    .empty-category {
        padding: 3rem 1.5rem;
        margin: 1rem 0;
    }
    
    .empty-category i {
        font-size: 3.5rem;
    }
    
    .empty-category h2 {
        font-size: 1.75rem;
    }
    
    .empty-category p {
        font-size: 1rem;
    }
    
    .admin-edit-corner {
        top: 8px;
        right: 8px;
    }
    
    .admin-edit-link {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .about-intro {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   12. FOOTER
   ======================================== */

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #d1d5db;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
}

.footer-bottom-content {
    text-align: center;
    color: #9ca3af;
}

/* ========================================
   13. RESPONSIVE (MOBILE)
   ======================================== */

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transition: var(--transition);
        box-shadow: var(--shadow);
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        padding: 2rem;
        gap: 1rem;
        min-height: auto;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    .brand-logo {
        height: 32px;
        max-width: 32px;
        flex-shrink: 0;
    }
    
    .nav-brand .brand-link {
        font-size: 1.25rem;
    }

    .nav-toggle {
        display: flex;
        flex-shrink: 0;
    }

    .bar {
        flex-shrink: 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .post-header .post-title {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Mobile: Make feature images responsive height but maintain aspect ratio */
    .post-image {
        height: 100%;
    }

    .post-featured-image {
        aspect-ratio: 16 / 9;
    }

    .gallery-image {
        height: 100%;
    }

    .post-featured-image {
        margin-bottom: 1rem;
    }

    /* Related posts mobile fixes for Auto Ads overflow */
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .related-post-card {
        width: 100%;
        max-width: 100%;
    }

    .related-post-content {
        padding: 1rem;
        max-width: 100%;
        overflow: hidden;
    }

    /* Force all content including Auto Ads to respect mobile width */
    .related-posts-grid > *,
    .related-post-card > *,
    .related-post-content > * {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .post-content {
        padding: 1rem;
    }

    .post-title {
        font-size: 1.25rem;
    }
}

/* ========================================
   14. UTILITIES
   ======================================== */

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }


/* ========================================
   15. STICKY BOTTOM AD (Google Compliant)
   ======================================== */

/* Sticky Bottom Ad - Google Policy Compliant */
.sticky-bottom-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: transform 0.3s ease;
    transform: translateY(0);
    padding: 0 1rem;
}

.sticky-ad-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.sticky-ad-content > * {
    max-width: 100% !important;
    overflow: hidden;
}

.sticky-ad-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    z-index: var(--z-sticky-close);
    transition: all 0.2s ease;
    padding: 0;
    /* Ensure close button doesn't overlap ad content */
    margin: 4px;
}

.sticky-ad-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.sticky-ad-close i {
    line-height: 1;
}

/* Add minimal padding to body - Google policy: don't push content excessively */
body {
    padding-bottom: 70px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    
    
    .sticky-bottom-ad {
        padding: 0;
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .sticky-ad-content {
        padding: 8px 4px;
        max-width: 100%;
        width: 100%;
    }
    
    .sticky-ad-content *,
    .sticky-ad-content ins.adsbygoogle,
    .sticky-ad-content iframe {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .sticky-ad-close {
        width: 26px;
        height: 26px;
        font-size: 11px;
        top: 6px;
        right: 6px;
    }
}
