/**
 * Herb Whisperer — Header Navigation & Footer Styles
 *
 * Targets the actual markup in header.php and footer.php.
 * Enqueued by functions.php via hw_enqueue_assets().
 *
 * @package HerbWhisperer
 */


/* ══════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════ */

.hw-site-header {
    background: var(--hw-cream, #faf8f4);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Push header below the WP admin bar when logged in */
.admin-bar .hw-site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .hw-site-header {
        top: 46px;
    }
}

.hw-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: 1.5rem;
}


/* ── Logo ── */

.hw-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.hw-logo img {
    max-height: 52px;
    width: auto;
    display: block;
}


/* ── Primary Nav ── */

.hw-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hw-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Top-level links */
.hw-nav > ul > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 0.75rem;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hw-text, #2c2a26);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease;
}

.hw-nav > ul > li > a:hover,
.hw-nav > ul > li.current-menu-item > a,
.hw-nav > ul > li.current-menu-ancestor > a {
    color: var(--hw-green, #2d7a4f);
}

/* Underline on hover/active */
.hw-nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: var(--hw-green, #2d7a4f);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.hw-nav > ul > li > a:hover::after,
.hw-nav > ul > li.current-menu-item > a::after,
.hw-nav > ul > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

/* Dropdown arrow from HW_Nav_Walker */
.hw-dropdown-arrow {
    margin-left: 2px;
    vertical-align: middle;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.menu-item-has-children:hover > a .hw-dropdown-arrow {
    transform: rotate(180deg);
}


/* ── Dropdown menus ── */

.hw-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 220px;
    padding: 0.4rem 0;
    z-index: 1000;
}

.hw-nav ul li {
    position: relative;
}

.hw-nav ul li:hover > ul {
    display: block;
}

/* Sub-sub-menus open to the right */
.hw-nav ul ul ul {
    top: 0;
    left: 100%;
    margin-left: 2px;
}

/* Dropdown links */
.hw-nav ul ul li a {
    display: block;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--hw-text, #2c2a26);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.4;
}

.hw-nav ul ul li a:hover {
    background: var(--hw-green-subtle, #e8f5ec);
    color: var(--hw-green-dark, #1a5632);
}

/* Dropdown item descriptions (if set in menu admin) */
.hw-menu-description {
    display: block;
    font-size: 0.75rem;
    color: var(--hw-text-muted, #78756e);
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.3;
}

.hw-nav ul ul li a:hover .hw-menu-description {
    color: var(--hw-warm-gray, #6b6458);
}


/* ── Header Actions (Login / My Account) ── */

.hw-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.hw-header-actions a {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--hw-text, #2c2a26);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hw-header-actions a:hover {
    color: var(--hw-green, #2d7a4f);
}

.hw-btn-login {
    background: var(--hw-green, #2d7a4f) !important;
    color: #fff !important;
    border-radius: 100px;
    padding: 0.45rem 1.2rem;
    font-weight: 600 !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
}

.hw-btn-login:hover {
    background: var(--hw-green-dark, #1a5632) !important;
    transform: translateY(-1px);
}


/* ── Mobile Menu Toggle ── */

.hw-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--hw-green-dark, #1a5632);
}

.hw-menu-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}


/* ── Screen reader only (skip link) ── */

.hw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.hw-sr-only:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 0.75rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    background: var(--hw-green, #2d7a4f);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    text-decoration: none;
}


/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE — HEADER
   ══════════════════════════════════════════════ */

@media (max-width: 960px) {
    .hw-header-inner {
        flex-wrap: wrap;
        min-height: 60px;
        padding: 0 1rem;
    }
.hw-nav li.is-open > a .hw-dropdown-arrow {
    transform: rotate(180deg);
}

    .hw-logo img {
        max-height: 42px;
    }

    .hw-menu-toggle {
        display: block;
        order: 3;
        margin-left: auto;
    }

    .hw-header-actions {
        order: 2;
        margin-left: auto;
    }

    .hw-nav {
        order: 4;
        flex-basis: 100%;
        display: none;
        border-top: 1px solid rgba(0,0,0,0.06);
        padding: 0.5rem 0;
    }

    .hw-nav.is-open {
        display: block;
    }

    .hw-nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    .hw-nav > ul > li > a {
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
    }

    .hw-nav > ul > li > a::after {
        display: none;
    }

    /* Dropdowns in mobile: show inline, no absolute positioning */
    .hw-nav ul ul {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--hw-green-subtle, #e8f5ec);
        padding: 0;
        display: none;
    }

    .hw-nav ul li.is-open > ul {
        display: block;
    }

    .hw-nav ul ul li a {
        padding-left: 2rem;
    }

    .hw-nav ul ul ul li a {
        padding-left: 3rem;
    }
}


/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */

.hw-site-footer {
    background: var(--hw-green-dark, #1a5632);
    color: rgba(255,255,255,0.85);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.hw-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 0;
}

.hw-site-footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hw-site-footer a:hover {
    color: #fff;
}


/* ── Footer Grid (4 columns) ── */

.hw-footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 960px) {
    .hw-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .hw-footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}


/* ── Brand column ── */
.hw-footer-brand img {
    width: auto;
    margin-bottom: 1rem;
}

.hw-footer-brand > img {
    max-height: 150px;
}

.hw-footer-badges img {
    max-height: 50px;
}


/* ── Social icons ── */

.hw-footer-social {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.hw-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.15s ease;
}

.hw-footer-social a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.hw-footer-social svg {
    fill: #fff;
}


/* ── Membership badges ── */

.hw-footer-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hw-footer-badges img {
    height: 50px;
    width: auto;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.hw-footer-badges img:hover {
    opacity: 1;
}


/* ── Footer link columns ── */

.hw-footer-col h4 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(196, 149, 42, 0.6);
}

.hw-footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hw-footer-col ul li {
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.hw-footer-col ul li a {
    opacity: 0.85;
}

.hw-footer-col ul li a:hover {
    opacity: 1;
}

/* Non-link list items (e.g., address lines) */
.hw-footer-col ul li:not(:has(a)) {
    opacity: 0.7;
    font-size: 0.85rem;
}


/* ── Footer bottom bar ── */

.hw-footer-bottom {
    margin-top: 2.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.hw-footer-bottom > span {
    opacity: 0.6;
}

.hw-footer-legal {
    display: flex;
    gap: 1.5rem;
}

.hw-footer-legal a {
    opacity: 0.6;
    font-size: 0.8rem;
}

.hw-footer-legal a:hover {
    opacity: 1;
}

@media (max-width: 560px) {
    .hw-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .hw-footer-legal {
        gap: 1rem;
    }
}
