<!DOCTYPE html>
<html lang="en" itemscope itemtype="http://schema.org/WebPage">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script>
        window.AALBC_CURRENT_PAGE = "/articles/feed";
    </script>
    
    <script type="text/javascript">
      var oneall_subdomain = 'aalbc';
      var oa = document.createElement('script'); oa.type = 'text/javascript'; oa.async = true;
      oa.src = 'https://' + oneall_subdomain + '.api.oneall.com/socialize/library.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(oa, s);
    </script>

    <script async src="https://plausible.io/js/pa-3wQjZMmbX0cjh0QUNM-Il.js"></script>
    <script>
      window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
      plausible.init()
    </script>

    <title>Article Not Found | AALBC</title>
    <meta name="description" content="The AALBC is the oldest and largest website dedicated to books by or about people of African descent.">
    <link rel="canonical" href="https://aalbc.com/articles/feed">
    
    <link rel="icon" type="image/x-icon" href="https://aalbc.com/favicon.ico">
    <link rel="icon" type="image/png" sizes="32x32" href="https://aalbc.com/images/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="https://aalbc.com/images/favicon-16x16.png">
    <link rel="apple-touch-icon" sizes="180x180" href="https://aalbc.com/images/apple-touch-icon.png">

    <link rel="stylesheet" href="/fontawesome/css/all.min.css">
    <link rel="stylesheet" href="/css/css2026mimi.css?v=04222026">
<!--<link rel="stylesheet" href="/css/css2026.css?v=04222026">-->
    
        
    <!-- mailchimp pop-up -->
    <script id="mcjs">!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/fe23d4832ca911e254ed6dace/1c32d4a69642ee9a3a097cb32.js");</script>
    </head>    <body>
        <script>
function dismissAALBCBanner() {
    var banner = document.getElementById('aalbc-upgrade-banner');
    if (banner) {
        banner.style.display = 'none';
        sessionStorage.setItem('aalbc_2026_banner_hidden', 'true');
    }
}
if (sessionStorage.getItem('aalbc_2026_banner_hidden') === 'true') {
    document.getElementById('aalbc-upgrade-banner').style.display = 'none';
}
</script>

    
<header class="site-header">
    <div class="nav-container">
        <a href="https://aalbc.com/" class="nav-logo"><img src="https://aalbc.com/images/AALBC-Logo-long-543-107.png" alt="AALBC Logo"></a>
        <form action="https://aalbc.com/search/" method="get" class="header-search">
            <input type="text" name="query" placeholder="Search authors, books..." required>
            <button type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
        </form>
        <div class="mobile-menu-toggle" onclick="toggleMenu()"><i class="fa-solid fa-bars"></i></div>
        <nav class="main-navigation" id="mainNav">
            <ul>
                <li><a href="https://aalbc.com/books/">Books</a></li>
                <li><a href="https://aalbc.com/authors/">Authors</a></li>
                <li><a href="https://aalbc.com/reviews/">Reviews</a></li>
                <li><a href="https://aalbc.com/events/">Events</a></li>
                <li><a href="https://aalbc.com/writers/">Resources</a></li>
                <li><a href="https://aalbc.com/tc/forum/5-culture-race-economy/">Forum</a></li>
                <li><a href="https://store.aalbc.com/cart.php" style="position: relative; display: inline-block; text-decoration: none; padding-right: 5px;">
                            <i class="fa-solid fa-cart-shopping nav-cart-icon"></i>
                                <span id="bc-cart-badge" style="display: none; position: absolute; top: -8px; right: -10px; background-color: #ff5200; color: #ffffff; font-size: 10px; font-weight: bold; border-radius: 50%; padding: 2px 5px; line-height: 1; text-align: center; min-width: 14px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);">  0</span></a>
                    </li>
                    <li id="auth-section" style="margin-left: 10px; display: flex; align-items: center;">
                                                    <a href="javascript:void(0)" onclick="openLoginModal()" style="font-weight: bold; color: #4a148c;"><i class="fa-solid fa-circle-user"></i> Login</a>
                                            </li>
                </ul>
            </nav>
        </div>
    </header>
    
    <div id="login-modal" class="modal-overlay" style="display:none;">
        <div class="modal-content">
            <span class="close-modal" onclick="closeLoginModal()">&times;</span>
            
                
            <h2 style="text-align: center; margin-bottom: 20px;">Login / Sign Up</h2>
    
            <div id="oa_social_login_container" style="margin-bottom: 0px;"></div>
            <script type="text/javascript">
              var _oneall = _oneall || [];
//            _oneall.push(['social_login', 'set_providers', ['google', 'facebook', 'apple', 'linkedin']]);    
              _oneall.push(['social_login', 'set_providers', ['google', 'facebook', 'apple']]);    
              _oneall.push(['social_login', 'set_callback_uri', 'https://aalbc.com/oneall_callback']);
              
              _oneall.push(['social_login', 'set_event', 'on_login_success', function(event) {
                  var form = document.createElement('form');
                  form.method = 'POST';
                  form.action = '/oneall_callback'; 
                  
                  // 1. Pass the authentication token
                  var input = document.createElement('input');
                  input.type = 'hidden';
                  input.name = 'connection_token';
                  input.value = event.connection.connection_token;
                  form.appendChild(input);
    
                  // 2. NEW: Capture the redirect intention
                  var urlParams = new URLSearchParams(window.location.search);
                  var redirectTarget = urlParams.get('redirect_to');
                  
                  // If there's no redirect param, but they are on a specific article/page, grab that URL instead
                  if (!redirectTarget && window.location.pathname !== '/' && window.location.pathname !== '/index.php' && window.location.pathname !== '/login.php') {
                      redirectTarget = window.location.pathname + window.location.search;
                  }
                  
                  // If we found a destination, pass it to the callback script
                  if (redirectTarget) {
                      var redirectInput = document.createElement('input');
                      redirectInput.type = 'hidden';
                      redirectInput.name = 'redirect_to';
                      redirectInput.value = redirectTarget;
                      form.appendChild(redirectInput);
                  }
                  
                  document.body.appendChild(form);
                  form.submit();
              }]);
              
              _oneall.push(['social_login', 'do_render_ui', 'oa_social_login_container']);
            </script>
        
            <div style="display: flex; align-items: center; margin: 20px 0; color: #bbb; font-size: 0.85rem; font-weight: bold; text-transform: uppercase;">
                <div style="flex: 1; height: 1px; background: #eee;"></div>
                <div style="padding: 0 15px;">or use email</div>
                <div style="flex: 1; height: 1px; background: #eee;"></div>
            </div>
           
            <form id="auth-form" method="POST">
                <input type="hidden" name="redirect_to" value="/articles/feed">
                
                <div style="display:none;"><input type="text" name="aalbc_verify_hp" value=""></div>
                
                <input type="email" name="email" id="auth-email" class="auth-input" placeholder="Email Address" required>    
                
                <div style="position: relative; width: 100%;">
                    <input type="password" name="password" id="auth-password" class="auth-input" placeholder="Password" required style="width:100%; padding-right:40px;">
                    <i class="fa-solid fa-eye" id="modalTogglePassword" style="position: absolute; right: 12px; top: 18px; cursor: pointer; color: #777;"></i>
                </div>
                
                <div style="display: flex; align-items: center; justify-content: center; margin: 15px 0; gap: 10px; font-family: 'Montserrat', sans-serif;">
                    <input type="checkbox" id="human_check" name="human_check" style="width: 18px; height: 18px; cursor: pointer; accent-color: #ff7e03;">
                    <label for="human_check" style="font-size: 0.9rem; color: #555; cursor: pointer; user-select: none;">
                        I am a human visitor
                    </label>
                </div>
                
                <div class="auth-button-group" style="display: flex; gap: 10px; margin-top: 20px;">
                    <button type="button" onclick="handleAuth('login')" class="btn-main" style="flex: 1;">LOG IN</button>
                    <button type="button" onclick="handleAuth('signup')" class="btn-main" style="flex: 1; background: #333 !important;">SIGN UP</button>
                </div>
    
                <div style="text-align: center; margin-top: 15px;">
                    <a href="#" onclick="closeLoginModal(); openForgotModal(); return false;" style="color: #555; text-decoration: underline; font-size: 0.95rem;">Reset your password</a>
                </div>
            </form>
        </div>
    </div>
    
    <script type="text/javascript">
    function toggleMenu() { document.getElementById('mainNav').classList.toggle('active'); }
    
    function toggleDropdown() {
        const dropdown = document.getElementById('user-dropdown');
        dropdown.style.display = (dropdown.style.display === 'block') ? 'none' : 'block';
    }
    
    function openLoginModal() { 
        document.getElementById('login-modal').style.display = 'flex'; 
    }
    
    function closeLoginModal() { document.getElementById('login-modal').style.display = 'none'; }
    function handleLogout() { if(confirm("Log out?")) { window.location.href = '/logout.php'; } }
    
    // Password Visibility Toggle
    document.getElementById('modalTogglePassword')?.addEventListener('click', function() {
        const pwd = document.getElementById('auth-password');
        const type = pwd.getAttribute('type') === 'password' ? 'text' : 'password';
        pwd.setAttribute('type', type);
        this.classList.toggle('fa-eye');
        this.classList.toggle('fa-eye-slash');
    });
    
    window.addEventListener('click', function(e) {
        const dropdown = document.getElementById('user-dropdown');
        const menu = document.getElementById('user-nav-menu');
        if (dropdown && menu && !menu.contains(e.target)) { dropdown.style.display = 'none'; }
    });
    
    function handleAuth(mode) {
        const form = document.getElementById('auth-form');
        const isHuman = document.getElementById('human_check').checked;
    
        // Checkbox Validation
        if (!isHuman) {
            alert("Please check the 'I am a human' box to continue.");
            return;
        }
    
        const email = document.getElementById('auth-email').value;
        const pass = document.getElementById('auth-password').value;
    
        if (!email || !pass) {
            alert("Please enter both email and password.");
            return;
        }
    
        form.action = (mode === 'signup') ? '/register_handler.php' : '/login_handler_email.php';
        form.submit();
    }
    </script>        <div class="container" style="text-align:center; padding:50px 20px;">
            <h1>Article Not Found</h1>
            <p>We couldn’t find the article you were looking for.</p>
            <a href="https://aalbc.com/authors/" class="btn btn-primary">Browse Authors</a>
        </div>
        <footer class="site-footer" id="colophon">
    <div class="footer-grid">
        <div class="footer-col">
            <h4>Company</h4>
            <ul>
                <li><a href="https://aalbc.com/about-us">About Us</a></li>
                <li><a href="https://aalbc.com/AALBC-Privacy-Policy">Privacy Policy</a></li>
                <li><a href="https://aalbc.com/Bookstore-Policies-and-Procedures">Store Policies</a></li>
            </ul>
        </div>
        <div class="footer-col">
            <h4>Support & Services</h4>
            <ul>
                <li><a href="https://aalbc.com/enewsletter/">Subscribe to Newsletter</a></li>
                <li><a href="https://aalbc.com/advertise.php">Advertise with Us</a></li>
                <li><a href="https://aalbc.com/faq/">FAQ</a></li>
                <li><a href="mailto:troy@aalbc.com"><i class="fa-solid fa-envelope"></i> troy@aalbc.com</a></li>
                <li><a href="tel:347-692-2522"><i class="fa-solid fa-phone"></i> 347-69-AALBC</a></li>
            </ul>
        </div>
        <div class="footer-col">
            <h4>Connect</h4>
            <div class="footer-social-icons">
                <a href="https://www.youtube.com/channel/UCKiZCFRFwsYgtn8doHwRtHA?sub_confirmation=1" target="_blank" class="social-btn" title="YouTube"><i class="fa-brands fa-youtube"></i></a>    
                <a href="https://www.facebook.com/aalbcfanpage/" target="_blank" class="social-btn" title="Facebook"><i class="fa-brands fa-facebook"></i></a>
                <a href="https://www.linkedin.com/company/aalbc-com/" target="_blank" class="social-btn" title="LinkedIn"><i class="fa-brands fa-linkedin"></i></a>
                <a href="https://pinterest.com/aalbc/" target="_blank" class="social-btn" title="Pinterest"><i class="fa-brands fa-pinterest"></i></a>
                <a href="https://twitter.com/aalbc" target="_blank" class="social-btn" title="Twitter"><i class="fa-brands fa-x-twitter"></i></a>
                <a href="https://www.instagram.com/aalbc/" target="_blank" class="social-btn" title="Instagram"><i class="fa-brands fa-instagram"></i></a>
                <a href="https://www.flickr.com/people/aalbc/" target="_blank" class="social-btn" title="Flickr"><i class="fa-brands fa-flickr"></i></a>
                <a href="https://www.ibpa-online.org/member/aalbc" target="_blank" class="social-btn" title="IBPA"><i class="fa-solid fa-book"></i></a>
                <a href="https://www.tiktok.com/@aalbccom" target="_blank" class="social-btn" title="TikTok"><i class="fa-brands fa-tiktok"></i></a>
                <a href="https://www.fanbase.app/@aalbc" target="_blank" class="social-btn" title="Fanbase"><i class="fa-solid fa-users"></i></a>
            </div>
        </div>
    </div>
    <div class="footer-bottom">
        &copy; 1997&ndash;2026, All Rights Reserved.<br>
        <a href="https://aalbc.com">African American Literature Book Club</a>, AALBC.com, LLC.
    </div>
    
</footer>

<div id="su-footer-links" style="text-align: center;"></div>


<script>
/**
 * Smooth Scroll and Auto-Open Details
 */
document.addEventListener("DOMContentLoaded", function() {
  if (window.location.hash) {
    const targetId = window.location.hash;
    try {
        const targetElement = document.querySelector(targetId);
        if (targetElement) {
          const parentDetails = targetElement.closest('details');
          if (parentDetails) { parentDetails.open = true; }
          setTimeout(() => {
              targetElement.scrollIntoView({behavior: "smooth", block: "start"});
          }, 200);
        }
    } catch (e) { console.warn("Hash error: ", e); }
  }
});

/**
 * ==========================================================
 * AALBC AJAX Utilities: Toggle Books & Authors (v3 Secure)
 * ==========================================================
 */

// --- 1. TOGGLE FAVORITE BOOK (Reverted to Original FormData for Server Compatibility) ---
function toggleFavorite(btn, isbn) {
    if (!isbn) {
        alert("System Error: ISBN is missing from the button.");
        return;
    }

    const textSpan = btn.querySelector('.btn-text');
    const currentText = textSpan ? textSpan.innerText.trim() : '';
    const icon = btn.querySelector('i, svg');
    
    // SMART CHECK: Works for text buttons AND minimalist heart icons
    let isAdding = true;
    if (btn.classList.contains('active')) isAdding = false;
    else if (currentText && !currentText.toLowerCase().includes('save to')) isAdding = false;

    const action = isAdding ? 'add' : 'remove';

    // Instantly toggle the visual state so it feels snappy
    btn.classList.toggle('active');
    if (icon) {
        icon.classList.toggle('fa-solid');
        icon.classList.toggle('fa-regular');
    }
    if (textSpan) textSpan.innerText = 'Saving...';
    
    btn.style.pointerEvents = 'none'; 

    // REVERTED: Back to your original FormData structure that your server likes!
    const formData = new FormData();
    formData.append('isbn', isbn);       
    formData.append('isbn13', isbn);     
    formData.append('action', action);

    fetch('/toggle_favorite', {
        method: 'POST',
        headers: { 'X-Requested-With': 'XMLHttpRequest' }, // NO Content-Type header so the browser sets the boundary automatically
        body: formData
    })
    .then(async response => {
        if (response.redirected && response.url.includes('signup')) return { status: 'unauthorized' };
        const text = await response.text();
        if (text.trim().startsWith('<')) return { status: 'unauthorized' };
        return JSON.parse(text); 
    })
    .then(data => {
        btn.style.pointerEvents = 'auto';

        if (data.status === 'unauthorized') {
            // Revert visuals and redirect
            btn.classList.toggle('active');
            if (icon) { icon.classList.toggle('fa-solid'); icon.classList.toggle('fa-regular'); }
            if (textSpan) textSpan.innerText = currentText; 
            window.location.href = '/signup.php?auth_required=1&redirect_to=' + encodeURIComponent(window.location.pathname);
            return;
        }

        if (data.success) {
            if (textSpan) textSpan.innerText = isAdding ? 'Saved to Bookshelf' : 'Save to Bookshelf';
            if (btn.hasAttribute('title')) {
                btn.title = isAdding ? "Remove from Bookshelf" : "Add to Your Bookshelf";
            }
        } else {
            // Revert visuals on failure
            btn.classList.toggle('active');
            if (icon) { icon.classList.toggle('fa-solid'); icon.classList.toggle('fa-regular'); }
            if (textSpan) textSpan.innerText = currentText;
            alert("Error: " + (data.message || "Could not save."));
        }
    })
    .catch(err => {
        btn.style.pointerEvents = 'auto';
        btn.classList.toggle('active');
        if (icon) { icon.classList.toggle('fa-solid'); icon.classList.toggle('fa-regular'); }
        if (textSpan) textSpan.innerText = currentText; 
        console.error("Favorite toggle failed:", err);
    });
}

// --- 2. TOGGLE FOLLOW AUTHOR ---
function toggleFollowAuthor(btn, aid) {
    if (!btn || !aid) return;
    
    const textSpan = btn.querySelector('.btn-text');
    const currentText = textSpan ? textSpan.innerText.trim() : '';
    
    const isAdding = currentText.toLowerCase().includes('follow author');
    const action = isAdding ? 'follow' : 'unfollow';

    if (textSpan) textSpan.innerText = 'Saving...';
    btn.style.opacity = '0.7';
    btn.style.pointerEvents = 'none';

    const formData = new FormData();
    formData.append('author_id', aid);
    formData.append('action', action);

    fetch('/toggle_follow', {
        method: 'POST',
        headers: {
            'X-Requested-With': 'XMLHttpRequest'
        },
        body: formData
    })
    .then(async response => {
        if (response.redirected && response.url.includes('signup')) return { status: 'unauthorized' };
        const text = await response.text();
        if (text.trim().startsWith('<')) return { status: 'unauthorized' };
        return JSON.parse(text);
    })
    .then(data => {
        btn.style.opacity = '1';
        btn.style.pointerEvents = 'auto';

        if (data.status === 'unauthorized') {
            if (textSpan) textSpan.innerText = currentText;
            window.location.href = '/signup.php?auth_required=1&redirect_to=' + encodeURIComponent(window.location.pathname);
            return;
        }

        if (data.success) {
            if (textSpan) textSpan.innerText = isAdding ? 'Following' : 'Follow Author';
            const icon = btn.querySelector('i, svg');
            if (icon) {
                if (icon.tagName.toLowerCase() === 'svg') {
                    icon.setAttribute('data-prefix', isAdding ? 'fas' : 'far');
                }
                icon.classList.remove(isAdding ? 'fa-regular' : 'fa-solid');
                icon.classList.add(isAdding ? 'fa-solid' : 'fa-regular');
                icon.style.color = isAdding ? '#4a148c' : '#777';
                btn.style.borderColor = isAdding ? '#4a148c' : '#ddd';
            }
        } else {
            if (textSpan) textSpan.innerText = currentText;
            alert("Error: " + (data.message || "Could not save."));
        }
    })
    .catch(err => {
        btn.style.opacity = '1';
        btn.style.pointerEvents = 'auto';
        if (textSpan) textSpan.innerText = currentText;
        console.error("Follow Error:", err);
    });
}

/**
 * --- 3. AALBC HIGH-ACCURACY AD TRACKER ---
 * Tracks an impression only if the ad is 50% visible for 1 second.
 */
document.addEventListener('DOMContentLoaded', function() {
    const adTracker = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                entry.target.dataset.timer = setTimeout(() => {
                    const adId = entry.target.getAttribute('data-ad-id');
                    if (navigator.sendBeacon) {
                        const formData = new FormData();
                        formData.append('id', adId);
                        navigator.sendBeacon('/data/collect_impression.php', formData);
                    } else {
                        fetch(`/data/collect_impression.php?id=${adId}`, { method: 'POST', keepalive: true });
                    }
                    adTracker.unobserve(entry.target);
                }, 1000); 
            } else {
                clearTimeout(entry.target.dataset.timer);
            }
        });
    }, { threshold: 0.5 });

    document.querySelectorAll('.track-ad-item').forEach(el => adTracker.observe(el));
});
</script>


<style>
    .forgot-modal-overlay {
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.6); z-index: 99999; align-items: center; justify-content: center;
    }
    .forgot-modal-box {
        background: #fff; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; position: relative; text-align: left;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    }
</style>

<div id="forgotPasswordModal" class="forgot-modal-overlay">
    <div class="forgot-modal-box">
        <span onclick="closeForgotModal();" style="position: absolute; right: 15px; top: 10px; cursor: pointer; font-size: 1.8rem; color: #888;">&times;</span>
        <h2 style="margin-bottom: 10px; font-size: 1.5rem; color:#333;">Reset Password</h2>
        <p style="color: #666; font-size: 0.95rem; margin-bottom: 20px;">Enter your email address below and we will send you a secure link to reset your password.</p>
        
        <form action="/process_forgot_password.php" method="POST">
            <label style="font-weight: bold; display: block; margin-bottom: 8px; color:#333;">Email Address</label>
            <input type="email" name="email" placeholder="you@example.com" required style="width: 100%; padding: 12px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 1rem;">
            <button type="submit" style="width: 100%; background: #ff7e03; color: white; padding: 14px; font-size: 1.1rem; border-radius: 50px; border: none; cursor: pointer; font-weight: bold;">Send Reset Link</button>
        </form>
    </div>
</div>

<script>
function openForgotModal() {
    document.getElementById('forgotPasswordModal').style.display = 'flex';
}

function closeForgotModal() {
    document.getElementById('forgotPasswordModal').style.display = 'none';
}

// Close the forgot modal if they click the dark background outside the box
window.addEventListener('click', function(event) {
    const forgotModal = document.getElementById('forgotPasswordModal');
    if (event.target == forgotModal) {
        forgotModal.style.display = "none";
    }
});
</script>

<div id="unauthorizedModal" class="modal-overlay" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); z-index:99999; align-items:center; justify-content:center;">
    <div class="modal-content" style="background:#fff; padding:30px; border-radius:12px; max-width:400px; width:90%; text-align:center; position:relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2);">
        <span onclick="document.getElementById('unauthorizedModal').style.display='none'" style="position:absolute; top:10px; right:15px; font-size:1.5rem; cursor:pointer; color:#888;">&times;</span>
        
        <i class="fa-solid fa-circle-exclamation" style="font-size: 3rem; color: #d32f2f; margin-bottom: 15px;"></i>
        <h2 style="margin-top:0; color:#333;">Access Restricted</h2>
        
        <p id="unauthMessage" style="color:#666; font-size:0.95rem; margin-bottom:20px;">
            Access to this page is restricted. Please log in with an authorized account.
        </p>
        
        <div style="display: flex; gap: 10px; justify-content: center;">
            <button onclick="document.getElementById('unauthorizedModal').style.display='none';" style="background:#eee; color:#333; border:none; padding:10px 20px; border-radius:50px; font-weight:bold; cursor:pointer;">CLOSE</button>
            <button id="unauthLoginBtn" onclick="document.getElementById('unauthorizedModal').style.display='none'; openLoginModal();" style="background:#4a148c; color:#fff; border:none; padding:10px 20px; border-radius:50px; font-weight:bold; cursor:pointer;">LOG IN</button>
        </div>
    </div>
</div>

<script>
    document.addEventListener("DOMContentLoaded", function() {
        const urlParams = new URLSearchParams(window.location.search);
        const errorType = urlParams.get('error');
        
        // Check if the URL contains the unauthorized or banned error
        if (errorType === 'unauthorized' || errorType === 'unauthorized_role' || errorType === 'banned') {
            
            const modal = document.getElementById('unauthorizedModal');
            const msgText = document.getElementById('unauthMessage');
            const loginBtn = document.getElementById('unauthLoginBtn');
            
            if (errorType === 'unauthorized_role') {
                // Logged in, but wrong role
                msgText.innerHTML = "<strong>Access Denied.</strong><br>Your current account does not grant you access to this page.";
                if (loginBtn) loginBtn.style.display = 'none'; // Hide login button
            } else {
                // Not logged in
                msgText.innerHTML = "Access to this page is restricted. Please log in to continue.";
                if (loginBtn) loginBtn.style.display = 'inline-block';
                
                // Capture the redirect_to URL and inject it into the hidden login form input!
                const redirectTo = urlParams.get('redirect_to');
                if (redirectTo) {
                    const formRedirect = document.querySelector('input[name="redirect_to"]');
                    if (formRedirect) {
                        formRedirect.value = redirectTo;
                    }
                }
            }

            // Show the modal
            modal.style.display = 'flex';
            
            // CLEANUP: Quietly remove the ?error parameters from the browser's address bar 
            // so the modal doesn't keep popping up if they refresh the page!
            const cleanUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
            window.history.replaceState({path: cleanUrl}, '', cleanUrl);
        }
    });
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
    // Look for the universal cookie BigCommerce created
    let match = document.cookie.match(new RegExp('(^| )universal_cart_qty=([^;]+)'));
    
    if (match) {
        let cartQty = parseInt(match[2]);
        
        // If there are items, show the badge!
        if (cartQty > 0) {
            const badge = document.getElementById('bc-cart-badge');
            if (badge) {
                badge.innerText = cartQty;
                badge.style.display = 'inline-block';
            }
        }
    }
});
</script>    </body>
    </html>
    