<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="theme-color" content="#1b5e20">
    <title>SPK Hama – Sistem Pelaporan Hama Pertanian</title>

    <!-- Preconnect fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">

    <!-- AOS -->
    <link href="https://unpkg.com/aos@2.3.4/dist/aos.css" rel="stylesheet">

    <!-- App CSS -->
    <link rel="stylesheet" href="<?php echo e(asset('css/landing.css')); ?>">

    <?php echo $__env->yieldContent('styles'); ?>
</head>

<body>

<!-- ===================== NAVBAR ===================== -->
<nav class="navbar" id="navbar" role="navigation" aria-label="Menu utama">

    <a href="<?php echo e(url('/')); ?>" class="logo" aria-label="SPK Hama – Beranda">🌾 SPK Hama</a>

    <!-- Drawer menu -->
    <div class="nav-menu" id="navMenu">
        <a href="<?php echo e(url('/')); ?>">Home</a>
        <a href="<?php echo e(url('/pelaporan')); ?>">Pelaporan</a>
        <a href="<?php echo e(url('/kontak')); ?>">Kontak</a>
        <!-- Login khusus mobile (di dalam drawer) -->
        <a href="<?php echo e(url('/login')); ?>" class="btn-login-mobile">Login</a>
    </div>

    <!-- Login desktop -->
    <a href="<?php echo e(url('/login')); ?>" class="btn-login">Login</a>

    <!-- Hamburger -->
    <button class="menu-toggle" id="menuToggle" aria-label="Buka menu" aria-expanded="false" aria-controls="navMenu">
        ☰
    </button>

</nav>

<!-- Overlay -->
<div class="nav-overlay" id="navOverlay" aria-hidden="true"></div>

<!-- ===================== CONTENT ===================== -->
<main>
    <?php echo $__env->yieldContent('content'); ?>
</main>

<!-- ===================== FOOTER ===================== -->
<footer class="footer">
    <p>© <?php echo e(date('Y')); ?> Pemerintah Kabupaten Gowa &mdash; Sistem Pendukung Keputusan Serangan Hama</p>
</footer>

<!-- ===================== SCRIPTS ===================== -->
<script src="https://unpkg.com/aos@2.3.4/dist/aos.js"></script>

<script>
document.addEventListener("DOMContentLoaded", function () {

    /* ----- AOS ----- */
    AOS.init({ duration: 900, once: true, offset: 60 });

    /* ----- NAVBAR SCROLL ----- */
    var navbar = document.getElementById("navbar");
    var onScroll = function () {
        if (navbar) navbar.classList.toggle("scrolled", window.scrollY > 50);
    };
    window.addEventListener("scroll", onScroll, { passive: true });
    onScroll(); // run once on load

    /* ----- HAMBURGER MENU ----- */
    var toggle  = document.getElementById("menuToggle");
    var menu    = document.getElementById("navMenu");
    var overlay = document.getElementById("navOverlay");

    function openMenu() {
        menu.classList.add("active");
        overlay.classList.add("active");
        toggle.textContent  = "✕";
        toggle.setAttribute("aria-expanded", "true");
        overlay.setAttribute("aria-hidden", "false");
        document.body.style.overflow = "hidden";
    }

    function closeMenu() {
        menu.classList.remove("active");
        overlay.classList.remove("active");
        toggle.textContent  = "☰";
        toggle.setAttribute("aria-expanded", "false");
        overlay.setAttribute("aria-hidden", "true");
        document.body.style.overflow = "";
    }

    if (toggle && menu) {
        toggle.addEventListener("click", function () {
            menu.classList.contains("active") ? closeMenu() : openMenu();
        });
    }

    if (overlay) overlay.addEventListener("click", closeMenu);

    if (menu) {
        menu.querySelectorAll("a").forEach(function (link) {
            link.addEventListener("click", closeMenu);
        });
    }

    /* Close on resize back to desktop */
    window.addEventListener("resize", function () {
        if (window.innerWidth > 768) closeMenu();
    }, { passive: true });

    /* ----- ACTIVE NAV LINK ----- */
    var currentPath = window.location.pathname;
    menu.querySelectorAll("a").forEach(function (link) {
        if (link.getAttribute("href") === currentPath) {
            link.style.fontWeight = "700";
            link.style.color = "var(--green-light)";
        }
    });

});
</script>

<?php echo $__env->yieldContent('scripts'); ?>

</body>
</html><?php /**PATH C:\Users\Maylha\pelaporanpertanian\resources\views/layouts/main.blade.php ENDPATH**/ ?>