/* ============================================================
   ETHERES CUSTOM MENU — menu.css
   ============================================================ */

:root {
    --menu-bg:      #d0c9ba;
    --menu-text:    #584f44;
    --menu-muted:   #8a7f6e;
    --menu-line:    rgba(88, 79, 68, 0.22);
    --menu-font:    'etheres-regular', Helvetica, Arial, Lucida, sans-serif;
    --transition-smooth: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ─── HIDE ORIGINAL PLUGIN MENU ─── */
.animatedfsmenu { display: none !important; }

/* ─── BURGER BUTTON ─── */
.etheres-burger {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 10001;
    width: 52px;
    height: 52px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s ease;
}
.etheres-burger:hover { transform: scale(1.1); }

/* Waves */
.burger-waves {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.wave-svg {
    width: 40px;
    height: 16px;
    overflow: visible;
    display: block;
}
.wave-path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: #f5f3ef;
    transition: stroke 0.35s ease;
}
.etheres-burger[data-theme="light"] .wave-path { stroke: var(--menu-text); }
.etheres-burger[data-theme="dark"]  .wave-path { stroke: #f5f3ef; }

/* Wave hover animation */
@keyframes etheres-wave {
    0%   { d: path("M0,8 C5,1 12,15 20,8 C28,1 35,15 40,8"); }
    50%  { d: path("M0,8 C5,15 12,1 20,8 C28,15 35,1 40,8"); }
    100% { d: path("M0,8 C5,1 12,15 20,8 C28,1 35,15 40,8"); }
}
.etheres-burger:not(.is-open):hover .wave-path {
    animation: etheres-wave 1.1s ease-in-out infinite;
}

/* Close × */
.burger-close {
    position: absolute;
    font-family: var(--menu-font);
    font-size: 30px;
    font-weight: 200;
    color: var(--menu-text);
    line-height: 1;
    opacity: 0;
    transform: rotate(-45deg) scale(0.7);
    transition: opacity 0.3s ease 0.4s, transform 0.3s ease 0.4s;
    pointer-events: none;
}
.etheres-burger.is-open .burger-waves {
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.etheres-burger.is-open .burger-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ─── MENU OVERLAY ─── */
.etheres-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--menu-bg);
    pointer-events: none;
    clip-path: circle(0% at 46px 46px);
    transition: clip-path 0.7s var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
}
.etheres-menu-overlay.is-open {
    pointer-events: all;
    clip-path: circle(160% at 46px 46px);
}

/* ─── MENU INNER LAYOUT ─── */
.etheres-menu-inner {
    min-height: 100vh;
    display: grid;
    grid-template-columns: auto 1px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "logo  .       ."
        "nav   divider villas"
        "contact .     .";
    padding: 90px 60px 50px 70px;
    gap: 0 0;
    position: relative;
}

/* ─── LOGO ─── */
.etheres-menu-logo {
    grid-area: logo;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease 0.35s, transform 0.4s ease 0.35s;
}
.etheres-menu-overlay.is-open .etheres-menu-logo {
    opacity: 1;
    transform: translateY(0);
}
.etheres-menu-logo img { width: 150px; height: auto; }

/* ─── NAV ─── */
.etheres-nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 60px;
    padding-top: 10px;
}

.etheres-nav-link,
.villas-item {
    font-family: var(--menu-font);
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--menu-text);
    text-decoration: none;
    line-height: 1.18;
    display: block;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease, color 0.2s ease;
}
.etheres-nav-link:hover { color: var(--menu-muted); }

/* Staggered entrance */
.etheres-menu-overlay.is-open .villas-item          { opacity:1; transform:translateY(0); transition-delay:0.28s; }
.etheres-menu-overlay.is-open .etheres-nav-link:nth-of-type(1) { opacity:1; transform:translateY(0); transition-delay:0.36s; }
.etheres-menu-overlay.is-open .etheres-nav-link:nth-of-type(2) { opacity:1; transform:translateY(0); transition-delay:0.44s; }
.etheres-menu-overlay.is-open .etheres-nav-link:nth-of-type(3) { opacity:1; transform:translateY(0); transition-delay:0.52s; }
.etheres-menu-overlay.is-open .etheres-nav-link:nth-of-type(4) { opacity:1; transform:translateY(0); transition-delay:0.60s; }

/* Villas trigger row */
.villas-item {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: default;
}
.villas-item .etheres-nav-link {
    opacity: 1;
    transform: none;
    transition: color 0.2s ease;
    display: inline;
}
.villas-item.is-active .etheres-nav-link { color: var(--menu-muted); }

.villas-toggle {
    background: none;
    border: 1px solid var(--menu-line);
    color: var(--menu-text);
    font-family: var(--menu-font);
    font-size: 1.4rem;
    font-weight: 200;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.35s ease, background 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    padding-bottom: 2px;
}
.villas-item.is-active .villas-toggle { transform: rotate(45deg); background: rgba(88,79,68,0.1); }

/* ─── VERTICAL DIVIDER ─── */
.etheres-villas-panel {
    grid-area: villas;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}
.villas-divider {
    width: 1px;
    background: var(--menu-line);
    align-self: stretch;
    margin: 0 0 0 0;
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 0.4s var(--transition-smooth);
    flex-shrink: 0;
}
.villas-item.is-active ~ .etheres-villas-panel .villas-divider,
.etheres-villas-panel.is-active .villas-divider {
    transform: scaleY(1);
}

/* ─── VILLAS CONTENT PANEL ─── */
.villas-content {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: 10px 0 0 60px;
    align-items: flex-start;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.etheres-villas-panel.is-active .villas-content {
    opacity: 1;
    pointer-events: all;
}

.villa-group {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.etheres-villas-panel.is-active .villa-group:nth-child(1) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.12s;
}
.etheres-villas-panel.is-active .villa-group:nth-child(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.22s;
}

.villa-group-title {
    font-family: var(--menu-font);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--menu-muted);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--menu-line);
}

.villa-link {
    display: block;
    font-family: var(--menu-font);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--menu-text);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 12px;
    position: relative;
    padding-left: 0;
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.villa-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 1px;
    background: var(--menu-muted);
    transition: width 0.22s ease;
    transform: translateY(-50%);
}
.villa-link:hover { color: var(--menu-muted); padding-left: 20px; }
.villa-link:hover::before { width: 14px; }

/* ─── CONTACT ─── */
.etheres-menu-contact {
    grid-area: contact;
    font-family: var(--menu-font);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--menu-muted);
    line-height: 1.85;
    margin-top: 40px;
    opacity: 0;
    transition: opacity 0.4s ease 0.65s;
}
.etheres-menu-overlay.is-open .etheres-menu-contact { opacity: 1; }
.etheres-menu-contact a {
    color: var(--menu-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.etheres-menu-contact a:hover { color: var(--menu-text); }

/* ─── MOBILE ─── */
@media (max-width: 768px) {
    .etheres-menu-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "logo"
            "nav"
            "villas"
            "contact";
        padding: 80px 32px 40px;
        gap: 0;
    }

    .etheres-nav { padding-right: 0; }

    .etheres-nav-link,
    .villas-item { font-size: clamp(1.8rem, 9vw, 2.8rem); }

    /* Hide desktop divider/panel layout */
    .etheres-villas-panel {
        flex-direction: column;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.45s ease;
    }
    .etheres-villas-panel.is-active {
        max-height: 500px;
    }
    .villas-divider { display: none; }
    .villas-content {
        opacity: 1;
        pointer-events: all;
        flex-direction: column;
        gap: 28px;
        padding: 20px 0 10px 24px;
    }
    .villa-group { opacity: 1; transform: none; }
    .etheres-villas-panel.is-active .villa-group { opacity: 1; transform: none; }

    .villa-group-title { font-size: 0.7rem; margin-bottom: 12px; }
    .villa-link { font-size: 0.7rem; margin-bottom: 9px; }

    /* Contact at bottom, full width */
    .etheres-menu-contact {
        margin-top: 32px;
        padding-top: 24px;
        border-top: 1px solid var(--menu-line);
        font-size: 0.7rem;
    }
    .desktop-only { display: none; }
}

@media (min-width: 769px) {
    /* On desktop the villas panel is alongside nav, not accordion */
    .etheres-villas-panel {
        max-height: none !important;
    }
}
