/* =========================================================
   VILLA TAZITUNT — 04-components.css
   V6.1 — Header, Navigation & Interface Components
   ========================================================= */


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    padding: 0.8rem 1rem;
    background: #fff;
    color: #181916;
    font-family: var(--font-sans, "Inter", sans-serif);
    font-size: 0.8rem;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1100;
    width: 100%;
    color: #fff;

    transition:
        color 300ms ease,
        background-color 300ms ease,
        border-color 300ms ease,
        backdrop-filter 300ms ease;
}

.site-header__inner {
    width: min(92%, 1540px);
    min-height: 84px;
    margin-inline: auto;

    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;

    gap: 2rem;
}


/* Header after scroll */

.site-header.is-scrolled {
    color: var(--charcoal, #181916);

    background: rgba(246, 243, 238, 0.92);

    border-bottom:
        1px solid rgba(24, 25, 22, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


/* Header while menu is open */

.site-header.is-menu-open {
    color: var(--charcoal, #181916);
    background: transparent;
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    justify-self: start;

    display: inline-flex;
    flex-direction: column;

    color: inherit;
    text-decoration: none;
    line-height: 1;
}

.brand__small {
    font-family: var(--font-sans, "Inter", sans-serif);

    font-size: 0.5rem;

    text-transform: uppercase;

    letter-spacing: 0.21em;

    opacity: 0.64;
}

.brand__name {
    margin-top: 0.22rem;

    font-family:
        var(--font-serif, "Cormorant Garamond", serif);

    font-size: 1.6rem;

    font-weight: 500;

    letter-spacing: -0.02em;
}


/* =========================================================
   DESKTOP NAVIGATION
   ========================================================= */

.desktop-nav {
    justify-self: end;

    display: flex;
    align-items: center;

    gap: clamp(1.7rem, 2.7vw, 3.2rem);
}

.desktop-nav a {
    position: relative;

    color: inherit;

    text-decoration: none;

    font-family:
        var(--font-sans, "Inter", sans-serif);

    font-size: 0.64rem;

    font-weight: 500;

    text-transform: uppercase;

    letter-spacing: 0.13em;

    white-space: nowrap;
}


/* Navigation underline */

.desktop-nav a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -0.5rem;

    width: 100%;
    height: 1px;

    background: currentColor;

    transform: scaleX(0);

    transform-origin: right;

    transition:
        transform 260ms cubic-bezier(.22, .61, .36, 1);
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
    transform: scaleX(1);

    transform-origin: left;
}


/* Reservation CTA */

.desktop-nav__availability {
    display: inline-flex;
    align-items: center;

    gap: 0.55rem;
}

.desktop-nav__availability span {
    transition:
        transform 240ms ease;
}

.desktop-nav__availability:hover span {
    transform: translate(3px, -3px);
}


/* =========================================================
   MENU BUTTON
   ========================================================= */

.menu-toggle {
    display: none;

    justify-self: end;

    position: relative;

    z-index: 1120;

    width: 30px;
    height: 24px;

    padding: 0;

    border: 0;

    background: transparent;

    color: inherit;

    cursor: pointer;
}

.menu-toggle span {
    display: block;

    width: 100%;
    height: 1px;

    background: currentColor;

    transform-origin: center;

    transition:
        transform 260ms ease,
        opacity 260ms ease;
}

.menu-toggle span + span {
    margin-top: 7px;
}

.menu-toggle.is-open span:first-child {
    transform:
        translateY(4px)
        rotate(45deg);
}

.menu-toggle.is-open span:last-child {
    transform:
        translateY(-4px)
        rotate(-45deg);
}


/* =========================================================
   MOBILE MENU BACKDROP
   ========================================================= */

.menu-backdrop {
    position: fixed;

    inset: 0;

    z-index: 1080;

    background:
        rgba(10, 11, 9, 0.24);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 280ms ease,
        visibility 280ms ease;
}

.menu-backdrop.is-visible {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;
}


/* =========================================================
   MOBILE MENU
   ========================================================= */

.mobile-menu {
    position: fixed;

    inset: 0;

    z-index: 1090;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    padding:
        calc(6.2rem + env(safe-area-inset-top))
        1.2rem
        calc(1.6rem + env(safe-area-inset-bottom));

    background:
        var(--stone-50, #f6f3ee);

    color:
        var(--charcoal, #181916);

    transform:
        translateX(100%);

    visibility: hidden;

    pointer-events: none;

    transition:
        transform 420ms cubic-bezier(.22, .61, .36, 1),
        visibility 420ms ease;
}

.mobile-menu.is-open {
    transform:
        translateX(0);

    visibility: visible;

    pointer-events: auto;
}


/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

.mobile-menu__nav {
    display: flex;

    flex-direction: column;
}

.mobile-menu__nav a {
    display: block;

    padding: 0.25rem 0;

    color: inherit;

    text-decoration: none;

    font-family:
        var(--font-serif, "Cormorant Garamond", serif);

    font-size:
        clamp(2.9rem, 12.8vw, 4.5rem);

    line-height: 0.94;

    font-weight: 400;

    letter-spacing: -0.045em;
}


/* =========================================================
   MOBILE FOOTER
   ========================================================= */

.mobile-menu__footer {
    padding-top: 1.6rem;

    border-top:
        1px solid rgba(24, 25, 22, 0.12);

    display: flex;

    flex-direction: column;

    gap: 0.7rem;

    font-family:
        var(--font-sans, "Inter", sans-serif);

    font-size: 0.61rem;

    text-transform: uppercase;

    letter-spacing: 0.11em;

    line-height: 1.6;

    color:
        var(--text-soft, #625e56);
}

.mobile-menu__footer a {
    width: max-content;

    max-width: 100%;

    color: inherit;

    text-decoration: none;
}


/* Prevent background scroll */

body.menu-open {
    overflow: hidden;
}


/* =========================================================
   FOOTER LINKS
   ========================================================= */

.v5-footer a {
    transition:
        color 200ms ease;
}

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


/* =========================================================
   RESPONSIVE NAVIGATION SWITCH
   ========================================================= */

@media (max-width: 980px) {

    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .site-header__inner {
        width: calc(100% - 2rem);
        min-height: 70px;
    }

    .brand__small {
        font-size: 0.44rem;
    }

    .brand__name {
        font-size: 1.42rem;
    }

    .menu-toggle {
        width: 29px;
        height: 26px;
    }

    .mobile-menu {
        padding:
            calc(5.6rem + env(safe-area-inset-top))
            1rem
            calc(2.2rem + env(safe-area-inset-bottom));
    }

    .mobile-menu__nav a {
        font-size:
            clamp(2.55rem, 11.8vw, 3.8rem);

        line-height: 0.94;

        padding: 0.18rem 0;
    }

    .mobile-menu__footer {
        margin-top: 2rem;

        padding-top: 1.25rem;

        font-size: 0.58rem;

        line-height: 1.55;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .mobile-menu__nav a {
        font-size:
            clamp(2.45rem, 11.8vw, 3.5rem);
    }

}


/* =========================================================
   FOCUS
   ========================================================= */

a:focus-visible,
button:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 5px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .site-header,
    .desktop-nav a::after,
    .desktop-nav__availability span,
    .menu-toggle span,
    .menu-backdrop,
    .mobile-menu {
        transition: none;
    }

}