/*
  Nocturne beta – refractive dropdown + framed editorial imagery
  Load AFTER /03-nocturne/beta/assets/theme.css.
  Scoped to .n-beta to leave the eight original concepts untouched.
*/

/* A clear lens with a softly distorted surface and luminous bevel. */
.n-beta .n-header .n-menu.menu-panel {
  --n-glass-x: 18%;
  --n-glass-y: 9%;
  --n-glass-edge: rgba(246, 237, 214, .48);
  --n-glass-ambient: rgba(10, 17, 14, .36);
  isolation: isolate;
  border: 1px solid rgba(245, 237, 216, .34);
  border-radius: 21px;
  background: linear-gradient(130deg, rgba(32, 42, 35, .79), rgba(12, 23, 19, .74) 75%);
  -webkit-backdrop-filter: blur(32px) saturate(165%) contrast(108%);
  backdrop-filter: blur(32px) saturate(165%) contrast(108%);
  box-shadow:
    0 22px 75px rgba(4, 12, 9, .40),
    0 3px 12px rgba(4, 12, 9, .12),
    inset 0 1px 0 rgba(255, 255, 245, .18);
  /* Preserve the original max-height, scrolling, and menu open/close logic. */
  overflow: auto;
}

.n-beta .n-header .n-menu.menu-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 300px 220px at var(--n-glass-x) var(--n-glass-y), rgba(250, 242, 215, .20), transparent 78%),
    radial-gradient(ellipse 190px 260px at 103% 93%, rgba(159, 185, 168, .13), transparent 80%),
    linear-gradient(110deg, rgba(255, 255, 243, .075), transparent 28% 75%, rgba(214, 238, 223, .065));
  /* SVG displacement warps the highlights, not the menu labels. Browsers
     without SVG filter support retain the static glass highlights. */
  filter: url("#nocturne-glass-surface");
  opacity: .88;
}

.n-beta .n-header .n-menu.menu-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 1.5px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg,
    rgba(255, 254, 244, .82) 0%,
    rgba(238, 245, 226, .24) 26%,
    transparent 49%,
    rgba(198, 216, 197, .10) 70%,
    rgba(245, 247, 231, .46) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.n-beta .n-header .n-menu.menu-panel > * {
  position: relative;
  z-index: 1;
}

/* Light glass: translucency without compromising text contrast. */
@media screen {
  html[data-theme="light"] .n-beta .n-header .n-menu.menu-panel {
    color: #26332d;
    border-color: rgba(116, 102, 76, .31);
    background: linear-gradient(135deg, rgba(255, 253, 246, .87), rgba(239, 235, 224, .83) 78%);
    -webkit-backdrop-filter: blur(32px) saturate(145%) contrast(105%);
    backdrop-filter: blur(32px) saturate(145%) contrast(105%);
    box-shadow:
      0 24px 64px rgba(50, 50, 39, .19),
      0 3px 11px rgba(50, 50, 39, .07),
      inset 0 1px 0 rgba(255, 255, 255, .93);
  }

  html[data-theme="light"] .n-beta .n-header .n-menu.menu-panel::before {
    background:
      radial-gradient(ellipse 310px 230px at var(--n-glass-x) var(--n-glass-y), rgba(255, 255, 255, .70), transparent 77%),
      radial-gradient(ellipse 180px 220px at 99% 95%, rgba(178, 149, 100, .14), transparent 82%),
      linear-gradient(125deg, rgba(255, 255, 255, .25), transparent 44%, rgba(120, 126, 109, .05));
  }

  html[data-theme="light"] .n-beta .n-header .n-menu.menu-panel::after {
    background: linear-gradient(130deg,
      rgba(255, 255, 255, .96),
      rgba(255, 255, 255, .30) 30%,
      rgba(121, 115, 97, .15) 61%,
      rgba(255, 255, 255, .76));
  }
}

/* Fallback on devices that cannot blur the backdrop. */
@supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .n-beta .n-header .n-menu.menu-panel { background: rgba(19, 28, 23, .96); }
  html[data-theme="light"] .n-beta .n-header .n-menu.menu-panel { background: rgba(248, 245, 235, .97); }
}

/* Dismiss the busy page behind an open menu without trapping pointer events. */
.n-beta.menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;  /* Below .n-header (80), above the page. */
  pointer-events: none;
  background: rgba(5, 12, 9, .19);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
@media screen {
  html[data-theme="light"] .n-beta.menu-open::after { background: rgba(236, 231, 219, .20); }
}

/* Rounded, individually framed editorial photographs. The hero remains full bleed. */
.n-beta .n-editorial-media,
.n-beta .n-framed-photo {
  position: relative;
  min-width: 0;
  padding: 6px;
  border-radius: 20px;
  border: 1px solid rgba(217, 205, 174, .30);
  background: linear-gradient(150deg, rgba(228, 219, 191, .14), rgba(125, 139, 120, .045));
  box-shadow: 0 19px 55px rgba(4, 11, 8, .25), inset 0 1px rgba(255,255,255,.10);
  overflow: hidden;
}

.n-beta .n-editorial-media > img,
.n-beta .n-framed-photo > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
}

/* These are already image-based cards; keep the existing hover and click behaviors. */
.n-beta .n-journey {
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(4, 11, 8, .23);
}
.n-beta .n-property .n-property-image {
  border-radius: 15px;
  border: 1px solid rgba(209, 202, 184, .22);
  box-shadow: 0 12px 34px rgba(4, 11, 8, .15);
  overflow: hidden;
}

@media screen {
  html[data-theme="light"] .n-beta .n-editorial-media,
  html[data-theme="light"] .n-beta .n-framed-photo {
    border-color: rgba(116, 100, 70, .25);
    background: linear-gradient(145deg, #f9f7ef, #eae4d8);
    box-shadow: 0 22px 56px rgba(63, 60, 46, .16), inset 0 1px 0 rgba(255,255,255,.95);
  }
  html[data-theme="light"] .n-beta .n-journey { box-shadow: 0 20px 55px rgba(57, 61, 49, .18); }
  html[data-theme="light"] .n-beta .n-property .n-property-image {
    border-color: rgba(104, 91, 67, .20);
    box-shadow: 0 14px 38px rgba(74, 72, 60, .12);
  }
}

@media (max-width: 700px) {
  .n-beta .n-header .n-menu.menu-panel { 
    border-radius: 17px; 
    background: linear-gradient(130deg, rgba(31, 40, 34, .91), rgba(14, 25, 20, .89));
  }
  html[data-theme="light"] .n-beta .n-header .n-menu.menu-panel {
    background: linear-gradient(140deg, rgba(255, 253, 247, .96), rgba(242, 238, 228, .92));
  }
  .n-beta .n-editorial-media, .n-beta .n-framed-photo { border-radius: 16px; padding: 5px; }
  .n-beta .n-editorial-media > img, .n-beta .n-framed-photo > img { border-radius: 11px; }
  .n-beta .n-journey { border-radius: 15px; }
  .n-beta .n-property .n-property-image { border-radius: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .n-beta .n-header .n-menu.menu-panel,
  .n-beta .n-header .n-menu.menu-panel::before,
  .n-beta .n-header .n-menu.menu-panel::after { animation: none !important; transition: none !important; }
}

@media print {
  .n-beta .n-editorial-media, .n-beta .n-framed-photo,
  .n-beta .n-property .n-property-image { box-shadow: none !important; }
}

/* Always-on navigation: tinted glass with a luminous edge in both palettes.
   Keep overflow visible so the dropdown retains its existing geometry. */
@media screen {
  html[data-theme="dark"] .n-beta :is(.n-header,.n-header.is-scrolled) {
    background: linear-gradient(115deg, rgba(9,31,43,.62), rgba(30,76,89,.40));
    border-color: rgba(188,228,229,.42);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: inset 0 1px 0 rgba(234,255,252,.24), inset 0 -1px 0 rgba(173,218,222,.10), 0 12px 36px rgba(3,18,27,.22);
  }
  html[data-theme="light"] .n-beta :is(.n-header,.n-header.is-scrolled) {
    background: linear-gradient(115deg, rgba(255,249,237,.68), rgba(238,224,201,.45));
    border-color: rgba(137,109,72,.32);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.88), inset 0 -1px 0 rgba(255,248,228,.35), 0 12px 36px rgba(77,58,34,.12);
  }
  @supports not ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
    html[data-theme="dark"] .n-beta :is(.n-header,.n-header.is-scrolled) { background: #102e3b; }
    html[data-theme="light"] .n-beta :is(.n-header,.n-header.is-scrolled) { background: #f5eddf; }
  }
}

/* Lab: clearer dropdown glass, with a little more tint than the slim header
   to protect the larger navigation text area over photographs. */
@media screen {
  @supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
    html[data-theme="dark"] .n-beta .n-header .n-menu.menu-panel {
      background: linear-gradient(130deg,rgba(26,65,79,.78),rgba(9,31,43,.70));
      -webkit-backdrop-filter: blur(18px) saturate(150%);
      backdrop-filter: blur(18px) saturate(150%);
    }
    html[data-theme="light"] .n-beta .n-header .n-menu.menu-panel {
      background: linear-gradient(135deg,rgba(255,248,234,.80),rgba(237,224,202,.70));
      -webkit-backdrop-filter: blur(18px) saturate(140%);
      backdrop-filter: blur(18px) saturate(140%);
    }
  }
}
