<?php include 'includes/header.php'; ?>
<?php include 'includes/db.php'; ?>

<?php
$ceo = $conn->query("SELECT * FROM ceo_message LIMIT 1")->fetch_assoc();
?>

<section class="ceo-section">
    <div class="ceo-container">
        <div class="ceo-text">
            <?= $ceo ? $ceo['body_text'] : '<p>No content available.</p>'; ?>
        </div>
        <div class="ceo-image">
            <?php if($ceo && !empty($ceo['image'])): ?>
            <img src="<?= $ceo['image'] ?>" alt="CEO Message">
            <?php else: ?>
            <img src="assets/images/default.jpg" alt="Placeholder">
            <?php endif; ?>
        </div>
    </div>
</section>

<style>
.ceo-section { padding:60px 20px; background:#f9f9f9; }
.ceo-container { display:flex; flex-wrap:nowrap; align-items:center; max-width:1200px; margin:auto; }
.ceo-text { width:55%; padding-right:20px; font-size:1rem; color:#333; }
.ceo-image { width:35%; }
.ceo-image img {     max-width: 80%; /* smaller than before, adjust as needed */
    height: auto;
    border-radius: 8px;
    display: block;}
@media(max-width:900px){
    .ceo-container { flex-wrap:wrap; text-align:center; }
    .ceo-text, .ceo-image { width:100%; padding:10px 0; }
    .ceo-text { padding-right:0; }
}
</style>

<?php include 'includes/footer.php'; ?>
