<?php 
// This must be the VERY FIRST LINE in your frontend template
require_once 'config.php';

// Performance optimization headers
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: SAMEORIGIN');
header('X-XSS-Protection: 1; mode=block');

// Enable compression if available
if (extension_loaded('zlib') && !ini_get('zlib.output_compression')) {
    ini_set('zlib.output_compression', 1);
}

// Set cache headers for static resources
$cache_time = 86400; // 24 hours
header("Cache-Control: public, max-age=$cache_time");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cache_time) . " GMT");
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>The Samachar Patra - Latest News</title>
    
    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    
    <!-- Preload critical resources -->
    <link rel="preload" href="css/styles.css" as="style">
    <link rel="preload" href="js/scripts.js" as="script">
    <link rel="preload" href="images/logo.png" as="image">
    
    <!-- DNS prefetch for external resources -->
    <link rel="dns-prefetch" href="//www.alphavantage.co">
    <link rel="dns-prefetch" href="//source.unsplash.com">
    
    <!-- Critical CSS inline -->
    <style>
        /* Critical rendering path CSS */
        body { margin: 0; padding: 0; font-family: 'Arial', sans-serif; background-color: #ffffff !important; color: #333333 !important; }
        .no-image-placeholder { 
            width: 100%; 
            height: 100%; 
            background: #e9ecef; 
            border: 2px dashed #adb5bd; 
            border-radius: 8px; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            justify-content: center; 
            color: #6c757d; 
            font-family: 'Arial', sans-serif; 
            text-align: center; 
            min-height: 200px;
        }
        .no-image-placeholder::before {
            content: '📷';
            font-size: 32px;
            margin-bottom: 8px;
            opacity: 0.7;
        }
        .no-image-placeholder::after {
            content: 'No Image';
            font-size: 12px;
            font-weight: 600;
            color: #495057;
        }
    </style>
</head>
<body>




<?php include 'includes/header.php'; ?>
    <?php include 'includes/breaking_news.php'; ?>

    <?php include 'includes/main_section.php'; ?>


    <?php include 'includes/category_section.php'; ?>
    <?php include 'includes/share_section.php'; ?>
    <?php include 'includes/section_one.php'; ?>
    <?php include 'includes/section_four.php'; ?>
    
    <!-- States Section -->
    <?php include 'includes/states_section.php'; ?>
    
    <!-- Content Top Ad -->
    <?php require_once 'includes/ads/simple_content_top.php'; ?>
    
    <?php require_once 'includes/ads/simple_homepage_section_1.php'; ?>
    <?php include 'includes/section_two.php'; ?>
    
    <!-- Content Middle Ad -->
    <?php require_once 'includes/ads/simple_content_middle.php'; ?>
     <?php require_once 'includes/ads/simple_homepage_section_2.php'; ?>
    <?php include 'includes/video_section.php'; ?>
    
    <!-- Content Bottom Ad -->
    <?php require_once 'includes/ads/simple_content_bottom.php'; ?>

 <?php include 'includes/footer.php'; ?>