/* ==========================================================================
   framework.css - additions to the old safferhelp.com style.css, which is
   kept byte-for-byte unchanged: the hamburger menu drawer - pin open on
   desktop, pop-up on mobile (same behaviour as JudeMed.AI / NutraLife).
   Site colours only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header row: logo left, hamburger right, on every screen size
   (overrides the old <=1024px column layout that existed for the long menu)
   -------------------------------------------------------------------------- */

header .header-content {
    flex-direction: row;
    flex-wrap: nowrap;
    text-align: left;
}

.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 0;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-toggle-bar {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--us-white);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
    transform-origin: center;
}

/* Bars turn into an X while the drawer is open or pinned */
body.nav-open .nav-toggle .nav-toggle-bar:nth-child(1),
body.nav-pinned .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-toggle .nav-toggle-bar:nth-child(2),
body.nav-pinned .nav-toggle .nav-toggle-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
body.nav-open .nav-toggle .nav-toggle-bar:nth-child(3),
body.nav-pinned .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Backdrop: dims the page while the pop-up drawer is open (not when pinned) */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: all;
}

/* Right-side drawer: SA green with a gold edge */
.site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 270px;
    background: #004d20;
    border-left: 4px solid var(--sa-gold);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.25rem 2rem;
    overflow-y: auto;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.35);
}

body.nav-open .site-nav,
body.nav-pinned .site-nav {
    transform: translateX(0);
}

.nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 2.5rem;
}

.nav-pin,
.nav-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    color: var(--us-white);
    line-height: 0;
}

/* Pin: desktop only */
.nav-pin {
    display: none;
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.25s ease;
}

.nav-pin:hover { opacity: 0.9; }

body.nav-pinned .nav-pin {
    color: var(--sa-gold);
    opacity: 1;
    transform: rotate(45deg);
}

.nav-close {
    opacity: 0.6;
    margin-left: auto;
    transition: opacity 0.15s ease;
}

.nav-close:hover { opacity: 1; }

@media (min-width: 769px) {
    .nav-pin { display: block; }
    /* Pinned: the pin (or the hamburger) closes it, so the X is hidden */
    body.nav-pinned .nav-close { display: none; }
    /* Pinned: the page makes room for the drawer */
    body.nav-pinned { padding-right: 270px; }
}

/* Drawer links: same labels and order as the old top menu */
.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav li {
    margin: 0;
}

.site-nav a {
    display: block;
    color: var(--us-white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 0.7rem;
    border-radius: 4px;
    transition: background 0.3s, color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus {
    background-color: rgba(255, 255, 255, 0.2);
}

.site-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--sa-gold);
    font-weight: bold;
}


@media (max-width: 768px) {
    .site-nav { width: min(85vw, 320px); }
}
