/* Mobile Menu Container */
#mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 50;
    overflow-y: auto;           /* allow scroll if many links */
    max-height: calc(100vh - 5rem); /* don't cover whole screen */

    /* Hidden state – performant properties only */
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    pointer-events: none;
    transition: 
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0.3s;  /* delay visibility change until fade out */
}

/* Open state */
#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: 
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0s;  /* show immediately */
}

/* Optional: If you still want the keyframe animation, add this class via JS */
#mobile-menu.animate-in {
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Links */
#mobile-menu a {
    display: block;
    padding: 1rem 2rem;
    color: #1f2937; /* gray-800 */
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

#mobile-menu a:hover,
#mobile-menu a:focus {
    background-color: #f3f4f6; /* gray-100 */
    color: #2563eb; /* blue-600 */
    outline: none;
}

/* Mobile Menu Toggle Icon */
#mobile-menu-toggle i {
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    transition: transform 0.2s ease;
}

#mobile-menu-toggle i:hover,
#mobile-menu-toggle i:focus {
    transform: scale(1.1);
}

/* Optional: Native smooth scrolling (can remove if JS handles all # links) */
html {
    scroll-behavior: smooth;
}

/* ─────────────────────────────────────────────── */
/* Icon / Text Spacing Utilities (unchanged – good as is) */
.icon-text-spacing img,
.icon-text-spacing svg,
.icon-text-spacing i[data-lucide] {
    margin-right: 1rem;
}

.icon-text-spacing-left img,
.icon-text-spacing-left svg,
.icon-text-spacing-left i[data-lucide] {
    margin-left: 1rem;
}

.img-text-pad     { padding: 1rem; }
.img-text-pad-sm  { padding: 0.75rem; }
.img-text-pad-lg  { padding: 1.25rem; }

[class*="flex"] > i[data-lucide],
[class*="flex"] > svg,
[class*="flex"] > img {
    flex-shrink: 0;
}

p i[data-lucide],
span i[data-lucide],
li i[data-lucide] {
    margin-inline: 0.5rem;
    vertical-align: middle;
}