﻿/* New mobile menu */
/* Enhanced Mobile Menu Button */
.menu-open-button .menu-toggle,
.overlay > .menu-toggle { background: none; border: 1px solid currentColor; border-radius: 6px; cursor: pointer; width: 40px; height: 37px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 0; position: relative; z-index: 10001; margin-right: 10px; color: inherit; }
.hamburger { width: 15px; height: 12px; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.hamburger span { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 2px; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); transform-origin: center; }

/* X Animation */
.menu-toggle.active .hamburger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-toggle.active .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.active .hamburger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* When open, toggle lives inside the overlay (moved by JS) */
.menu-toggle.active { position: absolute; top: 18px; right: 18px; }

/* Enhanced Overlay */
.overlay { opacity: 0; backdrop-filter: blur(8px); transition: all 0.3s ease; }

/* Flyout drawer sits above everything; hamburger stays above that */
.overlay { z-index: 10000 !important; }
.menu-toggle { z-index: 10001 !important; }

/* Clean overlay menu styling */
.overlay-nav { align-items: stretch !important; }
.overlay-menu, .overlay-menu ul { align-items: stretch !important; }
.overlay-menu li { text-align: left; }

.overlay-menu a { display: inline-block; padding: 24px 0; text-decoration: none; font-size: 1.4em !important; font-weight: 500; transition: all 0.3s ease; position: relative; background-image: linear-gradient(45deg, currentColor, currentColor); background-size: 0% 2px; background-repeat: no-repeat; background-position: left bottom; padding-bottom: 22px; /* Add space for the underline */ }

.overlay-menu a:hover { /*    color: #ff6b6b;*/ text-decoration: none; background-size: 100% 2px; }

.overlay-menu li a { padding: clamp(16px, 4vw, 24px) 0 4px; text-decoration: none !important; display: inline-block; text-align: left; }

/* Slide-from-right drawer */
.overlay { position: fixed; top: 0; right: 0; bottom: 0; width: 85%; max-width: 380px; opacity: 0; backdrop-filter: blur(8px); transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease, box-shadow 0.3s ease; transform: translateX(100%); visibility: hidden; }

.overlay.menu-visible { opacity: 0.98; transform: translateX(0); visibility: visible; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4); }

/* === Mobile drawer layout: ONE scrolling column (rearchitected) ===
   The nav links are the priority: they render from the top and are
   ALWAYS shown. If they don't all fit, the whole drawer scrolls as one
   column - there is no nested inner scroll panel (that was the 'links
   stuck in an iframe' behavior). The social row is a compact strip that
   always comes LAST, at the very bottom, after every link.

   TOP SPACING is owned here, in CSS - not by navigation.js. The script
   sets an inline padding-top on .overlay (header + nav height, ~250px of
   dead space), so we override it with !important (which beats a non-
   important inline style) and let .overlay-nav's own top padding do the
   spacing. That makes the result independent of whether the JS runs or
   what getTemplate() returns. */
.overlay {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 0 !important;   /* kill the inline padding-top the JS sets */
}

/* Links wrapper: natural height, NOT a separate scroll panel.
   The only thing at the top of the drawer is the absolutely-positioned
   close (X) button (top:18px, ~37px tall). 24px of top padding puts the
   first link up near the top, alongside the X (X is far-right, the link
   text is far-left, so they don't collide). */
.overlay-nav {
    padding: 24px 20px 0;
    flex: 0 0 auto;
    overflow: visible;
}

/* Social row: a compact, centered icon strip that is always LAST and is
   dropped to the very bottom. margin-top:auto pushes it to the bottom
   edge when the links don't fill the drawer; when they do, it simply
   follows the last link at the end of the single scroll.
   The explicit flex row + width:auto icons override site-base's
   width:100% (which was stacking every icon into a full-width column
   ~550px tall) - so this holds even if nav-base.css isn't loaded. */
#overlay-social {
    margin-top: auto;
    flex: 0 0 auto;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Social media icons: sit in the row, compact. */
#overlay-social a {
    display: inline-flex;
    width: auto;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-size: 1.2em;
    transition: color 0.2s ease;
}
#overlay-social i { font-size: 20px !important; }   /* beats nav-base's 24px !important */

/* Close button on its own full-width row, below the icons. */
#overlay-social > div { flex-basis: 100%; }

#overlay-social a:hover { /*    color: #ff6b6b;*/ }

/* Style the close menu link */
#overlay-social #close-overlay { display: inline-block; /*    color: #666;*/ text-decoration: none; font-size: 0.9em; margin-top: 15px; padding: 8px 16px; border: 1px solid #ddd; border-radius: 4px; transition: all 0.2s ease; }

#overlay-social #close-overlay:hover { /* color: #ff6b6b;*/ border-color: #ff6b6b; }




/* new mobile menu end */

.menu li a { font-size: clamp(13px, 1.2vw, 17px) !important; /* Scale vertical padding with font size */ padding-left: clamp(8px, 1.5vw, 35px) !important; padding-right: clamp(8px, 1.5vw, 35px) !important; line-height: 1.1 !important; }

.menu { height: auto !important; min-height: auto !important; }

/* More specific selector overrides the media query */
@@media screen and (max-width: 959px) {
    #navigation .menu { display: flex !important; }
}

@@media screen and (max-width: 500px) {
    #navigation .menu { display: none !important; }
}


/* Fix: allow logo to shrink on mobile so it doesn't push the hamburger off-screen */
.tinyLogo {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.menu-open-button {
    padding-left: 15px;
}