        /* --- Basic Reset & Font --- */
        :root {
            --gridzmenu-text-color: #ffffff;
            --gridzmenu-bg-color: #1a202c;
            --gridzmenu-primary-accent: #4a5568;
            --gridzmenu-secondary-accent: #2d3748;
            --gridzmenu-dropdown-bg: #ffffff;
            --gridzmenu-dropdown-text: #1a202c;
            --gridzmenu-dropdown-hover: #f7fafc;
        }

        .gridzmenu-component * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .gridzmenu-component body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
            line-height: 1.5;
            background-color: var(--gridzmenu-bg-color);
        }

        .gridzmenu-component a {
            color: inherit;
            text-decoration: none;
        }

        /* Screen reader only utility */
        .gridzmenu-sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border-width: 0;
        }

        /* --- Hero Section --- */
        .gridzmenu-hero-section {
            position: relative;
            height: 100vh;
            min-height: 600px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--gridzmenu-text-color);
            background-color: var(--gridzmenu-bg-color); /* Fallback color */
            background-image: linear-gradient(rgba(26, 32, 44, 0.6), rgba(26, 32, 44, 0.6)), url('https://placehold.co/1920x1080/2d3748/ffffff?text=lovejigsawpuzzles.com');
            background-size: cover;
            background-position: center;
        }

        .gridzmenu-hero-content h1 {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 1rem;
        }

        .gridzmenu-hero-content p {
            font-size: 1.25rem;
            color: #e2e8f0;
        }

        /* --- Header & Navigation --- */
        .gridzmenu-header {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            background-color: rgba(26, 32, 44, 0.2);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            transition: background-color 0.3s ease;
        }
        
 /* Ensure the nav takes up the remaining space */
.gridzmenu-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Change from space-between to flex-end on mobile */
    max-width: 1280px;
    margin: 0 auto;
    padding: 0rem 1.0rem; /* height above and below menu and margin right - left */
    position: relative;
    flex: 1; /* Take up remaining space in the container */
}

        .gridzmenu-logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--gridzmenu-text-color);
            z-index: 101;
        }
        
        /* --- Unified Navigation Links Container --- */
        .gridzmenu-nav-links {
            /* Mobile styles first: hidden, vertical, full-width overlay */
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            padding-top: 3.5rem; /* changed from 6  ??? */
            background-color: rgba(26, 32, 44, 0.95);
            flex-direction: column;
            align-items: flex-start;
        }

        .gridzmenu-nav-links.gridzmenu-open {
            display: flex;
        }

        .gridzmenu-nav-item {
            position: relative;
            width: 100%;
        }

        .gridzmenu-nav-item > a, .gridzmenu-nav-item > button {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            padding: 0.75rem 1.5rem;
            color: var(--gridzmenu-text-color);
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1.0rem;
            font-family: inherit;
            text-align: left;
        }
        
        .gridzmenu-nav-item > a:hover, .gridzmenu-nav-item > button:hover {
             background-color: rgba(255, 255, 255, 0.1);
        }

        .gridzmenu-dropdown-arrow {
            width: 1rem;
            height: 1rem;
            transition: transform 0.3s ease;
        }
        .gridzmenu-dropdown-toggle.gridzmenu-open .gridzmenu-dropdown-arrow {
            transform: rotate(180deg);
        }
        
        /* --- Dropdown Menu (Accordion on Mobile, Popover on Desktop) --- */
        .gridzmenu-dropdown-menu {
            /* Mobile accordion styles */
            display: none;
            overflow: hidden;
            background-color: rgba(0, 0, 0, 0.2);
            padding-left: 1rem;
        }
        
        .gridzmenu-dropdown-menu.gridzmenu-open {
            display: block;
        }

        .gridzmenu-dropdown-menu a, .gridzmenu-dropdown-menu button {
            display: block;
            width: 100%;
            padding: 0.75rem 2.5rem;
            color: var(--gridzmenu-text-color);
            text-align: left;
            background: none;
            border: none;
            font-family: inherit;
            font-size: 1rem;
            cursor: pointer;
        }

        .gridzmenu-dropdown-menu a:hover, .gridzmenu-dropdown-menu button:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        /* --- Mobile Hamburger Button --- */
   /* Push hamburger to the absolute right */
.gridzmenu-mobile-nav-button {
    display: block;
    margin-left: auto; /* This ensures it's pushed to the far right */
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    color: var(--gridzmenu-text-color);
    cursor: pointer;
    z-index: 101;
}

        .gridzmenu-hamburger-line {
            display: block;
			 margin-left: auto; /* Add this line */
            position: absolute;
            height: 2px;
            width: 1.5rem;
            background-color: currentColor;
            transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
            left: 50%;
            transform: translateX(-50%);
        }
        .gridzmenu-line-top { top: 0.75rem; }
        .gridzmenu-line-middle { top: 1.25rem; }
        .gridzmenu-line-bottom { top: 1.75rem; }

        .gridzmenu-mobile-nav-button.gridzmenu-open .gridzmenu-line-top { transform: translateX(-50%) rotate(135deg); top: 1.25rem; }
        .gridzmenu-mobile-nav-button.gridzmenu-open .gridzmenu-line-middle { opacity: 0; }
        .gridzmenu-mobile-nav-button.gridzmenu-open .gridzmenu-line-bottom { transform: translateX(-50%) rotate(-135deg); top: 1.25rem; }
        
        /* --- DESKTOP STYLES --- */
		
		
        @media (min-width: 768px) {
            .gridzmenu-mobile-nav-button { display: none; }

            .gridzmenu-nav-links {
                display: flex !important; /* Override JS toggle */
                position: static;
                height: auto;
                width: auto;
                padding-top: 0;
                background-color: transparent;
                flex-direction: row;
                align-items: center;
            }

            .gridzmenu-nav-item {
                width: auto;
                margin-left: 0.5rem;
            }

            .gridzmenu-nav-item > a, .gridzmenu-nav-item > button {
                padding: 0.5rem 1rem;
                border-radius: 0.5rem;
                font-size: 1rem;
            }

            .gridzmenu-dropdown-menu {
                position: absolute;
                top: calc(100% + 0.5rem);
                left: 0;
                width: 12rem;
                background-color: var(--gridzmenu-dropdown-bg);
                color: var(--gridzmenu-dropdown-text);
                border-radius: 0.5rem;
                box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
                padding: 0.5rem 0;
                padding-left: 0;
                opacity: 0;
                transform: translateY(-10px);
                visibility: hidden;
                transition: opacity 0.3s ease, transform 0.3s ease;
            }

            .gridzmenu-dropdown-menu.gridzmenu-open {
                opacity: 1;
                transform: translateY(0);
                visibility: visible;
            }
             
            .gridzmenu-nav-item:last-child .gridzmenu-dropdown-menu {
                left: auto;
                right: 0;
            }
            
            .gridzmenu-dropdown-menu a, .gridzmenu-dropdown-menu button {
                 padding: 0.5rem 1rem;
                 color: var(--gridzmenu-dropdown-text);
				text-decoration:none;
            }
            .gridzmenu-dropdown-menu a:hover, .gridzmenu-dropdown-menu button:hover {
                background-color: var(--gridzmenu-dropdown-hover);
            }
            
            .gridzmenu-dropdown-arrow {
                 margin-left: 0.5rem;
            }
            .gridzmenu-dropdown-toggle.gridzmenu-open .gridzmenu-dropdown-arrow {
                 transform: rotate(0deg); /* No rotation on desktop */
            }

            .gridzmenu-hero-content h2 { font-size: 4rem; }
            .gridzmenu-hero-content p { font-size: 1.5rem; }
        }

        /* ===== MODAL STYLES ===== */
        :root{
          --gridzmenu-panel:#ffffff;
          --gridzmenu-ink:#1c1c1c;
          --gridzmenu-muted:#666;
          --gridzmenu-ring:#dfe3ea;
          --gridzmenu-card:#ffffff;
          --gridzmenu-shadow: 0 6px 18px rgba(0,0,0,.08);
          --gridzmenu-radius: 14px;
          --gridzmenu-gap: 1rem;
        }

        .gridzmenu-no-scroll{ overflow:hidden; }

        .gridzmenu-modal{
          position: fixed; inset:0;
          display:grid; place-items:start center;
          padding: clamp(10px, 3vw, 24px);
          background: rgba(10,10,14,.45);
          opacity: 0; pointer-events: none;
          transition: opacity .2s ease;
          z-index: 9999;
        }
        .gridzmenu-modal.gridzmenu-open{ opacity:1; pointer-events:auto; }

        .gridzmenu-modal-content{
          width:min(100%, 1000px); 
          background: var(--gridzmenu-panel);
          color: var(--gridzmenu-ink);
          border-radius: var(--gridzmenu-radius);
          box-shadow: 0 20px 40px rgba(0,0,0,.25);
          transform: translateY(8px) scale(.98);
          opacity: 0;
          transition: transform .2s ease, opacity .2s ease;
          outline: 0;
          position: relative;
          display: grid;
          grid-template-rows: auto 1fr;
          max-height: calc(100vh - (2 * clamp(10px, 3vw, 24px)));
          overflow: hidden;
        }
        .gridzmenu-modal.gridzmenu-open .gridzmenu-modal-content{ transform: translateY(0) scale(1); opacity:1; }

        .gridzmenu-close{
          position:absolute; right:.75rem; top:.75rem;
          display:inline-grid; place-items:center;
          width:42px; height:42px; border-radius:50%;
          border:1px solid var(--gridzmenu-ring); background:#fff; cursor:pointer;
          font-size: 24px;
          z-index: 4;
        }
        .gridzmenu-close:hover{ transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }

        .gridzmenu-hero{
          padding: 2rem 2.5rem;
          border-radius: var(--gridzmenu-radius) var(--gridzmenu-radius) 0 0;
          color: #0b0b0b;
          background: linear-gradient(120deg, #f3f5ff, #fff);
          border-bottom: 1px solid var(--gridzmenu-ring);
          position: sticky;
          top: 0;
          z-index: 1;
        }
        .gridzmenu-hero h2{margin:0 0 .25rem 0; font-size: clamp(1.2rem, 3vw, 1.6rem);}
        .gridzmenu-hero p{margin:0; color:#333}
        .gridzmenu-hero .gridzmenu-kicker{font-weight:700; color:#4b47ff; font-size:.85rem; letter-spacing:.02em}

        .gridzmenu-modal-body{
          padding: 1.25rem 1.25rem 1.5rem;
          display:flex; flex-direction: column; gap:1rem;
          overflow: auto;
        }
        
        .gridzmenu-cards{
          display:grid;
          grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
          gap: var(--gridzmenu-gap);
        }
        .gridzmenu-card{
          display:grid; gap:.4rem;
          text-decoration:none; color:inherit;
          background:#fff; border:1px solid var(--gridzmenu-ring);
          border-radius:10px; padding:.9rem;
          box-shadow: 0 1px 0 rgba(0,0,0,.02);}
        .gridzmenu-card:hover{ transform: translateY(-2px); box-shadow: var(--gridzmenu-shadow); }
        .gridzmenu-card-title{ font-weight:800; line-height:1.2; }
        .gridzmenu-card-meta { font-size:.85rem; color:var(--gridzmenu-muted); }
        .gridzmenu-pills{ display:flex; flex-wrap:wrap; gap:.5rem; margin: .25rem 0 1rem; }
        .gridzmenu-pill{ border:1px solid var(--gridzmenu-ring); padding:.35rem .7rem; border-radius:999px; background:#fff; cursor:pointer; font-weight:700; }
        .gridzmenu-pill[aria-pressed="true"]{ background:#111; color:#fff; border-color:#111; }
        
        /* How-To Modal Content Styles */
        .gridzmenu-modal-body pre {
            background-color: #f3f4f6;
            padding: 1rem;
            border-radius: 8px;
            white-space: pre-wrap;
            word-break: break-all;
            font-family: monospace;
            margin: 0.5rem 0 1.5rem;
            color: #111827;
        }
        .gridzmenu-modal-body code {
            font-family: monospace;
            background-color: #e5e7eb;
            padding: 0.2em 0.4em;
            border-radius: 4px;
        }
        .gridzmenu-modal-body h3 {
            margin-top: 1.5rem;
            border-bottom: 1px solid var(--gridzmenu-ring);
            padding-bottom: 0.5rem;
            margin-bottom: 1rem;
            font-size: 1.25rem;
        }
        .gridzmenu-modal-body ul {
            list-style-position: inside;
            padding-left: 1rem;
        }
        .gridzmenu-modal-body li {
            margin-bottom: 0.5rem;
        }

        @media (prefers-reduced-motion: reduce){
          .gridzmenu-modal, .gridzmenu-modal-content{ transition:none !important; }
        }

/* This main rule ensures that both standalone links (<a>) and buttons (<button>)
  look and feel exactly the same as top-level menu items.
*/
.gridzmenu-nav-item > a
 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    color: var(--gridmz1-text-color, #FFFFFF); /* Uses your variable, with white as a fallback */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.0rem;
    font-family: inherit;
    text-align: left;
    text-decoration: none; /* Explicitly removes the underline */
}

/* This rule handles the hover effect, applying it consistently
  to both links and buttons.
*/
.gridzmenu-nav-item > a:hover,
.gridzmenu-nav-item > button:hover {
     background-color: rgba(255, 255, 255, 0.1);
}

/* This is the key for link behavior: it forces the link to keep its original
  color even after it has been clicked/visited.
*/
.gridzmenu-nav-item > a:visited {
    color: var(--gridmz1-text-color, #FFFFFF);
}