/* Navigation drawer (components/nav.js, site/snippets/nav.php). */

/* The "open" trigger: a persistent round button, always bottom-left. It
   fades out once the panel is open (the panel's own close button, below,
   takes over) rather than relocating/morphing itself. */
.nav-toggle {
  position: fixed;
  z-index: 4050;
  bottom: 1rem;
  left: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: var(--color-text-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.nav-toggle.is-open {
  opacity: 0;
  pointer-events: none;
}

.nav-fab__overlay {
  position: fixed;
  inset: 0;
  z-index: 3999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-fab__overlay.is-open {
  opacity: 0.3;
  pointer-events: auto;
}

/* The panel itself never changes size or shape: it's always laid out at
   its full resting dimensions, and GSAP only scales it (see components/nav.js), with
   the transform anchored at the bottom-left corner, near where the toggle
   button sits. That keeps it a crisp rectangle throughout, instead of
   growing from a round button and passing through blob-shaped corners. */
.nav-panel {
  position: fixed;
  z-index: 4000;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 600px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  overflow: hidden;
  transform-origin: left bottom;
  transform: scale(0);
  pointer-events: none;
}

.nav-panel.is-open {
  pointer-events: auto;
}

/* Lives inside the panel (positioned relative to it, not the viewport),
   so it always sits in the panel's own top-right corner regardless of how
   wide the viewport is -- unlike a viewport-fixed button, which would
   drift away from the panel on screens wider than its 600px max-width. */
.nav-panel__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--color-text-primary);
  transition: color 0.2s ease;
}

.nav-panel__close:hover {
  color: var(--color-text-darkpurple);
}

.nav-panel__content {
  position: absolute;
  top: 64px;
  left: 40px;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.nav-list {
  /* Room (cancelled by the negative margin) so focus outlines and the
     rotated chevrons aren't clipped by the overflow. */
  padding-left: var(--focus-room);
  margin: 0 0 0 calc(-1 * var(--focus-room));
  flex: 1;
  overflow: auto;
  padding-right: 0.25rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item__toggle {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  font-weight: 400;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--color-text-primary);
  text-align: left;
  transition: color 0.2s ease;
  line-height: 1.33;
}

.nav-item__toggle:hover {
  color: var(--color-text-darkpurple);
}

/* A menu item that's a link rather than a section (the news). */
.nav-item__link {
  text-decoration: none;
}

.nav-item__toggle::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  /* Rounds the point of the chevron (where these two borders meet),
     matching the rounded tips/joins used on the SVG arrows elsewhere. */
  border-bottom-right-radius: 2px;
  transform: rotate(-45deg);
  transition: transform calc(var(--duration-panel) * 0.5) var(--ease-panel);
}

.nav-item.is-open .nav-item__toggle::before {
  transform: rotate(45deg);
}

/* Expands to the content's real height by transitioning the grid row
   from 0fr to 1fr (a max-height transition would run to the 60vh cap,
   so short sections looked rushed open and late to close). */
.nav-item__body {
  --duration-accordion: calc(var(--duration-panel) * 0.7);
  display: grid;
  grid-template-rows: 0fr;
  color: var(--color-text-primary);
  font-size: 1.25rem;
  line-height: 1.5;
  opacity: 0;
  transition:
    grid-template-rows var(--duration-accordion) var(--ease-panel),
    margin var(--duration-accordion) var(--ease-panel),
    opacity calc(var(--duration-accordion) * 0.6) ease;
}

.nav-item__inner {
  min-height: 0;
  /* Room for focus rings on the links inside: sideways via padding, and
     top/bottom via the spacers below (vertical padding would keep a
     collapsed section from shrinking to 0). */
  padding-inline: var(--focus-room);
  margin-inline: calc(-1 * var(--focus-room));
  /* Always capped (not only while open): dropping the cap at the start of
     the close would flash long sections at full height for a frame. */
  max-height: 60vh;
  overflow: hidden;
}

.nav-item.is-open .nav-item__body {
  grid-template-rows: 1fr;
  opacity: 1;
  margin: 0.75rem 0;
  transition:
    grid-template-rows var(--duration-accordion) var(--ease-panel),
    margin var(--duration-accordion) var(--ease-panel),
    opacity var(--duration-accordion) ease calc(var(--duration-accordion) * 0.3);
}

.nav-item__inner::before,
.nav-item__inner::after {
  content: '';
  display: block;
  height: var(--focus-room);
}

.nav-item.is-open .nav-item__inner {
  overflow-y: auto;
}

.nav-item__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item__links a {
  display: block;
  font-size: 1.25rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  line-height: 1.4;
}

.nav-item__links a:hover {
  color: var(--color-text-darkpurple);
}

.nav-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-fab__footer {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-primary);
 
}

.lang-switch a {
  text-decoration: none;
   text-underline-offset: 4px;
}

.lang-switch a.is-active {
  text-decoration: underline;
}

/* The fullscreen photo viewer is a descendant of .detail-panel, which has
   its own z-index stacking context (position: fixed + z-index) -- no
   z-index set inside it can ever outrank elements outside that context,
   like the nav toggle, no matter how high. Hide it explicitly instead. */
.app.is-media-fullscreen .nav-toggle {
  display: none;
}

/* Set for a single frame by components/nav.js while it collapses all menu items. */
.nav-panel.is-resetting * {
  transition: none !important;
}
