.primary-header.wrapper {
    position: sticky;
    top: 0;
    z-index: 999;

    @media (width <=768px) {
        --_gap: 1.125rem !important;
    }
}

.primary-header:not(.is-sticky) {
    .logo {
        opacity: 1;
        width: 136px;
        max-height: none;
        animation: none;
        flex-shrink: 0;
    }
}

.primary-header.is-sticky {
    background-color: var(--white-clr-800);
    background-color: hsl(from var(--white-clr-800) h s l / 0.65);
    backdrop-filter: blur(5rem);
    border-bottom: 1px solid var(--white-clr);

    .primary-nav {
        min-height: 6rem;
        padding-block: 1.25rem;
    }
    /* Keep logo visible when sticky on all screen sizes */
    .logo {
        opacity: 1;
        width: 136px;
        max-height: none;
        animation: none;
        flex-shrink: 0;
    }

    @media (width > 1024px) {
        .logout-form {
            display: none;
        }
        /* Keep original nav spacing so header layout does not jump when sticky */
        .nav-links {
            margin-left: 3rem;
        }
    }
}

@keyframes fadeIn {
    from {
        width: 0;
        max-height: 0;
        opacity: 0;
    }

    to {
        opacity: 1;
        width: var(--_fade-in-to-width, auto);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        width: var(--_fade-out-from-width, auto);
    }

    to {
        width: 0;
        max-height: 0;
        opacity: 0;
    }
}

/* Primay Nav */
.primary-nav {
    display: flex;
    align-items: center;
    padding-block: 2.125rem;
    transition: flex 300ms ease, padding 500ms ease-in-out;

    .logo {
        --_fade-out-from-width: 6.25rem;
        width: var(--_fade-out-from-width);
        height: 3rem;

        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
    }

    .btns {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 1.75rem;
    }

    .btn-link {
        color: var(--tertiary-clr-900);
        font-weight: var(--fw-700);
        text-transform: uppercase;

        &:hover {
            color: var(--secondary-clr-900);
        }
    }

    @media (width <=1024px) {
        .btns,
        .nav-links {
            display: none;
        }
    }
}

.nav-links {
    margin-inline: 3rem auto;
    display: flex;
    text-transform: uppercase;
    gap: 1.5rem;
    transition: margin 300ms ease;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: var(--fw-700);

    a {
        color: var(--tertiary-clr-900);

        &:hover {
            color: var(--secondary-clr-900);
        }
    }
}

    /* Active nav state: visual indication + accessible non-color cue */
    .nav-link.active > a,
    .nav-link > a[aria-current="page"] {
        color: var(--secondary-clr-900);
        font-weight: var(--fw-900);
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 0.25rem;
    }

    /* Keyboard accessibility */
    .nav-link > a:focus-visible {
        outline: 2px solid var(--secondary-clr-900);
        outline-offset: 3px;
        border-radius: 0.25rem;
    }

.primary-nav-toggler {
    --_toggler-clr: var(--tertiary-clr-900);
    cursor: pointer;
    margin-left: auto;
    border: none;
    border-radius: 50%;
    color: var(--white-clr);

    &:hover {
        --_toggler-clr: var(--white-clr);
        color: var(--tertiary-clr-900);
    }

    @media (width > 1024px) {
        display: none;
    }
}

.sidebar {
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(3rem);

    .sidebar-dialog-content {
        padding-inline: 2rem;

        @media (width <=768px) {
            padding-inline: 1.125rem;
        }
    }
}

.sidebar {
    .dialog-header {
        margin-top: 2.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 1.75rem;

        .close-btn {
            cursor: pointer;
            width: 1.75rem;
            height: 1.75rem;
            color: var(--tertiary-clr);
            background-color: var(--white-clr);
        }
    }

    .primary-nav {
        flex-direction: column;
        align-items: start;
        padding-block: 0;
        margin-block: 2.125rem;
    }

    .nav-links,
    .btns {
        display: revert;
        width: 100%;
    }

    .nav-links {
        margin-left: 0;
        margin-top: 4rem;
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
    }

    .nav-link {
        font-size: var(--fs-600);
    }

    .btns {
        background-color: transparent;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        border: none;
        box-shadow: none;
    }

    @media (width > 1024px) {
        display: none;
    }
}

/* End of Primary Nav */

/* Footer */
.footer.wrapper {
    --_gap: 1.125rem !important;
    color: var(--white-clr);
    position: relative;

    &::before {
        content: "";
        position: absolute;
        z-index: -6;
        inset: 0;
        background-image: url("/assets/images/home/footer.jpg");
        background-size: cover;
    }

    a {
        color: var(--white-clr);
        text-decoration: var(--_text-decoration, none);
    }

    .content {
        position: relative;
        /* padding-block: 11.5rem 18rem; */
        /* padding-block: clamp(6.5rem, 15vw + 0.75rem, 11.5rem) 3rem; */
        padding-block: clamp(6.5rem, 15vw + 0.75rem, 9rem) 3rem;
        padding-inline: 0.625rem;

        &::after {
            content: "";
            bottom: 0;
            left: 0;
            position: absolute;
            display: block;
            width: 100%;
            z-index: -1;
            aspect-ratio: 3142/928;
            background-image: url("/images/white-logo.png");
            background-size: 100%;
            opacity: 0.04;
        }
    }
}

.footer-title {
    font-size: var(--fs-400);
    font-weight: var(--fw-900);
    color: inherit;
    padding-bottom: 1.5rem;
    /* position: relative; */
    border-bottom: 1px solid #896d7d;
    /* &::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block-end: -0.5rem;
    inset-block-end: var(--underline-position, -0.5rem);
    height: 4px;
    width: var(--underline-width, 4ch);
    background-color: var(--primary-clr);
    transform-origin: center;
    transition: width 500ms ease;
  }

  &:hover::after {
    --underline-width: 100%;
    transition: width 500ms ease;
  } */
}

.footer-description {
    max-width: 55ch;
    line-height: 26px;
    margin-right: 1.5rem;
}

.footer-top {
    padding-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 2rem;
    column-gap: 2.5rem;
    justify-content: center;

    @media (width > 600px) {
        grid-template-columns: 1.5fr 1fr;
        /* justify-items: center;

    .columns:nth-of-type(2n + 1) {
      justify-self: start;
    } */
    }

    @media (width > 1024px) {
        grid-template-columns: 1.75fr repeat(3, 1fr);
        /* justify-items: center;
    justify-content: center;

    .columns:nth-of-type(2n + 1) {
      justify-self: inherit;
    } */
    }
}

.footer-contact,
.footer-about,
.footer-popular-services,
.footer-quick-links {
    display: grid;
    gap: 1.25rem;
}

.footer-about,
.footer-popular-services,
.footer-quick-links {
    align-content: start;
}

.footer-social-links {
    --_social-icon-size: 2rem;
    display: flex;
    gap: 4rem;
    gap: 1.5rem;

    @media (width <=600px) {
        gap: 1.5rem;
        justify-content: space-between;
    }

    .social-icon-32 {
        width: var(--_social-icon-size, 2.25rem);
        height: var(--_social-icon-size, 2.25rem);
        color: var(--white-clr);
        transition: scale 250ms ease-in-out;

        &:hover {
            scale: 1.2;
        }
    }
}

.footer-bottom {
    font-family: var(--ff-inter);
    padding-block: 2.5rem 0.5rem;
    border-top: 1px solid var(--white-clr-700);
    align-items: center;
    display: grid;
    gap: 1rem;

    @media (width > 1024px) {
        grid-template-columns: 1fr auto;
    }

    @media (600px < width <= 1024px) {
        justify-items: center;

        .footer-bottom-links {
            justify-content: center;
        }
    }

    .footer-bottom-links {
        display: flex;
        align-items: end;
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
    }

    .footer-link {
        font-family: var(--ff-inter);
        font-size: var(--fs-200);

        &:hover {
            --_text-decoration: underline;
        }
    }

    .footer-copyright {
        font-size: var(--fs-200);
    }
}
