/* Phyllux nav — grouped, accessible, no JS. Uses native <details>. */

.phyllux-nav {
  position: sticky;
  top: 0;
  background: rgba(8, 10, 7, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(125, 138, 117, 0.25);
  z-index: 100;
}

.phyllux-nav nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.phyllux-brand {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #f5f1e8;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.phyllux-brand:hover {
  opacity: 0.9;
}

/* Active state — current page */
.phyllux-nav a[aria-current="page"],
body[data-current-page] .phyllux-nav a.phyllux-current {
  color: #d4a84b;
  font-weight: 600;
  border-left: 3px solid #d4a84b;
  padding-left: 17px;
  margin-left: -20px;
}

.phyllux-nav .phyllux-brand.phyllux-current {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
}

/* Native details/summary — no JS */
.phyllux-menu {
  margin-left: auto;
  position: relative;
}

.phyllux-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 18px;
  border: 1px solid rgba(125, 138, 117, 0.3);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.6);
  color: #9aa890;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.phyllux-menu summary::-webkit-details-marker {
  display: none;
}

.phyllux-menu summary::after {
  content: ' ▾';
  font-size: 0.75em;
}

.phyllux-menu[open] summary::after {
  content: ' ▴';
}

.phyllux-menu summary:hover {
  border-color: rgba(212, 168, 75, 0.5);
  color: #d4a84b;
  background: rgba(212, 168, 75, 0.1);
}

.phyllux-menu[open] summary {
  border-color: rgba(212, 168, 75, 0.5);
  color: #d4a84b;
}

.phyllux-links {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 280px;
  max-width: 90vw;
  padding: 12px 0;
  background: #0f130e;
  border: 1px solid rgba(212, 168, 75, 0.2);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  max-height: 75vh;
  overflow-y: auto;
}

/* Grouped nav */
.phyllux-nav-group {
  padding: 0 0 8px 0;
  border-bottom: 1px solid rgba(125, 138, 117, 0.15);
  margin-bottom: 8px;
}

.phyllux-nav-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.phyllux-nav-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212, 168, 75, 0.7);
  padding: 4px 20px 6px;
  margin-bottom: 2px;
}

.phyllux-links a {
  display: block;
  padding: 10px 20px;
  color: #9aa890;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.phyllux-links a:hover {
  background: rgba(212, 168, 75, 0.12);
  color: #d4a84b;
}

/* Mobile — compact dropdown */
@media (max-width: 640px) {
  .phyllux-nav nav {
    padding: 0.5rem 1rem;
    flex-wrap: nowrap;
  }

  .phyllux-menu {
    flex-shrink: 0;
  }

  .phyllux-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin-top: 6px;
    min-width: 280px;
    max-width: calc(100vw - 2rem);
    max-height: min(75vh, 450px);
    padding: 8px 0;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .phyllux-links a {
    padding: 12px 18px;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Desktop sidebar mode */
@media (min-width: 900px) {
  body.phyllux-has-sidebar {
    padding-left: 18rem;
  }

  body.phyllux-has-sidebar .phyllux-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 16rem;
    min-height: 100vh;
    border-bottom: none;
    border-right: 1px solid rgba(125, 138, 117, 0.25);
    overflow-y: auto;
  }

  body.phyllux-has-sidebar .phyllux-nav nav {
    max-width: none;
    margin: 0;
    min-height: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }

  body.phyllux-has-sidebar .phyllux-brand {
    display: block;
    margin-bottom: 0.5rem;
  }

  body.phyllux-has-sidebar .phyllux-menu {
    margin-left: 0;
    width: 100%;
  }

  body.phyllux-has-sidebar .phyllux-menu summary {
    display: none;
  }

  body.phyllux-has-sidebar .phyllux-links {
    position: static;
    display: block;
    margin-top: 0;
    min-width: 0;
    max-width: none;
    max-height: none;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  body.phyllux-has-sidebar .phyllux-nav-group {
    border-bottom: 1px solid rgba(125, 138, 117, 0.12);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  body.phyllux-has-sidebar .phyllux-nav-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }

  body.phyllux-has-sidebar .phyllux-nav-label {
    padding: 4px 0.95rem 4px;
  }

  body.phyllux-has-sidebar .phyllux-links a {
    margin-bottom: 0.15rem;
    padding: 0.65rem 0.95rem;
    border: 1px solid transparent;
    border-radius: 8px;
  }

  body.phyllux-has-sidebar .phyllux-links a:hover,
  body.phyllux-has-sidebar .phyllux-links a.phyllux-current {
    border-color: rgba(212, 168, 75, 0.25);
  }

  body.phyllux-has-sidebar .phyllux-nav a[aria-current="page"],
  body.phyllux-has-sidebar .phyllux-nav a.phyllux-current {
    border-left: 3px solid #d4a84b;
    padding-left: calc(0.95rem - 3px);
    margin-left: 0;
  }
}

/* Site-wide operator status (injected after nav via partials/site-status-banner.html) */
.phyllux-site-status {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid rgba(212, 168, 75, 0.35);
  background: rgba(212, 168, 75, 0.12);
}

.phyllux-site-status__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #c9d4c0;
  font-family: inherit;
  text-align: center;
}

@media (max-width: 640px) {
  .phyllux-site-status {
    padding: 0.5rem 0.85rem;
  }
  .phyllux-site-status__text {
    font-size: 0.8125rem;
    text-align: left;
  }
}
