/* =========================================================
   DEMI'S HOUSE — MENU.CSS
   Complete navigation styling
   ========================================================= */

/* ---------- Desktop ---------- */
@media (min-width: 981px) {

  nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 1100 !important;
  }

  .nav-inner {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  /* Keep the menu centered in the viewport, not beside the logo. */
  .nav-links {
    position: absolute !important;
    left: 46% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;

    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
  }

  .nav-links > a {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 9px !important;
    margin: 0 !important;

    white-space: nowrap !important;
    text-decoration: none !important;
    transition: color .25s ease !important;
  }

  .nav-links > a:first-child {
    padding-left: 0 !important;
  }

  .nav-links > a:last-child {
    padding-right: 0 !important;
  }

  /* Thin separators */
  .nav-links > a + a::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;

    width: 1px !important;
    height: 17px !important;

    transform: translateY(-50%) !important;
    background: currentColor !important;
    opacity: .22 !important;
  }

  /* Animated underline */
  .nav-links > a::after {
    content: "" !important;
    position: absolute !important;
    left: 9px !important;
    right: 9px !important;
    bottom: -7px !important;

    height: 1px !important;
    background: currentColor !important;

    opacity: 0 !important;
    transform: scaleX(0) !important;
    transform-origin: left center !important;

    transition: transform .28s ease, opacity .28s ease !important;
  }

  .nav-links > a:first-child::after {
    left: 0 !important;
  }

  .nav-links > a:last-child::after {
    right: 0 !important;
  }

  /* Hover */
  .nav-links > a:hover::after,
  .nav-links > a:focus-visible::after,

  /* Active state from JS */
  .nav-links > a.active::after,

  /* Active state from URL/hash */
  .nav-links > a[href="#about"]:is(:focus, :active)::after,
  .nav-links > a[href="#modern"]:is(:focus, :active)::after,
  .nav-links > a[href="#ethnic"]:is(:focus, :active)::after,
  .nav-links > a[href="#common"]:is(:focus, :active)::after,
  .nav-links > a[href="#explore"]:is(:focus, :active)::after,
  .nav-links > a[href="#contact"]:is(:focus, :active)::after {
    opacity: .72 !important;
    transform: scaleX(1) !important;
  }

  .nav-links > a.active::after {
    opacity: .72 !important;
    transform: scaleX(1) !important;
  }

  .nav-links > a:focus-visible {
    outline: none !important;
  }
}

/* ---------- Anchor positioning ---------- */
/* Prevent the sticky header from covering the section title. */
section[id],
header[id] {
  scroll-margin-top: 92px;
}

/* ---------- Mobile ---------- */
.mobile-menu-toggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

@media (max-width: 980px) {

  nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 1100 !important;
  }

  .nav-inner {
    display: grid !important;
    grid-template-columns: 46px 1fr 46px !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 0 !important;
  }

  .hamburger {
    display: flex !important;
    width: 46px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1202 !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .hamburger span {
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    background: var(--ink) !important;
  }

  .nav-inner > .brand {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    font-size: 19px !important;
    white-space: nowrap !important;
  }

  .nav-inner > .nav-links,
  .nav-inner > .lang-switch,
  .nav-inner > a.btn.dark {
    display: none !important;
  }

  .mobile-drawer {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(86vw, 360px) !important;
    background: #f6f2eb !important;
    z-index: 1400 !important;
    transform: translateX(-105%) !important;
    transition: transform .25s ease !important;
    box-shadow: 14px 0 34px rgba(0,0,0,.16) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #mobile-menu-toggle:checked ~ .site .mobile-drawer {
    transform: translateX(0) !important;
  }

  .drawer-overlay {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.38) !important;
    z-index: 1390 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity .2s ease, visibility .2s ease !important;
  }

  #mobile-menu-toggle:checked ~ .site .drawer-overlay {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .drawer-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 22px 22px 16px !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .drawer-title {
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 20px !important;
    letter-spacing: .08em !important;
  }

  .drawer-close {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 34px !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }

  .drawer-body {
    padding: 22px !important;
  }

  .drawer-label {
    text-transform: uppercase !important;
    letter-spacing: .12em !important;
    font-size: 11px !important;
    margin-bottom: 10px !important;
  }

  .drawer-lang-switch {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 24px !important;
  }

  .drawer-link {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 16px 0 !important;
    border-bottom: 1px solid var(--line) !important;
    text-decoration: none !important;
    color: inherit !important;
  }

  .drawer-link strong {
    font-size: 16px !important;
    font-weight: 500 !important;
  }

  .drawer-link > span {
    font-size: 12px !important;
    opacity: .62 !important;
  }

  .drawer-whatsapp {
    display: block !important;
    margin-top: 24px !important;
    text-decoration: none !important;
    color: inherit !important;
  }

  /* Desktop effects are disabled on mobile. */
  .nav-links > a::before,
  .nav-links > a::after {
    display: none !important;
  }
}
