/* =============================================================
   NICHENCY -- FOOTER
   layout/footer.css
   ============================================================= */

/* ----------------------------------------------------------------
   FOOTER SHELL
   ---------------------------------------------------------------- */
.site-footer {
    padding: 40px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copyright p { font-size: 14px; color: var(--muted); margin: 0; }

/* ----------------------------------------------------------------
   FOOTER NAVIGATION -- top-level items
   ---------------------------------------------------------------- */
.footer-navigation ul {
    list-style: none;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-navigation ul li {
    position: relative;   /* anchor for submenu */
}

.footer-navigation ul li a {
    font-family: 'Karla', sans-serif;
    font-size: 14px;
    color: var(--muted);
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}

.footer-navigation ul li a:hover {
    color: var(--dark-blue);
    border-bottom-color: var(--dark-blue);
}

/* Active / current page */
.footer-navigation .current-menu-item > a,
.footer-navigation .current-menu-ancestor > a,
.footer-navigation .current-page-ancestor > a {
    color: var(--dark-blue);
    border-bottom-color: var(--dark-blue);
    font-weight: 600;
}

/* ----------------------------------------------------------------
   FOOTER DROPDOWN -- opens upward (footer is at the bottom)
   ---------------------------------------------------------------- */
.footer-navigation .sub-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px); /* open upward */
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 -6px 20px rgba(19,15,73,0.09);
    min-width: 180px;
    padding: 6px 0;
    z-index: 500;
    flex-direction: column;
    gap: 0;
}

/* Bridge gap between parent link and panel */
.footer-navigation .sub-menu::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

/* Show on hover */
.footer-navigation .menu-item-has-children:hover > .sub-menu {
    display: flex;
}

/* Submenu items */
.footer-navigation .sub-menu li {
    position: static;
    width: 100%;
}

.footer-navigation .sub-menu li a {
    display: block;
    width: 100%;
    padding: 9px 18px;
    font-size: 13px;
    border-bottom: none;
    color: var(--muted);
    transition: background .15s, color .15s;
}

.footer-navigation .sub-menu li a:hover {
    background: var(--hero-bg);
    color: var(--dark-blue);
    border-bottom: none;
}

.footer-navigation .sub-menu .current-menu-item > a {
    color: var(--dark-blue);
    font-weight: 600;
    background: var(--hero-bg);
}

/* Chevron indicator on parent link */
.footer-navigation .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
    transform: rotate(-45deg) translateY(1px); /* points up -- submenu opens upward */
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.55;
    transition: transform .2s, opacity .2s;
}

.footer-navigation .menu-item-has-children:hover > a::after {
    transform: rotate(135deg) translateY(1px); /* flips down when open */
    opacity: 1;
}

/* ----------------------------------------------------------------
   RESPONSIVE -- 900px
   ---------------------------------------------------------------- */
@media screen and (max-width: 900px) {
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }

    .footer-navigation ul { flex-wrap: wrap; gap: 12px 20px; }

    /* On tablet/mobile the footer is tall enough to open downward safely */
    .footer-navigation .sub-menu {
        bottom: auto;
        top: calc(100% + 10px);
        box-shadow: 0 6px 20px rgba(19,15,73,0.09);
    }

    /* Bridge flips to top */
    .footer-navigation .sub-menu::after {
        bottom: auto;
        top: -10px;
    }

    /* Chevron points down when submenu opens downward */
    .footer-navigation .menu-item-has-children > a::after {
        transform: rotate(135deg) translateY(1px);
    }

    .footer-navigation .menu-item-has-children:hover > a::after {
        transform: rotate(-45deg) translateY(1px);
    }
}
